Skip to content

Case Lists

Case lists allow you to save reusable case filters that power campaigns and automations.

List Case Lists

GET/v1/case_lists

Query Parameters

FieldRequiredTypeDescription
keyfalseStringSearch term for list name
pagefalseIntPage number (default: 1)
page_sizefalseIntResults per page (default: 25, max: 100)
hide_emptyfalseBoolOnly return non-empty lists
Request
bash
curl -X GET 'https://public-api.kayse.ai/v1/case_lists?key=tort' \
-H 'X-API-KEY: your_api_key'
Response
json
{
  "data": [
    {
      "id": 1,
      "name": "Mass Tort Prospects",
      "description": "Prospects matching tort filters",
      "case_count": 150,
      "origin": "public_api",
      "update_origin": null
    }
  ],
  "page": 1,
  "total": 1
}

Create a Case List

POST/v1/case_lists

Request Body Fields

FieldRequiredTypeDescription
nametrueStringCase list name
descriptionfalseStringDescription shown in UI
external_sourcefalseStringOrigin system name
external_source_idfalseStringID in origin system
filterfalseObjectCase filter criteria
include_idsfalseArrayCase IDs to include
exclude_idsfalseArrayCase IDs to exclude
is_obofalseBooleanOn behalf of flag
Request
bash
curl -X POST 'https://public-api.kayse.ai/v1/case_lists' \
-H 'X-API-KEY: your_api_key' \
-H 'Content-Type: application/json' \
-d '{
  "name": "Mass Tort Prospects",
  "description": "Prospects matching tort filters",
  "filter": {
    "case_type_ids": [25],
    "status_ids": [30]
  },
  "include_ids": [101, 102]
}'
Response
json
{
  "id": 1,
  "name": "Mass Tort Prospects",
  "description": "Prospects matching tort filters",
  "case_count": 52,
  "origin": "public_api",
  "update_origin": null
}

Bulk Upsert Case Lists

POST/v1/case_lists/bulk

Request Body Fields

FieldRequiredTypeDescription
liststrueArrayArray of case list definitions

Each object inside lists accepts the same fields as the create endpoint. When an id is provided, the existing list is updated.

Request
bash
curl -X POST 'https://public-api.kayse.ai/v1/case_lists/bulk' \
-H 'X-API-KEY: your_api_key' \
-H 'Content-Type: application/json' \
-d '{
  "lists": [
    {
      "name": "PI Prospects",
      "filter": { "case_type_ids": [10] }
    },
    {
      "id": 55,
      "name": "Updated List",
      "is_obo": true
    }
  ]
}'
Response
json
{
  "results": [
    { "id": 100, "action": "created" },
    { "id": 55, "action": "updated" }
  ]
}

Attach Cases to a Case List

PATCH/v1/case_lists/{id}/attach

Attach cases to a case list using a filter, explicit case IDs, or both.

Path Parameters

FieldRequiredTypeDescription
idtrueIntCase list ID

Request Body Fields

FieldRequiredTypeDescription
filterconditionalObjectCase filter criteria (required unless include_ids is provided)
include_idsconditionalArrayCase IDs to attach (required unless filter is provided)
exclude_idsfalseArrayCase IDs to exclude (requires filter)
Request
bash
curl -X PATCH 'https://public-api.kayse.ai/v1/case_lists/1/attach' \
-H 'X-API-KEY: your_api_key' \
-H 'Content-Type: application/json' \
-d '{
  "include_ids": [201, 202, 203]
}'
Response
json
{
  "action": "attach",
  "list_id": "1"
}

Detach Cases from a Case List

PATCH/v1/case_lists/{id}/detach

Detach cases from a case list using a filter, explicit case IDs, or both.

Path Parameters

FieldRequiredTypeDescription
idtrueIntCase list ID

Request Body Fields

FieldRequiredTypeDescription
filterconditionalObjectCase filter criteria (required unless include_ids is provided)
include_idsconditionalArrayCase IDs to detach (required unless filter is provided)
exclude_idsfalseArrayCase IDs to exclude from detaching (requires filter)
Request
bash
curl -X PATCH 'https://public-api.kayse.ai/v1/case_lists/1/detach' \
-H 'X-API-KEY: your_api_key' \
-H 'Content-Type: application/json' \
-d '{
  "include_ids": [201, 202]
}'
Response
json
{
  "action": "detach",
  "list_id": "1"
}

Append Clients to a Case List

POST/v1/case_lists/{id}/clients/append

Add clients to a case list by providing their client IDs. The system finds all cases belonging to the specified clients and attaches them to the list.

Path Parameters

FieldRequiredTypeDescription
idtrueIntCase list ID

Request Body Fields

FieldRequiredTypeDescription
client_idstrueArrayClient IDs to add to the list
Request
bash
curl -X POST 'https://public-api.kayse.ai/v1/case_lists/1/clients/append' \
-H 'X-API-KEY: your_api_key' \
-H 'Content-Type: application/json' \
-d '{
  "client_ids": [101, 102, 103]
}'
Response
json
{
  "action": "append",
  "list_id": 1,
  "client_count": 3,
  "matched_case_count": 5
}

Remove Clients from a Case List

POST/v1/case_lists/{id}/clients/remove

Remove clients from a case list by providing their client IDs. The system finds all cases belonging to the specified clients and detaches them from the list.

Path Parameters

FieldRequiredTypeDescription
idtrueIntCase list ID

Request Body Fields

FieldRequiredTypeDescription
client_idstrueArrayClient IDs to remove from the list
Request
bash
curl -X POST 'https://public-api.kayse.ai/v1/case_lists/1/clients/remove' \
-H 'X-API-KEY: your_api_key' \
-H 'Content-Type: application/json' \
-d '{
  "client_ids": [101, 102]
}'
Response
json
{
  "action": "remove",
  "list_id": 1,
  "client_count": 2,
  "matched_case_count": 3
}

Duplicate a Case List

POST/v1/case_lists/{id}/duplicate

Create a copy of an existing case list, including its filter and case memberships.

Path Parameters

FieldRequiredTypeDescription
idtrueIntCase list ID to duplicate
Request
bash
curl -X POST 'https://public-api.kayse.ai/v1/case_lists/1/duplicate' \
-H 'X-API-KEY: your_api_key'
Response
json
{
  "id": 42,
  "original_list_id": "1"
}

Bulk Delete Case Lists

POST/v1/case_lists/bulk_delete

Request Body Fields

FieldRequiredTypeDescription
idstrueArrayCase list IDs to delete
Request
bash
curl -X POST 'https://public-api.kayse.ai/v1/case_lists/bulk_delete' \
-H 'X-API-KEY: your_api_key' \
-H 'Content-Type: application/json' \
-d '{
  "ids": [44, 55]
}'
Response
json
{
  "deleted_ids": [44, 55]
}

Turn unreachable clients into paid cases.