Skip to main content
All endpoints require an Authorization: Bearer <token> header.

Endpoint

POST /api/customers

Request body

name
string
required
Full name of the customer.
email
string
required
Email address of the customer.
phone
string
Phone number of the customer.
address
string
Mailing address of the customer.
tenantId is set automatically from the authenticated user’s session. You do not need to include it in the request body.

Response

Returns the created customer object.
id
string
required
Unique identifier for the new customer (UUID).
name
string
required
Full name of the customer.
email
string
required
Email address of the customer.
phone
string
Phone number of the customer. null if not provided.
address
string
Mailing address of the customer. null if not provided.
tenantId
string
required
UUID of the tenant this customer belongs to.
createdAt
string
required
ISO 8601 timestamp of when the customer was created.
updatedAt
string
required
ISO 8601 timestamp of when the customer was last updated.

Examples

curl --request POST \
  --url http://localhost:5000/api/customers \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "Acme Corp",
    "email": "[email protected]",
    "phone": "+1-555-0100",
    "address": "123 Main St, Springfield, IL 62701"
  }'

Example response

{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "name": "Acme Corp",
  "email": "[email protected]",
  "phone": "+1-555-0100",
  "address": "123 Main St, Springfield, IL 62701",
  "tenantId": "f0e1d2c3-b4a5-6789-cdef-012345678901",
  "createdAt": "2024-01-15T10:30:00.000Z",
  "updatedAt": "2024-01-15T10:30:00.000Z"
}

Build docs developers (and LLMs) love