auth.v1.PolicyService
SetApiKeyPolicy
Attach or clear an API key policy for a key.
Method
POST
Path
auth.v1.PolicyService/SetApiKeyPolicy
Service
auth.v1.PolicyService
Visibility
Authentication
Session token
MFA Requirement
POST
auth.v1.PolicyService/SetApiKeyPolicy Request
Testnet
curl --request POST \ \
--url 'https://api.testnet.polyester.com/auth.v1.PolicyService/SetApiKeyPolicy' \
--header 'Content-Type: application/json' \
--header 'Connect-Protocol-Version: 1' \
--data '{
"keyId": "ak_1a3c6de8153d5a5b04cd2a6529779542",
"policyId": "1"
}'Responses
{}Request
auth.v1.SetApiKeyPolicyRequestResponse
auth.v1.SetApiKeyPolicyResponse keyId string
Opaque API key identifier, formatted as "ak_" followed by 32 lowercase hex characters.
policyId string (fixed64)
Policy template to attach (opaque ID). A value of 0 clears the binding. An API key without an attached policy has no permissions.
No response fields documented for this type.
| 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. |