Browse documentation

RESOURCES

Debtors

People who owe money. Create them first; cases, conversations, and payments all hang off a debtor.

GET/debtorsaccounts:read

List debtors (cursor pagination).

Response

{
  "object": "list",
  "data": [
    {
      "object": "debtor",
      "id": "…",
      "given_name": "Avery",
      "email": "a@example.com"
    }
  ],
  "has_more": false,
  "next_cursor": null
}

Example

curl https://debt.hlhunt.org/api/v1/debtors \
  -H "Authorization: Bearer hlh_live_..."
POST/debtorsaccounts:writeIdempotency-Key required

Create a debtor. At least one of givenName, familyName, or email.

Request body

{
  "givenName": "Avery",
  "familyName": "Quinn",
  "email": "avery@example.com",
  "phone": "+15555550100",
  "externalRef": "crm-1042"
}

Response

{
  "object": "debtor",
  "id": "a1b2…",
  "given_name": "Avery",
  "external_ref": "crm-1042"
}

Example

curl https://debt.hlhunt.org/api/v1/debtors \
  -H "Authorization: Bearer hlh_live_..." \
  -X POST \
  -H "Idempotency-Key: my-unique-key" \
  -H "Content-Type: application/json" \
  -d '{ "givenName": "Avery", "familyName": "Quinn", "email": "avery@example.com", "phone": "+15555550100", "externalRef": "crm-1042" }'
GET/debtors/{id}accounts:read

Retrieve one debtor.

Response

{
  "object": "debtor",
  "id": "a1b2…",
  "given_name": "Avery"
}

Example

curl https://debt.hlhunt.org/api/v1/debtors/ID \
  -H "Authorization: Bearer hlh_live_..."
PATCH/debtors/{id}accounts:writeIdempotency-Key optional

Update debtor metadata (only the metadata object is mutable).

Request body

{
  "metadata": {
    "notes": "Prefers SMS"
  }
}

Response

{
  "metadata": {
    "notes": "Prefers SMS"
  }
}

Example

curl https://debt.hlhunt.org/api/v1/debtors/ID \
  -H "Authorization: Bearer hlh_live_..." \
  -X PATCH \
  -H "Idempotency-Key: my-unique-key" \
  -H "Content-Type: application/json" \
  -d '{ "metadata": { "notes": "Prefers SMS" } }'