agentlyleads docs
Cases API

API Reference

The reference below covers every endpoint in the Cases API. Code examples are generated automatically; the live playground is disabled to prevent accidental writes to production from the docs site.

GET/api/v1/cases

Authorization

BearerAuth
AuthorizationBearer <token>

Pass an API key issued from the agentlyleads workspace settings. Example: Authorization: Bearer alk_live_xxxxxxxxxxxx

In: header

Query Parameters

status?string

Filter to cases in this status.

Value in

  • "NEW"
  • "OPEN"
  • "PENDING"
  • "RESOLVED"
  • "CLOSED"
severity?string

Filter to cases at this severity.

Value in

  • "LOW"
  • "MEDIUM"
  • "HIGH"
  • "URGENT"
open?boolean

true returns only cases still being worked (NEW, OPEN, PENDING); false returns only RESOLVED and CLOSED ones. Omit for both.

companyId?string

Filter to cases on this company.

contactId?string

Filter to cases raised by this contact.

assigneeId?string

Filter to cases held by this workspace user.

updatedSince?string

Only cases updated at or after this ISO 8601 datetime.

Formatdate-time
limit?integer

Page size.

Range1 <= value <= 1000
Default100
cursor?string

The nextCursor value from the previous page.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1/cases"
{  "cases": [    {      "id": "cmq2case0alk34567890",      "number": 31,      "subject": "Pallet arrived damaged",      "description": "string",      "status": "NEW",      "severity": "LOW",      "source": "MANUAL",      "open": true,      "ageMins": 4320,      "overdue": true,      "company": {        "id": "cmq2comp0alk34567890",        "name": "Acme Corp"      },      "contact": {        "id": "cmq2comp0alk34567890",        "name": "Acme Corp"      },      "assignee": {        "id": "cmq2comp0alk34567890",        "name": "Acme Corp"      },      "threadKey": "string",      "firstResponseAt": "2019-08-24T14:15:22Z",      "resolvedAt": "2019-08-24T14:15:22Z",      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z"    }  ],  "nextCursor": "string"}
{  "error": "severity must be one of: LOW, MEDIUM, HIGH, URGENT."}
{  "error": "Invalid or missing API key."}
{  "error": "API key missing required scope: read:cases."}
{  "error": "Rate limit exceeded."}
GET/api/v1/cases/{id}

Authorization

BearerAuth
AuthorizationBearer <token>

Pass an API key issued from the agentlyleads workspace settings. Example: Authorization: Bearer alk_live_xxxxxxxxxxxx

In: header

Path Parameters

id*string

The agentlyleads case ID.

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1/cases/string"
{  "case": {    "id": "cmq2case0alk34567890",    "number": 31,    "subject": "Pallet arrived damaged",    "description": "string",    "status": "NEW",    "severity": "LOW",    "source": "MANUAL",    "open": true,    "ageMins": 4320,    "overdue": true,    "company": {      "id": "cmq2comp0alk34567890",      "name": "Acme Corp"    },    "contact": {      "id": "cmq2comp0alk34567890",      "name": "Acme Corp"    },    "assignee": {      "id": "cmq2comp0alk34567890",      "name": "Acme Corp"    },    "threadKey": "string",    "firstResponseAt": "2019-08-24T14:15:22Z",    "resolvedAt": "2019-08-24T14:15:22Z",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z"  }}
{  "error": "Invalid or missing API key."}
{  "error": "API key missing required scope: read:cases."}
{  "error": "Case not found."}