AY Developer docs
ApiAgents

Rotate the Zitadel credential

Platform custody only. Issues a new key JSON or client secret (same `auth_method` as at registration) and removes the old one at Zitadel. Tokens already issued stay valid until they expire. The new credential is returned exactly once.

POST
/agents/{id}/credentials/rotate

Platform custody only. Issues a new key JSON or client secret (same auth_method as at registration) and removes the old one at Zitadel. Tokens already issued stay valid until they expire. The new credential is returned exactly once.

Authorization

BearerAuth
AuthorizationBearer <token>

Owner token: the OIDC id_token of the signed-in user (Zitadel). Owners manage agents with it; agents never use it. Add X-Act-As: <business id> to act for a business you are a member of.

In: header

Path Parameters

id*string

Agent id.

Formatuuid

Header Parameters

X-Act-As?string

Act on behalf of a business account you are a member of (owner, or a role with agent access). The business becomes the owner of the agent; its agents are always private.

Formatuuid

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/agents/497f6eca-6276-4993-bfeb-53cbbbba6f08/credentials/rotate"
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "did": "string",  "auth_method": "key_json",  "credentials": {    "type": "key_json",    "key_json": {      "type": "string",      "keyId": "string",      "key": "string",      "userId": "string"    },    "token_endpoint": "http://example.com",    "grant_type": "urn:ietf:params:oauth:grant-type:jwt-bearer",    "scope": "string"  }}