跳转到内容
EN

List end users

Code Mode: praxis.customer.customers.list

HTTP: GET /customer/v1/customers

Read the organization’s end-user directory and obtain the customer_id the administrative acts take. Results are ordered by last_seen_at, most recently seen first. Filter with type (identified for people who signed in through a grant code, anonymous for visitors admitted with a publishable key), blocked (true or false), resource (one product in the form agent:<id>, content:<id> or application:<id>, giving that product’s own view of the directory) and q (a prefix of the customer id). Identified and anonymous end users both appear; an anonymous one that later signs in shows merged_into and its record joins that person. page_size is 1 to 100 and defaults to 50; copy next_page into page_token until it is null, keeping the same filters.

签名

praxis.customer.customers.list(args?:{query?:{page_size?:number;page_token?:string;type?:"identified"|"anonymous";blocked?:boolean;resource?:string;q?:string}}):Promise<{/** The end users of this page, most recently seen first. */ data?:Array<{/** Object type, always customer. */ type?:"customer";/** End-user id — your own customer_id for an identified person, or anon_… for a visitor admitted with a publishable key. */ id?:string;/** Kind of end user: identified for one that signed in through a grant code, anonymous for a visitor admitted with a publishable key. */ customer_type?:"identified"|"anonymous";/** For an anonymous end user that later signed in, the identified end user it joined; null otherwise. */ merged_into?:string|null;/** The block fact (time, reason and actor) while the end user is blocked; null when it is not. */ blocked?:{/** RFC 3339 time the end user was blocked; a repeated block keeps the first time. */ time?:string;/** Reason recorded with the block, or null when none was given. */ reason?:string|null;/** Actor that blocked the end user, either human:<user id> or agent:<api key id>. */ by?:string}|null;/** Product metadata recorded with this end user, as string key to string value; empty when none was sent. */ metadata?:{[key:string]:string};/** RFC 3339 time the end user was first seen (first sign-in, admission or token issue). */ first_seen_at?:string;/** RFC 3339 time the end user was last seen; the directory list is ordered by it, newest first. */ last_seen_at?:string;/** Products this end user has used, with counts and last use; present only when expand asked for products. */ products?:Array<{/** The product the end user used. */ product?:{/** Product type: agent, content or application. */ type:string;/** Product id, for example agent_123 or cnt_0123456789abcdef. */ id:string};/** How many times this end user was admitted to that product. */ count?:number;/** RFC 3339 time this end user was last admitted to that product. */ last_used_at?:string}>;/** Sign-ins of this end user, newest first; present only when expand asked for sign_ins. */ sign_ins?:Array<{/** Sign-in id (csi_…) that its tokens renew and that the sign-out act ends. */ id?:string;/** The resource scopes this sign-in may reach, recorded at issue time. */ resources?:Array<{/** Scope in the form <type>:<id>:<action> — agent:<id>:chat, content:<id>:play or application:<id>:visit — where <id> may be * for every object of that type. e.g. "content:cnt_0123456789abcdef:play" */ scope?:string;/** Product-defined data for this grant, for example an agent version or a budget; this service stores it and never interprets it. */ params?:Record<string,unknown>}>;/** Page origin this sign-in is bound to, or null when it was not bound. */ origin?:string|null;/** RFC 3339 time this sign-in started. */ created_at?:string;/** RFC 3339 time this sign-in ends; a renewal of its tokens never extends it. */ expires_at?:string;/** RFC 3339 time this sign-in was revoked, or null while it is live. */ revoked_at?:string|null}>;/** Usage recorded for this end user; present only when expand asked for usage. */ usage?:{/** Object type, always customer.usage. */ type?:"customer.usage";/** The end user this usage belongs to. */ customer_id?:string;/** Total recorded cost over the window (or over everything when no window was sent). */ total?:{/** Amount as a decimal string in the currency's smallest written form, for example 12.340000; never a float and never arithmetic on the client. */ amount?:string;/** Currency of the amount; platform usage is charged in USD. */ currency?:string};/** The recorded cost split by the product that incurred it. */ by_product?:Array<{/** The product the cost belongs to. */ product?:{/** Product type: agent, content or application. */ type:string;/** Product id, for example agent_123 or cnt_0123456789abcdef. */ id:string};/** Cost recorded for that product. */ cost?:{/** Amount as a decimal string in the currency's smallest written form, for example 12.340000; never a float and never arithmetic on the client. */ amount?:string;/** Currency of the amount; platform usage is charged in USD. */ currency?:string}}>;/** The recorded cost split by day. */ by_day?:Array<{/** Day the cost was recorded, as an ISO date such as 2026-11-17. */ date?:string;/** Cost recorded on that day. */ cost?:{/** Amount as a decimal string in the currency's smallest written form, for example 12.340000; never a float and never arithmetic on the client. */ amount?:string;/** Currency of the amount; platform usage is charged in USD. */ currency?:string}}>}}>;/** Cursor to send as page_token for the next page, or null when this is the last page. */ next_page?:string|null}>;

参数

名称位置类型必填说明
page_sizequerynumber否Maximum end users in one page, from 1 to 100; defaults to 50.
page_tokenquerystring否next_page from the preceding list response with the same filters; omit for the first page.
typequery“identified” | “anonymous”否Only end users of this kind; identified for people who signed in through a grant code, anonymous for visitors admitted with a publishable key. Omit for both.
blockedqueryboolean否true for blocked end users only, false for end users who are not blocked; omit for both.
resourcequerystring否Only end users of one product, as <type>:<id>, for example content:cnt_0123456789abcdef, agent:agent_123 or application:app_456.
qquerystring否Only end users whose customer id starts with this prefix, for example cus_; omit for every id.

响应

状态码内容类型说明
200application/jsonOne page of end users, most recently seen first, with each one’s product use.
400application/jsonINVALID_PARAMS: the request is not shaped the way this face accepts — an unknown or misspelled field, a repeated query parameter, a resource scope not in the form <type>:<id>:<action>, an expand value that is not products, sign_ins or usage, or a confirm that does not repeat the path customer id. The error names the field at fault and what it accepts; correct that field and send the request again.
401application/jsonThe credential is missing, malformed or expired. Merchant routes answer UNAUTHENTICATED when the API key or session names no organization; the pre-auth doors answer GRANT_CODE_INVALID when a grant code is unknown, already used, expired or foreign, and ACCESS_TOKEN_EXPIRED when the end-user token cannot be verified (a sign-in that is over answers SIGN_IN_EXPIRED or SIGN_IN_REVOKED). Send a valid API key, request a fresh grant code, or sign the end user in again.
502application/jsonUPSTREAM_UNAVAILABLE: the token issuer or another dependency refused the call, so nothing was issued or changed. Retry later, and if it persists report the time and the request path.
503application/jsonUPSTREAM_UNAVAILABLE: this face is not usable in this environment — the CUSTOMER service binding is unwired, or the anonymous rate limiter is unavailable or misconfigured so the door fails closed. Use an environment where the face is wired, or retry when the dependency is back.