跳转到内容
EN

Unblock an end user

Code Mode: praxis.customer.customers.unblock

HTTP: POST /customer/v1/customers/{customer_id}/unblock

Lift a block from one end user, so the products accept its grant codes, sign-ins, renewals and new sessions again. Tokens that were revoked to enforce the block are not restored: the end user signs in again for a fresh sign-in. Unblocking an end user that is not blocked is idempotent and returns it unchanged. An unknown or foreign id answers 404 CUSTOMER_NOT_FOUND.

签名

praxis.customer.customers.unblock(args:{path:{customer_id:string}}):Promise<{/** 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}}>}}>;

参数

名称位置类型必填说明
customer_idpathstring是End-user id from customers.list or customers.get; an id of another organization answers CUSTOMER_NOT_FOUND.

响应

状态码内容类型说明
200application/jsonThe end user with no block fact.
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.
404application/jsonCUSTOMER_NOT_FOUND: no end user of this organization has that id, or the id belongs to another organization; a deleted key answers the same way. Read the current id from customers.list (or publishable_keys.list for a key) and retry with that; never construct an id.
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.