Skip to main content
POST
/
api
/
customers
Create Customer
curl --request POST \
  --url https://app.sphinxhq.com/api/customers/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "full_name": "<string>",
  "external_id": "<string>",
  "customer_type": "INDIVIDUAL",
  "input_details": {},
  "delete_after": 123
}
'
{
  "external_id": "cust-123",
  "full_name": "John Smith",
  "customer_type": "INDIVIDUAL",
  "input_details": {
    "aliases": [
      "Johnny",
      "Jonno"
    ],
    "dob": "1990-01-01",
    "email": "john@example.com",
    "address": {
      "street": "123 Main St",
      "city": "New York",
      "country": "USA"
    }
  }
}

Authorizations

Authorization
string
header
required

OAuth2 access token obtained from POST /api/oauth/token/ using client credentials.

Body

Write serializer for Customer creation with flexible JSON details.

full_name
string
required
Maximum string length: 255
external_id
string | null

ID from the source system, for lookups.

Maximum string length: 255
customer_type
enum<string> | null
  • INDIVIDUAL - Individual
  • COMPANY - Company
Available options:
INDIVIDUAL,
COMPANY,
,
null
input_details
object

Flexible JSON for inputting customer fields. Any format accepted.

delete_after
integer

Number of days until deletion. Use 0 for immediate deletion, or -1 for indefinite retention (never delete). Defaults to -1.

Response

201 - application/json

Read-only serializer for Customer with computed fields.

id
integer
required
external_id
string | null
required

ID from the source system, for lookups.

full_name
string
required
customer_type
enum<string> | null
required
  • INDIVIDUAL - Individual
  • COMPANY - Company
Available options:
INDIVIDUAL,
COMPANY,
null
input_details
object
required

Flexible JSON for inputting customer fields such as first_name, address, etc. Any format accepted.

delete_after
integer
required

Days until deletion. -1 means never delete.

created_at
string<date-time>
required
updated_at
string<date-time>
required
parent
integer | null
required

Parent customer ID.