Sub-users
Create, list, change, suspend and delete sub-users, and manage their invitations and regions, with the Sub-user API.
These endpoints manage the sub-users themselves. To give a sub-user access to buckets, see Bucket policy rules and Inline policies. To manage its keys, see Access keys.
Paths are relative to https://cli.zata.ai/cli/v1. {subuserId} is the sub-user's KC_id, which the create and list responses return. Python examples use the call() helper from Authentication.
| Method | Path | What it does |
|---|---|---|
POST | /subusers/register | Create a sub-user |
GET | /subusers/parent/me | List your sub-users |
GET | /subusers/{subuserId} | Get one sub-user |
PUT | /subusers/{subuserId} | Change its description or email |
DELETE | /subusers/{subuserId} | Delete it for good |
POST | /subusers/{subuserId}/suspend | Suspend or reactivate it |
POST | /subusers/{subuserId}/invitations/resend | Send a new invitation email |
POST | /subusers/{subuserId}/invitations/revoke | Cancel a pending invitation |
POST | /subusers/{subuserId}/regions | Add a region |
DELETE | /subusers/{subuserId}/regions/{region} | Remove a region |
Create a sub-user
/subusers/registerCreates a sub-user in one or more regions, with one access key in each. The secret keys are in this response only, so store them now.
Choose the kind of sub-user with mode:
"programmatic": keys only, no console sign-in. It is active at once.- anything else, or no
mode: a console user. Zata emails an invitation, and the sub-user stays suspended (its keys don't work) until it accepts. See Invitations.
Body
| Field | Type | Required | Description |
|---|---|---|---|
username | string | Yes | 1-64 characters: letters, digits, ., _ and -. Zata adds your account's prefix (sub + the last four characters of your account id + -) if it is missing. The prefix counts towards the 64. |
regions | array of strings | Yes | At least one region: idr01, bom01. |
mode | string | No | programmatic, or leave it out for a console user. |
email | string | For console users | Where the invitation goes. Ignored for programmatic, where Zata makes one from your own address (you+<username>@example.com). |
description | string | No | Up to 500 characters. |
- 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 '{"username": "backup-job", "mode": "programmatic", "regions": ["idr01"], "description": "Nightly backups"}' \
"https://cli.zata.ai/cli/v1/subusers/register"
status, body = call("POST", "/subusers/register", {
"username": "backup-job",
"mode": "programmatic",
"regions": ["idr01"],
"description": "Nightly backups",
})
SUBUSER_ID = body["subuser"]["KC_id"]
201 Created
{
"message": "Subuser created successfully",
"subuser": {
"KC_id": "5f2c8a1e-0000-4000-8000-000000000001",
"username": "sub0abc-backup-job",
"description": "Nightly backups",
"regions": ["idr01"],
"status": "active",
"suspendedRegions": [],
"invitationStatus": "accepted",
"createdAt": "2026-11-25T10:15:00.000Z"
},
"credentials": {
"accessKey": "EXAMPLEACCESSKEY0002",
"secretKey": "EXAMPLEsecretKEY000000000000000000000002"
},
"credentialsByRegion": {
"idr01": {
"accessKey": "EXAMPLEACCESSKEY0002",
"secretKey": "EXAMPLEsecretKEY000000000000000000000002"
}
}
}
credentials is the key of the first region. credentialsByRegion has one key per region.
Errors
| Status | Code | When |
|---|---|---|
| 400 | (none) | A field is missing or invalid, for example a bad username, email or region. error says which. |
| 400 | SUBUSER_LIMIT_REACHED | You already have the maximum number of sub-users (5 by default). |
| 400 | USERNAME_TOO_LONG | programmatic only: the generated email would be too long. error says how many characters you can use. |
| 400 | REGION_NOT_ALLOWED, REGION_NO_SUBUSERS | The region is not available for sub-users. |
| 400 | PARENT_EMAIL_MISSING, PARENT_NOT_PROVISIONED | Your account is not fully set up. Sign in to the console once, then retry. |
| 409 | (varies) | The username or email can't be used, or the sub-user already exists in a region. error says which. |
| 409 | SUBUSER_CREATE_BUSY | Another sub-user is being created for your account. Retry in a moment. |
| 502 | IDENTITY_PROVIDER_ERROR, STORAGE_PROVISION_FAILED | Zata could not set the sub-user up. Nothing was kept; retry. |
List your sub-users
/subusers/parent/meLists your sub-users, newest first, up to 100. me stands for your own account. Each sub-user includes the buckets it can reach (shared_buckets), with the type of each access rule: bucket_policy or inline.
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
status | string | No | active or suspended. |
region | string | No | Only sub-users in 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/parent/me?status=active"
status, body = call("GET", "/subusers/parent/me?status=active")
for s in body["subusers"]:
print(s["KC_id"], s["username"], s["status"])
200 OK
{
"count": 1,
"subusers": [
{
"KC_id": "5f2c8a1e-0000-4000-8000-000000000001",
"username": "sub0abc-backup-job",
"description": "Nightly backups",
"regions": ["idr01"],
"status": "active",
"suspendedRegions": [],
"invitationStatus": "accepted",
"invitedAt": null,
"invitationExpiresAt": null,
"invitationAcceptedAt": null,
"createdAt": "2026-11-25T10:15:00.000Z",
"updatedAt": "2026-11-25T10:15:00.000Z",
"shared_buckets_count": 1,
"shared_buckets": [
{
"id": "c3a9f6d1-0000-4000-8000-000000000003",
"bucket": "reports",
"region": "idr01",
"resources": null,
"permission_preset": "view",
"conditions": null,
"status": "active",
"createdAt": "2026-11-25T10:20:00.000Z",
"updatedAt": "2026-11-25T10:20:00.000Z",
"type": "bucket_policy"
}
]
}
]
}
Errors: none specific to this endpoint.
Get a sub-user
/subusers/{subuserId}Returns one sub-user, with its invitation details and its owner (parent).
Path parameters
| Name | Description |
|---|---|
subuserId | The sub-user's KC_id. |
- 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"
status, body = call("GET", f"/subusers/{SUBUSER_ID}")
200 OK
{
"KC_id": "5f2c8a1e-0000-4000-8000-000000000001",
"parent_KC_id": "9f8e7d6c-0000-4000-8000-000000000abc",
"username": "sub0abc-backup-job",
"description": "Nightly backups",
"regions": ["idr01"],
"status": "active",
"suspendedRegions": [],
"invitationStatus": "accepted",
"invitedAt": null,
"invitationSendCount": 0,
"invitationExpiresAt": null,
"invitationAcceptedAt": null,
"createdAt": "2026-11-25T10:15:00.000Z",
"updatedAt": "2026-11-25T10:15:00.000Z",
"parent": {
"KC_id": "9f8e7d6c-0000-4000-8000-000000000abc",
"name": "Your Name",
}
}
Errors
| Status | Code | When |
|---|---|---|
| 404 | (none) | "Subuser not found", for example when {subuserId} is your own account id. |
Change a sub-user
/subusers/{subuserId}Changes the description, the email, or both. A new email resets the invitation to pending and sends an invitation to the new address, also for a programmatic sub-user. That gives the sub-user a way to set a console password. If it had already accepted, its current password keeps working until it uses the new link. Each sub-user gets at most 3 invitation emails in total.
Path parameters
| Name | Description |
|---|---|
subuserId | The sub-user's KC_id. |
Body
| Field | Type | Required | Description |
|---|---|---|---|
description | string or null | No | New description. null clears it. |
email | string | No | New email address. Stored in lower case. |
Send at least one field.
- curl
- Python
curl --aws-sigv4 "aws:amz:us-east-1:zata" \
--user "$ZATA_ACCESS_KEY:$ZATA_SECRET_KEY" \
-H "Content-Type: application/json" \
-X PUT --data '{"description": "Nightly and weekly backups"}' \
"https://cli.zata.ai/cli/v1/subusers/$SUBUSER_ID"
status, body = call("PUT", f"/subusers/{SUBUSER_ID}", {"description": "Nightly and weekly backups"})
200 OK
{
"message": "Subuser updated successfully",
"subuser": {
"KC_id": "5f2c8a1e-0000-4000-8000-000000000001",
"username": "sub0abc-backup-job",
"description": "Nightly and weekly backups",
"regions": ["idr01"],
"status": "active",
"invitationStatus": "accepted",
"updatedAt": "2026-11-25T11:00:00.000Z"
}
}
Errors
| Status | Code | When |
|---|---|---|
| 400 | (none) | "Invalid email address", or "No valid updates provided". |
| 404 | (none) | "Subuser not found". |
| 409 | DUPLICATE_EMAIL | The email can't be used. Choose a different one. |
| 429 | INVITATION_SEND_LIMIT_REACHED | The sub-user already got 3 invitation emails. |
| 502 | EMAIL_UPDATE_FAILED | The email could not be changed. Retry. |
Delete a sub-user
/subusers/{subuserId}Deletes the sub-user for good, in every region: its inline policies, its bucket policy rules, its keys and its sign-in. This cannot be undone. If storage cannot remove the sub-user, nothing is deleted and you can retry.
Path parameters
| Name | Description |
|---|---|
subuserId | The sub-user's KC_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"
status, body = call("DELETE", f"/subusers/{SUBUSER_ID}")
200 OK
{
"message": "Subuser permanently deleted",
"KC_id": "5f2c8a1e-0000-4000-8000-000000000001",
"policy_cleanup": {
"buckets_scanned": 2,
"buckets_modified": 1,
"statements_removed": 1
}
}
partialSuccess: true is added when the sub-user is gone but a final clean-up step failed.
Errors
| Status | Code | When |
|---|---|---|
| 404 | (none) | "Subuser not found". |
| 500 | INLINE_POLICY_REVOKE_FAILED | Its inline policies could not be removed. Nothing was deleted. Retry. |
| 500 | (none) | Its bucket policy rules could not be removed. Nothing was deleted. Retry. |
| 502 | STORAGE_DELETION_FAILED | Storage could not remove the sub-user. It was not deleted. Retry. |
Suspend or reactivate a sub-user
/subusers/{subuserId}/suspendSuspends the sub-user, or reactivates it, in all of its regions or only some. A suspended sub-user's keys stop working in that region. The sub-user gets a notification and an email.
An empty body suspends: suspended defaults to true. The string "false" also suspends. To reactivate, send the JSON boolean false.
Reactivating also makes the keys of a console sub-user work before it has accepted its invitation. Sign-in still needs the invitation.
Path parameters
| Name | Description |
|---|---|
subuserId | The sub-user's KC_id. |
Body
| Field | Type | Required | Description |
|---|---|---|---|
suspended | boolean | No | true (default) to suspend, false to reactivate. |
regions | array of strings | No | Only these regions. They must be regions of the sub-user. Leave out for all regions. |
- 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 '{"suspended": false}' \
"https://cli.zata.ai/cli/v1/subusers/$SUBUSER_ID/suspend"
status, body = call("POST", f"/subusers/{SUBUSER_ID}/suspend", {"suspended": False})
200 OK
{
"message": "Subuser activated",
"KC_id": "5f2c8a1e-0000-4000-8000-000000000001",
"status": "active",
"regions": ["idr01"],
"suspendedRegions": []
}
status is suspended only when every region is suspended. A call that changes nothing answers the same way.
Errors
| Status | Code | When |
|---|---|---|
| 400 | REGION_NOT_ASSIGNED | A region in regions is not one of the sub-user's. |
| 400 | (none) | regions is not a non-empty array. |
| 404 | (none) | "Subuser not found". |
| 502 | STORAGE_SUSPEND_FAILED | Storage could not change the state. Nothing changed. Retry. |
Resend the invitation
/subusers/{subuserId}/invitations/resendSends a new invitation email to a console sub-user. The old link stops working. Wait about 2 minutes between resends; each sub-user gets at most 3 invitation emails in total.
Path parameters
| Name | Description |
|---|---|
subuserId | The sub-user's KC_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/invitations/resend"
status, body = call("POST", f"/subusers/{SUBUSER_ID}/invitations/resend")
200 OK
{
"message": "Invitation resent",
"KC_id": "5f2c8a1e-0000-4000-8000-000000000001",
"invitationStatus": "pending",
"invitedAt": "2026-11-25T11:30:00.000Z",
"invitationExpiresAt": "2026-12-02T11:30:00.000Z",
"invitationSendCount": 2
}
Errors
| Status | Code | When |
|---|---|---|
| 404 | (none) | "Subuser not found". |
| 409 | INVITATION_ALREADY_ACCEPTED | The sub-user already accepted. Always the case for a programmatic sub-user. |
| 429 | RESEND_COOLDOWN | Too soon after the last email. The body has retryAfterSeconds. |
| 429 | INVITATION_SEND_LIMIT_REACHED | The sub-user already got 3 invitation emails. |
Revoke the invitation
/subusers/{subuserId}/invitations/revokeCancels a pending invitation. The emailed link stops working at once. Revoking twice is not an error.
Path parameters
| Name | Description |
|---|---|
subuserId | The sub-user's KC_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/invitations/revoke"
status, body = call("POST", f"/subusers/{SUBUSER_ID}/invitations/revoke")
200 OK
{
"message": "Invitation revoked",
"KC_id": "5f2c8a1e-0000-4000-8000-000000000001",
"invitationStatus": "revoked"
}
If it was already revoked, message is "Invitation already revoked".
Errors
| Status | Code | When |
|---|---|---|
| 404 | (none) | "Subuser not found". |
| 409 | INVITATION_ALREADY_ACCEPTED | The sub-user already accepted. |
Add a region
/subusers/{subuserId}/regionsAdds a region to the sub-user and creates its access key there. The secret key is in this response only. A sub-user that is suspended, or has not accepted its invitation, is added suspended in the new region too.
Path parameters
| Name | Description |
|---|---|
subuserId | The sub-user's KC_id. |
Body
| Field | Type | Required | Description |
|---|---|---|---|
region | string | Yes | The region to add: idr01 or bom01. |
- 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": "bom01"}' \
"https://cli.zata.ai/cli/v1/subusers/$SUBUSER_ID/regions"
status, body = call("POST", f"/subusers/{SUBUSER_ID}/regions", {"region": "bom01"})
201 Created
{
"message": "Subuser added to region bom01",
"KC_id": "5f2c8a1e-0000-4000-8000-000000000001",
"status": "active",
"regions": ["idr01", "bom01"],
"credentials": {
"region": "bom01",
"accessKey": "EXAMPLEACCESSKEY0003",
"secretKey": "EXAMPLEsecretKEY000000000000000000000003"
}
}
Errors
| Status | Code | When |
|---|---|---|
| 400 | (none) | region is missing or unknown. |
| 400 | REGION_NOT_ALLOWED, REGION_NO_SUBUSERS | The region is not available for sub-users. |
| 403 | SUBUSER_REGION_SELF_MANAGEMENT_FORBIDDEN | {subuserId} is your own account id. |
| 404 | (none) | "Subuser not found". |
| 409 | REGION_ALREADY_ASSIGNED | The sub-user is already in that region. |
| 409 | REGION_UPDATE_IN_PROGRESS | Another region change for this sub-user is running. Retry. |
| 409 | (varies) | The sub-user's email can't be used in that region, or the sub-user already exists there. error says which. |
| 502 | STORAGE_PROVISION_FAILED | The sub-user could not be set up in the region. Retry. |
Remove a region
/subusers/{subuserId}/regions/{region}Removes the sub-user from one region: its inline policy there, its bucket policy rules on that region's buckets, and its keys in that region. Its other regions are not touched. A sub-user must keep at least one region; to remove the last one, delete the sub-user.
Path parameters
| Name | Description |
|---|---|
subuserId | The sub-user's KC_id. |
region | The region to remove: idr01 or bom01. |
- 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/regions/bom01"
status, body = call("DELETE", f"/subusers/{SUBUSER_ID}/regions/bom01")
200 OK
{
"message": "Region bom01 removed from subuser",
"KC_id": "5f2c8a1e-0000-4000-8000-000000000001",
"regions": ["idr01"]
}
Errors
| Status | Code | When |
|---|---|---|
| 400 | LAST_REGION | It is the sub-user's only region. Delete the sub-user instead. |
| 403 | SUBUSER_REGION_SELF_MANAGEMENT_FORBIDDEN | {subuserId} is your own account id. |
| 404 | (none) | "Subuser not found", or the sub-user is not in that region. |
| 409 | REGION_UPDATE_IN_PROGRESS | Another region change for this sub-user is running. Retry. |
| 500 | INLINE_POLICY_REVOKE_FAILED | Its inline policy in the region could not be removed. Nothing was removed. Retry. |
| 502 | STORAGE_REMOVAL_FAILED | Storage could not remove the sub-user from the region. Retry. |