auth.v1.PolicyService
GetApiPolicy
Get an API key policy template by id.
Request
curl --request POST \ \
--url 'https://api.testnet.polyester.com/auth.v1.PolicyService/GetApiPolicy' \
--header 'Content-Type: application/json' \
--header 'Connect-Protocol-Version: 1' \
--data '{
"keyId": "ak_1a3c6de8153d5a5b04cd2a6529779542",
"policyId": "1"
}'Responses
{
"policy": {
"actions": [
"TRADE_SPOT"
],
"createdAt": "2025-01-01T00:00:00Z",
"description": "Allow market and account data reads.",
"id": "1",
"isTemplate": false,
"name": "Read-Only Analytics",
"revision": "1",
"sourceTemplateId": "1",
"spotMarketScope": "ALL",
"spotMarkets": [
{
"symbolId": 1
}
],
"updatedAt": "2025-01-01T00:00:00Z"
}
}auth.v1.GetApiPolicyRequestauth.v1.GetApiPolicyResponsePolicy identifier (opaque ID).
Optional API key context for delegated administration. When omitted, the policy must be owned by the caller's root account.
Policy identifier (opaque ID).
Human-readable policy name.
Optional policy description for dashboards and audits.
Stable numeric pair ID.
High-level actions enabled for this API key. Up to 64 unique explicit actions may be returned.
Market-level scope for spot markets. When ALL, spot_markets is returned for display only and is not enforced.
When true, this policy is intended to be reused as a template across multiple API keys. When false, it represents a single-key instance.
Optional source template this policy was copied from (opaque ID). This is audit metadata only and does not imply live linkage.
Creation time in UTC.
Last update time in UTC.
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. |