v1
latestOpenAPI 3.1.02026-07-267724480.0 KBUpdate an API key
Update an API key by sending its ID and editable fields in the JSON body. This endpoint behaves like a full update: send fields you want to preserve because omitted numeric, boolean, or string fields can be reset.
put/api/token/
Request body
Example request
{
"id": 1234,
"name": "production",
"status": 1,
"expired_time": -1,
"remain_quota": 100000,
"allow_ips": "198.51.100.10\n203.0.113.0/24\n2001:db8::/32"
}Response
Updated API key record.
Example response
{
"data": {
"id": 1234,
"user_id": 5678,
"key": "$COMETAPI_KEY",
"status": 1,
"name": "production",
"created_time": 1766102400,
"accessed_time": 1766102400,
"expired_time": -1,
"remain_quota": 100000,
"allow_ips": "198.51.100.10\n203.0.113.0/24\n2001:db8::/32"
}
}