Response shape
{ "success": true, "data": { … } } // one record
{ "success": true, "data": [ … ], "nextCursor": "…", "limit": 25 } // a list
{ "success": false, "error": "…", "code": "NOT_FOUND" } // any failureBranch on success and the HTTP status. error is for people and may change wording; code is stable — see Errors.
Dates, ids and hidden fields
- Dates are ISO-8601 strings in UTC in both directions, e.g.
2026-09-04T02:15:31.000Z. Send an offset if you have one (+08:00); it is normalised. - Ids are opaque strings assigned by the server and returned in every record as
id. - Server-owned fields (ownership, timestamps, internal indexes) are set by the API and rejected in request bodies. The catalog's
fieldsandupdatableFieldslist exactly what you may send. - Hidden fields such as embeddings, credentials and internal search indexes are never returned.
Limits
| Page size | 1–100 records, default 25 |
| Filters per request | 5, equality only |
| Request body | 1 MB JSON |
| Rate | 300 requests per minute per token. Above that, 429 with a Retry-After header. |
| Active tokens | 25 per user |
Sorting needs an index
Each resource lists its sortableFields. Sorting by anything else returns 400 with the allowed fields in details. Without sort, lists use the resource's default order (usually newest first).
| GET | /me | Who am I |
| GET | /resources | Resource catalog |
| GET | /{resource} | List records |
| POST | /{resource} | Create a record |
| GET | /{resource}/{id} | Read a record |
| PATCH | /{resource}/{id} | Update a record |
| DELETE | /{resource}/{id} | Delete a record |
| GET | /{resource}/{id}/{child} | List a child collection |
/mescope · readWho am I
Confirms the token works and returns the access it holds on every resource. Always call this first.
curl https://api2.djcsystem.com/v1/me -H "Authorization: Bearer $DJC_TOKEN"{
"success": true,
"data": {
"email": "jane@example.com",
"clientId": "acme",
"role": "Admin",
"tokenKind": "token",
"tokenId": "8sTq…",
"scopes": ["leads:write", "appointments:read"],
"resources": { "leads": "write", "appointments": "read", "ai-flows": null, "chatrooms": null, "…": null },
"catalog": "/v1/resources"
}
}resources maps each resource to read, write or null. tokenKind is token for personal tokens and session for the signed-in app.
| Status | When |
|---|---|
401 | Missing, unknown, revoked or expired token (UNAUTHORIZED). |
/resourcesscope · readResource catalog
A machine-readable description of every resource: fields with types and required flags, updatable fields, filters, sorts, child collections and guidance notes. It is generated from the same rules the API validates with, so it is always current.
curl https://api2.djcsystem.com/v1/resources -H "Authorization: Bearer $DJC_TOKEN"{
"success": true,
"data": [
{
"name": "leads", "title": "Leads", "basePath": "/v1/leads",
"operations": ["list", "get", "create", "update", "delete"],
"access": "write",
"fields": { "name": { "type": "string", "required": true }, "phone": { "type": "string", "required": false }, "…": {} },
"updatableFields": ["name", "phone", "…"],
"filterableFields": ["status", "source", "phone", "…"],
"sortableFields": ["created"],
"defaultSort": { "field": "created", "direction": "desc" },
"children": [],
"notes": ["Search for an existing lead by phone before creating one."]
}
]
}accesson each entry is what *this* token may do. Agents should plan from/meplus/resourcesinstead of hard-coding field lists.
/{resource}scope · readList records
Your workspace's records, newest first by default, paginated with an opaque cursor.
| Parameter | Type | Description |
|---|---|---|
limit | integer | 1–100, default 25. |
cursor | string | nextCursor from the previous page. |
sort | string | field:asc or field:desc; the field must be in the resource's sortableFields. |
filter[field] | string | Equality filter, up to five per request; the field must be in filterableFields. true, false, null and numbers are typed automatically. |
curl "https://api2.djcsystem.com/v1/leads?filter[status]=new&sort=created:desc&limit=50" -H "Authorization: Bearer $DJC_TOKEN"{
"success": true,
"data": [ {
"id": "k3Jd…",
"name": "Aisha Rahman",
"phone": "60123456789",
"status": "new",
"tags": ["webinar"],
"ownerEmail": "jane@example.com",
"created": "2026-09-04T02:15:31.000Z",
"lastUpdated": "2026-09-04T02:15:31.000Z"
} ],
"nextCursor": "eyJpZCI6Im…",
"limit": 50
}nextCursor is null on the last page. Pages never overlap, even when records are being added.
| Status | When |
|---|---|
403 | Token lacks {resource}:read (INSUFFICIENT_SCOPE, the missing scope is in details.required). |
400 | Unknown filter or sort field (details lists the allowed ones), or an invalid cursor. |
/{resource}scope · read & writeCreate a record
Creates one record. Bodies are validated strictly: unknown fields are rejected, and server-owned fields such as ownership and timestamps are set by the API, never by the caller.
curl -X POST https://api2.djcsystem.com/v1/leads -H "Authorization: Bearer $DJC_TOKEN" -H "Content-Type: application/json" \
-d '{ "name": "Aisha Rahman", "phone": "60123456789", "tags": ["webinar"], "status": "new" }'{
"id": "k3Jd…",
"name": "Aisha Rahman",
"phone": "60123456789",
"status": "new",
"tags": ["webinar"],
"ownerEmail": "jane@example.com",
"created": "2026-09-04T02:15:31.000Z",
"lastUpdated": "2026-09-04T02:15:31.000Z"
}| Status | When |
|---|---|
403 | Token lacks {resource}:write (INSUFFICIENT_SCOPE, the missing scope is in details.required). |
400 | Validation failed — see details.fieldErrors. |
403 | The resource does not support creation (FORBIDDEN), e.g. chatrooms are created by incoming messages. |
/{resource}/{id}scope · readRead a record
One record by id.
curl https://api2.djcsystem.com/v1/leads/k3Jd… -H "Authorization: Bearer $DJC_TOKEN"{ "success": true, "data": {
"id": "k3Jd…",
"name": "Aisha Rahman",
"phone": "60123456789",
"status": "new",
"tags": ["webinar"],
"ownerEmail": "jane@example.com",
"created": "2026-09-04T02:15:31.000Z",
"lastUpdated": "2026-09-04T02:15:31.000Z"
} }| Status | When |
|---|---|
403 | Token lacks {resource}:read (INSUFFICIENT_SCOPE, the missing scope is in details.required). |
404 | The record does not exist in your workspace (NOT_FOUND). |
/{resource}/{id}scope · read & writeUpdate a record
Partial update. Send only the fields you want to change; everything else is untouched.
curl -X PATCH https://api2.djcsystem.com/v1/leads/k3Jd… -H "Authorization: Bearer $DJC_TOKEN" -H "Content-Type: application/json" \
-d '{ "status": "contacted", "remarks": "Called at 10am, wants a demo." }'{ "success": true, "data": { "id": "k3Jd…", "status": "contacted", "remarks": "Called at 10am, wants a demo.", "lastUpdated": "2026-09-04T03:02:10.000Z", "…": "…" } }| Status | When |
|---|---|
403 | Token lacks {resource}:write (INSUFFICIENT_SCOPE, the missing scope is in details.required). |
404 | The record does not exist in your workspace (NOT_FOUND). |
400 | Empty body, unknown field, or a field that is not updatable. |
/{resource}/{id}scope · read & writeDelete a record
Permanently deletes one record. There is no undo.
curl -X DELETE https://api2.djcsystem.com/v1/leads/k3Jd… -H "Authorization: Bearer $DJC_TOKEN"{ "success": true, "data": { "id": "k3Jd…", "deleted": true } }| Status | When |
|---|---|
403 | Token lacks {resource}:write (INSUFFICIENT_SCOPE, the missing scope is in details.required). |
404 | The record does not exist in your workspace (NOT_FOUND). |
403 | The resource does not support deletion (FORBIDDEN). |
/{resource}/{id}/{child}scope · readList a child collection
Records that belong to one parent, such as a chatroom's messages or a workflow's executions. Same paging parameters as a list.
curl "https://api2.djcsystem.com/v1/chatrooms/6012…@s.whatsapp.net/messages?limit=20" -H "Authorization: Bearer $DJC_TOKEN"{ "success": true, "data": [ { "id": "…", "date": "2026-09-04T01:58:02.000Z", "…": "…" } ], "nextCursor": null, "limit": 20 }| Status | When |
|---|---|
403 | Token lacks {resource}:read (INSUFFICIENT_SCOPE, the missing scope is in details.required). |
404 | Unknown child name, or parent not in your workspace. |
- Some children are writable:
POST /{resource}/{id}/{child}, andGET,PATCH,DELETEon/{resource}/{id}/{child}/{childId}. The catalog lists each child'soperations. AI flowblocksandrelationsare the main example — see *Building AI flow sequences*.