Update a Portfolio API key using a JSON body. Main User Level key with TRADE required.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Updates an existing Portfolio API key's label, IP whitelist or permissions. It does not change the key's Portfolio scope or reveal its Secret Key.
API key access
Requires a signed LTP Open API request with TRADE permission on the calling key.
| API key type | Can call | Scope |
|---|---|---|
| Main User Level API key (also the Main Portfolio key) | Yes | API keys for RapidX Portfolios under the main user. |
| Sub-user Level API key | No | This Open API endpoint does not support Sub-user Level keys. |
| Sub Portfolio Level API key | No | TRADE on a Sub Portfolio key does not grant API key management access. |
Client UI access and Open API access are different. A sub-user's ability to manage an assigned Portfolio's keys in the client does not allow their Sub-user Level key to call this endpoint. See API Management.
Sub-user Level keys do not support TRADE and cannot use this endpoint.
Rate limit
3 requests per 10 seconds.
Request body
Send parameters as a JSON body with Content-Type: application/json.
| Name | Type | Required | Description |
|---|---|---|---|
portfolioId | integer (int64) | Yes | RapidX Portfolio ID under the main user. This is not a user UID or a DMA account ID. |
portfolioApiKey | string | Yes | The target key's accessKey, returned by creation or listing. This is not the caller key used to sign the request. |
apiName | string | No | API key label, up to 20 characters. |
ip | string | No | IP whitelist: up to 20 addresses, comma-separated. Keys with TRADE or WITHDRAW require a configured whitelist. |
permission | string | No | Permissions to assign to the target key, comma-separated: READ, TRANSFER, WITHDRAW, TRADE. Send the desired permission set explicitly. |
Target key permissions
The request's permission field configures the target key. It is separate from the calling key's TRADE permission required to use this endpoint.
| Value | Meaning |
|---|---|
READ | Read data within the target key's scope. Always enabled. |
TRANSFER | Transfer assets within the target key's permitted scope. |
WITHDRAW | Withdraw assets to permitted external addresses. |
TRADE | Place and manage RapidX orders for the target Portfolio. |
A main user can grant WITHDRAW to a Sub Portfolio key. Sub-users cannot grant it when creating or editing keys in the client, and their Sub-user Level keys cannot call this Open API endpoint.
For a Sub Portfolio key, withdrawal destinations are the account's withdrawal whitelist, not an assigned sub-user's address subset. See API Management for scope restrictions.
A key with TRADE or WITHDRAW must have an IP whitelist. A read-only key may have an empty whitelist. READ cannot be removed.
Response fields
| Field | Type | Description |
|---|---|---|
code | integer | Application result code. 200 means success. |
message | string | Result message. |
data | object | The key configuration after this operation. |
Key result: data
data| Field | Type | Description |
|---|---|---|
data.portfolioId | integer (int64) | Portfolio identifier. Preserve the full integer value. |
data.apiName | string | Key label. |
data.accessKey | string | The key identifier; use it as portfolioApiKey when filtering, updating or deleting. |
data.status | integer | 1 = Normal; 2 = Frozen. |
data.ip | string | Comma-separated IP whitelist; empty string means no IP restriction. |
data.permission | string | Granted permissions, comma-separated. |
data.createdAt | integer (int64) | Creation time, Unix timestamp in milliseconds. |
data.updatedAt | integer (int64) | Last update time, Unix timestamp in milliseconds. |
Example request
{
"portfolioId": 2154503491108165,
"portfolioApiKey": "EXAMPLE_ACCESS_KEY",
"apiName": "ExampleKeyUpdated",
"ip": "203.0.113.10",
"permission": "READ,WITHDRAW"
}The 200 response example shows the successful response structure. Credentials in examples are placeholders.
Error responses
Check the application code even when the HTTP status is 200.
| Code | Meaning / action |
|---|---|
2003 | Permission denied. The calling key type is not supported by this endpoint. |
2004 | The calling key lacks TRADE. Sub-user Level keys cannot be granted this permission and are not supported. |
500003 | apiName exceeds 20 characters. Shorten the label. |
See Error codes for common authentication and request errors.
