Skip to content
中文

Revoke every token of an end user

Code Mode: praxis.customer.customers.revokeTokens

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

End every sign-in of one end user at once, everything of the organization’s, not one product’s and not one token’s. Use it when credentials may have leaked and the end user must not be trusted until it signs in again; a single sign-in is ended instead with praxis.customer.accessTokens.revoke. After it every token of that end user stops working and a new session or playback answers 401 SIGN_IN_REVOKED, while the end user itself stays in the directory and may sign in again. The response counts how many sign-ins were revoked. An unknown or foreign id answers 404 CUSTOMER_NOT_FOUND.

Signature

praxis.customer.customers.revokeTokens(args:{path:{customer_id:string}}):Promise<{/** Object type, always customer_tokens_revoked. */ type?:"customer_tokens_revoked";/** How many sign-ins were revoked. */ revoked?:number}>;

Parameters

NameInTypeRequiredDescription
customer_idpathstringyesEnd-user id from customers.list or customers.get; an id of another organization answers CUSTOMER_NOT_FOUND.

Responses

StatusContent typesDescription
200application/jsonHow many sign-ins were revoked; the end user stays in the directory.
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.