PolicyService
Set API Key Policy
Attach or clear an API key policy for the target key.
Method
PATCH
Path
/v1/auth/api-keys/{key_id}/policy
Visibility
Authentication
Session token
MFA Requirement
PATCH
/v1/auth/api-keys/{key_id}/policy Request
Testnet
curl --request PATCH \ \
--url 'https://api.testnet.polyester.com/v1/auth/api-keys/ak_1a3c6de8153d5a5b04cd2a6529779542/policy' \
--header 'Accept: */*' \
--header 'X-API-KEY-ID: YOUR_API_KEY_ID' \
--header 'X-API-TIMESTAMP: YOUR_API_TIMESTAMP' \
--header 'X-API-SIGNATURE: YOUR_API_SIGNATURE' \
--header 'Content-Type: application/json' \
--data '{
"policyId": "1"
}'Responses
{} key_id string
Opaque API key identifier, formatted as "ak_" followed by 32 lowercase hex characters.
policyId string (int64)
Policy template to attach (opaque ID). A value of 0 clears the binding. An API key without an attached policy has no permissions.
| Key | Status | Error | When |
|---|---|---|---|
| unauthenticated | 401 | Unauthenticated | Authentication required. |
| permission-denied | 403 | Permission Denied | Permission denied. |
| invalid-argument | 400 | Invalid Argument | Invalid argument. |
| not-found | 404 | Not Found | Not found. |
| unavailable | 503 | Unavailable | Service unavailable. |