跳转到内容
EN

List publishable keys

Code Mode: praxis.customer.publishableKeys.list

HTTP: GET /customer/v1/publishable_keys

List the organization’s publishable keys, newest first, so you can see which anonymous admittance is open and what each one may reach. A publishable key is public by design (it ships in the browser page); use it from the Kit to admit anonymous visitors, and never expose an API key this way. The plaintext value is not in this list: it is returned once, by the create call, and only its hash is stored. page_size is 1 to 100 and defaults to 50; copy next_page into page_token until it is null.

签名

praxis.customer.publishableKeys.list(args?:{query?:{page_size?:number;page_token?:string}}):Promise<{/** The publishable keys of this page, newest first. */ data?:Array<{/** Object type, always customer_publishable_key. */ type?:"customer_publishable_key";/** Key id (pk_…) used by the key list and the delete call. */ id?:string;/** Label you gave the key, for example Storefront. */ name?:string;/** The resource scopes the key grants an anonymous visitor. */ 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>}>;/** RFC 3339 time the key was created; the key list is ordered by it, newest first. */ created_at?:string;/** Most exchanges this key allows per UTC minute, counting every exchange (a returning visitor's too), or null for no per-key limit; the per-IP limit of the exchan */ anon_rate_per_min?:number|null;/** Most new anonymous visitors this key admits per UTC day, or null for no limit; a returning visitor that continues with its continuation_token is not counted, an */ daily_session_cap?:number|null;/** The most the usage events of this key may cost in one UTC day, or null for no spend cap; once reached, every visitor is refused until 00:00 UTC and a running pr */ daily_spend_cap?:{/** Amount in major units of the currency as a decimal string with at most 2 decimals, for example 5.00 for five dollars; read back with exactly 2 decimals. e.g. "5.00" */ amount:string;/** Currency the amount is in, USD or CNY. e.g. "USD" */ currency:"USD"|"CNY"}|null;/** The plaintext key value, present only in the create response; every later read returns the key without it, because only its hash is stored. */ key?: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 keys in one page, from 1 to 100; defaults to 50.
page_tokenquerystring否next_page from the preceding key list response; omit for the first page.

响应

状态码内容类型说明
200application/jsonOne page of publishable keys, newest first, with the cursor for the next page.
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.