PolicyService
Set Subaccount Policy
Attach or clear a sub-account policy for the target sub-account.
Method
PATCH
Path
/v1/auth/subaccounts/{subaccount_id}/policy
Visibility
Authentication
Session token
MFA Requirement
PATCH
/v1/auth/subaccounts/{subaccount_id}/policy Request
Testnet
curl --request PATCH \ \
--url 'https://api.testnet.polyester.com/v1/auth/subaccounts/45LUmqjT/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": "2"
}'Responses
{} subaccount_id string (int64)
Sub-account identifier (opaque ID).
policyId string (int64)
Policy template to attach (opaque ID). A value of 0 clears the explicit binding and restores the system Read Only policy.
| 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. |