Creates API keys in batches.
Operation description
Each cluster can have a maximum of three manually created backups at the same time.
If the error message
Exceeding the daily backup times of this DB clusteris returned, three manually created backups already exist in your cluster. Delete backups before calling this operation.After you call this operation, a backup task is created in the background. If the data volume is large, the backup may take a long time. Wait until the backup is complete.
Try it now
Test
RAM authorization
Request syntax
POST HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| GwClusterId |
string |
Yes |
The gateway instance ID. |
pg-xxxxxxxx |
| Count |
integer |
No |
The number of user API keys. |
1 |
| ConsumerGroupId |
string |
No |
The user group ID. |
cg-xxxxxx |
| ClientToken |
string |
No |
The client token that is used to ensure the idempotency of the request and prevent repeated submissions. The token is generated by the client and must be unique among different requests. The token is case-sensitive and cannot exceed 64 ASCII characters in length. |
6000170000591aed949d0f5******************** |
| CreditToken |
string |
No |
The redemption code. If specified, the recharge-type activation branch is used, and the count and quota are populated from the database. |
"9" |
| Description |
string |
No |
The consumer description prefix. |
myapp |
| RegionId |
string |
Yes |
The region ID. |
cn-beijing |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| RequestId |
string |
Id of the request |
A7E6A8FD-C50B-46B2-BA85-D8B8D3****** |
| TotalRecordCount |
integer |
The total number of records. |
2 |
| PageRecordCount |
integer |
The number of records on the current page. |
1 |
| PageNumber |
integer |
The page number. Default value: 1. |
1 |
| PageSize |
integer |
The number of records per page. Valid values:
Default value: 30. |
30 |
| TotalPages |
integer |
The total number of pages. |
1 |
| Items |
array<object> |
The list of consumer objects. |
|
|
object |
The consumer object. |
||
| ConsumerId |
string |
The user ID. |
c-mqveroemc*** |
| Name |
string |
The name. |
test |
| ConsumerGroupId |
string |
The user group ID. |
cg-xxxxxx |
| ConsumerTag |
string |
The consumer tag. |
test |
| ApiKey |
string |
The full API key. Returned only in this response. |
xxxxxxxx |
| GwClusterId |
string |
The gateway instance ID. |
pg-xxxxxxxxxx |
| ApiStatus |
string |
The API key status. Default value: Active. |
Active |
| ApiKeyStatus |
string |
The status of the API key. Default value: Active. |
Active |
| Status |
string |
The consumer status. Default value: Enabled. |
Enabled |
| GmtCreated |
string |
The creation time. |
2024-10-16 16:46:20 |
| GmtModified |
string |
The last modification time. |
2026-01-04T16:09:29+08:00 |
| Description |
string |
The application description or remarks. |
myapp |
| ApiKeyMd5 |
string |
The MD5 hash of the API key. |
0769a11c2d474f96fbb527f8e273d3de |
| BudgetPolicyId |
string |
The budget policy ID. Each key has an independent budget policy. |
023aacc1effc4b56bb154bfbec6ba9** |
| BudgetLimit |
integer |
The budget limit, which equals the number of credits per package. |
3000 |
| BudgetUsed |
integer |
The used quota. |
0 |
| ExpireTime |
string |
The expiration time. |
2025-06-25T09:37:10Z |
| Active |
boolean |
Indicates whether the key is active. |
true |
| Expired |
boolean |
Indicates whether the key is expired. |
false |
Examples
Success response
JSON format
{
"RequestId": "A7E6A8FD-C50B-46B2-BA85-D8B8D3******",
"TotalRecordCount": 2,
"PageRecordCount": 1,
"PageNumber": 1,
"PageSize": 30,
"TotalPages": 1,
"Items": [
{
"ConsumerId": "c-mqveroemc***",
"Name": "test",
"ConsumerGroupId": "cg-xxxxxx",
"ConsumerTag": "test",
"ApiKey": "xxxxxxxx",
"GwClusterId": "pg-xxxxxxxxxx",
"ApiStatus": "Active",
"ApiKeyStatus": "Active",
"Status": "Enabled",
"GmtCreated": "2024-10-16 16:46:20\n",
"GmtModified": "2026-01-04T16:09:29+08:00",
"Description": "myapp",
"ApiKeyMd5": "0769a11c2d474f96fbb527f8e273d3de",
"BudgetPolicyId": "023aacc1effc4b56bb154bfbec6ba9**",
"BudgetLimit": 3000,
"BudgetUsed": 0,
"ExpireTime": "2025-06-25T09:37:10Z",
"Active": true,
"Expired": false
}
]
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.