Customers
Private previewCustomer resources anchor the public platform. They give downstream systems a stable identity model for accounts, service locations, communication preferences, and lifecycle activity.
Canonical public representation of a customer record in Asteri.
| Field | Type | Required | Description |
|---|---|---|---|
| id | uuid | Yes | Stable customer identifier. |
| organization_id | uuid | Yes | Organization that owns the record. |
| account_type | "individual" | "business" | Yes | High-level account classification. |
| display_name | string | Yes | Primary display name shown across the platform. |
| string | null | Yes | Primary contact email. | |
| phone | string | null | Yes | Primary contact phone number. |
| created_at | datetime | Yes | ISO-8601 timestamp for record creation. |
{
"id": "8af2ca8e-8f31-4e6e-a46c-0703b61f7ca3",
"organization_id": "dce3853d-4f94-4bc8-a816-4d0d74c11a9d",
"account_type": "business",
"display_name": "North Harbor Facilities",
"email": "ops@northerborfacilities.com",
"phone": "+1-404-555-0128",
"created_at": "2026-03-18T15:40:12.000Z"
}Payload for creating a customer in the public API.
| Field | Type | Required | Description |
|---|---|---|---|
| account_type | "individual" | "business" | Yes | Account classification used when creating the customer. |
| display_name | string | No | Customer display name or company name. Useful when you do not want to provide explicit name fields. |
| company_name | string | No | Explicit company name for business accounts. |
| first_name | string | No | Primary contact first name. |
| last_name | string | No | Primary contact last name. |
| string | Yes | Primary contact email. | |
| phone | string | Yes | Primary contact phone number. |
{
"account_type": "business",
"display_name": "North Harbor Facilities",
"company_name": "North Harbor Facilities",
"first_name": "Nora",
"last_name": "Harbor",
"email": "ops@northerborfacilities.com",
"phone": "+1-404-555-0128"
}Response body for customer list endpoints.
| Field | Type | Required | Description |
|---|---|---|---|
| data | Customer[] | Yes | Collection of customers matching the current filter set. |
| pagination | Pagination | Yes | List metadata for page traversal. |
{
"data": [
{
"id": "8af2ca8e-8f31-4e6e-a46c-0703b61f7ca3",
"organization_id": "dce3853d-4f94-4bc8-a816-4d0d74c11a9d",
"account_type": "business",
"display_name": "North Harbor Facilities",
"email": "ops@northerborfacilities.com",
"phone": "+1-404-555-0128",
"created_at": "2026-03-18T15:40:12.000Z"
}
],
"pagination": {
"count": 2,
"limit": 25,
"next_cursor": null
}
}/api/public/v1/customersList customers in the active organization with filtering and pagination.
{
"data": [
{
"id": "8af2ca8e-8f31-4e6e-a46c-0703b61f7ca3",
"organization_id": "dce3853d-4f94-4bc8-a816-4d0d74c11a9d",
"account_type": "business",
"display_name": "North Harbor Facilities",
"email": "ops@northerborfacilities.com",
"phone": "+1-404-555-0128",
"created_at": "2026-03-18T15:40:12.000Z"
}
],
"pagination": {
"count": 2,
"limit": 25,
"next_cursor": null
}
}Missing or invalid organization context.
{
"error": "Missing organization context. Provide x-organization-id.",
"issues": [
{
"path": "email",
"message": "Invalid email address"
}
]
}Missing, invalid, or expired API credentials.
{
"error": "Invalid API key"
}Missing scopes or organization access for this request.
{
"error": "API key missing required scopes",
"missingScopes": [
"write:customers"
]
}Configured API key rate limit exceeded.
{
"error": "API key minute rate limit exceeded",
"limit": 60,
"window": "minute"
}Unexpected preview API failure.
{
"error": "Failed to fetch customers"
}curl -X GET \
http://localhost:3000/api/public/v1/customers \
-H "x-api-key: ast_live_your_key" \
-H "x-organization-id: ${ORG_ID}"import { AsteriPublicApiClient } from '@asteri/public-api-sdk';
const client = new AsteriPublicApiClient({
baseUrl: 'http://localhost:3000',
organizationId: process.env.ASTERI_ORG_ID!,
apiKey: process.env.ASTERI_API_KEY!,
});
const response = await client.customers.list();/api/public/v1/customersCreate a customer with organization-scoped identity and contact data.
{
"account_type": "business",
"display_name": "North Harbor Facilities",
"company_name": "North Harbor Facilities",
"first_name": "Nora",
"last_name": "Harbor",
"email": "ops@northerborfacilities.com",
"phone": "+1-404-555-0128"
}{
"data": {
"id": "8af2ca8e-8f31-4e6e-a46c-0703b61f7ca3",
"organization_id": "dce3853d-4f94-4bc8-a816-4d0d74c11a9d",
"account_type": "business",
"display_name": "North Harbor Facilities",
"email": "ops@northerborfacilities.com",
"phone": "+1-404-555-0128",
"created_at": "2026-03-18T15:40:12.000Z"
}
}Missing organization context or invalid request payload.
{
"error": "Missing organization context. Provide x-organization-id.",
"issues": [
{
"path": "email",
"message": "Invalid email address"
}
]
}Missing, invalid, or expired API credentials.
{
"error": "Invalid API key"
}Missing scopes or organization access for this request.
{
"error": "API key missing required scopes",
"missingScopes": [
"write:customers"
]
}Duplicate customer email or conflicting customer state.
{
"error": "Customer email already exists in this organization",
"field": "email"
}Configured API key rate limit exceeded.
{
"error": "API key minute rate limit exceeded",
"limit": 60,
"window": "minute"
}Unexpected preview API failure.
{
"error": "Failed to fetch customers"
}curl -X POST \
http://localhost:3000/api/public/v1/customers \
-H "x-api-key: ast_live_your_key" \
-H "x-organization-id: ${ORG_ID}" \
-H "Content-Type: application/json" \
-d '{
"account_type": "business",
"display_name": "North Harbor Facilities",
"company_name": "North Harbor Facilities",
"first_name": "Nora",
"last_name": "Harbor",
"email": "ops@northerborfacilities.com",
"phone": "+1-404-555-0128"
}'import { AsteriPublicApiClient } from '@asteri/public-api-sdk';
const client = new AsteriPublicApiClient({
baseUrl: 'http://localhost:3000',
organizationId: process.env.ASTERI_ORG_ID!,
apiKey: process.env.ASTERI_API_KEY!,
});
const response = await client.customers.create({
"account_type": "business",
"display_name": "North Harbor Facilities",
"company_name": "North Harbor Facilities",
"first_name": "Nora",
"last_name": "Harbor",
"email": "ops@northerborfacilities.com",
"phone": "+1-404-555-0128"
});/api/public/v1/customers/{customerId}Retrieve one customer and related profile metadata.
{
"data": {
"id": "8af2ca8e-8f31-4e6e-a46c-0703b61f7ca3",
"organization_id": "dce3853d-4f94-4bc8-a816-4d0d74c11a9d",
"account_type": "business",
"display_name": "North Harbor Facilities",
"email": "ops@northerborfacilities.com",
"phone": "+1-404-555-0128",
"created_at": "2026-03-18T15:40:12.000Z"
}
}Missing or invalid organization context.
{
"error": "Missing organization context. Provide x-organization-id.",
"issues": [
{
"path": "email",
"message": "Invalid email address"
}
]
}Missing, invalid, or expired API credentials.
{
"error": "Invalid API key"
}Missing scopes or organization access for this request.
{
"error": "API key missing required scopes",
"missingScopes": [
"write:customers"
]
}Requested customer record was not found.
{
"error": "Customer not found"
}Configured API key rate limit exceeded.
{
"error": "API key minute rate limit exceeded",
"limit": 60,
"window": "minute"
}Unexpected preview API failure.
{
"error": "Failed to fetch customers"
}curl -X GET \
http://localhost:3000/api/public/v1/customers/8af2ca8e-8f31-4e6e-a46c-0703b61f7ca3 \
-H "x-api-key: ast_live_your_key" \
-H "x-organization-id: ${ORG_ID}"import { AsteriPublicApiClient } from '@asteri/public-api-sdk';
const client = new AsteriPublicApiClient({
baseUrl: 'http://localhost:3000',
organizationId: process.env.ASTERI_ORG_ID!,
apiKey: process.env.ASTERI_API_KEY!,
});
const response = await client.customers.get({ customerId: '8af2ca8e-8f31-4e6e-a46c-0703b61f7ca3' });