Skip to main content
Sub-user API

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.

MethodPathWhat it does
POST/subusers/registerCreate a sub-user
GET/subusers/parent/meList 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}/suspendSuspend or reactivate it
POST/subusers/{subuserId}/invitations/resendSend a new invitation email
POST/subusers/{subuserId}/invitations/revokeCancel a pending invitation
POST/subusers/{subuserId}/regionsAdd a region
DELETE/subusers/{subuserId}/regions/{region}Remove a region

Create a sub-user​

POST/subusers/register

Creates 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

FieldTypeRequiredDescription
usernamestringYes1-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.
regionsarray of stringsYesAt least one region: idr01, bom01.
modestringNoprogrammatic, or leave it out for a console user.
emailstringFor console usersWhere the invitation goes. Ignored for programmatic, where Zata makes one from your own address (you+<username>@example.com).
descriptionstringNoUp to 500 characters.
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"
201 Created
{
"message": "Subuser created successfully",
"subuser": {
"KC_id": "5f2c8a1e-0000-4000-8000-000000000001",
"username": "sub0abc-backup-job",
"email": "[email protected]",
"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

StatusCodeWhen
400(none)A field is missing or invalid, for example a bad username, email or region. error says which.
400SUBUSER_LIMIT_REACHEDYou already have the maximum number of sub-users (5 by default).
400USERNAME_TOO_LONGprogrammatic only: the generated email would be too long. error says how many characters you can use.
400REGION_NOT_ALLOWED, REGION_NO_SUBUSERSThe region is not available for sub-users.
400PARENT_EMAIL_MISSING, PARENT_NOT_PROVISIONEDYour 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.
409SUBUSER_CREATE_BUSYAnother sub-user is being created for your account. Retry in a moment.
502IDENTITY_PROVIDER_ERROR, STORAGE_PROVISION_FAILEDZata could not set the sub-user up. Nothing was kept; retry.

List your sub-users​

GET/subusers/parent/me

Lists 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

NameTypeRequiredDescription
statusstringNoactive or suspended.
regionstringNoOnly sub-users in this region: idr01, bom01.
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"
200 OK
{
"count": 1,
"subusers": [
{
"KC_id": "5f2c8a1e-0000-4000-8000-000000000001",
"username": "sub0abc-backup-job",
"email": "[email protected]",
"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​

GET/subusers/{subuserId}

Returns one sub-user, with its invitation details and its owner (parent).

Path parameters

NameDescription
subuserIdThe sub-user's KC_id.
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"
200 OK
{
"KC_id": "5f2c8a1e-0000-4000-8000-000000000001",
"parent_KC_id": "9f8e7d6c-0000-4000-8000-000000000abc",
"username": "sub0abc-backup-job",
"email": "[email protected]",
"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",
"email": "[email protected]"
}
}

Errors

StatusCodeWhen
404(none)"Subuser not found", for example when {subuserId} is your own account id.

Change a sub-user​

PUT/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

NameDescription
subuserIdThe sub-user's KC_id.

Body

FieldTypeRequiredDescription
descriptionstring or nullNoNew description. null clears it.
emailstringNoNew email address. Stored in lower case.

Send at least one field.

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"
200 OK
{
"message": "Subuser updated successfully",
"subuser": {
"KC_id": "5f2c8a1e-0000-4000-8000-000000000001",
"username": "sub0abc-backup-job",
"email": "[email protected]",
"description": "Nightly and weekly backups",
"regions": ["idr01"],
"status": "active",
"invitationStatus": "accepted",
"updatedAt": "2026-11-25T11:00:00.000Z"
}
}

Errors

StatusCodeWhen
400(none)"Invalid email address", or "No valid updates provided".
404(none)"Subuser not found".
409DUPLICATE_EMAILThe email can't be used. Choose a different one.
429INVITATION_SEND_LIMIT_REACHEDThe sub-user already got 3 invitation emails.
502EMAIL_UPDATE_FAILEDThe email could not be changed. Retry.

Delete a sub-user​

DELETE/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

NameDescription
subuserIdThe sub-user's KC_id.
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"
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

StatusCodeWhen
404(none)"Subuser not found".
500INLINE_POLICY_REVOKE_FAILEDIts inline policies could not be removed. Nothing was deleted. Retry.
500(none)Its bucket policy rules could not be removed. Nothing was deleted. Retry.
502STORAGE_DELETION_FAILEDStorage could not remove the sub-user. It was not deleted. Retry.

Suspend or reactivate a sub-user​

POST/subusers/{subuserId}/suspend

Suspends 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

NameDescription
subuserIdThe sub-user's KC_id.

Body

FieldTypeRequiredDescription
suspendedbooleanNotrue (default) to suspend, false to reactivate.
regionsarray of stringsNoOnly these regions. They must be regions of the sub-user. Leave out for all regions.
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"
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

StatusCodeWhen
400REGION_NOT_ASSIGNEDA 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".
502STORAGE_SUSPEND_FAILEDStorage could not change the state. Nothing changed. Retry.

Resend the invitation​

POST/subusers/{subuserId}/invitations/resend

Sends 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

NameDescription
subuserIdThe sub-user's KC_id.
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"
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

StatusCodeWhen
404(none)"Subuser not found".
409INVITATION_ALREADY_ACCEPTEDThe sub-user already accepted. Always the case for a programmatic sub-user.
429RESEND_COOLDOWNToo soon after the last email. The body has retryAfterSeconds.
429INVITATION_SEND_LIMIT_REACHEDThe sub-user already got 3 invitation emails.

Revoke the invitation​

POST/subusers/{subuserId}/invitations/revoke

Cancels a pending invitation. The emailed link stops working at once. Revoking twice is not an error.

Path parameters

NameDescription
subuserIdThe sub-user's KC_id.
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"
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

StatusCodeWhen
404(none)"Subuser not found".
409INVITATION_ALREADY_ACCEPTEDThe sub-user already accepted.

Add a region​

POST/subusers/{subuserId}/regions

Adds 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

NameDescription
subuserIdThe sub-user's KC_id.

Body

FieldTypeRequiredDescription
regionstringYesThe region to add: idr01 or bom01.
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"
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

StatusCodeWhen
400(none)region is missing or unknown.
400REGION_NOT_ALLOWED, REGION_NO_SUBUSERSThe region is not available for sub-users.
403SUBUSER_REGION_SELF_MANAGEMENT_FORBIDDEN{subuserId} is your own account id.
404(none)"Subuser not found".
409REGION_ALREADY_ASSIGNEDThe sub-user is already in that region.
409REGION_UPDATE_IN_PROGRESSAnother 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.
502STORAGE_PROVISION_FAILEDThe sub-user could not be set up in the region. Retry.

Remove a region​

DELETE/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

NameDescription
subuserIdThe sub-user's KC_id.
regionThe region to remove: idr01 or bom01.
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"
200 OK
{
"message": "Region bom01 removed from subuser",
"KC_id": "5f2c8a1e-0000-4000-8000-000000000001",
"regions": ["idr01"]
}

Errors

StatusCodeWhen
400LAST_REGIONIt is the sub-user's only region. Delete the sub-user instead.
403SUBUSER_REGION_SELF_MANAGEMENT_FORBIDDEN{subuserId} is your own account id.
404(none)"Subuser not found", or the sub-user is not in that region.
409REGION_UPDATE_IN_PROGRESSAnother region change for this sub-user is running. Retry.
500INLINE_POLICY_REVOKE_FAILEDIts inline policy in the region could not be removed. Nothing was removed. Retry.
502STORAGE_REMOVAL_FAILEDStorage could not remove the sub-user from the region. Retry.