Skip to content

Cases

Manage case records in the Kayse AI system.

Create a New Case

POST/v1/cases

Request Body Fields

FieldRequiredTypeDescription
case_numbertrueStringUnique case identifier
external_sourcetrueStringSource system identifier
external_source_idtrueStringUnique ID from external source
external_source_datafalseObjectAdditional data as key-value pairs
namefalseStringCase name/title
court_namefalseStringName of the court
jurisdictionfalseStringLegal jurisdiction
descriptionfalseStringCase description
statustrueStringCase status
typetrueStringCase type
is_obofalseBooleanOn behalf of another party
created_datefalseDateCase creation date
court_datefalseDateNext court date
end_datefalseDateCase end date
client_idsfalseArrayAssociated client IDs
opt_out_voice_callsfalseBooleanOpt out linked clients
Request
bash
curl -X POST 'https://public-api.kayse.ai/v1/cases' \
-H 'X-API-KEY: your_api_key' \
-H 'Content-Type: application/json' \
-d '{
  "case_number": "CASE-2024-001",
  "external_source": "other",
  "external_source_id": "ext_case_123",
  "name": "Smith vs. Johnson",
  "status": "active",
  "type": "civil",
  "client_ids": [123, 456]
}'
Response
json
{
  "id": 456,
  "case_number": "CASE-2024-001",
  "external_source": "other",
  "external_source_id": "ext_case_123",
  "name": "Smith vs. Johnson",
  "status": "active",
  "type": "civil",
  "client_ids": [123, 456],
  "origin": "public_api",
  "update_origin": null
}

Get a Case by ID

GET/v1/cases/{id}

URL Parameters

FieldRequiredTypeDescription
idtrueIntegerThe unique identifier of the case
Request
bash
curl -X GET 'https://public-api.kayse.ai/v1/cases/456' \
-H 'X-API-KEY: your_api_key'
Response
json
{
  "id": 456,
  "case_number": "CASE-2024-001",
  "name": "Smith vs. Johnson",
  "status": "active",
  "type": "civil",
  "origin": "public_api",
  "update_origin": null,
  "call_opted_out": false,
  "sms_opted_out": false,
  "email_opted_out": false
}

Opt-Out Status Fields

Case responses include call_opted_out, sms_opted_out, and email_opted_out to indicate whether all clients on the case have opted out of that channel. Use these fields to filter or exclude cases in integrations and outreach workflows.

Update a Case

PUT/v1/cases/{id}

Important

This is a PUT endpoint (NOT PATCH). All optional fields that are omitted will be set to null.

Request
bash
curl -X PUT 'https://public-api.kayse.ai/v1/cases/456' \
-H 'X-API-KEY: your_api_key' \
-H 'Content-Type: application/json' \
-d '{
  "case_number": "CASE-2024-001",
  "external_source": "other",
  "external_source_id": "ext_case_123",
  "status": "closed",
  "type": "civil"
}'
Response
json
{
  "id": 456,
  "case_number": "CASE-2024-001",
  "status": "closed",
  "type": "civil",
  "origin": "public_api",
  "update_origin": "public_api"
}

Delete a Case

DELETE/v1/cases/{id}

URL Parameters

FieldRequiredTypeDescription
idtrueIntegerThe unique identifier of the case
Request
bash
curl -X DELETE 'https://public-api.kayse.ai/v1/cases/456' \
-H 'X-API-KEY: your_api_key'
Response
json
{
  "message": "case deleted successfully"
}

Bulk Upsert Cases

POST/v1/cases/bulk

Each object follows the create schema. When id is omitted the case is created; when provided it's updated.

Request
bash
curl -X POST 'https://public-api.kayse.ai/v1/cases/bulk' \
-H 'X-API-KEY: your_api_key' \
-H 'Content-Type: application/json' \
-d '{
  "cases": [
    {
      "case_number": "CASE-2024-001",
      "external_source": "other",
      "external_source_id": "ext-001",
      "status": "open",
      "type": "civil"
    }
  ]
}'

Bulk Delete Cases

POST/v1/cases/bulk_delete

Request Body Fields

FieldRequiredTypeDescription
idstrueArrayCase IDs to delete (max 500)
with_clientsfalseBooleanAlso delete exclusively linked clients
Request
bash
curl -X POST 'https://public-api.kayse.ai/v1/cases/bulk_delete' \
-H 'X-API-KEY: your_api_key' \
-H 'Content-Type: application/json' \
-d '{
  "ids": [456, 789],
  "with_clients": false
}'

Send SMS to Client + Case

POST/v1/cases/communication/sms

Request Body Fields

FieldRequiredTypeDescription
case_idtrueIntegerUnique case identifier
client_idtrueIntegerUnique client identifier
messagetrueStringMessage text (supports template variables)
Request
bash
curl -X POST 'https://public-api.kayse.ai/v1/cases/communication/sms' \
-H 'X-API-KEY: your_api_key' \
-H 'Content-Type: application/json' \
-d '{
  "case_id": 123,
  "client_id": 456,
  "message": "Hello {{first_name}}, update on your case."
}'
Response
json
{
  "message": "sms scheduled"
}

Send Email to Client + Case

POST/v1/cases/communication/email

Request Body Fields

FieldRequiredTypeDescription
case_idtrueIntegerUnique case identifier
client_idtrueIntegerUnique client identifier
subjecttrueStringEmail subject
messagetrueStringEmail body (supports template variables)
Request
bash
curl -X POST 'https://public-api.kayse.ai/v1/cases/communication/email' \
-H 'X-API-KEY: your_api_key' \
-H 'Content-Type: application/json' \
-d '{
  "case_id": 123,
  "client_id": 456,
  "subject": "Case Update",
  "message": "Hello {{first_name}}, here is an update."
}'
Response
json
{
  "message": "email scheduled"
}

Turn unreachable clients into paid cases.