Skip to content
中文

List customers

Call Create agent first and replace the example agent ID with its returned ID.

GET/agent/v1/agents/{agent_id}/customers● Supported

Request parameters

  • agent_idstringrequired

    path: Active service agent id from agent creation or listing. Also accepts an 8-character identity number (0–9, A–Z); malformed, absent and foreign references return 404, and response ids always use agent_….

  • limitintegeroptional
    default 20

    query: Maximum customers per page, 1 to 100; defaults to 20.

  • pagestringoptional

    query: next_page from the previous response with the same q, type, blocked and limit.

  • qstringoptional

    query: Case-sensitive literal prefix of the customer id; omit for all customers.

  • typestringoptional

    query: Only identified or only anonymous customers; omit for both.

    values identifiedanonymous
  • blockedbooleanoptional

    query: true for blocked customers only, false for customers who are not blocked; omit for both.

Returns

200

Call this from your backend with your API key, or from the console. Customers follow Shopify Admin customers (list, retrieve, block, sign-out and data deletion of the people who use your storefront), so that experience applies. The list includes customers who signed in but have not started a session yet, and customers recorded under your own ids by embed tokens before customer sign-in existed; an id first seen that way is identified unless it starts with anon_. Unlike Shopify, a customer can be anonymous: a visitor admitted with the publishable key gets an anon_ id, and when it later signs in with anonymous_access_token it is merged: merged_into names the identified customer, and its sessions count toward that customer. Filter with q (a case-sensitive customer id prefix), type (identified or anonymous) and blocked (true or false). limit is 1 to 100, default 20; reuse next_page with the same filters and limit. A customer access token gets 404. Example: GET /agent/v1/agents/agent_example/customers?type=identified&blocked=false&limit=50.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Request

curl
# Call Create agent first and replace the example agent ID with its returned ID.
curl "https://api.deepraxis.com/agent/v1/agents/agent_123/customers?limit=20" \
  -H "Authorization: Bearer $PRAXIS_API_KEY"
Python
# Call Create agent first and replace the example agent ID with its returned ID.
import requests

opts = dict(
    base_url="https://api.deepraxis.com/agent",
    api_key="$PRAXIS_API_KEY",
)

# /agent 是我们自己的 Managed Agents 形状,直接发 HTTP 请求(Bearer 认证)
resp = requests.get(
    f"{opts['base_url']}/v1/agents/agent_123/customers?limit=20",
    headers={"Authorization": f"Bearer {opts['api_key']}"},
)
print(resp.status_code, resp.json())
TypeScript
// Call Create agent first and replace the example agent ID with its returned ID.
const opts = {
  baseURL: "https://api.deepraxis.com/agent",
  apiKey: "$PRAXIS_API_KEY",
};

// /agent 是我们自己的 Managed Agents 形状,直接发 HTTP 请求(Bearer 认证)
const resp = await fetch(`${opts.baseURL}/v1/agents/agent_123/customers?limit=20`, {
  headers: { Authorization: `Bearer ${opts.apiKey}` },
});
console.log(resp.status, await resp.json());

Response 200

{
  "data": [
    {
      "id": "docs-sample",
      "type": "identified",
      "merged_into": null,
      "blocked": false,
      "first_seen_at": "2026-10-24T08:07:33.125Z",
      "last_seen_at": "2026-10-24T08:07:33.125Z",
      "session_count": 0,
      "cost": {
        "amount": "0.000000",
        "currency": "USD"
      }
    }
  ],
  "next_page": null
}

Response

HTTP 200

Matching customers and the next page cursor.

application/json

Name Type Description
data array<object> Items of this page, in the order requested by the call.
data[].id string The customer id: your customer_id for an identified customer, or anon_ followed by 16 characters for an anonymous one.
data[].type string identified: signed in through a grant code from your backend, or seen under your own id before customer sign-in existed. anonymous: a visitor admitted with the publishable key.
data[].merged_into string | null For an anonymous customer who later signed in, the identified customer it joined; their conversations count toward that customer. null otherwise.
data[].blocked boolean Whether the customer is blocked: no grant code, sign-in, renewal or new session is accepted for this id until it is unblocked.
data[].first_seen_at string | null Earliest sign-in, session or token issuance for this customer, in RFC 3339; null when nothing is recorded.
data[].last_seen_at string | null Latest sign-in, token renewal, session update or token issuance, in RFC 3339; the list is ordered by it, newest first.
data[].session_count integer Sessions of this customer on this agent, including those of anonymous customers merged into it.
data[].cost object Recorded cost of those sessions: model usage (threads included) plus session runtime; "0.000000" when nothing has been recorded.
next_page string | null Cursor for the next page with the same agent, q, type, blocked and limit; null when exhausted.

Before running the example

Create a service agent and sign your own test customer docs-sample in with a grant code from the Customer face (/customer/v1); replace agent_123. Block the customer before testing unblock. For deletion, confirm must equal the customer ID. Revoke tokens and delete the test customer’s data after testing, then archive the agent.