About the Sub-user API
Manage sub-users, their access keys and their bucket access from your own scripts, signed with your own access key.
The Sub-user API is an HTTP JSON API for the account owner. With it, a script can do what you do on the Subusers page: create and delete sub-users, issue and rotate their access keys, and give them access to your buckets.
You sign every request with one of your own S3 access keys, the same way an S3 tool signs a request. There is no program to install: you send signed HTTPS requests with curl, Python or any AWS Signature V4 signer.
Base URL
https://cli.zata.ai/cli/v1
Every path in this reference is relative to it.
The API works across both regions, Indore (idr01) and Mumbai (bom01). Requests that act on one region take the region as a parameter.
Who it is for
The account owner. Sub-users cannot call it, and their keys are refused.
Use it when you manage many sub-users, or when you create and remove them from your own tooling (CI jobs, onboarding scripts, a customer portal). For one-off changes, the Zata console is quicker.
Requirements
| You need | Why |
|---|---|
| A paid plan | The API is not available on the free trial, or when your plan has lapsed. |
| An account that isn't suspended | A suspended account is refused. |
| A root access key | One of your own keys, active, in either region. Sub-user keys are refused. See Access keys. |
| Sub-user API access turned on | It is off by default. See below. |
Turn it on
Sign in to the Zata console as the account owner and open Access Keys in the sidebar.
Turn on the Sub-user API access switch and confirm the warning.
Only the account owner can turn it on or off, and only from the console. The API cannot switch itself on.
While it is on, anyone holding one of your root access keys can create and delete sub-users, issue their keys and give them access to your buckets, without signing in to the console. Keep your root keys safe, and turn the switch off when you no longer need it.
What it can do
| Page | What you manage |
|---|---|
| Sub-users | Create, list, change, suspend and delete sub-users, their invitations and their regions. |
| Access keys | List, create, rotate, deactivate and delete a sub-user's keys. |
| Bucket policy rules | Give a sub-user access to one bucket at a time, in that bucket's bucket policy. |
| Inline policies | Give a sub-user access to several buckets in one inline policy rule, and see everything a sub-user can reach. |
Changes made through the API show in the console straight away, like any change you make there. Writes that create keys or sub-users, or change a sub-user's access, email or invitation, also send you a dashboard notification.
What it can't do
Some actions stay in the console. The API refuses them:
| Action | Answer |
|---|---|
| Making a bucket or file public, or any public grant | 403 CLI_NOT_AVAILABLE |
| Grants to another Zata account | 403 CLI_NOT_AVAILABLE |
A bucket's capability settings (/buckets/{bucket}/capabilities: the public switch and the sub-user publishing and Object Lock settings) | 403 CLI_NOT_AVAILABLE |
Browsing a sub-user's files or folder statistics (/subusers/{subuserId}/buckets/{bucket}/objects…, …/folders…, …/stats) | 403 CLI_NOT_AVAILABLE |
| Creating, rotating or deleting your own access keys | 403 CLI_ROOT_KEYS_DASHBOARD_ONLY |
| Approving or rejecting sub-users' requests for more access (policy requests) | 404 CLI_NOT_FOUND |
| Buckets, objects, raw bucket policy edits, ACLs, CORS, billing | 404 CLI_NOT_FOUND. Use the console or an S3 tool. |
Your first call
List your sub-users. me stands for your own account, so you never need your account id.
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"
ZATA_ACCESS_KEY and ZATA_SECRET_KEY hold one of your root keys. A 200 answer with count and subusers means everything is set up. If you get an error, the response body says what went wrong. Signing errors are listed in Authentication.
Next steps
- Authentication: the signing rules and a Python helper.
- Sub-users.