Skip to content
中文

Get customer

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

GET/agent/v1/agents/{agent_id}/customers/{customer_id}● 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_….

  • customer_idstringrequired

    path: Customer id from customer listing, or your own customer_id.

Returns

200

Use the customer id from the list or your own customer_id. An unknown customer returns 404 CUSTOMER_NOT_FOUND, and so does a customer access token. Unlike Shopify, an identified customer's session_count, cost and recent_sessions include the sessions of anonymous customers merged into it; the merged anonymous customer still shows its own sessions and its merged_into.

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/docs-sample \
  -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/docs-sample",
    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/docs-sample`, {
  headers: { Authorization: `Bearer ${opts.apiKey}` },
});
console.log(resp.status, await resp.json());

Response 200

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

Response

HTTP 200

The customer with its recent sessions.

application/json

Name Type Description
id string The customer id: your customer_id for an identified customer, or anon_ followed by 16 characters for an anonymous one.
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.
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.
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.
first_seen_at string | null Earliest sign-in, session or token issuance for this customer, in RFC 3339; null when nothing is recorded.
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.
session_count integer Sessions of this customer on this agent, including those of anonymous customers merged into it.
cost object Recorded cost of those sessions: model usage (threads included) plus session runtime; "0.000000" when nothing has been recorded.
cost.amount string Amount in US dollars, as a decimal string with exactly 6 decimals and no exponent, e.g. "0.000345" or "12.500000".
cost.currency string Always USD.
recent_sessions array<object> Up to twenty sessions of the customer, and of anonymous customers merged into it, most recently updated first.
recent_sessions[].id string Public sesn_ session identifier, usable with session retrieval.
recent_sessions[].title string | null Session title, or null when unset.
recent_sessions[].source string | null Session entry surface, or null when no surface was recorded.
recent_sessions[].created_at string Session creation time in UTC.
recent_sessions[].updated_at string Most recent session update time in UTC.

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.