auth.v1.ApiKeyService
UpdateApiKey
Update API key metadata and allowed status transitions. Revocation must use DeleteApiKey.
Request
curl --request POST \ \
--url 'https://api.testnet.polyester.com/auth.v1.ApiKeyService/UpdateApiKey' \
--header 'Content-Type: application/json' \
--header 'Connect-Protocol-Version: 1' \
--data '{
"apiKey": {
"color": "#7C3AED",
"expiresAt": "2025-01-01T00:00:00Z",
"icon": "💰",
"ipWhitelist": [
"value"
],
"label": "Name Of My Subaccount",
"status": "ACTIVE"
},
"expectedRevision": "1",
"keyId": "ak_1a3c6de8153d5a5b04cd2a6529779542",
"updateMask": {
"paths": [
"value"
]
}
}'Responses
{
"apiKey": {
"color": "#7C3AED",
"createdAt": "2025-01-01T00:00:00Z",
"createdByActor": "dashboard",
"expiresAt": "2025-01-01T00:00:00Z",
"icon": "💰",
"ipWhitelist": [
"203.0.113.0/24"
],
"keyId": "ak_1a3c6de8153d5a5b04cd2a6529779542",
"label": "Trading Bot",
"lastUsedAt": "2025-01-01T00:00:00Z",
"policyId": "1",
"publicKeyEd25519": "AA==",
"revision": "1",
"status": "ACTIVE",
"subaccountId": "6789012345678",
"updatedAt": "2025-01-01T00:00:00Z"
}
}auth.v1.UpdateApiKeyRequestauth.v1.UpdateApiKeyResponseOpaque API key identifier to update.
Human-friendly label for the key. Empty clears the label when selected. Must not contain '<' or '>'.
User-chosen icon/emoji for UI display. Empty clears the icon when selected.
User-chosen color token for UI display. Empty clears the color when selected.
New status. ACTIVE and DISABLED are allowed; revocation uses DeleteApiKey.
Complete replacement IP whitelist. Empty clears the restriction when selected.
Expiry time in UTC. When selected, omission or the epoch clears expiry.
The set of field mask paths.
Revision returned by the latest successful read.
Stable opaque identifier used to refer to this key, formatted as "ak_" followed by 32 lowercase hex characters.
Human-readable label for the key. Maximum length is 64 characters.
Optional user-chosen icon/emoji for UI display.
Optional user-chosen color token for UI display.
Optional CIDR whitelist. Empty means no IP restriction. Maximum 32 unique entries.
Current key status.
Optional sub-account this key is scoped to (opaque ID; empty = root-level).
Optional API policy attached to this key (opaque ID). Empty means no policy is attached and the key has no permissions.
Time in UTC when this key was created.
Approximate last time in UTC when this key authenticated a request, recorded at most about once a minute; it may lag recent use by a few minutes. Omitted when no use has been recorded.
Ed25519 public key bytes associated with this API key. The private key or seed is never returned by the API.
Optional expiry time in UTC. When set, the key cannot authenticate requests after this time, regardless of status.
Read-only actor label describing who created this key, such as a username or account label.
Time in UTC when this key's configuration was last changed. For the same key, later is fresher, equal is an idempotent replay, and earlier is stale. Equal timestamps with different configuration indicate an invariant failure. This is independent of last_used_at, which tracks authentication activity.
Monotonic resource revision used for conditional updates.
| Key | HTTP status | Connect code | Error | When |
|---|---|---|---|---|
| unauthenticated | 401 | unauthenticated | Unauthenticated | Authentication required. |
| permission-denied | 403 | permission_denied | Permission Denied | Permission denied. |
| invalid-argument | 400 | invalid_argument | Invalid Argument | Invalid argument. |
| not-found | 404 | not_found | Not Found | Not found. |
| unavailable | 503 | unavailable | Unavailable | Service unavailable. |