QuickSwapBrokerService
Create API key
Create a broker API key; its token is shown once.
Method
POST
Path
/v1/quickswap/brokers/{broker}/keys
Visibility
Authentication
Session token
MFA Requirement
Not required
POST
/v1/quickswap/brokers/{broker}/keys Request
Testnet
curl --request POST \ \
--url 'https://api.testnet.polyester.com/v1/quickswap/brokers/value/keys' \
--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 '{
"label": "Name Of My Subaccount"
}'Responses
{
"key": {
"active": false,
"createdAt": "2025-01-01T00:00:00Z",
"createdByAccountId": "7563897446546",
"expiresAt": "2025-01-01T00:00:00Z",
"keyId": "3f9c2a7b5d1e4f8a9b0c6d2e7f1a3b5c",
"label": "Name Of My Subaccount",
"revokedAt": "2025-01-01T00:00:00Z",
"rotatedFrom": "value"
},
"token": "qsk_3f9c2a7b5d1e4f8a9b0c6d2e7f1a3b5c_8e1d4b7a2c9f6e3d0b5a8c1f4e7d2a9b6c3f0e5d8a1b4c7e2f9d6a3b0c5e8f1d4a"
} broker string
Broker name.
label string
Label, 1 to 64 characters without leading or trailing whitespace.
8 fields
active boolean
Whether the key works now: neither revoked nor past expires_at.
Example
false createdAt string (date-time)
When the key was created.
Example
2025-01-01T00:00:00Z createdByAccountId string
Public account ID of the member who created the key; 0 for a key that a key created by rotating itself.
Example
7563897446546 expiresAt string (date-time)
End of the key's rotation overlap; the key stops working then. Unset while the key works until revoked.
Example
2025-01-01T00:00:00Z keyId string
Public key ID: the part of the token between "qsk_" and the second "_".
Example
3f9c2a7b5d1e4f8a9b0c6d2e7f1a3b5c label string
Label given at creation; empty for a key created by rotation.
Example
Name Of My Subaccount revokedAt string (date-time)
When the key was revoked; unset while not revoked.
Example
2025-01-01T00:00:00Z rotatedFrom string
Key this key replaced by rotation; empty otherwise.
Example
value token string
Bearer token qsk_<key id>_<secret>. Store it as a server secret.
Example
qsk_3f9c2a7b5d1e4f8a9b0c6d2e7f1a3b5c_8e1d4b7a2c9f6e3d0b5a8c1f4e7d2a9b6c3f0e5d8a1b4c7e2f9d6a3b0c5e8f1d4a| 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. |