👤

Clients API

Clients represent the people your firm represents. Each matter is associated with a client. Use this API to create and manage client records.

POST/api/v1/clients

Create a Client

Creates a new client record for your firm. At minimum, first name and last name are required.

Authentication

Requires clients:write scope.

Headers

HeaderValueRequired
X-Api-Keyyour-api-keyYes
Content-Typeapplication/jsonYes

Request Body Fields

FieldTypeRequiredDescription
first_namestringYesClient first name
last_namestringYesClient last name
emailstringNoClient email address
phonestringNoE.164 format phone number
date_of_birthstringNoISO 8601 date (YYYY-MM-DD)
addressobjectNoAddress object with line1, line2, city, state, zip
notesstringNoInternal notes (not visible to client)
custom_fieldsobjectNoKey-value custom field data

Request Body Example

json
{
  "first_name": "David",
  "last_name": "Johnson",
  "email": "david.johnson@example.com",
  "phone": "+15551234567",
  "date_of_birth": "1985-06-15",
  "address": {
    "line1": "123 Main St",
    "line2": "Apt 4B",
    "city": "Austin",
    "state": "TX",
    "zip": "78701"
  },
  "notes": "Referred by Martinez Law",
  "custom_fields": {
    "referral_source": "existing_client",
    "language": "en"
  }
}

Response (201 Created)

json
{
  "data": {
    "id": "cli_01HABC",
    "first_name": "David",
    "last_name": "Johnson",
    "email": "david.johnson@example.com",
    "phone": "+15551234567",
    "date_of_birth": "1985-06-15",
    "address": {
      "line1": "123 Main St",
      "line2": "Apt 4B",
      "city": "Austin",
      "state": "TX",
      "zip": "78701"
    },
    "notes": "Referred by Martinez Law",
    "custom_fields": {
      "referral_source": "existing_client",
      "language": "en"
    },
    "matters_count": 0,
    "created_at": "2024-03-07T14:00:00Z",
    "updated_at": "2024-03-07T14:00:00Z"
  }
}

Error Responses

StatusCodeDescription
400invalid_requestMissing required fields
401unauthorizedMissing or invalid API key
403insufficient_scopeAPI key lacks clients:write scope
409duplicate_emailClient with this email already exists

Code Examples

curl -X POST https://api.calmintake.com/api/v1/clients \
  -H "X-Api-Key: ch_live_sk_abc123xyz" \
  -H "Content-Type: application/json" \
  -d '{
    "first_name": "David",
    "last_name": "Johnson",
    "email": "david.johnson@example.com",
    "phone": "+15551234567"
  }'
GET/api/v1/clients

List Clients

Returns a paginated list of clients for your firm.

Authentication

Requires clients:read scope.

Query Parameters

ParameterTypeDefaultDescription
pageinteger1Page number
per_pageinteger20Results per page (max 100)
searchstring-Search by name or email
sortstringcreated_atSort field: created_at, last_name
orderstringdescSort order: asc, desc

Response (200)

json
{
  "data": [
    {
      "id": "cli_01HABC",
      "first_name": "David",
      "last_name": "Johnson",
      "email": "david.johnson@example.com",
      "phone": "+15551234567",
      "matters_count": 2,
      "created_at": "2024-03-07T14:00:00Z"
    },
    {
      "id": "cli_01HBBB",
      "first_name": "Maria",
      "last_name": "Martinez",
      "email": "maria.m@example.com",
      "phone": "+15559876543",
      "matters_count": 1,
      "created_at": "2024-03-05T09:00:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "per_page": 20,
    "total": 87,
    "has_more": true
  }
}
GET/api/v1/clients/:id

Get Client

Returns full details for a single client, including their associated matters.

Authentication

Requires clients:read scope.

Response (200)

json
{
  "data": {
    "id": "cli_01HABC",
    "first_name": "David",
    "last_name": "Johnson",
    "email": "david.johnson@example.com",
    "phone": "+15551234567",
    "date_of_birth": "1985-06-15",
    "address": {
      "line1": "123 Main St",
      "line2": "Apt 4B",
      "city": "Austin",
      "state": "TX",
      "zip": "78701"
    },
    "notes": "Referred by Martinez Law",
    "custom_fields": {
      "referral_source": "existing_client",
      "language": "en"
    },
    "matters": [
      {
        "id": "mat_01HXYZ",
        "title": "Johnson v. Smith",
        "status": "active",
        "practice_area": "personal_injury"
      }
    ],
    "matters_count": 1,
    "created_at": "2024-03-07T14:00:00Z",
    "updated_at": "2024-03-07T15:30:00Z"
  }
}

Error Responses

StatusCodeDescription
401unauthorizedMissing or invalid API key
403forbiddenClient belongs to a different firm
404client_not_foundClient with that ID does not exist
PATCH/api/v1/clients/:id

Update Client

Updates client fields. Only include the fields you want to change — all other fields remain unchanged.

Authentication

Requires clients:write scope.

Request Body Example

json
{
  "phone": "+15550001111",
  "address": {
    "line1": "456 Oak Ave",
    "city": "Austin",
    "state": "TX",
    "zip": "78702"
  },
  "notes": "Moved to new address. Preferred contact: phone."
}

Returns the updated client object with status 200. Same schema as the GET response.

Error Responses

StatusCodeDescription
400invalid_requestInvalid field values
401unauthorizedMissing or invalid API key
403insufficient_scopeAPI key lacks clients:write scope
404client_not_foundClient does not exist
409duplicate_emailNew email already belongs to another client