Documentation menu

Developer API

Requests, filters & paging

Two discovery calls and five operations cover every resource. Learn them once; the Resources reference only adds the fields.

Response shape

{ "success": true, "data": { … } }                       // one record
{ "success": true, "data": [ … ], "nextCursor": "…", "limit": 25 }   // a list
{ "success": false, "error": "…", "code": "NOT_FOUND" }             // any failure

Branch 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 fields and updatableFields list exactly what you may send.
  • Hidden fields such as embeddings, credentials and internal search indexes are never returned.

Limits

Page size1–100 records, default 25
Filters per request5, equality only
Request body1 MB JSON
Rate300 requests per minute per token. Above that, 429 with a Retry-After header.
Active tokens25 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/meWho am I
GET/resourcesResource 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
GET/mescope · read

Who am I

Confirms the token works and returns the access it holds on every resource. Always call this first.

Request
curl https://api2.djcsystem.com/v1/me -H "Authorization: Bearer $DJC_TOKEN"
Response · 200
{
  "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.

StatusWhen
401Missing, unknown, revoked or expired token (UNAUTHORIZED).
GET/resourcesscope · read

Resource 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.

Request
curl https://api2.djcsystem.com/v1/resources -H "Authorization: Bearer $DJC_TOKEN"
Response · 200
{
  "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."]
    }
  ]
}
  • access on each entry is what *this* token may do. Agents should plan from /me plus /resources instead of hard-coding field lists.
GET/{resource}scope · read

List records

Your workspace's records, newest first by default, paginated with an opaque cursor.

ParameterTypeDescription
limitinteger1–100, default 25.
cursorstringnextCursor from the previous page.
sortstringfield:asc or field:desc; the field must be in the resource's sortableFields.
filter[field]stringEquality filter, up to five per request; the field must be in filterableFields. true, false, null and numbers are typed automatically.
Request
curl "https://api2.djcsystem.com/v1/leads?filter[status]=new&sort=created:desc&limit=50" -H "Authorization: Bearer $DJC_TOKEN"
Response · 200
{
  "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.

StatusWhen
403Token lacks {resource}:read (INSUFFICIENT_SCOPE, the missing scope is in details.required).
400Unknown filter or sort field (details lists the allowed ones), or an invalid cursor.
POST/{resource}scope · read & write

Create 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.

Request
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" }'
Response · 201
{
  "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"
}
StatusWhen
403Token lacks {resource}:write (INSUFFICIENT_SCOPE, the missing scope is in details.required).
400Validation failed — see details.fieldErrors.
403The resource does not support creation (FORBIDDEN), e.g. chatrooms are created by incoming messages.
GET/{resource}/{id}scope · read

Read a record

One record by id.

Request
curl https://api2.djcsystem.com/v1/leads/k3Jd… -H "Authorization: Bearer $DJC_TOKEN"
Response · 200
{ "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"
  } }
StatusWhen
403Token lacks {resource}:read (INSUFFICIENT_SCOPE, the missing scope is in details.required).
404The record does not exist in your workspace (NOT_FOUND).
PATCH/{resource}/{id}scope · read & write

Update a record

Partial update. Send only the fields you want to change; everything else is untouched.

Request
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." }'
Response · 200
{ "success": true, "data": { "id": "k3Jd…", "status": "contacted", "remarks": "Called at 10am, wants a demo.", "lastUpdated": "2026-09-04T03:02:10.000Z", "…": "…" } }
StatusWhen
403Token lacks {resource}:write (INSUFFICIENT_SCOPE, the missing scope is in details.required).
404The record does not exist in your workspace (NOT_FOUND).
400Empty body, unknown field, or a field that is not updatable.
DELETE/{resource}/{id}scope · read & write

Delete a record

Permanently deletes one record. There is no undo.

Request
curl -X DELETE https://api2.djcsystem.com/v1/leads/k3Jd… -H "Authorization: Bearer $DJC_TOKEN"
Response · 200
{ "success": true, "data": { "id": "k3Jd…", "deleted": true } }
StatusWhen
403Token lacks {resource}:write (INSUFFICIENT_SCOPE, the missing scope is in details.required).
404The record does not exist in your workspace (NOT_FOUND).
403The resource does not support deletion (FORBIDDEN).
GET/{resource}/{id}/{child}scope · read

List 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.

Request
curl "https://api2.djcsystem.com/v1/chatrooms/6012…@s.whatsapp.net/messages?limit=20" -H "Authorization: Bearer $DJC_TOKEN"
Response · 200
{ "success": true, "data": [ { "id": "…", "date": "2026-09-04T01:58:02.000Z", "…": "…" } ], "nextCursor": null, "limit": 20 }
StatusWhen
403Token lacks {resource}:read (INSUFFICIENT_SCOPE, the missing scope is in details.required).
404Unknown child name, or parent not in your workspace.
  • Some children are writable: POST /{resource}/{id}/{child}, and GET, PATCH, DELETE on /{resource}/{id}/{child}/{childId}. The catalog lists each child's operations. AI flow blocks and relations are the main example — see *Building AI flow sequences*.