Skip to content
Hardcount
Run it locally
Pre-1.0 · one maintainer · Stripe and cards only · no SDKs (client libraries) yet · no production users yet. Docs describe v0.12.0 (30 Nov 2026) · What’s new →

List customers

GET
/v1/customers
curl --request GET \
--url 'http://localhost:8080/v1/customers?sort=created_at&dir=desc&limit=50&offset=0' \
--header 'Authorization: Bearer <token>'

Customers in the mode of your API key, newest first unless you choose a sort. The list answer leaves out additional_emails, email_status, the bounce fields and stripe_customer_id: get one customer for those.

status
string
Allowed values: active archived

Only customers with this status, active or archived. Any other value is a 422 with param: status.

external_id
string

Only the customer with this external_id (exact match).

ids
string

Comma-separated customer IDs. Only those customers are returned; IDs not found are skipped.

search
string

Case-insensitive substring match on display name, email, external ID or ID. It looks at the first 5,000 customers, in the list’s sort order, that match the other filters; the rows and total stop there.

sort
string
default: created_at
Allowed values: created_at display_name name email external_id status

The order of the list. created_at (the default), display_name (or name), email, external_id or status. Any other value is a 422 with param: sort. On a server that encrypts customer data, a sort by display_name, name or email looks at the 5,000 newest customers at most; the rows and total stop there.

Example

created_at
dir
string
default: desc
Allowed values: asc desc

Sort direction: desc (the default) or asc, in lower case. Any other value is a 422 with param: dir.

Example

desc
limit
integer
default: 50 >= 1 <= 100

Rows per page, from 1 to 100. Default 50. Any other value, one that is not a whole number, or limit sent twice is a 422 with param: limit. It is never clamped.

offset
integer
0

Rows to skip, 0 or more. Default 0. A negative value, one that is not a whole number, or offset sent twice is a 422 with param: offset.

One page of customers, and how many match.

Media typeapplication/json
object
data
required
Array<object>

A customer you bill: the person or company that subscriptions, invoices, credits and payment methods belong to. Create, list, get and update customers under /v1/customers. The customer.email_bounced and customer.email_complained webhook events carry this object too.

Not every route fills every optional field. Get and update return the whole record. The list and create answers leave out email_status, the bounce fields and stripe_customer_id, and the list also leaves out additional_emails.

object
id
required

The customer’s ID, hc_cus_ and 20 characters.

string
external_id
required

Your own ID for the customer, such as the account ID in your app. Unique in the account and mode, and fixed after create. Create refuses one longer than 255 bytes (UTF-8).

string
display_name
required

The name shown on invoices, emails and the dashboard. Create refuses one longer than 255 bytes (UTF-8); an update does not check the length.

string
email

Where billing emails go: invoices, receipts, payment reminders and payment-method links. Absent when the customer has none.

string
additional_emails

Addresses copied (CC) on billing documents and billing emails: invoice, receipt, payment reminder, final notice, failed payment and credit note. Never on the payment setup emails, whose link lets the reader add a card. Lowercase bare addresses, no duplicates, never the primary email. At most 10: a create or update with more is refused with 422. Absent when the list is empty.

Array<string>
<= 10 items
status
required

archived blocks new subscriptions for the customer. Its unpaid invoices stay collectible.

string
Allowed values: active archived
created_at
required

When the customer was created.

string format: date-time
tenant_id

The account the customer belongs to.

string
email_status

Whether email receives mail, learned from bounce and spam reports. unknown until a report arrives. bounced or complained after one, and Hardcount then stops emailing the address. Changing email sets it back to unknown. Hardcount does not set ok today.

string
Allowed values: unknown ok bounced complained
email_last_bounced_at

When the last bounce or spam report was recorded. Absent until one is, and again after email changes.

string format: date-time
email_bounce_reason

The reason the email provider gave with the last bounce or spam report. Absent until one is recorded, when the report gave no reason, and again after email changes.

string
stripe_customer_id

The Stripe customer linked to this customer. Absent until Hardcount first creates it: when you create a payment-method link (setup session or setup email), or when the customer opens Stripe Checkout from a payment-update link or the hosted invoice page. Set once, never replaced.

string
livemode

Whether the customer is in live mode. The customer routes and webhook events leave it out: use the mode of your API key.

boolean
updated_at
required

When the customer was last changed.

string format: date-time
total
required

