Docs

Endpoints

All paths are relative to https://crm.api.kushicorp.com and require authentication.

Create a record

POST /public/v1/collections/{collectionId}/records

Creates a record (a lead or an order) in the collection. The body is a flat JSON object of field values, keyed by your collection's field keys (read them from the schema endpoint).

  • Keys that match a field are stored against it; unmatched keys are kept too, so you never lose data if your form and schema drift.
  • The new record is given the collection's first status (New Order for order collections, otherwise new).
  • If the collection has auto-assign on, the record is routed to the least-loaded active rep.

Attribution — set a source with a ?source= query parameter or a "source" key in the body (e.g. "facebook-ads").

Request

{
  "full_name": "Ada Obi",
  "phone": "+2348012345678",
  "address": "12 Marina, Lagos",
  "product": "Wireless earbuds",
  "cod_amount": 18000,
  "source": "instagram"
}

Response201 Created

{ "id": "3f9c…", "status": "New Order" }

Update a record

PATCH /public/v1/records/{recordId}

Updates a record's status and/or merges new field values into its existing data. Send either or both of status and data:

Request

{
  "status": "Confirmed",
  "data": { "phone": "+2348099999999" }
}
  • data is merged — only the keys you send are changed; everything else is left alone.
  • status replaces the record's current status.

Response200 OK

{ "ok": true }

Read a collection schema

GET /public/v1/collections/{collectionId}/schema

Returns the collection's fields — ideal for dynamically building or validating a form.

Response200 OK

{
  "fields": [
    { "key": "full_name", "label": "Full name", "type": "text", "required": true },
    { "key": "phone", "label": "Phone", "type": "phone", "required": true },
    { "key": "cod_amount", "label": "COD amount", "type": "number", "required": false }
  ]
}