Skip to main content
POST
/
customers
Create customer
curl --request POST \
  --url https://api.truust.io/2.0/customers \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "John Doe",
  "email": "john@example.com",
  "prefix": "+34",
  "phone": "612345678"
}
'
{
  "id": 123,
  "self": "/2.0/customers/abc123",
  "uuid": "<string>",
  "type": "<string>",
  "name": "<string>",
  "first_name": "<string>",
  "last_name": "<string>",
  "email": "jsmith@example.com",
  "prefix": "+34",
  "phone": "<string>",
  "tag": "<string>",
  "metadata": {},
  "created_at": "2023-11-07T05:31:56Z",
  "connections": {}
}

Authorizations

Authorization
string
header
required

Use your account's Secret Key as the Bearer token.

Body

application/json
name
string
Maximum string length: 255
Example:

"John Doe"

first_name
string
Maximum string length: 255
Example:

"John"

last_name
string
Maximum string length: 255
Example:

"Doe"

email
string<email>

Required if phone is not provided.

Maximum string length: 255
Example:

"john@example.com"

prefix
string

Phone country prefix (e.g. +34). Required with phone.

Example:

"+34"

phone
string

Phone number without prefix. Required if email is not provided.

Example:

"612345678"

locale
string

Customer's preferred locale.

Example:

"es"

tag
string

Custom tag for grouping or filtering.

Maximum string length: 100
metadata
object

Arbitrary key-value metadata.

Response

Customer created or updated

id
integer
self
string
Example:

"/2.0/customers/abc123"

uuid
string
type
string | null
name
string | null
first_name
string | null
last_name
string | null
email
string<email> | null
prefix
string | null
Example:

"+34"

phone
string | null
tag
string | null
metadata
object
created_at
string<date-time> | null
connections
object

Hypermedia links to related resources.