How many rows match the request’s filters, on every page, not only this one. The audit log and the customer list’s search and name or email sort say where they stop counting.

integer

Example

{
"data": [
{
"id": "hc_cus_dakhnk2q3gpgqfoq5c0g",
"tenant_id": "hc_ten_dajqj02q3gpgqfoq5c00",
"external_id": "acme-42",
"display_name": "Acme Inc",
"email": "billing@acme.example",
"status": "active",
"created_at": "2026-09-30T16:20:00Z",
"updated_at": "2026-09-30T16:20:00Z"
}
],
"total": 1
}

No valid credential: the API key or session is missing, wrong, expired or revoked. With no API key and no valid session cookie, the message starts with missing credentials. A wrong, expired and revoked key all get the same message, invalid or expired API key.

Media typeapplication/json

The body of an error answer. error.type is the broad class, error.code is the exact reason for your code to branch on, and error.message is a sentence for a person. Quote error.request_id when you ask for help.

object
error

What went wrong.

object
type
required

One of invalid_request_error, authentication_error, rate_limit_error or api_error. Every error the API answers has this shape, including an unknown path (404, code route_not_found) and a method the path does not take (405, code method_not_allowed, with an Allow header). The few exceptions are listed in Errors.

string
code
required

The exact reason, such as validation_error, not_found, already_exists, invalid_state or a more specific code the operation lists. Branch on this, not on message.

string
message
required

What went wrong, written for a person to read.

string
request_id
required

The id of the request that produced this answer (req_…). It is normally the same value as the Hardcount-Request-Id response header. On an answer replayed for a repeated Idempotency-Key, the body is the first request’s, so this is the first request’s id, while the Hardcount-Request-Id header holds the new request’s id.

string
param

The request field or query parameter the error is about. Sent only when the error names one.

A request body may hold only the fields its operation lists, spelled and cased as listed. Any other field, or one the server sets (such as id), is refused with 422 and param naming it. An operation with no request body lists no fields: send no body, {} or null. The Stripe and Postmark webhooks and the LiteLLM callback take their sender’s body as it comes.

string

Example

{
"error": {
"type": "authentication_error",
"code": "unauthorized",
"message": "invalid or expired API key",
"request_id": "req_dbjg652q3gpgqfoq5cd0"
}
}

The credential is valid but may not call this route. A usage-only key (hc_ingest_…) can only send usage, read a customer’s live credit balance and call GET /v1/whoami; use a secret key. The message names the permission the key lacks. A browser request that would change data (POST, PUT, PATCH or DELETE) from a page on another site gets this 403 too, with the message cross-site request blocked.

Media typeapplication/json

The body of an error answer. error.type is the broad class, error.code is the exact reason for your code to branch on, and error.message is a sentence for a person. Quote error.request_id when you ask for help.

object
error

What went wrong.

object
type
required

One of invalid_request_error, authentication_error, rate_limit_error or api_error. Every error the API answers has this shape, including an unknown path (404, code route_not_found) and a method the path does not take (405, code method_not_allowed, with an Allow header). The few exceptions are listed in Errors.

string
code
required

The exact reason, such as validation_error, not_found, already_exists, invalid_state or a more specific code the operation lists. Branch on this, not on message.

string
message
required

What went wrong, written for a person to read.

string
request_id
required

The id of the request that produced this answer (req_…). It is normally the same value as the Hardcount-Request-Id response header. On an answer replayed for a repeated Idempotency-Key, the body is the first request’s, so this is the first request’s id, while the Hardcount-Request-Id header holds the new request’s id.

string
param

The request field or query parameter the error is about. Sent only when the error names one.

A request body may hold only the fields its operation lists, spelled and cased as listed. Any other field, or one the server sets (such as id), is refused with 422 and param naming it. An operation with no request body lists no fields: send no body, {} or null. The Stripe and Postmark webhooks and the LiteLLM callback take their sender’s body as it comes.

string

Example

{
"error": {
"type": "authentication_error",
"code": "forbidden",
"message": "insufficient permissions: this key type does not have customer:read access",
"request_id": "req_dbjg652q3gpgqfoq5cd0"
}
}

status is not one of its values, limit or offset is out of range or not a whole number, the request sends the removed after cursor, or sort or dir is not one of its values. param names it, and for status, sort and dir the message lists the allowed values.

Media typeapplication/json

