/api/v1/customers/{id}Changes contact details on a customer. Omitted fields are left as they are. Changing the email rewrites the customer's bookings and newsletter record too, the same way the admin customer page does. Requires the "customers:write" scope; an "Idempotency-Key" header is optional.
Path parameters#
| Field | Type | Description |
|---|---|---|
idrequired | string | Awrora id (UUID) for the customer. |
Headers#
| Field | Type | Description |
|---|---|---|
Idempotency-Key | string≥ 8 chars · ≤ 200 chars | Optional. A unique key, 8-200 characters. Retrying with the same key replays the first response verbatim instead of acting twice. |
Request body#
| Field | Type | Description |
|---|---|---|
name | string≥ 1 chars · ≤ 200 chars | New name. |
phone | string | null | New phone number. Pass null to clear it. |
email | stringemail · ≤ 200 chars | New email. Changing it rewrites the customer's bookings too. An email that already belongs to another customer answers 409 "conflict". |
email_subscription | boolean | Whether the customer has agreed to marketing email. |
tags | string[] | Replaces the customer's tags. Omit to leave them unchanged. |
Example request#
bash
curl -X PATCH "https://your-site.awrora.app/api/v1/customers/id_8f2k3n" \
-H "Authorization: Bearer $AWRORA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"phone": "string",
"email": "anna@example.com",
"email_subscription": true,
"tags": [
"string"
]
}'Responses#
200The updated customer.400Invalid request — codes "validation_failed" or, on an endpoint that requires one, "idempotency_key_required".401Missing, invalid, revoked or expired API key — codes "api_key_missing", "api_key_invalid", "api_key_revoked", "api_key_expired".403The API app is off, the plan does not include the API, or the key lacks the required scope — codes "app_not_enabled", "plan_upgrade_required", "insufficient_scope" (the last carries "required_scope").404No such resource. The same response is returned for a resource that belongs to another organization — code "not_found".409The request conflicts with the current state — codes "insufficient_capacity" (carries "seats_available"), "conflict", or "idempotency_in_progress" when another request with the same Idempotency-Key is still running.422The request was understood but cannot be fulfilled as asked — codes "validation_failed" or "idempotency_key_reused" (the same Idempotency-Key was already used with a different body).429Rate limit exceeded — code "rate_limited". See the x-ratelimit-* headers.500Something went wrong on our side — code "internal_error".
Response 200
| Field | Type | Description |
|---|---|---|
idrequired | string | Awrora id (UUID) for the customer record. |
namerequired | string | Customer name. |
emailrequired | string | Customer email. Unique within the organization. |
phonerequired | string | null | Phone number, or null. |
tagsrequired | string[] | Merchant-defined tags. May be empty. |
email_subscriptionrequired | boolean | True when the customer has opted in to marketing email. |
created_atrequired | string | ISO 8601 timestamp with offset. |
200 response
{
"id": "res_8f2k3n",
"name": "string",
"email": "anna@example.com",
"phone": "string",
"tags": [
"string"
],
"email_subscription": true,
"created_at": "string"
}