Skip to content
中文

Revoke customer tokens

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

POST/agent/v1/agents/{agent_id}/customers/{customer_id}/revoke_tokens● 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

Ends every live sign-in of the customer, revoking each access token and closing its open event streams; the customer can sign in again right away. Returns the number of access tokens this request revoked; a repeat returns 0. Credential revocation failure returns 502; retry to finish. An unknown customer returns 404 CUSTOMER_NOT_FOUND.

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 -X POST https://api.deepraxis.com/agent/v1/agents/agent_123/customers/docs-sample/revoke_tokens \
  -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.post(
    f"{opts['base_url']}/v1/agents/agent_123/customers/docs-sample/revoke_tokens",
    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/revoke_tokens`, {
  method: "POST",
  headers: { Authorization: `Bearer ${opts.apiKey}`, "Content-Type": "application/json" },
});
console.log(resp.status, await resp.json());

Response 200

{
  "revoked": 1
}

Response

HTTP 200

How many access tokens this request revoked.

application/json

Name Type Description
revoked integer Number of access tokens this request revoked; 0 when none was live.

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.