Introduction
Backend API for the M2 Partner referral platform. Covers authentication, partner onboarding, referral management, property activity timeline, commission tracking, and admin operations.
This documentation covers all Phase 1 M2 Partner API endpoints for the mobile app and web platform.
**Authentication** uses JWT Bearer tokens. Obtain a token via `POST /api/auth/login` with your email and password. Pass the returned token as `Authorization: Bearer {token}` on all subsequent requests.
**User flow:** Register → verify email (6-digit code) → await admin approval → access app.
<aside>Code examples are shown in the dark panel on the right. Use the tabs at the top right to switch between languages.</aside>
Authenticating requests
To authenticate requests, include an Authorization header with the value "Bearer {YOUR_JWT_TOKEN}".
All authenticated endpoints are marked with a requires authentication badge in the documentation below.
Obtain a token via POST /api/auth/login with your email and password. Pass the returned token as Authorization: Bearer {token} on all subsequent requests.
Authentication
Login
Authenticate with email and password to receive a JWT token.
Example request:
curl --request POST \
"http://m2-partner-api.test/api/auth/login" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"admin@example.com\",
\"password\": \"secret\"
}"
const url = new URL(
"http://m2-partner-api.test/api/auth/login"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "admin@example.com",
"password": "secret"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/auth/login';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'email' => 'admin@example.com',
'password' => 'secret',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Confirm email
Confirms a newly registered user's email address using the code sent by email.
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/auth/confirm/architecto" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/auth/confirm/architecto"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/auth/confirm/architecto';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 59
access-control-allow-origin: *
{
"message": "INVALID_USER_CONFIRMATION_CODE",
"body": []
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Request password reset
Sends a password reset link to the given email address.
Example request:
curl --request POST \
"http://m2-partner-api.test/api/password/request_reset" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"user@example.com\"
}"
const url = new URL(
"http://m2-partner-api.test/api/password/request_reset"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "user@example.com"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/password/request_reset';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'email' => 'user@example.com',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Reset password
Sets a new password using the token received via email.
Example request:
curl --request POST \
"http://m2-partner-api.test/api/password/reset" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"user@example.com\",
\"token\": \"abc123xyz\",
\"password\": \"newpass456\"
}"
const url = new URL(
"http://m2-partner-api.test/api/password/reset"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "user@example.com",
"token": "abc123xyz",
"password": "newpass456"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/password/reset';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'email' => 'user@example.com',
'token' => 'abc123xyz',
'password' => 'newpass456',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Register
Creates a new user account. The sponsor invite code is optional: when provided it links the new user to the sponsoring partner, and when omitted the user registers as a direct signup (no sponsor). Sends a 6-digit verification code to the provided email.
Terms of Service are NOT accepted here — the user accepts them later via
POST /api/auth/accept-tos, after email verification (see the registration flow).
Re-registering an email that is still pending_verification is allowed: the
draft account is updated, so a client whose flow has a "Back" button can replay
this step. A live verification code stays valid and no second one is sent, so
replaying costs neither a code nor a send.
The password and the sponsor are written at creation only. This route is
anonymous, so a replay must not be able to set either on a draft it does not own;
a changed password submitted by a replay is ignored, and the account keeps the one
it was created with (POST /api/auth/forgot-password is how a password changes).
Name and phone ARE updated, deliberately: they are not credentials and losing an
edit to them is the complaint this endpoint exists to fix. An email belonging to
any further-along account is rejected as taken.
Example request:
curl --request POST \
"http://m2-partner-api.test/api/auth/register" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"invite_code\": \"AB12CD34\",
\"first_name\": \"Jelena\",
\"last_name\": \"Petrović\",
\"email\": \"jelena@example.com\",
\"password\": \"Secret123!\",
\"phone\": \"+381641234567\"
}"
const url = new URL(
"http://m2-partner-api.test/api/auth/register"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"invite_code": "AB12CD34",
"first_name": "Jelena",
"last_name": "Petrović",
"email": "jelena@example.com",
"password": "Secret123!",
"phone": "+381641234567"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/auth/register';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'invite_code' => 'AB12CD34',
'first_name' => 'Jelena',
'last_name' => 'Petrović',
'email' => 'jelena@example.com',
'password' => 'Secret123!',
'phone' => '+381641234567',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (201):
{
"message": "REGISTRATION_SUCCESS",
"body": {
"user_id": 42
}
}
Example response (406):
{
"message": "VALIDATION_ERROR",
"body": {
"invite_code": [
"Pozivni kod nije ispravan."
]
}
}
Example response (406):
{
"message": "VALIDATION_ERROR",
"body": {
"email": [
"Ova email adresa je već zauzeta."
]
}
}
Example response (406):
{
"message": "VALIDATION_ERROR",
"body": {
"error_fields": {
"password": {
"failed_rule": "Regex",
"message": "Lozinka mora da sadrži bar jedno slovo, jednu cifru i jedan specijalni znak."
}
}
}
}
Example response (429):
{
"message": "TOO_MANY_ATTEMPTS",
"body": {}
}
Example response (429):
{
"message": "RATE_LIMIT_EXCEEDED",
"body": {
"retry_after": 2731
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Social login
Authenticates (or registers) a user via a social OAuth provider. Logs in an existing user or creates a new account.
Register with invitation
Creates a new confirmed user account using an invitation code. The email is pre-filled from the invitation.
Example request:
curl --request POST \
"http://m2-partner-api.test/api/auth/register/architecto" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"first_name\": \"John\",
\"last_name\": \"Doe\",
\"password\": \"secret123\"
}"
const url = new URL(
"http://m2-partner-api.test/api/auth/register/architecto"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"first_name": "John",
"last_name": "Doe",
"password": "secret123"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/auth/register/architecto';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'first_name' => 'John',
'last_name' => 'Doe',
'password' => 'secret123',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Change password
requires authentication
Changes the authenticated user's password. Requires the current password for
verification. The new password must satisfy the password policy and must differ
from the current one. Passwords do not expire by default (M2-125); only when the
server runs with password expiration on does the new password also have to avoid
the previously used ones (PASSWORD_ALREADY_USED), and a successful change then
restarts the expiration window.
Example request:
curl --request POST \
"http://m2-partner-api.test/api/password/change" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"old_password\": \"Secret123!\",
\"new_password\": \"NewSecret123!\"
}"
const url = new URL(
"http://m2-partner-api.test/api/password/change"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"old_password": "Secret123!",
"new_password": "NewSecret123!"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/password/change';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'old_password' => 'Secret123!',
'new_password' => 'NewSecret123!',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"message": "PASSWORD_CHANGE_SUCCESS",
"body": {}
}
Example response (401):
{
"message": "PASSWORD_CHANGE_FAILURE_WRONG_PASSWORD",
"body": {}
}
Example response (406):
{
"message": "PASSWORD_SAME_AS_CURRENT",
"body": {}
}
Example response (406):
{
"message": "PASSWORD_ALREADY_USED",
"body": {}
}
Example response (406):
{
"message": "VALIDATION_ERROR",
"body": {
"error_fields": {
"new_password": {
"failed_rule": "Regex",
"message": "Format polja nova lozinka nije ispravan."
}
}
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Refresh token
requires authentication
Issues a new JWT token using the current valid token.
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/auth/refresh" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/auth/refresh"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/auth/refresh';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Logout
requires authentication
Invalidates the current JWT token, ending the session.
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/auth/logout" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/auth/logout"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/auth/logout';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get authenticated user
requires authentication
Retrieves the currently authenticated user's profile and relations.
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/auth/me" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/auth/me"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/auth/me';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "GET_LOGGED_IN_USER_SUCCESS",
"body": {
"user": {
"system": {
"id": 1,
"created_at": "2016-03-30T11:43:28.000000Z",
"updated_at": "2026-10-09T09:40:08.000000Z",
"published_at": null,
"anchor_text": "Super Administrator",
"anchor_html": "",
"content_preview": "",
"slug": "",
"created_by": {
"system": {
"id": 1,
"created_at": "2016-03-30T11:43:28.000000Z",
"updated_at": "2026-10-09T09:40:08.000000Z",
"published_at": null,
"anchor_text": "Super Administrator",
"anchor_html": "",
"content_preview": "",
"slug": "",
"created_by": 1,
"updated_by": 1,
"module": {
"name": "Users",
"table_name": "users"
},
"extensions": null
},
"fields": {
"email": "super.administrator@photoncms.test",
"password": null,
"first_name": "Super",
"last_name": "Administrator",
"confirmation_code": null,
"confirmed": true,
"password_created_at": "2026-10-09T09:40:08.000000Z",
"locked": false,
"lock_date": null,
"cannot_access_private_api": false
}
},
"updated_by": {
"system": {
"id": 1,
"created_at": "2016-03-30T11:43:28.000000Z",
"updated_at": "2026-10-09T09:40:08.000000Z",
"published_at": null,
"anchor_text": "Super Administrator",
"anchor_html": "",
"content_preview": "",
"slug": "",
"created_by": 1,
"updated_by": 1,
"module": {
"name": "Users",
"table_name": "users"
},
"extensions": null
},
"fields": {
"email": "super.administrator@photoncms.test",
"password": null,
"first_name": "Super",
"last_name": "Administrator",
"confirmation_code": null,
"confirmed": true,
"password_created_at": "2026-10-09T09:40:08.000000Z",
"locked": false,
"lock_date": null,
"cannot_access_private_api": false
}
},
"module": {
"name": "Users",
"table_name": "users"
},
"permission_control": {
"crud": {
"edit_restrictions": [],
"create": true,
"update": true,
"delete": true
}
},
"extensions": null
},
"fields": {
"email": "super.administrator@photoncms.test",
"password": null,
"first_name": "Super",
"last_name": "Administrator",
"confirmation_code": null,
"confirmed": true,
"password_created_at": "2026-10-09T09:40:08.000000Z",
"locked": false,
"lock_date": null,
"cannot_access_private_api": false
}
},
"impersonating": false
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Stop impersonating user
requires authentication
Invalidates the impersonation token and issues a fresh token for the original super admin user.
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/auth/impersonate/stop" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/auth/impersonate/stop"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/auth/impersonate/stop';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Start impersonating user
requires authentication
Issues a new token with the target user's ID embedded as a custom claim, allowing the super admin to act as that user.
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/auth/impersonate/architecto" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/auth/impersonate/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/auth/impersonate/architecto';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Clear user tokens
requires authentication
Invalidates all active JWT tokens for the specified user. Requires super admin role.
Example request:
curl --request POST \
"http://m2-partner-api.test/api/auth/clear/architecto" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/auth/clear/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/auth/clear/architecto';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Clear all tokens
requires authentication
Invalidates all active JWT tokens for all users. Super admins are skipped unless force=1. Requires super admin role.
Example request:
curl --request POST \
"http://m2-partner-api.test/api/auth/clear-all/architecto" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/auth/clear-all/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/auth/clear-all/architecto';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Verify email
Submits the 6-digit code sent to the user's email during registration.
On success, status changes to pending_tos — the user must still accept the
Terms of Service via POST /api/auth/accept-tos before admins are notified.
Replaying this step with the same code is a no-op that still answers
EMAIL_VERIFIED, so a client with a "Back" button does not have to remember
whether it already verified. Any other code is still rejected.
Example request:
curl --request POST \
"http://m2-partner-api.test/api/auth/verify-email" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"jelena@example.com\",
\"code\": \"123456\"
}"
const url = new URL(
"http://m2-partner-api.test/api/auth/verify-email"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "jelena@example.com",
"code": "123456"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/auth/verify-email';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'email' => 'jelena@example.com',
'code' => '123456',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"message": "EMAIL_VERIFIED",
"body": {}
}
Example response (406):
{
"message": "CODE_EXPIRED",
"body": {}
}
Example response (406):
{
"message": "CODE_INVALID",
"body": {}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Accept Terms of Service
Final registration step ("Završi registraciju"). The user accepts both the
Terms of Service / Privacy Policy and the confidentiality agreement. Only valid
once the email has been verified (status pending_tos). On success the status
changes to pending_approval and admins are notified.
Example request:
curl --request POST \
"http://m2-partner-api.test/api/auth/accept-tos" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"jelena@example.com\",
\"tos_accepted\": true,
\"confidentiality_accepted\": true
}"
const url = new URL(
"http://m2-partner-api.test/api/auth/accept-tos"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "jelena@example.com",
"tos_accepted": true,
"confidentiality_accepted": true
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/auth/accept-tos';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'email' => 'jelena@example.com',
'tos_accepted' => true,
'confidentiality_accepted' => true,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"message": "TOS_ACCEPTED",
"body": {}
}
Example response (406):
{
"message": "TOS_INVALID_STATE",
"body": {}
}
Example response (406):
{
"message": "VALIDATION_ERROR",
"body": {
"tos_accepted": [
"Potrebno je prihvatiti uslove korišćenja."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Resend verification code
Resends the 6-digit email verification code. Rate-limited to 3 per hour.
An address that is already verified has nothing to resend, so no code is minted
and no quota is spent — but the answer is the same VERIFICATION_CODE_SENT
either way. Saying "already verified" here would let an anonymous caller sort any
address into not-registered / unverified draft / real account.
Example request:
curl --request POST \
"http://m2-partner-api.test/api/auth/resend-verification" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"jelena@example.com\"
}"
const url = new URL(
"http://m2-partner-api.test/api/auth/resend-verification"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "jelena@example.com"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/auth/resend-verification';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'email' => 'jelena@example.com',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"message": "VERIFICATION_CODE_SENT",
"body": {}
}
Example response (429):
{
"message": "RATE_LIMIT_EXCEEDED",
"body": {
"retry_after": 2731
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Registration status
Returns whether the pending user has been approved by an admin. Used by the "Check status" button on the pending approval screen.
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/auth/registration-status" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"jelena@example.com\"
}"
const url = new URL(
"http://m2-partner-api.test/api/auth/registration-status"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "jelena@example.com"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/auth/registration-status';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'email' => 'jelena@example.com',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"message": "REGISTRATION_STATUS",
"body": {
"approved": false,
"status": "pending_approval"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Forgot password
Sends a 6-digit password reset code to the user's email.
This overrides the default PCMS link-based reset — the app uses a code input.
Rate-limited to 30 per hour per user, and to 5 requests/min per IP.
On the per-user limit, body.retry_after holds the seconds until the
quota resets.
Example request:
curl --request POST \
"http://m2-partner-api.test/api/auth/forgot-password" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"jelena@example.com\"
}"
const url = new URL(
"http://m2-partner-api.test/api/auth/forgot-password"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "jelena@example.com"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/auth/forgot-password';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'email' => 'jelena@example.com',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"message": "PASSWORD_RESET_CODE_SENT",
"body": {}
}
Example response (429):
{
"message": "RATE_LIMIT_EXCEEDED",
"body": {
"retry_after": 2731
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Reset password
Verifies the 6-digit code and sets a new password.
Example request:
curl --request POST \
"http://m2-partner-api.test/api/auth/reset-password" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"jelena@example.com\",
\"code\": \"654321\",
\"password\": \"NewSecret123!\"
}"
const url = new URL(
"http://m2-partner-api.test/api/auth/reset-password"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "jelena@example.com",
"code": "654321",
"password": "NewSecret123!"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/auth/reset-password';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'email' => 'jelena@example.com',
'code' => '654321',
'password' => 'NewSecret123!',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"message": "PASSWORD_RESET_SUCCESS",
"body": {}
}
Example response (406):
{
"message": "CODE_EXPIRED",
"body": {}
}
Example response (406):
{
"message": "VALIDATION_ERROR",
"body": {
"error_fields": {
"password": {
"failed_rule": "Regex",
"message": "Lozinka mora da sadrži bar jedno slovo, jednu cifru i jedan specijalni znak."
}
}
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Onboarding
Validate invite code
Checks whether a referral code is valid and returns the sponsor's name. Used on the first onboarding screen before registration.
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/onboarding/invite/AB12CD34" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/onboarding/invite/AB12CD34"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/onboarding/invite/AB12CD34';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"message": "INVITE_CODE_VALID",
"body": {
"sponsor_first_name": "Marko",
"sponsor_last_name": "Marković"
}
}
Example response (404):
{
"message": "INVITE_CODE_INVALID",
"body": {}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Me
Get profile
requires authentication
Returns the authenticated user's profile.
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/me" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/me"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/me';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"message": "ME_RETRIEVED",
"body": {
"id": 1,
"first_name": "Jelena",
"last_name": "Petrović",
"email": "jelena@example.com",
"phone": "+381641234567",
"status": "active",
"referral_code": "AB12CD34",
"roles": [
"partner"
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update profile
requires authentication
Updates the authenticated user's profile fields.
Example request:
curl --request PATCH \
"http://m2-partner-api.test/api/me" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"first_name\": \"Jelena\",
\"last_name\": \"Petrović\",
\"phone\": \"+381641234567\"
}"
const url = new URL(
"http://m2-partner-api.test/api/me"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"first_name": "Jelena",
"last_name": "Petrović",
"phone": "+381641234567"
};
fetch(url, {
method: "PATCH",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/me';
$response = $client->patch(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'first_name' => 'Jelena',
'last_name' => 'Petrović',
'phone' => '+381641234567',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"message": "ME_UPDATED",
"body": {
"id": 1
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete account
requires authentication
Permanently deletes the authenticated partner's or candidate's account (Apple 5.1.1(v) / Google Play). The account is anonymised in place: name, email, phone, IBAN and the profile image are removed irreversibly, every token is invalidated and the email can be registered again. Commissions, payouts and referrals stay with the agency as its financial record.
Refused while the user has an unpaid commission or payout — the agency settles it first. Staff accounts cannot delete themselves.
Example request:
curl --request DELETE \
"http://m2-partner-api.test/api/me" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"password\": \"L!gthsp44d\"
}"
const url = new URL(
"http://m2-partner-api.test/api/me"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"password": "L!gthsp44d"
};
fetch(url, {
method: "DELETE",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/me';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'password' => 'L!gthsp44d',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"message": "ACCOUNT_DELETED",
"body": []
}
Example response (406):
{
"message": "ACCOUNT_DELETION_WRONG_PASSWORD",
"body": []
}
Example response (406):
{
"message": "ACCOUNT_HAS_OPEN_PAYMENTS",
"body": {
"open_commissions": 1,
"open_payouts": 0
}
}
Example response (406):
{
"message": "ACCOUNT_DELETION_NOT_ALLOWED",
"body": []
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Dashboard
requires authentication
Returns KPI summary and latest activity feed for the home screen.
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/me/dashboard" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/me/dashboard"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/me/dashboard';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"message": "DASHBOARD_RETRIEVED",
"body": {
"earnings_total": 1250,
"earnings_pending": 250,
"referrals_count": 5,
"active_count": 3,
"team_count": 2,
"activity_feed": []
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Digital card
requires authentication
Returns data for the partner's digital business card and QR code.
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/me/digital-card" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/me/digital-card"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/me/digital-card';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"message": "DIGITAL_CARD_RETRIEVED",
"body": {
"first_name": "Jelena",
"last_name": "Petrović",
"status": "candidate",
"referral_code": "AB12CD34",
"qr_payload": "https://m2-partner-api.test/join/AB12CD34"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Earnings
requires authentication
Returns earnings summary and commission bracket information.
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/me/earnings" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/me/earnings"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/me/earnings';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"message": "EARNINGS_RETRIEVED",
"body": {
"total": 1250,
"pending": 250,
"paid": 1000,
"brackets": {
"seller": [
{
"min": 750,
"max": 5000,
"rate": 10
},
{
"min": 5001,
"max": 10000,
"rate": 13
},
{
"min": 10001,
"max": null,
"rate": 15
}
],
"buyer": [
{
"min": 750,
"max": 5000,
"rate": 7
},
{
"min": 5001,
"max": 10000,
"rate": 8
},
{
"min": 10001,
"max": null,
"rate": 10
}
]
}
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Earnings history (commissions & bonuses)
requires authentication
Itemised list of the authenticated user's commissions and referral bonuses,
for the "Istorija zarada" screen. Complements /me/earnings (which returns
only the totals + brackets).
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/me/commissions?filter=month&type=direct" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/me/commissions"
);
const params = {
"filter": "month",
"type": "direct",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/me/commissions';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'filter' => 'month',
'type' => 'direct',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"message": "COMMISSIONS_RETRIEVED",
"body": {
"commissions": [
{
"id": 1,
"amount": 884,
"type": "direct",
"status": "paid",
"date": "2026-03-18 10:00:00",
"client_name": "Miloš Jovanović"
}
],
"total": 1
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
My team
requires authentication
Returns a list of partners sponsored by the authenticated user, including the sponsor's earnings from each (10% of their commissions).
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/me/team" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/me/team"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/me/team';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"message": "TEAM_RETRIEVED",
"body": {
"team": [
{
"id": 2,
"first_name": "Ana",
"last_name": "Anić",
"role": "candidate",
"completed_deals": 1,
"my_earnings": 50
}
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Activities (email log)
requires authentication
Returns the authenticated user's email notification history. Powers the Activity Center (bell icon) in the app.
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/me/activities?filter=week" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/me/activities"
);
const params = {
"filter": "week",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/me/activities';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'filter' => 'week',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"message": "ACTIVITIES_RETRIEVED",
"body": {
"activities": [
{
"template": "referral_activity",
"subject": "Novost o tvojoj preporuci: Marko",
"sent_at": "2026-06-01 10:00:00",
"reference_type": "referral",
"reference_id": 5
}
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Referrals
List referrals
requires authentication
Returns referrals filtered by role: partners see only their own, agents see assigned referrals, admins see all.
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/referrals?status=qualified&search=Marko" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/referrals"
);
const params = {
"status": "qualified",
"search": "Marko",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/referrals';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'status' => 'qualified',
'search' => 'Marko',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"message": "REFERRALS_RETRIEVED",
"body": {
"referrals": [],
"total": 0
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create referral
requires authentication
Submits a new client referral. Runs duplicate detection automatically.
Example request:
curl --request POST \
"http://m2-partner-api.test/api/referrals" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"client_name\": \"Marko Marković\",
\"client_phone\": \"+381641234567\",
\"client_email\": \"marko@example.com\",
\"transaction_type\": \"sale\",
\"property_type\": \"apartment\",
\"estimated_value\": 150000,
\"monthly_rent\": 600,
\"gdpr_consent\": true,
\"property_description\": \"Three-bedroom apartment in Novi Beograd\"
}"
const url = new URL(
"http://m2-partner-api.test/api/referrals"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"client_name": "Marko Marković",
"client_phone": "+381641234567",
"client_email": "marko@example.com",
"transaction_type": "sale",
"property_type": "apartment",
"estimated_value": 150000,
"monthly_rent": 600,
"gdpr_consent": true,
"property_description": "Three-bedroom apartment in Novi Beograd"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/referrals';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'client_name' => 'Marko Marković',
'client_phone' => '+381641234567',
'client_email' => 'marko@example.com',
'transaction_type' => 'sale',
'property_type' => 'apartment',
'estimated_value' => 150000.0,
'monthly_rent' => 600.0,
'gdpr_consent' => true,
'property_description' => 'Three-bedroom apartment in Novi Beograd',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (201):
{
"message": "REFERRAL_CREATED",
"body": {
"id": 1,
"duplicate_flag": false,
"duplicate_score": 0
}
}
Example response (406):
{
"message": "VALIDATION_ERROR",
"body": {
"gdpr_consent": [
"Potrebna je saglasnost klijenta za obradu podataka."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Check for duplicates
requires authentication
Pre-submission duplicate check. Returns a score and list of potential matches.
Example request:
curl --request POST \
"http://m2-partner-api.test/api/referrals/check-duplicate" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"client_name\": \"Marko Marković\",
\"client_phone\": \"+381641234567\",
\"client_email\": \"marko@example.com\"
}"
const url = new URL(
"http://m2-partner-api.test/api/referrals/check-duplicate"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"client_name": "Marko Marković",
"client_phone": "+381641234567",
"client_email": "marko@example.com"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/referrals/check-duplicate';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'client_name' => 'Marko Marković',
'client_phone' => '+381641234567',
'client_email' => 'marko@example.com',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"message": "DUPLICATE_CHECK_COMPLETE",
"body": {
"score": 80,
"flagged": true,
"matches": [
{
"referral_id": 3,
"score": 80
}
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get referral
requires authentication
Returns a single referral with all fields.
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/me/referrals/1" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/me/referrals/1"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/me/referrals/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"message": "REFERRAL_RETRIEVED",
"body": {
"referral": {}
}
}
Example response (403):
{
"message": "FORBIDDEN",
"body": {}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get referral for the /cp panel
requires authentication
Staff-only. Delegates to the Photon generic module GET so the /cp admin edit form
receives the {system, fields} entry shape it expects. Serves GET /api/referrals/{id}
(the app's own visibility-gated detail moved to GET /api/me/referrals/{id}); this
route re-gates the otherwise default-open generic read for referrals to staff.
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/referrals/1" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/referrals/1"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/referrals/1';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "LOAD_DYNAMIC_MODULE_ENTRY_SUCCESS",
"body": {
"entry": {
"system": {
"id": 1,
"created_at": "2026-03-28T09:29:29.000000Z",
"updated_at": "2026-05-12T09:29:29.000000Z",
"published_at": null,
"anchor_text": "Miloš Jovanović",
"anchor_html": "",
"content_preview": "",
"slug": "",
"created_by": null,
"updated_by": null,
"module": {
"name": "Referrals",
"table_name": "referrals"
},
"permission_control": {
"crud": {
"edit_restrictions": [],
"create": true,
"update": true,
"delete": true
}
},
"extensions": null
},
"fields": {
"client_name": "Miloš Jovanović",
"client_phone": "+381631001001",
"client_email": "milos.jovanovic@example.com",
"transaction_type": "sale",
"property_type": "apartment",
"property_description": {
"en": "Trosoban stan, 78m², Vračar, Beograd"
},
"estimated_value": 210000,
"monthly_rent": null,
"status": "completed",
"rejection_reason": null,
"gdpr_consent": true,
"duplicate_score": 0,
"duplicate_flag": false,
"completed_at": "2026-05-12 09:29:29"
}
}
}
}
Example response (403):
{
"message": "FORBIDDEN",
"body": {}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update referral status
requires authentication
Updates the status of a referral. Admin/agent only.
Example request:
curl --request PATCH \
"http://m2-partner-api.test/api/referrals/1/status" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"status\": \"qualified\"
}"
const url = new URL(
"http://m2-partner-api.test/api/referrals/1/status"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"status": "qualified"
};
fetch(url, {
method: "PATCH",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/referrals/1/status';
$response = $client->patch(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'status' => 'qualified',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"message": "REFERRAL_STATUS_UPDATED",
"body": {
"id": 1,
"status": "qualified"
}
}
Example response (403):
{
"message": "FORBIDDEN",
"body": {}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Reject referral
requires authentication
Rejects a referral with a mandatory reason. Notifies the referrer by email. Admin/agent only.
Example request:
curl --request POST \
"http://m2-partner-api.test/api/referrals/1/reject" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"rejection_reason\": \"Klijent je već u kontaktu sa drugom agencijom.\"
}"
const url = new URL(
"http://m2-partner-api.test/api/referrals/1/reject"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"rejection_reason": "Klijent je već u kontaktu sa drugom agencijom."
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/referrals/1/reject';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'rejection_reason' => 'Klijent je već u kontaktu sa drugom agencijom.',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"message": "REFERRAL_REJECTED",
"body": {
"id": 1
}
}
Example response (403):
{
"message": "FORBIDDEN",
"body": {}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Property Timeline
List activities
requires authentication
Returns the property timeline for a referral.
Partners only see activities with visibility = referrer; admins/agents see all.
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/referrals/1/activities" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/referrals/1/activities"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/referrals/1/activities';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"message": "ACTIVITIES_RETRIEVED",
"body": {
"activities": []
}
}
Example response (403):
{
"message": "FORBIDDEN",
"body": {}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Add activity
requires authentication
Adds a new timeline activity to a referral. Admin/agent only.
Example request:
curl --request POST \
"http://m2-partner-api.test/api/referrals/1/activities" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"activity_type_id\": 3,
\"description\": \"Client meeting scheduled for Monday.\",
\"agent_notes\": \"Client seems motivated.\",
\"visibility\": \"referrer\",
\"amount\": 175000,
\"next_action\": \"Send offer\",
\"due_date\": \"2026-06-15\"
}"
const url = new URL(
"http://m2-partner-api.test/api/referrals/1/activities"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"activity_type_id": 3,
"description": "Client meeting scheduled for Monday.",
"agent_notes": "Client seems motivated.",
"visibility": "referrer",
"amount": 175000,
"next_action": "Send offer",
"due_date": "2026-06-15"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/referrals/1/activities';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'activity_type_id' => 3,
'description' => 'Client meeting scheduled for Monday.',
'agent_notes' => 'Client seems motivated.',
'visibility' => 'referrer',
'amount' => 175000.0,
'next_action' => 'Send offer',
'due_date' => '2026-06-15',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (201):
{
"message": "ACTIVITY_CREATED",
"body": {
"id": 1
}
}
Example response (403):
{
"message": "FORBIDDEN",
"body": {}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Admin: Users
List users
requires authentication
Returns all users with filtering. Includes pending approval queue.
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/admin/users?status=pending_approval&search=Jelena" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/admin/users"
);
const params = {
"status": "pending_approval",
"search": "Jelena",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/admin/users';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'status' => 'pending_approval',
'search' => 'Jelena',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"message": "USERS_RETRIEVED",
"body": {
"users": [],
"total": 0
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Approve user
requires authentication
Sets user status to active, generates a referral code, and sends a welcome email.
Example request:
curl --request POST \
"http://m2-partner-api.test/api/admin/users/42/approve" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/admin/users/42/approve"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/admin/users/42/approve';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"message": "USER_APPROVED",
"body": {
"id": 42,
"referral_code": "AB12CD34"
}
}
Example response (403):
{
"message": "FORBIDDEN",
"body": {}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Block user
requires authentication
Sets user status to blocked, preventing login.
Example request:
curl --request POST \
"http://m2-partner-api.test/api/admin/users/42/block" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/admin/users/42/block"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/admin/users/42/block';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"message": "USER_BLOCKED",
"body": {
"id": 42
}
}
Example response (403):
{
"message": "FORBIDDEN",
"body": {}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Promote to partner
requires authentication
Force-promotes a candidate to partner role regardless of deal count.
Example request:
curl --request POST \
"http://m2-partner-api.test/api/admin/users/42/promote" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/admin/users/42/promote"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/admin/users/42/promote';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"message": "USER_PROMOTED",
"body": {
"id": 42
}
}
Example response (403):
{
"message": "FORBIDDEN",
"body": {}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Admin: Commissions
Preview commission
requires authentication
Calculates the commission breakdown for a referral before confirming. Includes referral bonus if the referrer has a sponsor.
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/admin/commissions/preview?referral_id=5&agency_commission=3500" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"referral_id\": 16,
\"agency_commission\": 662
}"
const url = new URL(
"http://m2-partner-api.test/api/admin/commissions/preview"
);
const params = {
"referral_id": "5",
"agency_commission": "3500",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"referral_id": 16,
"agency_commission": 662
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/admin/commissions/preview';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'referral_id' => '5',
'agency_commission' => '3500',
],
'json' => [
'referral_id' => 16,
'agency_commission' => 662,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"message": "COMMISSION_PREVIEW",
"body": {
"rate": 0.1,
"partner_amount": 350,
"sponsor_bonus": 35,
"bonus_eligible": true
}
}
Example response (403):
{
"message": "FORBIDDEN",
"body": {}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create commission
requires authentication
Confirms and persists the direct commission for a referral, and (if the referrer has an eligible sponsor) auto-creates the sponsor's referral bonus — 10% of the direct amount, paid on top of it (the direct amount is not reduced) — and emails the sponsor about it (ReferralBonusService, shared with the /cp form path). Admin only.
Example request:
curl --request POST \
"http://m2-partner-api.test/api/admin/commissions" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"referral_id\": 5,
\"agency_commission\": 5000
}"
const url = new URL(
"http://m2-partner-api.test/api/admin/commissions"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"referral_id": 5,
"agency_commission": 5000
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/admin/commissions';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'referral_id' => 5,
'agency_commission' => 5000.0,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (201):
{
"message": "COMMISSION_CREATED",
"body": {
"direct_id": 1,
"direct_amount": 500,
"bonus_id": 2,
"sponsor_bonus": 50
}
}
Example response (403):
{
"message": "FORBIDDEN",
"body": {}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Admin: Payouts
Preview monthly payout
requires authentication
Lists the partners who would be paid (and how much) from the currently pending, not-yet-paid-out commissions — without persisting anything. Feeds the /cp payout screen so the admin can confirm before initiating.
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/admin/payouts/preview" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/admin/payouts/preview"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/admin/payouts/preview';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"message": "PAYOUT_PREVIEW",
"body": {
"recipients": [
{
"user_id": 3,
"name": "Partner Test",
"total": 500,
"commission_count": 1
}
],
"total": 500,
"count": 1
}
}
Example response (403):
{
"message": "FORBIDDEN",
"body": {}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Initiate monthly payout
requires authentication
Creates payout records for all partners with pending commissions and notifies them.
Example request:
curl --request POST \
"http://m2-partner-api.test/api/admin/payouts" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"period_month\": 6,
\"period_year\": 2026
}"
const url = new URL(
"http://m2-partner-api.test/api/admin/payouts"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"period_month": 6,
"period_year": 2026
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/admin/payouts';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'period_month' => 6,
'period_year' => 2026,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"message": "PAYOUT_INITIATED",
"body": {
"payouts_created": 5,
"total_disbursed": 4250
}
}
Example response (403):
{
"message": "FORBIDDEN",
"body": {}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
General
System-level endpoints for CMS management, AI helpers and API overdraft status.
Refresh API overdraft status
Refreshes and returns the current API overdraft flag. Used by the frontend to check if the API call limit is exceeded.
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/refresh-api-overdraft-status" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/refresh-api-overdraft-status"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/refresh-api-overdraft-status';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 59
access-control-allow-origin: *
{
"message": "API_OVERDRAFT_STATUS_REFRESH_SUCCESS",
"body": {
"api_overdraft_status": false
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Check export status
requires authentication
Returns the current database export status and a list of available export files.
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/database-export" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/database-export"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/database-export';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "INSUFICIENT_PERMISSIONS",
"body": {
"message": "Insuficient permissions."
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Check import status
requires authentication
Returns the current database import status.
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/database-import" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/database-import"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/database-import';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "INSUFICIENT_PERMISSIONS",
"body": {
"message": "Insuficient permissions."
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Export database
requires authentication
Dispatches an async job to export the database to a .tar archive. Check export status to poll for completion.
Example request:
curl --request POST \
"http://m2-partner-api.test/api/database-export" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/database-export"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/database-export';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Import database
requires authentication
Uploads a .tar database backup file and dispatches an async import job.
Example request:
curl --request POST \
"http://m2-partner-api.test/api/database-import" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "file=@/private/var/folders/kt/2yvy5kfx3g9d63g5xcj534z00000gn/T/phpaU6BWV" const url = new URL(
"http://m2-partner-api.test/api/database-import"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('file', document.querySelector('input[name="file"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/database-import';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
],
'multipart' => [
[
'name' => 'file',
'contents' => fopen('/private/var/folders/kt/2yvy5kfx3g9d63g5xcj534z00000gn/T/phpaU6BWV', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Hard reset CMS
requires authentication
Clears all dynamic models, migrations and DB tables, then rebuilds and re-seeds from scratch. Destructive — use with extreme caution.
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/photon/hard-reset?clean=" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/photon/hard-reset"
);
const params = {
"clean": "0",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/photon/hard-reset';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'clean' => '0',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "PHOTON_HARD_RESET_SUCCESS",
"body": []
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Soft reset CMS
requires authentication
Resets the CMS to its default state while preserving module extenders. Useful when a project-specific seed is configured.
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/photon/soft-reset?clean=" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/photon/soft-reset"
);
const params = {
"clean": "0",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/photon/soft-reset';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'clean' => '0',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "PHOTON_SOFT_RESET_SUCCESS",
"body": []
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Translate text (AI)
requires authentication
Translates the given text to the target language using OpenAI. Requires OPENAI_API_KEY to be configured.
Example request:
curl --request POST \
"http://m2-partner-api.test/api/ai/translate" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"string\": \"Hello world\",
\"target_language_code\": \"de\"
}"
const url = new URL(
"http://m2-partner-api.test/api/ai/translate"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"string": "Hello world",
"target_language_code": "de"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/ai/translate';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'string' => 'Hello world',
'target_language_code' => 'de',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Edit text (AI)
requires authentication
Edits or rewrites text according to the given system prompt, using OpenAI. Requires OPENAI_API_KEY to be configured.
Example request:
curl --request POST \
"http://m2-partner-api.test/api/ai/edit" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"text\": \"This is a rough draft.\",
\"system_prompt\": \"Fix grammar and improve clarity.\",
\"target_language_code\": \"en\"
}"
const url = new URL(
"http://m2-partner-api.test/api/ai/edit"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"text": "This is a rough draft.",
"system_prompt": "Fix grammar and improve clarity.",
"target_language_code": "en"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/ai/edit';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'text' => 'This is a rough draft.',
'system_prompt' => 'Fix grammar and improve clarity.',
'target_language_code' => 'en',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Admin: Referrals
Potential duplicates for a referral
requires authentication
Basic duplicate display (scope §6.2) for the /cp AdminSlot. Recomputes the check
live against the current table (the stored duplicate_score reflects submission
time) excluding the referral itself, and returns matches above threshold enriched
with each duplicate's name + a probable/possible classification so the panel only
renders links. Display-only — merge/dismiss/notifications are Phase 2. Staff-only.
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/admin/referrals/5/duplicates" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/admin/referrals/5/duplicates"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/admin/referrals/5/duplicates';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"message": "REFERRAL_DUPLICATES",
"body": {
"score": 80,
"flagged": true,
"matches": [
{
"referral_id": 3,
"client_name": "Marko Marković",
"score": 80,
"classification": "probable"
}
]
}
}
Example response (403):
{
"message": "FORBIDDEN",
"body": {}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Remove referral from system
requires authentication
Fully deletes a referral from the system (e.g. deal closed through another agency). Different from rejection — the record is permanently removed.
Example request:
curl --request DELETE \
"http://m2-partner-api.test/api/admin/referrals/5" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"reason\": \"Deal closed through another agency.\"
}"
const url = new URL(
"http://m2-partner-api.test/api/admin/referrals/5"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"reason": "Deal closed through another agency."
};
fetch(url, {
method: "DELETE",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/admin/referrals/5';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'reason' => 'Deal closed through another agency.',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"message": "REFERRAL_REMOVED",
"body": {
"id": 5
}
}
Example response (403):
{
"message": "FORBIDDEN",
"body": {}
}
Example response (409):
{
"message": "REFERRAL_HAS_COMMISSIONS",
"body": {}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Entries
Endpoints for creating, reading, updating and deleting dynamic module entries.
Retrieves a single dynamic module entry.
requires authentication
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/architecto/564" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/architecto/564"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/architecto/564';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "MODULE_NOT_FOUND",
"body": {
"table_name": "architecto"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Filter entries
requires authentication
Returns paginated entries from one or more modules matching the given filter, sorting and pagination criteria.
Example request:
curl --request POST \
"http://m2-partner-api.test/api/filter" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"modules\": [
\"news\"
],
\"filter\": {
\"system\": [],
\"fields\": []
},
\"sorting\": {
\"field\": \"created_at\",
\"direction\": \"desc\"
},
\"pagination\": {
\"items_per_page\": 15,
\"current_page\": 1
},
\"include\": [
\"architecto\"
]
}"
const url = new URL(
"http://m2-partner-api.test/api/filter"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"modules": [
"news"
],
"filter": {
"system": [],
"fields": []
},
"sorting": {
"field": "created_at",
"direction": "desc"
},
"pagination": {
"items_per_page": 15,
"current_page": 1
},
"include": [
"architecto"
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/filter';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'modules' => [
'news',
],
'filter' => [
'system' => [],
'fields' => [],
],
'sorting' => [
'field' => 'created_at',
'direction' => 'desc',
],
'pagination' => [
'items_per_page' => 15,
'current_page' => 1,
],
'include' => [
'architecto',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Download export
Downloads a previously exported file by its file name. Use the file name returned by the export endpoint.
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/export/download/architecto" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/export/download/architecto"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/export/download/architecto';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "FILE_NOT_FOUND",
"body": {
"file": "/Users/milanandjelkovic/Sites/m2-partner-api-m2-132/storage/app/database-exports/architecto"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get node children
requires authentication
Returns the immediate children of the specified node, or root-level nodes if no ID is given.
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/nodes/architecto/architecto?child_modules=architecto" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/nodes/architecto/architecto"
);
const params = {
"child_modules": "architecto",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/nodes/architecto/architecto';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'child_modules' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "MODULE_NOT_FOUND",
"body": {
"table_name": "architecto"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get node ancestors
requires authentication
Returns the ancestral tree path from the root down to the specified node.
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/nodes/architecto/ancestors/architecto" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/nodes/architecto/ancestors/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/nodes/architecto/ancestors/architecto';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "MODULE_NOT_FOUND",
"body": {
"table_name": "architecto"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get node children
requires authentication
Returns the immediate children of the specified node, or root-level nodes if no ID is given.
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/nodes/architecto?child_modules=architecto" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/nodes/architecto"
);
const params = {
"child_modules": "architecto",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/nodes/architecto';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'child_modules' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "MODULE_NOT_FOUND",
"body": {
"table_name": "architecto"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Reposition node
requires authentication
Repositions a node within the tree using a named action (e.g. moveLeft, makeChildOf).
Example request:
curl --request PUT \
"http://m2-partner-api.test/api/nodes/reposition" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"action\": \"moveLeft\",
\"affected\": [],
\"target\": []
}"
const url = new URL(
"http://m2-partner-api.test/api/nodes/reposition"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"action": "moveLeft",
"affected": [],
"target": []
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/nodes/reposition';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'action' => 'moveLeft',
'affected' => [],
'target' => [],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Call extension action
requires authentication
Calls a custom action defined in the module's extension class.
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/extension_call/architecto/architecto/architecto/{+-0pB" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/extension_call/architecto/architecto/architecto/{+-0pB"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/extension_call/architecto/architecto/architecto/{+-0pB';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "MODULE_NOT_FOUND",
"body": {
"table_name": "architecto"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Subscribe to entry
requires authentication
Subscribes the authenticated user to change notifications for the specified entry.
Example request:
curl --request POST \
"http://m2-partner-api.test/api/subscribe/architecto/architecto" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/subscribe/architecto/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/subscribe/architecto/architecto';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Unsubscribe from entry
requires authentication
Unsubscribes the authenticated user from change notifications for the specified entry.
Example request:
curl --request DELETE \
"http://m2-partner-api.test/api/subscribe/architecto/architecto" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/subscribe/architecto/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/subscribe/architecto/architecto';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create entry
requires authentication
Creates a new entry in the specified module. File uploads are supported for asset modules (multipart/form-data).
Example request:
curl --request POST \
"http://m2-partner-api.test/api/architecto" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"system\": [],
\"fields\": []
}"
const url = new URL(
"http://m2-partner-api.test/api/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"system": [],
"fields": []
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/architecto';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'system' => [],
'fields' => [],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Duplicate entry
requires authentication
Creates a copy of an existing module entry, preserving all field values.
Example request:
curl --request POST \
"http://m2-partner-api.test/api/duplicate/architecto/architecto" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/duplicate/architecto/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/duplicate/architecto/architecto';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update entry
requires authentication
Updates field values on an existing module entry.
Example request:
curl --request PUT \
"http://m2-partner-api.test/api/architecto/architecto" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"system\": [],
\"fields\": []
}"
const url = new URL(
"http://m2-partner-api.test/api/architecto/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"system": [],
"fields": []
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/architecto/architecto';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'system' => [],
'fields' => [],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Mass update entries
requires authentication
Applies a bulk update to all module entries matching the given filter.
Example request:
curl --request PUT \
"http://m2-partner-api.test/api/architecto" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"filter\": [],
\"fields\": []
}"
const url = new URL(
"http://m2-partner-api.test/api/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"filter": [],
"fields": []
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/architecto';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'filter' => [],
'fields' => [],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete entry
requires authentication
Deletes a module entry. The entry must have no related entries in other modules unless force is passed.
Example request:
curl --request DELETE \
"http://m2-partner-api.test/api/architecto/564" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"force\": false
}"
const url = new URL(
"http://m2-partner-api.test/api/architecto/564"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"force": false
};
fetch(url, {
method: "DELETE",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/architecto/564';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'force' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Export entries
requires authentication
Exports module entries matching the given filter to a file (e.g. XLSX). Returns a file name to use with the download endpoint.
Example request:
curl --request POST \
"http://m2-partner-api.test/api/export/architecto" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"file_type\": \"xlsx\",
\"file_name\": \"news-export\",
\"filter\": [],
\"sorting\": [],
\"parameters\": []
}"
const url = new URL(
"http://m2-partner-api.test/api/export/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"file_type": "xlsx",
"file_name": "news-export",
"filter": [],
"sorting": [],
"parameters": []
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/export/architecto';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'file_type' => 'xlsx',
'file_name' => 'news-export',
'filter' => [],
'sorting' => [],
'parameters' => [],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Export single entry
requires authentication
Exports a single module entry to a file.
Example request:
curl --request POST \
"http://m2-partner-api.test/api/export/architecto/architecto" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"file_type\": \"xlsx\",
\"file_name\": \"entry-export\",
\"parameters\": []
}"
const url = new URL(
"http://m2-partner-api.test/api/export/architecto/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"file_type": "xlsx",
"file_name": "entry-export",
"parameters": []
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/export/architecto/architecto';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'file_type' => 'xlsx',
'file_name' => 'entry-export',
'parameters' => [],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Count entries
requires authentication
Returns the total count of module entries matching the given filter.
Example request:
curl --request POST \
"http://m2-partner-api.test/api/count/architecto" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"filter\": []
}"
const url = new URL(
"http://m2-partner-api.test/api/count/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"filter": []
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/count/architecto';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'filter' => [],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get entry stats
requires authentication
Returns aggregated statistics (totals, breakdowns) for the specified module's entries.
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/stats/architecto" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/stats/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/stats/architecto';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (500):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "GENERAL_EXCEPTION",
"body": {
"message": "There's been an error!",
"code": "disabled",
"file": "disabled",
"line": "disabled",
"trace": "disabled"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get weekly chart data
requires authentication
Returns entry counts grouped by week for charting purposes.
Example request:
curl --request POST \
"http://m2-partner-api.test/api/weekly-chart/architecto" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"chart_period\": 4
}"
const url = new URL(
"http://m2-partner-api.test/api/weekly-chart/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"chart_period": 4
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/weekly-chart/architecto';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'chart_period' => 4,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Fields
Endpoints for retrieving available field type definitions.
Retrieves all field types.
requires authentication
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/field_types" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/field_types"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/field_types';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "GET_ALL_FIELD_TYPES_SUCCESS",
"body": {
"field_types": [
{
"id": 1,
"type": "input_text",
"title": "Input Text",
"laravel_type": "mediumText",
"is_system": false,
"supports_translation": true
},
{
"id": 2,
"type": "rich_text",
"title": "Rich Text",
"laravel_type": "mediumText",
"is_system": false,
"supports_translation": true
},
{
"id": 3,
"type": "image",
"title": "Image",
"laravel_type": "string",
"is_system": false,
"supports_translation": false
},
{
"id": 4,
"type": "boolean",
"title": "Boolean",
"laravel_type": "boolean",
"is_system": false,
"supports_translation": false
},
{
"id": 5,
"type": "date",
"title": "Date",
"laravel_type": "date",
"is_system": false,
"supports_translation": false
},
{
"id": 7,
"type": "many_to_one",
"title": "Many to One",
"laravel_type": "",
"is_system": false,
"supports_translation": false
},
{
"id": 8,
"type": "relationship",
"title": "Relationship",
"laravel_type": "",
"is_system": false,
"supports_translation": false
},
{
"id": 9,
"type": "password",
"title": "Password",
"laravel_type": "string",
"is_system": false,
"supports_translation": false
},
{
"id": 10,
"type": "integer",
"title": "Integer",
"laravel_type": "integer",
"is_system": false,
"supports_translation": false
},
{
"id": 11,
"type": "system_integer",
"title": "System Integer",
"laravel_type": "integer",
"is_system": true,
"supports_translation": false
},
{
"id": 12,
"type": "system_date_time",
"title": "System Date-time",
"laravel_type": "datetime",
"is_system": true,
"supports_translation": false
},
{
"id": 13,
"type": "system_string",
"title": "System String",
"laravel_type": "string",
"is_system": false,
"supports_translation": false
},
{
"id": 14,
"type": "one_to_one",
"title": "One to One",
"laravel_type": "integer",
"is_system": false,
"supports_translation": false
},
{
"id": 15,
"type": "asset",
"title": "Asset",
"laravel_type": "string",
"is_system": false,
"supports_translation": false
},
{
"id": 17,
"type": "one_to_many",
"title": "One To Many",
"laravel_type": "",
"is_system": false,
"supports_translation": false
},
{
"id": 18,
"type": "date_time",
"title": "Date-time",
"laravel_type": "datetime",
"is_system": false,
"supports_translation": false
},
{
"id": 24,
"type": "permissions",
"title": "Permissions",
"laravel_type": "",
"is_system": false,
"supports_translation": false
},
{
"id": 25,
"type": "big_integer",
"title": "Big Integer",
"laravel_type": "bigInteger",
"is_system": false,
"supports_translation": false
},
{
"id": 26,
"type": "textarea",
"title": "Textarea",
"laravel_type": "mediumText",
"is_system": false,
"supports_translation": true
},
{
"id": 27,
"type": "color_picker",
"title": "ColorPicker",
"laravel_type": "mediumText",
"is_system": false,
"supports_translation": false
},
{
"id": 28,
"type": "video",
"title": "Video",
"laravel_type": "string",
"is_system": false,
"supports_translation": false
},
{
"id": 29,
"type": "location",
"title": "Location",
"laravel_type": "string",
"is_system": false,
"supports_translation": false
},
{
"id": 30,
"type": "modules_multi_select",
"title": "ModulesMultiSelect",
"laravel_type": "mediumText",
"is_system": false,
"supports_translation": false
},
{
"id": 31,
"type": "modules_single_select",
"title": "ModulesSingleSelect",
"laravel_type": "bigInteger",
"is_system": false,
"supports_translation": false
},
{
"id": 32,
"type": "section",
"title": "Section",
"laravel_type": "mediumText",
"is_system": false,
"supports_translation": true
},
{
"id": 33,
"type": "icon",
"title": "Icon",
"laravel_type": "string",
"is_system": false,
"supports_translation": false
},
{
"id": 34,
"type": "simple_text",
"title": "Simple Text",
"laravel_type": "string",
"is_system": false,
"supports_translation": false
},
{
"id": 35,
"type": "system_many_to_one",
"title": "System Many to One",
"laravel_type": "integer",
"is_system": true,
"supports_translation": false
},
{
"id": 36,
"type": "markdown",
"title": "Markdown",
"laravel_type": "mediumText",
"is_system": false,
"supports_translation": true
},
{
"id": 37,
"type": "encrypted",
"title": "Encrypted",
"laravel_type": "text",
"is_system": false,
"supports_translation": false
},
{
"id": 38,
"type": "json",
"title": "JSON",
"laravel_type": "json",
"is_system": false,
"supports_translation": false
},
{
"id": 39,
"type": "uuid",
"title": "UUID",
"laravel_type": "uuid",
"is_system": false,
"supports_translation": false
},
{
"id": 40,
"type": "float_number",
"title": "Float Number",
"laravel_type": "float",
"is_system": false,
"supports_translation": false
},
{
"id": 41,
"type": "enum",
"title": "Enum",
"laravel_type": "enum",
"is_system": false,
"supports_translation": false
}
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Modules
Endpoints for managing CMS module definitions (schema, fields, types).
List modules
requires authentication
Returns all registered CMS modules with their field definitions.
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/modules" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/modules"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/modules';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "GET_ALL_MODULES_SUCCESS",
"body": {
"modules": [
{
"id": 1,
"category": null,
"type": "non_sortable",
"name": "Users",
"table_name": "users",
"icon": "fal fa-users",
"anchor_text": "{{first_name}} {{last_name}}",
"content_preview": null,
"anchor_html": null,
"is_system": true,
"slug": null,
"created_at": "2016-04-01T09:17:48.000000Z",
"updated_at": "2016-04-01T11:29:51.000000Z",
"lazy_loading": false,
"enable_export": false,
"create_factory": false,
"published": true,
"publish_id": true,
"publish_slug": false,
"publish_ownership": true,
"publish_timestamps": true,
"factory_number": null,
"reporting": true,
"max_depth": null,
"overdraft_status": false,
"permission_control": {
"access": true,
"edit_restrictions": [],
"crud": {
"create": true,
"update": true,
"delete": true
}
}
},
{
"id": 2,
"category": null,
"type": "non_sortable",
"name": "Invitations",
"table_name": "invitations",
"icon": "fal fa-envelope",
"anchor_text": "{{email}}",
"content_preview": null,
"anchor_html": null,
"is_system": true,
"slug": null,
"created_at": "2016-08-18T08:10:56.000000Z",
"updated_at": "2016-08-18T08:10:56.000000Z",
"lazy_loading": false,
"enable_export": false,
"create_factory": false,
"published": false,
"publish_id": false,
"publish_slug": false,
"publish_ownership": false,
"publish_timestamps": false,
"factory_number": null,
"reporting": false,
"max_depth": null,
"overdraft_status": false,
"permission_control": {
"access": true,
"edit_restrictions": [],
"crud": {
"create": true,
"update": true,
"delete": true
}
}
},
{
"id": 3,
"category": null,
"type": "non_sortable",
"name": "Invitation Statuses",
"table_name": "invitation_statuses",
"icon": "fal fa-list",
"anchor_text": "{{title}}",
"content_preview": null,
"anchor_html": null,
"is_system": true,
"slug": null,
"created_at": "2016-08-18T12:18:07.000000Z",
"updated_at": "2016-08-18T12:18:07.000000Z",
"lazy_loading": false,
"enable_export": false,
"create_factory": false,
"published": false,
"publish_id": false,
"publish_slug": false,
"publish_ownership": false,
"publish_timestamps": false,
"factory_number": null,
"reporting": false,
"max_depth": null,
"overdraft_status": false,
"permission_control": {
"access": true,
"edit_restrictions": [],
"crud": {
"create": true,
"update": true,
"delete": true
}
}
},
{
"id": 4,
"category": null,
"type": "non_sortable",
"name": "Assets",
"table_name": "assets",
"icon": "fal fa-file",
"anchor_text": "{{file_name}}",
"content_preview": null,
"anchor_html": null,
"is_system": false,
"slug": null,
"created_at": "2016-08-30T12:01:17.000000Z",
"updated_at": "2016-08-30T12:01:17.000000Z",
"lazy_loading": false,
"enable_export": false,
"create_factory": false,
"published": false,
"publish_id": false,
"publish_slug": false,
"publish_ownership": false,
"publish_timestamps": false,
"factory_number": null,
"reporting": false,
"max_depth": null,
"overdraft_status": false,
"permission_control": {
"access": true,
"edit_restrictions": [],
"crud": {
"create": true,
"update": true,
"delete": true
}
}
},
{
"id": 5,
"category": null,
"type": "non_sortable",
"name": "Roles",
"table_name": "roles",
"icon": "fal fa-user-circle",
"anchor_text": "{{title}}",
"content_preview": null,
"anchor_html": null,
"is_system": true,
"slug": null,
"created_at": "2016-09-02T12:24:28.000000Z",
"updated_at": "2016-09-02T12:24:28.000000Z",
"lazy_loading": false,
"enable_export": false,
"create_factory": false,
"published": false,
"publish_id": false,
"publish_slug": false,
"publish_ownership": false,
"publish_timestamps": false,
"factory_number": null,
"reporting": false,
"max_depth": null,
"overdraft_status": false,
"permission_control": {
"access": true,
"edit_restrictions": [],
"crud": {
"create": true,
"update": true,
"delete": true
}
}
},
{
"id": 6,
"category": null,
"type": "non_sortable",
"name": "Permissions",
"table_name": "permissions",
"icon": "fal fa-minus-circle",
"anchor_text": "{{title}}",
"content_preview": null,
"anchor_html": null,
"is_system": true,
"slug": null,
"created_at": "2016-09-02T12:43:44.000000Z",
"updated_at": "2016-09-02T12:43:44.000000Z",
"lazy_loading": false,
"enable_export": false,
"create_factory": false,
"published": false,
"publish_id": false,
"publish_slug": false,
"publish_ownership": false,
"publish_timestamps": false,
"factory_number": null,
"reporting": false,
"max_depth": null,
"overdraft_status": false,
"permission_control": {
"access": true,
"edit_restrictions": [],
"crud": {
"create": true,
"update": true,
"delete": true
}
}
},
{
"id": 7,
"category": null,
"type": "non_sortable",
"name": "File Tags",
"table_name": "file_tags",
"icon": "fal fa-tags",
"anchor_text": "{{title}}",
"content_preview": null,
"anchor_html": null,
"is_system": true,
"slug": null,
"created_at": "2016-10-07T07:14:34.000000Z",
"updated_at": "2016-10-07T07:14:34.000000Z",
"lazy_loading": false,
"enable_export": false,
"create_factory": false,
"published": false,
"publish_id": false,
"publish_slug": false,
"publish_ownership": false,
"publish_timestamps": false,
"factory_number": null,
"reporting": false,
"max_depth": null,
"overdraft_status": false,
"permission_control": {
"access": true,
"edit_restrictions": [],
"crud": {
"create": true,
"update": true,
"delete": true
}
}
},
{
"id": 8,
"category": 0,
"type": "sortable",
"name": "Widgets",
"table_name": "widgets",
"icon": "fal fa-square",
"anchor_text": null,
"content_preview": null,
"anchor_html": null,
"is_system": false,
"slug": null,
"created_at": "2018-01-10T22:23:31.000000Z",
"updated_at": "2018-01-11T08:18:51.000000Z",
"lazy_loading": false,
"enable_export": false,
"create_factory": false,
"published": false,
"publish_id": false,
"publish_slug": false,
"publish_ownership": false,
"publish_timestamps": false,
"factory_number": null,
"reporting": false,
"max_depth": null,
"overdraft_status": false,
"permission_control": {
"access": true,
"edit_restrictions": [],
"crud": {
"create": true,
"update": true,
"delete": true
}
}
},
{
"id": 10,
"category": null,
"type": "non_sortable",
"name": "Image sizes",
"table_name": "image_sizes",
"icon": "fal fa-image",
"anchor_text": "{{name}}",
"content_preview": null,
"anchor_html": null,
"is_system": true,
"slug": "{{name}}",
"created_at": "2017-06-13T06:52:01.000000Z",
"updated_at": "2017-06-13T06:52:01.000000Z",
"lazy_loading": false,
"enable_export": false,
"create_factory": false,
"published": false,
"publish_id": false,
"publish_slug": false,
"publish_ownership": false,
"publish_timestamps": false,
"factory_number": null,
"reporting": false,
"max_depth": null,
"overdraft_status": false,
"permission_control": {
"access": true,
"edit_restrictions": [],
"crud": {
"create": true,
"update": true,
"delete": true
}
}
},
{
"id": 15,
"category": null,
"type": "non_sortable",
"name": "User Social Data",
"table_name": "user_social_data",
"icon": "fal fa-users",
"anchor_text": "",
"content_preview": null,
"anchor_html": null,
"is_system": true,
"slug": null,
"created_at": "2016-04-01T09:17:48.000000Z",
"updated_at": "2016-04-01T11:29:51.000000Z",
"lazy_loading": false,
"enable_export": false,
"create_factory": false,
"published": false,
"publish_id": false,
"publish_slug": false,
"publish_ownership": false,
"publish_timestamps": false,
"factory_number": null,
"reporting": true,
"max_depth": null,
"overdraft_status": false,
"permission_control": {
"access": true,
"edit_restrictions": [],
"crud": {
"create": true,
"update": true,
"delete": true
}
}
},
{
"id": 16,
"category": null,
"type": "non_sortable",
"name": "Webhook Custom Headers",
"table_name": "webhook_custom_headers",
"icon": "fal fa-bars",
"anchor_text": "{{name}}",
"content_preview": null,
"anchor_html": null,
"is_system": false,
"slug": null,
"created_at": "2019-11-05T08:45:58.000000Z",
"updated_at": "2019-11-05T08:45:58.000000Z",
"lazy_loading": false,
"enable_export": false,
"create_factory": false,
"published": false,
"publish_id": false,
"publish_slug": false,
"publish_ownership": false,
"publish_timestamps": false,
"factory_number": null,
"reporting": false,
"max_depth": null,
"overdraft_status": false,
"permission_control": {
"access": true,
"edit_restrictions": [],
"crud": {
"create": true,
"update": true,
"delete": true
}
}
},
{
"id": 17,
"category": null,
"type": "non_sortable",
"name": "Webhook Event Filters",
"table_name": "webhook_event_filters",
"icon": "fal fa-bars",
"anchor_text": "{{name}}",
"content_preview": null,
"anchor_html": null,
"is_system": false,
"slug": null,
"created_at": "2019-11-05T08:56:11.000000Z",
"updated_at": "2019-11-05T08:56:11.000000Z",
"lazy_loading": false,
"enable_export": false,
"create_factory": false,
"published": false,
"publish_id": false,
"publish_slug": false,
"publish_ownership": false,
"publish_timestamps": false,
"factory_number": null,
"reporting": false,
"max_depth": null,
"overdraft_status": false,
"permission_control": {
"access": true,
"edit_restrictions": [],
"crud": {
"create": true,
"update": true,
"delete": true
}
}
},
{
"id": 18,
"category": null,
"type": "non_sortable",
"name": "Webhook Methods",
"table_name": "webhook_methods",
"icon": "fal fa-bars",
"anchor_text": "{{name}}",
"content_preview": null,
"anchor_html": null,
"is_system": false,
"slug": null,
"created_at": "2019-11-05T09:23:24.000000Z",
"updated_at": "2019-11-05T09:23:24.000000Z",
"lazy_loading": false,
"enable_export": false,
"create_factory": false,
"published": false,
"publish_id": false,
"publish_slug": false,
"publish_ownership": false,
"publish_timestamps": false,
"factory_number": null,
"reporting": false,
"max_depth": null,
"overdraft_status": false,
"permission_control": {
"access": true,
"edit_restrictions": [],
"crud": {
"create": true,
"update": true,
"delete": true
}
}
},
{
"id": 19,
"category": null,
"type": "non_sortable",
"name": "Webhook Content Types",
"table_name": "webhook_content_types",
"icon": "fal fa-bars",
"anchor_text": "{{name}}",
"content_preview": null,
"anchor_html": null,
"is_system": false,
"slug": null,
"created_at": "2019-11-05T11:06:46.000000Z",
"updated_at": "2019-11-05T11:06:46.000000Z",
"lazy_loading": false,
"enable_export": false,
"create_factory": false,
"published": false,
"publish_id": false,
"publish_slug": false,
"publish_ownership": false,
"publish_timestamps": false,
"factory_number": null,
"reporting": false,
"max_depth": null,
"overdraft_status": false,
"permission_control": {
"access": true,
"edit_restrictions": [],
"crud": {
"create": true,
"update": true,
"delete": true
}
}
},
{
"id": 20,
"category": null,
"type": "non_sortable",
"name": "Webhooks",
"table_name": "webhooks",
"icon": "fal fa-bars",
"anchor_text": "{{name}}",
"content_preview": null,
"anchor_html": null,
"is_system": false,
"slug": null,
"created_at": "2019-11-05T11:19:33.000000Z",
"updated_at": "2019-11-05T11:44:50.000000Z",
"lazy_loading": false,
"enable_export": false,
"create_factory": false,
"published": false,
"publish_id": false,
"publish_slug": false,
"publish_ownership": false,
"publish_timestamps": false,
"factory_number": null,
"reporting": false,
"max_depth": null,
"overdraft_status": false,
"permission_control": {
"access": true,
"edit_restrictions": [],
"crud": {
"create": true,
"update": true,
"delete": true
}
}
},
{
"id": 21,
"category": null,
"type": "sortable",
"name": "Menus",
"table_name": "menus",
"icon": "fal fa-bars",
"anchor_text": "{{name}}",
"content_preview": null,
"anchor_html": null,
"is_system": true,
"slug": null,
"created_at": "2019-12-09T14:08:42.000000Z",
"updated_at": "2019-12-09T14:08:42.000000Z",
"lazy_loading": false,
"enable_export": false,
"create_factory": false,
"published": false,
"publish_id": false,
"publish_slug": false,
"publish_ownership": false,
"publish_timestamps": false,
"factory_number": null,
"reporting": false,
"max_depth": null,
"overdraft_status": false,
"permission_control": {
"access": true,
"edit_restrictions": [],
"crud": {
"create": true,
"update": true,
"delete": true
}
}
},
{
"id": 22,
"category": null,
"type": "non_sortable",
"name": "Menu Link Types",
"table_name": "menu_link_types",
"icon": "fal fa-bars",
"anchor_text": "{{title}}",
"content_preview": null,
"anchor_html": null,
"is_system": false,
"slug": null,
"created_at": "2019-12-09T14:36:13.000000Z",
"updated_at": "2019-12-09T14:36:13.000000Z",
"lazy_loading": false,
"enable_export": false,
"create_factory": false,
"published": false,
"publish_id": false,
"publish_slug": false,
"publish_ownership": false,
"publish_timestamps": false,
"factory_number": null,
"reporting": false,
"max_depth": null,
"overdraft_status": false,
"permission_control": {
"access": true,
"edit_restrictions": [],
"crud": {
"create": true,
"update": true,
"delete": true
}
}
},
{
"id": 23,
"category": 21,
"type": "multilevel_sortable",
"name": "Menu Items",
"table_name": "menu_items",
"icon": "fal fa-bars",
"anchor_text": "{{title}}",
"content_preview": null,
"anchor_html": null,
"is_system": true,
"slug": "{{title}}",
"created_at": "2019-12-09T14:52:36.000000Z",
"updated_at": "2019-12-09T14:54:22.000000Z",
"lazy_loading": false,
"enable_export": false,
"create_factory": false,
"published": false,
"publish_id": false,
"publish_slug": false,
"publish_ownership": false,
"publish_timestamps": false,
"factory_number": null,
"reporting": false,
"max_depth": null,
"overdraft_status": false,
"permission_control": {
"access": true,
"edit_restrictions": [],
"crud": {
"create": true,
"update": true,
"delete": true
}
}
},
{
"id": 24,
"category": null,
"type": "non_sortable",
"name": "Available Locales",
"table_name": "available_locales",
"icon": "fal fa-language",
"anchor_text": "{{name}} ({{code}})",
"content_preview": null,
"anchor_html": null,
"is_system": true,
"slug": null,
"created_at": "2017-08-20T16:32:56.000000Z",
"updated_at": "2017-08-20T16:32:56.000000Z",
"lazy_loading": false,
"enable_export": false,
"create_factory": false,
"published": false,
"publish_id": false,
"publish_slug": false,
"publish_ownership": false,
"publish_timestamps": false,
"factory_number": null,
"reporting": false,
"max_depth": null,
"overdraft_status": false,
"permission_control": {
"access": true,
"edit_restrictions": [],
"crud": {
"create": true,
"update": true,
"delete": true
}
}
},
{
"id": 25,
"category": null,
"type": "sortable",
"name": "Locales",
"table_name": "locales",
"icon": "fal fa-language",
"anchor_text": "{{language|languageName}} {{default|default}}",
"content_preview": null,
"anchor_html": null,
"is_system": true,
"slug": null,
"created_at": "2017-08-20T16:32:56.000000Z",
"updated_at": "2017-08-20T16:32:56.000000Z",
"lazy_loading": false,
"enable_export": false,
"create_factory": false,
"published": false,
"publish_id": false,
"publish_slug": false,
"publish_ownership": false,
"publish_timestamps": false,
"factory_number": null,
"reporting": false,
"max_depth": null,
"overdraft_status": false,
"permission_control": {
"access": true,
"edit_restrictions": [],
"crud": {
"create": true,
"update": true,
"delete": true
}
}
},
{
"id": 26,
"category": null,
"type": "sortable",
"name": "UI Locales",
"table_name": "ui_locales",
"icon": "fal fa-language",
"anchor_text": "{{language|languageName}} {{default|default}}",
"content_preview": null,
"anchor_html": null,
"is_system": true,
"slug": null,
"created_at": "2017-08-20T16:32:56.000000Z",
"updated_at": "2017-08-20T16:32:56.000000Z",
"lazy_loading": false,
"enable_export": false,
"create_factory": false,
"published": false,
"publish_id": false,
"publish_slug": false,
"publish_ownership": false,
"publish_timestamps": false,
"factory_number": null,
"reporting": false,
"max_depth": null,
"overdraft_status": false,
"permission_control": {
"access": true,
"edit_restrictions": [],
"crud": {
"create": true,
"update": true,
"delete": true
}
}
},
{
"id": 27,
"category": null,
"type": "non_sortable",
"name": "Environments",
"table_name": "environments",
"icon": "fal fa-asterisk",
"anchor_text": "{{environment}}",
"content_preview": null,
"anchor_html": null,
"is_system": true,
"slug": null,
"created_at": "2019-12-09T14:08:42.000000Z",
"updated_at": "2019-12-09T14:08:42.000000Z",
"lazy_loading": false,
"enable_export": false,
"create_factory": false,
"published": false,
"publish_id": false,
"publish_slug": false,
"publish_ownership": false,
"publish_timestamps": false,
"factory_number": null,
"reporting": false,
"max_depth": null,
"overdraft_status": false,
"permission_control": {
"access": true,
"edit_restrictions": [],
"crud": {
"create": true,
"update": true,
"delete": true
}
}
},
{
"id": 28,
"category": null,
"type": "non_sortable",
"name": "Field Options",
"table_name": "field_options",
"icon": "fa fa-bars",
"anchor_text": "{{name}}",
"content_preview": null,
"anchor_html": null,
"is_system": true,
"slug": null,
"created_at": "2017-08-20T16:32:56.000000Z",
"updated_at": "2017-08-20T16:32:56.000000Z",
"lazy_loading": false,
"enable_export": false,
"create_factory": false,
"published": false,
"publish_id": false,
"publish_slug": false,
"publish_ownership": false,
"publish_timestamps": false,
"factory_number": null,
"reporting": false,
"max_depth": null,
"overdraft_status": false,
"permission_control": {
"access": true,
"edit_restrictions": [],
"crud": {
"create": true,
"update": true,
"delete": true
}
}
}
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create module
requires authentication
Creates a new dynamic module with its database table and field definitions. Requires super admin + dev environment.
Example request:
curl --request POST \
"http://m2-partner-api.test/api/modules" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"module\": {
\"name\": \"News Articles\",
\"table_name\": \"news_articles\",
\"type\": 1
},
\"fields\": [
\"architecto\"
],
\"reporting\": false
}"
const url = new URL(
"http://m2-partner-api.test/api/modules"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"module": {
"name": "News Articles",
"table_name": "news_articles",
"type": 1
},
"fields": [
"architecto"
],
"reporting": false
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/modules';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'module' => [
'name' => 'News Articles',
'table_name' => 'news_articles',
'type' => 1,
],
'fields' => [
'architecto',
],
'reporting' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update module
requires authentication
Updates an existing module's definition and field structure. Requires super admin + dev environment.
Example request:
curl --request PUT \
"http://m2-partner-api.test/api/modules/architecto" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"module\": [],
\"fields\": [
\"architecto\"
],
\"reporting\": false
}"
const url = new URL(
"http://m2-partner-api.test/api/modules/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"module": [],
"fields": [
"architecto"
],
"reporting": false
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/modules/architecto';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'module' => [],
'fields' => [
'architecto',
],
'reporting' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get module
requires authentication
Returns a single module's definition including all field configurations.
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/modules/architecto" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/modules/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/modules/architecto';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "MODULE_NOT_FOUND",
"body": []
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete module
requires authentication
Permanently deletes a module and its database table. Requires super admin + dev environment.
Example request:
curl --request DELETE \
"http://m2-partner-api.test/api/modules/architecto" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/modules/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/modules/architecto';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Notifications
Endpoints for managing and retrieving user notifications.
Sends the specified notification.
requires authentication
Example request:
curl --request POST \
"http://m2-partner-api.test/api/notify/architecto" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/notify/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/notify/architecto';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Marks the specific notification as read.
requires authentication
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/notifications/read/architecto" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/notifications/read/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/notifications/read/architecto';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "NOTIFICATION_NOT_FOUND",
"body": {
"notification_id": "architecto"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Counts unread notifications of the currently logged in user.
requires authentication
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/notifications/unread/count" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/notifications/unread/count"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/notifications/unread/count';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "GET_UNREAD_NOTIFICATIONS_COUNT_SUCCESS",
"body": {
"count": 0
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get notifications
requires authentication
Retrieves paginated notifications for the authenticated user.
Example request:
curl --request POST \
"http://m2-partner-api.test/api/notifications/all" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"pagination\": {
\"items_per_page\": 10,
\"current_page\": 1
}
}"
const url = new URL(
"http://m2-partner-api.test/api/notifications/all"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"pagination": {
"items_per_page": 10,
"current_page": 1
}
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/notifications/all';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'pagination' => [
'items_per_page' => 10,
'current_page' => 1,
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get unread notifications
requires authentication
Retrieves paginated unread notifications for the authenticated user.
Example request:
curl --request POST \
"http://m2-partner-api.test/api/notifications/unread" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"pagination\": {
\"items_per_page\": 10,
\"current_page\": 1
}
}"
const url = new URL(
"http://m2-partner-api.test/api/notifications/unread"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"pagination": {
"items_per_page": 10,
"current_page": 1
}
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/notifications/unread';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'pagination' => [
'items_per_page' => 10,
'current_page' => 1,
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Assigns the specified FCM token to the currently logged in user.
requires authentication
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/notifications/fcm/assign_token/architecto" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/notifications/fcm/assign_token/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/notifications/fcm/assign_token/architecto';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "FCM_TOKEN_ADD_SUCCESS",
"body": []
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Revokes the specified FCM token from the currently logged in user.
requires authentication
Example request:
curl --request GET \
--get "http://m2-partner-api.test/api/notifications/fcm/revoke_token/architecto" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://m2-partner-api.test/api/notifications/fcm/revoke_token/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://m2-partner-api.test/api/notifications/fcm/revoke_token/architecto';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_JWT_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "FCM_TOKEN_REMOVE_SUCCESS",
"body": []
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.