Skip to content
Longplay
Docs
Browse docs / Search and filter customers
On this page

Search and filter customers

Operation
listCustomers
Server SDK
listCustomers
Python
list_customers
Go
ListCustomers
POST/api/v1/customers/list

Filter and paginate Customers by search, tag, Product, status and creation time.

Markdown
API v1Updated

Request#

Credential
Server Key with customers:read. Call from your backend only.
SDK
JavaScript createLongplayServer().listCustomers · Python list_customers · Go ListCustomers
Success
HTTP 200
request.shShell
curl -X POST "$LONGPLAY_API_URL/api/v1/customers/list" \  -H "Authorization: Bearer $LONGPLAY_SERVER_KEY" \  -H "X-Indiana-Protocol: 0.10" \  -H "Content-Type: application/json" \  -d '{  "limit": 20,  "offset": 0}'

The response shows example data.

Body parameters#

application/json

searchstringOptional

Keyword search.

maxLength: 200 · default: ""

tagstringOptional

Filter by tag.

maxLength: 40 · default: ""

planIdstringOptional

The products.id of a membership product in the current App and environment; combined with versionId, it selects membership holdings and schedules.

maxLength: 200 · default: ""

versionIdstringOptional

Immutable product_versions.id, including historical versions.

maxLength: 200 · default: ""

holdingStatusenumOptional

Filter verified membership periods and confirmed renewal schedules by active, scheduled, expired or unavailable; none means no currently active membership.

default: ""

Show allowed values

"""active""scheduled""expired""unavailable""none"

membershipStatusenumOptional

Filter canonical membership records by active, trial, past_due or ended; an empty string includes all statuses.

default: ""

Show allowed values

"""active""trial""past_due""ended"

createdFromdate-time | ""Optional

Earliest creation time (ISO 8601).

default: ""

createdUntildate-time | ""Optional

Latest creation time (ISO 8601).

default: ""

offsetintegerOptional

Record offset, starting at 0.

min: 0 · max: 100000 · default: 0

limitintegerOptional

Maximum records per page, subject to the contract limit.

min: 1 · max: 100 · default: 50

Response fields#

Every successful response includes requestId (this request's ID, for support) and scope (App and environment).

HTTP 200 · application/json

requestIduuidRequired

UUID the server generated for this HTTP request; include it when reporting a problem. It is not your business requestId.

scopeobjectRequired

The App and environment of this response. Headers only verify scope; they cannot switch key scope.

Show child fields
projectIdstringRequired

App ID bound to the credential.

minLength: 1

environmentenumRequired

Separate data scope: sandbox or live.

Show allowed values

"sandbox""live"

customersarrayRequired

Customer; fields below.

Show child fields
iduuidRequired

The Customer's ID.

externalUserIdstring | nullRequired

Stable user ID from your server-authenticated login system, not an email address. null for a customer reserved by email and not yet claimed.

namestringRequired

Display name; not a unique identifier.

maxLength: 80

emailemail | ""Required

Customer contact email; not used to merge customer identities.

phonestring | nullOptional

Customer contact phone in E.164 format; null clears the number without granting messaging consent.

attributesobjectRequired

Up to 128 keys, 1–128 characters each, and 64 KiB total JSON. Values may contain nested JSON, limited to 20 levels and 10,000 nodes per value. Reserved fields are rejected. Null is a value. Tags live in attributes.tags; when updating a Customer, delete keys with removeAttributes and change tags through tagChanges.

createdAtdate-timeRequired

ISO 8601 UTC time when the record was created.

hasMorebooleanRequired

Whether another page exists; continue with the returned cursor or pagination parameters.

totalinteger | nullRequired

Number of Customers matching the filters across all pages; null when search is set.

evaluatedAtdate-timeRequired

UTC server time at which this state was evaluated.

Errors#

Failures return an error object; handle them by error.code and error.recovery. The table lists the errors that follow from this operation's credential, scope and idempotency fields; depending on the request it can also return NOT_FOUND (a referenced resource doesn't exist), NOT_CONFIGURED (a required integration isn't connected) or PAYLOAD_TOO_LARGE. Some refusals, such as insufficient balance, are not errors but a reason in a successful response.

Possible errors
codeHTTPWhenrecovery
INVALID_REQUEST400The request doesn't match this page's parameters. A missing or malformed protocol header returns UNSUPPORTED_PROTOCOL_VERSION or INVALID_PROTOCOL_VERSION instead.fix_request
UNAUTHENTICATED401The credential is missing, invalid, expired or revoked.authenticate
FORBIDDEN403The credential lacks customers:read.check_permissions
SCOPE_MISMATCH403X-Indiana-Project or X-Indiana-Environment doesn't match the credential's App and environment.check_scope
RATE_LIMITED429Too many requests; wait for Retry-After and retry the same request.retry_same_request
SERVICE_UNAVAILABLE503The service is temporarily unavailable; retry the same request.retry_same_request
INTERNAL_ERROR500The outcome is unknown; retry later.recover_operation

Possible errors

  • INVALID_REQUEST

    HTTP
    400
    When
    The request doesn't match this page's parameters. A missing or malformed protocol header returns UNSUPPORTED_PROTOCOL_VERSION or INVALID_PROTOCOL_VERSION instead.
    recovery
    fix_request
  • UNAUTHENTICATED

    HTTP
    401
    When
    The credential is missing, invalid, expired or revoked.
    recovery
    authenticate
  • FORBIDDEN

    HTTP
    403
    When
    The credential lacks customers:read.
    recovery
    check_permissions
  • SCOPE_MISMATCH

    HTTP
    403
    When
    X-Indiana-Project or X-Indiana-Environment doesn't match the credential's App and environment.
    recovery
    check_scope
  • RATE_LIMITED

    HTTP
    429
    When
    Too many requests; wait for Retry-After and retry the same request.
    recovery
    retry_same_request
  • SERVICE_UNAVAILABLE

    HTTP
    503
    When
    The service is temporarily unavailable; retry the same request.
    recovery
    retry_same_request
  • INTERNAL_ERROR

    HTTP
    500
    When
    The outcome is unknown; retry later.
    recovery
    recover_operation

Related: Error codes and recovery·Request conventions·All operations