The body of an error answer. error.type is the broad class, error.code is the exact reason for your code to branch on, and error.message is a sentence for a person. Quote error.request_id when you ask for help.

object
error

What went wrong.

object
type
required

One of invalid_request_error, authentication_error, rate_limit_error or api_error. Every error the API answers has this shape, including an unknown path (404, code route_not_found) and a method the path does not take (405, code method_not_allowed, with an Allow header). The few exceptions are listed in Errors.

string
code
required

The exact reason, such as validation_error, not_found, already_exists, invalid_state or a more specific code the operation lists. Branch on this, not on message.

string
message
required

What went wrong, written for a person to read.

string
request_id
required

The id of the request that produced this answer (req_…). It is normally the same value as the Hardcount-Request-Id response header. On an answer replayed for a repeated Idempotency-Key, the body is the first request’s, so this is the first request’s id, while the Hardcount-Request-Id header holds the new request’s id.

string
param

The request field or query parameter the error is about. Sent only when the error names one.

A request body may hold only the fields its operation lists, spelled and cased as listed. Any other field, or one the server sets (such as id), is refused with 422 and param naming it. An operation with no request body lists no fields: send no body, {} or null. The Stripe and Postmark webhooks and the LiteLLM callback take their sender’s body as it comes.

string

Example

{
"error": {
"type": "invalid_request_error",
"code": "validation_error",
"message": "sort \"nope\" is not one of created_at, display_name, name, email, external_id, status",
"request_id": "req_dbjg652q3gpgqfoq5cd0",
"param": "sort"
}
}

Too many requests. Wait for the number of seconds in Retry-After, then retry. The answers that pass the limit carry the X-RateLimit-* headers too.

Each API key has its own limit, by default 1,000 requests a minute (HARDCOUNT_RATE_LIMIT_GENERAL_PER_MIN), and 1,000 a second on the usage routes (HARDCOUNT_RATE_LIMIT_INGEST_PER_SEC). The dashboard sessions of one account share one limit per mode. The routes under /v1/auth and /v1/bootstrap (sign-in, password reset, invite accept, setup) count per client address, by default 100 a minute (HARDCOUNT_RATE_LIMIT_AUTH_PER_MIN). The public invoice, payment-update and cost-dashboard pages allow 60 a minute per client address.

Media typeapplication/json

The body of an error answer. error.type is the broad class, error.code is the exact reason for your code to branch on, and error.message is a sentence for a person. Quote error.request_id when you ask for help.

object
error

What went wrong.

object
type
required

One of invalid_request_error, authentication_error, rate_limit_error or api_error. Every error the API answers has this shape, including an unknown path (404, code route_not_found) and a method the path does not take (405, code method_not_allowed, with an Allow header). The few exceptions are listed in Errors.

string
code
required

The exact reason, such as validation_error, not_found, already_exists, invalid_state or a more specific code the operation lists. Branch on this, not on message.

string
message
required

What went wrong, written for a person to read.

string
request_id
required

The id of the request that produced this answer (req_…). It is normally the same value as the Hardcount-Request-Id response header. On an answer replayed for a repeated Idempotency-Key, the body is the first request’s, so this is the first request’s id, while the Hardcount-Request-Id header holds the new request’s id.

string
param

The request field or query parameter the error is about. Sent only when the error names one.

A request body may hold only the fields its operation lists, spelled and cased as listed. Any other field, or one the server sets (such as id), is refused with 422 and param naming it. An operation with no request body lists no fields: send no body, {} or null. The Stripe and Postmark webhooks and the LiteLLM callback take their sender’s body as it comes.

string

Example

{
"error": {
"type": "rate_limit_error",
"code": "rate_limited",
"message": "too many requests — please retry after the rate limit resets",
"request_id": "req_dbjg652q3gpgqfoq5cd0"
}
}
Retry-After
integer
Example
12

Seconds to wait before the next request can pass, rounded up to a whole second and at least 1.

X-RateLimit-Limit
integer
Example
1000

How many requests the limit allows in its period (a minute, or a second on the usage routes).

X-RateLimit-Remaining
integer
Example
0

How many requests are left in the current period.

X-RateLimit-Reset
integer format: int64
Example
1793870460

When the whole limit is available again, as Unix seconds. One request may pass sooner; Retry-After says when.

Stuck, or found a bug? Ask in Discussions · Open an issue