API Keys
Set an API key's policies
Replaces the policies granted to an existing API key, changing what it may do without changing the key itself. The secret value is untouched, so every consumer keeps working. A recent two-factor re-verification is required, exactly as creating a key is.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://loading/accounts.v1.Accounts/SetAPIKeyPolicies" \ -H "Content-Type: application/json" \ -d '{ "apiKeyId": "CgsMDQ4PEBESExQVFhcYGQ==", "policies": [ "trading", "analytics", "csfloat-wallets" ] }'{
"apiKey": {
"id": "CgsMDQ4PEBESExQVFhcYGQ==",
"name": "CI deploy key",
"keyPrefix": "gm_live_8f3a",
"workspaceId": "AAECAwQFBgcICQoLDA0ODw==",
"createdAt": "2026-06-29T12:00:00Z",
"policies": [
"trading",
"analytics",
"csfloat-wallets"
]
}
}{
"code": "failed_precondition",
"message": "The request cannot be carried out in the current system state."
}{
"code": "unauthenticated",
"message": "The request lacks a valid API key in the Authorization header."
}{
"code": "permission_denied",
"message": "The API key is not allowed to perform this action on this workspace."
}{
"code": "not_found",
"message": "The requested resource does not exist in this workspace."
}{
"code": "resource_exhausted",
"message": "The request was rate limited. Slow down and retry later."
}{
"code": "internal",
"message": "An internal server error occurred."
}