Access keys
List, create, rotate, deactivate and delete a sub-user's access keys with the Sub-user API.
These endpoints manage the S3 access keys of your sub-users. Your own keys can only be managed in the console: any of these paths with your own account id answers 403 CLI_ROOT_KEYS_DASHBOARD_ONLY.
Each key works in one region. A sub-user gets one key in each of its regions when you create it or add a region.
By default a sub-user can have 1 key per region, and it already has one. So to give a sub-user a new key pair, rotate the existing key. Creating a key only works in a region where the sub-user has no key, and a sub-user must always keep at least one key.
Paths are relative to https://cli.zata.ai/cli/v1. {subuserId} is the sub-user's KC_id. {keyId} is the key's id from List a sub-user's keys, not the access key itself. Python examples use the call() helper from Authentication.
| Method | Path | What it does |
|---|---|---|
GET | /subusers/{subuserId}/keys | List a sub-user's keys |
POST | /subusers/{subuserId}/keys | Create a key |
POST | /subusers/{subuserId}/keys/{keyId}/rotate | Replace a key with a new pair |
PATCH | /subusers/{subuserId}/keys/{keyId} | Turn a key off or back on |
DELETE | /subusers/{subuserId}/keys/{keyId} | Delete a key |
List a sub-user's keys
/subusers/{subuserId}/keysLists the sub-user's keys without their secret keys, and how many it may have (limits).
A key's status is active or inactive, or one of:
revoke_pending: Zata turned the key off, and storage has not yet confirmed its removal. It is removed automatically.rgw_only: a key found in storage that Zata did not create. It still works until you deactivate or delete it.
region_suspended: true means the sub-user is suspended in that key's region, so the key does not work there for now.
Path parameters
| Name | Description |
|---|---|
subuserId | The sub-user's KC_id. |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
region | string | No | Only keys of this region: idr01, bom01. |
- curl
- Python
curl --aws-sigv4 "aws:amz:us-east-1:zata" \
--user "$ZATA_ACCESS_KEY:$ZATA_SECRET_KEY" \
"https://cli.zata.ai/cli/v1/subusers/$SUBUSER_ID/keys?region=idr01"
status, body = call("GET", f"/subusers/{SUBUSER_ID}/keys?region=idr01")
KEY_ID = body["keys"][0]["id"]
200 OK
{
"KC_id": "5f2c8a1e-0000-4000-8000-000000000001",
"user_type": "subuser",
"limits": { "current": 1, "max": 1 },
"keys": [
{
"id": "b7d4e2f0-0000-4000-8000-000000000002",
"access_key": "EXAMPLEACCESSKEY0002",
"region": "idr01",
"status": "active",
"region_suspended": false,
"createdAt": "2026-11-25T10:15:00.000Z",
"owner_type": "subuser",
"owner_id": "5f2c8a1e-0000-4000-8000-000000000001"
}
]
}
imported_inactive is added when this read found keys in storage that Zata did not know about. They are listed as rgw_only.
Errors: none specific to this endpoint.
Create a key
/subusers/{subuserId}/keysCreates a new key for the sub-user in one region. The secret key is in this response only. With the default limit of 1 key per region this fails while the sub-user has a key in that region, active or not. To replace a key, rotate it instead.
Path parameters
| Name | Description |
|---|---|
subuserId | The sub-user's KC_id. |
Body
| Field | Type | Required | Description |
|---|---|---|---|
region | string | No | The exact region code, idr01 or bom01. Default idr01. Short forms such as idr are refused here. |
- curl
- Python
curl --aws-sigv4 "aws:amz:us-east-1:zata" \
--user "$ZATA_ACCESS_KEY:$ZATA_SECRET_KEY" \
-H "Content-Type: application/json" \
-X POST --data '{"region": "idr01"}' \
"https://cli.zata.ai/cli/v1/subusers/$SUBUSER_ID/keys"
status, body = call("POST", f"/subusers/{SUBUSER_ID}/keys", {"region": "idr01"})
201 Created
{
"message": "Key created successfully",
"KC_id": "5f2c8a1e-0000-4000-8000-000000000001",
"region": "idr01",
"credentials": {
"accessKey": "EXAMPLEACCESSKEY0004",
"secretKey": "EXAMPLEsecretKEY000000000000000000000004"
}
}
Errors
| Status | Code | When |
|---|---|---|
| 400 | (none) | "Key limit reached for idr01 (1/1)". Rotate the existing key instead. |
| 400 | (none) | "Invalid region", or "Cannot create keys for suspended subuser." (also for a console sub-user that has not accepted its invitation). |
| 400 | SUBUSER_REGION_MISMATCH | The sub-user is not in that region. Add the region first. |
| 409 | KEY_CREATE_BUSY | Another key is being created for this sub-user. Retry in a moment. |
Rotate a key
/subusers/{subuserId}/keys/{keyId}/rotateReplaces a key: Zata creates a new key pair in the same region, then deletes the old one. The old pair stops working. The new secret key is in this response only. The sub-user gets a notification. Only an active key can be rotated.
Path parameters
| Name | Description |
|---|---|
subuserId | The sub-user's KC_id. |
keyId | The key's id. |
- curl
- Python
curl --aws-sigv4 "aws:amz:us-east-1:zata" \
--user "$ZATA_ACCESS_KEY:$ZATA_SECRET_KEY" \
-X POST \
"https://cli.zata.ai/cli/v1/subusers/$SUBUSER_ID/keys/$KEY_ID/rotate"
status, body = call("POST", f"/subusers/{SUBUSER_ID}/keys/{KEY_ID}/rotate")
new_key = body["credentials"]
200 OK
{
"message": "Key rotated successfully",
"KC_id": "5f2c8a1e-0000-4000-8000-000000000001",
"old_key_id": "b7d4e2f0-0000-4000-8000-000000000002",
"region": "idr01",
"credentials": {
"accessKey": "EXAMPLEACCESSKEY0005",
"secretKey": "EXAMPLEsecretKEY000000000000000000000005"
}
}
Errors
| Status | Code | When |
|---|---|---|
| 400 | (none) | "Cannot rotate inactive key. Activate first." |
| 403 | (none) | "Key does not belong to this user": {keyId} is not a key of {subuserId}. |
| 404 | (none) | "Key not found". |
| 502 | KEY_REVOKE_FAILED | The new key was created and works, but storage did not confirm that the old one was removed. The old key is turned off and removed automatically. The body still has the new credentials: save them. |
Activate or deactivate a key
/subusers/{subuserId}/keys/{keyId}Turns a key off, or back on with the same access key and secret key. A deactivated key stops working but is not deleted, and still counts towards the key limit. The sub-user gets a notification when a key is deactivated.
Path parameters
| Name | Description |
|---|---|
subuserId | The sub-user's KC_id. |
keyId | The key's id. |
Body
| Field | Type | Required | Description |
|---|---|---|---|
active | boolean | Yes | false to deactivate, true to reactivate. |
- curl
- Python
curl --aws-sigv4 "aws:amz:us-east-1:zata" \
--user "$ZATA_ACCESS_KEY:$ZATA_SECRET_KEY" \
-H "Content-Type: application/json" \
-X PATCH --data '{"active": false}' \
"https://cli.zata.ai/cli/v1/subusers/$SUBUSER_ID/keys/$KEY_ID"
status, body = call("PATCH", f"/subusers/{SUBUSER_ID}/keys/{KEY_ID}", {"active": False})
200 OK
{
"message": "Key deactivated successfully",
"KC_id": "5f2c8a1e-0000-4000-8000-000000000001",
"key_id": "b7d4e2f0-0000-4000-8000-000000000002",
"status": "inactive"
}
Reactivating answers "message": "Key reactivated successfully", "status": "active" and the access_key. The secret key is never returned.
Errors
| Status | Code | When |
|---|---|---|
| 400 | (none) | "active must be a boolean", or "Key is already active". |
| 403 | (none) | "Key does not belong to this user". |
| 404 | (none) | "Key not found". |
| 409 | KEY_REVOKE_PENDING | The key is still being removed from storage. Try again in a few minutes. |
| 502 | KEY_REVOKE_FAILED | Storage did not confirm the key was turned off. If the body says "status": "revoke_pending", Zata finishes it automatically; otherwise retry. |
Delete a key
/subusers/{subuserId}/keys/{keyId}Deletes a key for good. Apps using it stop working. A sub-user must keep at least one key; to remove its last one, delete the sub-user. The sub-user gets a notification.
Path parameters
| Name | Description |
|---|---|
subuserId | The sub-user's KC_id. |
keyId | The key's id. |
- curl
- Python
curl --aws-sigv4 "aws:amz:us-east-1:zata" \
--user "$ZATA_ACCESS_KEY:$ZATA_SECRET_KEY" \
-X DELETE \
"https://cli.zata.ai/cli/v1/subusers/$SUBUSER_ID/keys/$KEY_ID"
status, body = call("DELETE", f"/subusers/{SUBUSER_ID}/keys/{KEY_ID}")
200 OK
{
"message": "Key deleted successfully",
"KC_id": "5f2c8a1e-0000-4000-8000-000000000001",
"key_id": "b7d4e2f0-0000-4000-8000-000000000002"
}
Errors
| Status | Code | When |
|---|---|---|
| 400 | LAST_SUBUSER_KEY | It is the sub-user's last key. |
| 403 | (none) | "Key does not belong to this user". |
| 404 | (none) | "Key not found". |
| 502 | KEY_REVOKE_FAILED | Storage did not confirm the removal. If the body says "status": "revoke_pending", the key is turned off and Zata removes it automatically; otherwise retry. |