Skip to content

Clients

Manage client records in the Kayse AI system.

Create a New Client

POST/v1/clients

Request Body Fields

FieldRequiredTypeDescription
emailfalseStringClient's email address
mobilefalseStringClient's mobile phone number
external_sourcetrueStringSource system identifier
external_source_idtrueStringUnique identifier from external source
first_nametrueStringClient's first name
last_nametrueStringClient's last name
date_of_birthfalseDateDate of birth (YYYY-MM-DD)
cityfalseStringCity of residence
statefalseStringState of residence
postal_codefalseStringPostal/ZIP code
address_line1falseStringPrimary address line
address_line2falseStringSecondary address line
voice_calls_opted_outfalseBooleanOpt out of voice calls
case_idsfalseArrayAssociated case IDs
Request
bash
curl -X POST 'https://public-api.kayse.ai/v1/clients' \
-H 'X-API-KEY: your_api_key' \
-H 'Content-Type: application/json' \
-d '{
  "email": "john.doe@example.com",
  "mobile": "+1234567890",
  "external_source": "manual",
  "external_source_id": "ext_123",
  "first_name": "John",
  "last_name": "Doe",
  "city": "New York",
  "state": "NY",
  "case_ids": [12345, 67890]
}'
Response
json
{
  "id": 123,
  "email": "john.doe@example.com",
  "mobile": "+1234567890",
  "external_source": "manual",
  "external_source_id": "ext_123",
  "first_name": "John",
  "last_name": "Doe",
  "city": "New York",
  "state": "NY",
  "voice_calls_opted_out": false,
  "case_ids": [12345, 67890],
  "origin": "public_api",
  "update_origin": null
}

Get a Client by ID

GET/v1/clients/{id}

URL Parameters

FieldRequiredTypeDescription
idtrueIntegerThe unique identifier of the client
Request
bash
curl -X GET 'https://public-api.kayse.ai/v1/clients/123' \
-H 'X-API-KEY: your_api_key'
Response
json
{
  "id": 123,
  "email": "john.doe@example.com",
  "mobile": "+1234567890",
  "first_name": "John",
  "last_name": "Doe",
  "city": "New York",
  "state": "NY",
  "origin": "public_api",
  "update_origin": null
}

Update a Client

PUT/v1/clients/{id}

Note

This is a PUT endpoint, but only provided fields are updated. Required fields must still be included.

URL Parameters

FieldRequiredTypeDescription
idtrueIntegerThe unique identifier of the client
Request
bash
curl -X PUT 'https://public-api.kayse.ai/v1/clients/123' \
-H 'X-API-KEY: your_api_key' \
-H 'Content-Type: application/json' \
-d '{
  "email": "john.updated@example.com",
  "city": "Los Angeles",
  "state": "CA"
}'
Response
json
{
  "id": 123,
  "email": "john.updated@example.com",
  "mobile": "+1234567890",
  "first_name": "John",
  "last_name": "Doe",
  "city": "Los Angeles",
  "state": "CA",
  "origin": "public_api",
  "update_origin": "public_api"
}

Delete a Client

DELETE/v1/clients/{id}

URL Parameters

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

Bulk Upsert Clients

POST/v1/clients/bulk

Each entry in the clients array follows the create schema when id is omitted. When id is provided, the entry is treated as a partial update.

Request Body Fields

FieldRequiredTypeDescription
clientstrueArrayArray of client payloads
clients[].idfalseIntegerClient ID to update (omit to create)
Request
bash
curl -X POST 'https://public-api.kayse.ai/v1/clients/bulk' \
-H 'X-API-KEY: your_api_key' \
-H 'Content-Type: application/json' \
-d '{
  "clients": [
    {
      "external_source": "manual",
      "external_source_id": "ext-901",
      "first_name": "New",
      "last_name": "Client"
    },
    {
      "id": 123,
      "voice_calls_opted_out": true
    }
  ]
}'
Response
json
{
  "clients": [...],
  "successful_ids": [999, 123],
  "failed": []
}

Bulk Delete Clients

POST/v1/clients/bulk_delete

Request Body Fields

FieldRequiredTypeDescription
client_idstrueArrayClient IDs to delete
forcefalseBooleanWhen true, performs a hard delete
Request
bash
curl -X POST 'https://public-api.kayse.ai/v1/clients/bulk_delete' \
-H 'X-API-KEY: your_api_key' \
-H 'Content-Type: application/json' \
-d '{
  "client_ids": [123, 456],
  "force": false
}'
Response
json
{
  "deleted_ids": [123, 456]
}

Turn unreachable clients into paid cases.