Account API
Konten ini belum tersedia dalam bahasa Anda.
The current user and notifications. Every endpoint below is part of the stable v1 contract. Base URL https://app.aio.opexcg.com; send your key in X-API-Key.
GET /api/me: Get the current userGET /api/notifications: List notificationsPOST /api/notifications/:id/read: Mark a notification readPOST /api/notifications/read-all: Mark all notifications read
Get the current user
GET /api/me
Who the API key acts as: user id, roles, the permission codes those roles grant in this workspace, and the products the workspace is entitled to. Call it first to check what a key can do.
- Product: none (any workspace)
- Permission: any member
Response 200
The caller’s profile.
| Field | Type | Description |
|---|---|---|
userId |
string |
Your user id. |
role |
string |
Primary role in this workspace, e.g. admin, consultant. |
roles |
string[] |
Every role you hold in this workspace. |
permissions |
string[] |
Permission codes your roles grant here, e.g. crm:record:read. |
tenantId |
string |
The workspace this key acts in. |
tenantName |
string |
|
displayName |
string | null |
|
email |
string |
|
companyId |
string | null |
Your company, for client users. |
language |
string |
en or id. |
entitlements |
"helpdesk" | "pmo" | "crm" | "timesheets" | "expenses" | "leave"[] |
Products the workspace can use (read and write). |
readOnlyProducts |
"helpdesk" | "pmo" | "crm" | "timesheets" | "expenses" | "leave"[] |
Products whose trial ended: still readable, writes answer 402. |
entitlementDetails |
object[] |
|
entitlementDetails[].product |
"helpdesk" | "pmo" | "crm" | "timesheets" | "expenses" | "leave" |
|
entitlementDetails[].status |
"active" | "trial" | "expired" | "suspended" |
|
entitlementDetails[].plan |
string |
|
entitlementDetails[].trialEndsAt |
number | null |
Objects may carry more fields than listed; only the listed ones are part of the contract.
Example
curl -X GET 'https://app.aio.opexcg.com/api/me' \ -H "X-API-Key: $OPEX_API_KEY"Response 200:
{ "userId": "usr-fitri-handayani", "role": "admin", "roles": [ "admin" ], "permissions": [ "ticket:notes:read", "helpdesk:masters:manage" ], "tenantId": "opexcg-tenant", "homeTenantId": "opexcg-tenant", "defaultTenantId": "opexcg-tenant", "tenantName": "OpexCG", "displayName": "Fitri Handayani", "avatarUrl": null, "companyId": null, "accessibleTenants": [ { "id": "opexcg-tenant", "name": "OpexCG" } ], "theme": "system", "language": "en", "currency": null, "entitlements": [ "timesheets", "helpdesk" ], "readOnlyProducts": [], "productAccessRestricted": false, "entitlementDetails": [ { "product": "timesheets", "status": "active", "plan": "dev", "trialEndsAt": null, "provisionedAt": 0, "settingsJson": "{}", "restricted": false }, { "product": "helpdesk", "status": "active", "plan": "dev", "trialEndsAt": null, "provisionedAt": 0, "settingsJson": "{}", "restricted": false } ]}List notifications
GET /api/notifications
The caller’s 50 most recent notifications in this workspace, newest first, plus the unread count. There is no paging: older notifications are not returned.
- Product: none (any workspace)
- Permission: any member
Response 200
Recent notifications and the unread count.
| Field | Type | Description |
|---|---|---|
items |
object[] |
|
items[].id |
string |
|
items[].kind |
string |
What happened, e.g. ticket_assigned. |
items[].title |
string |
|
items[].body |
string | null |
|
items[].actor_name |
string | null |
|
items[].entity_type |
string | null |
Record type the notification is about. |
items[].entity_id |
string | null |
|
items[].link |
string | null |
Path in the web app, relative to the app origin. |
items[].read |
number |
1 = read, 0 = unread. |
items[].created_at |
number |
Epoch milliseconds. |
unread |
number |
Objects may carry more fields than listed; only the listed ones are part of the contract.
Example
curl -X GET 'https://app.aio.opexcg.com/api/notifications' \ -H "X-API-Key: $OPEX_API_KEY"Response 200:
{ "items": [ { "id": "d16873d6-2906-415c-b926-deef865e7c10", "tenant_id": "opexcg-tenant", "user_id": "usr-fajar-nugroho", "ticket_id": null, "entity_type": "leave_request", "entity_id": "f5e82a9f-325e-4069-a3a7-5e3e56a039d5", "link": "/leave/approvals?requestId=f5e82a9f-325e-4069-a3a7-5e3e56a039d5", "approval_task_id": null, "kind": "approval_decision", "title": "Approved: Sick leave for Fajar Nugroho", "body": "2028-03-31 → 2028-03-31 · 1 working day — Enjoy the day off", "actor_name": "Fitri Handayani", "read": 0, "created_at": 1794052052042, "created_by": "usr-fitri-handayani", "deleted_at": null, "deleted_by": null }, { "id": "f57e0d52-7c53-40a5-be96-9f4b97a76d46", "tenant_id": "opexcg-tenant", "user_id": "usr-fajar-nugroho", "ticket_id": "8defe6e2-afcd-46ba-a041-da8fdd7665ff", "entity_type": "ticket", "entity_id": "8defe6e2-afcd-46ba-a041-da8fdd7665ff", "link": "/helpdesk/tickets/8defe6e2-afcd-46ba-a041-da8fdd7665ff", "approval_task_id": null, "kind": "new_ticket", "title": "New ticket: Export to CSV times out", "body": "#SUP-2026-000013", "actor_name": "Fitri Handayani", "read": 0, "created_at": 1794052049439, "created_by": null, "deleted_at": null, "deleted_by": null } ], "unread": 2}Mark a notification read
POST /api/notifications/:id/read
Marks one of the caller’s notifications read. An id that is not the caller’s is ignored and still answers ok.
- Product: none (any workspace)
- Permission: any member
Path parameters
| Field | Type | Required | Description |
|---|---|---|---|
id |
string |
yes | Notification id. |
Response 200
Done.
| Field | Type | Description |
|---|---|---|
ok |
boolean |
Objects may carry more fields than listed; only the listed ones are part of the contract.
Example
curl -X POST 'https://app.aio.opexcg.com/api/notifications/d16873d6-2906-415c-b926-deef865e7c10/read' \ -H "X-API-Key: $OPEX_API_KEY"Response 200:
{ "ok": true}Mark all notifications read
POST /api/notifications/read-all
Marks every notification of the caller in this workspace read.
- Product: none (any workspace)
- Permission: any member
Response 200
Done.
| Field | Type | Description |
|---|---|---|
ok |
boolean |
Objects may carry more fields than listed; only the listed ones are part of the contract.
Example
curl -X POST 'https://app.aio.opexcg.com/api/notifications/read-all' \ -H "X-API-Key: $OPEX_API_KEY"Response 200:
{ "ok": true}