Inline policies
Read and change a sub-user's inline policy, change an access rule's type, and see who can reach a bucket, with the Sub-user API.
Each sub-user has one inline policy per region: its own policy, which holds all of its inline policy rules in that region. One inline policy rule can cover several of your buckets, each with its own folders. A bucket policy rule covers one bucket. Allows from both types add up, and any Deny wins. For the concepts, see Inline policies.
Zata also adds its own Deny statements to every sub-user's policy (bucket settings, ACLs, tags, retention and public uploads, unless you delegated them). You can read them, but not change them.
Paths are relative to https://cli.zata.ai/cli/v1. {subuserId} is the sub-user's KC_id, {region} is idr01 or bom01, {sid} is an inline policy rule's sid, and {bucket} is a bucket name. Python examples use the call() helper from Authentication.
The rule object
The rule endpoints take a rule:
| Field | Type | Required | Description |
|---|---|---|---|
effect | string | Yes | Allow or Deny. |
buckets | array of strings | Yes, unless scopes is sent | Your own buckets in the region, exact names, no wildcards. |
scopes | array of objects | No | One entry per bucket: { "bucket", "scope_type": "bucket" or "prefix", "resources": [folders] }. Each bucket gets its own scope. If you also send buckets, it must name the same buckets. |
scope_type, resources | string, array | No | The older form, without scopes: one scope for every bucket. prefix needs at least one folder. |
actions | array of strings | Yes | Actions from the catalog. No wildcards, nothing outside s3:. |
conditions | object | No | AWS-style conditions. See Conditions. |
Folders are written like 2026/ and stored as 2026/*. Bucket-wide actions (s3:GetBucketVersioning, s3:GetBucketTagging) need at least one whole bucket in the rule.
For example, all of reports and only the 2026/ folder of invoices:
{
"effect": "Allow",
"scopes": [
{ "bucket": "reports", "scope_type": "bucket" },
{ "bucket": "invoices", "scope_type": "prefix", "resources": ["2026/"] }
],
"actions": ["s3:ListBucket", "s3:GetObject"]
}
Zata writes each rule as one or more statements whose Sid starts with the rule's sid. Companion statements end in -list, -list-<n> or -bulkdelete: they let the sub-user list its folders and delete several files at once. They belong to the rule and are changed with it.
Conditions
- Operators:
StringEquals,StringNotEquals,StringLike,StringNotLike,IpAddress,NotIpAddress,Bool,DateGreaterThan,DateGreaterThanEquals,DateLessThan,DateLessThanEquals,NumericEquals,NumericLessThan,NumericLessThanEquals,NumericGreaterThan,NumericGreaterThanEquals, each also withIfExists(for exampleStringLikeIfExists). TheIfExistsforms work only in inline policy rules, not in bucket policy rules. - Keys:
aws:SourceIp,aws:SecureTransport,aws:CurrentTime,aws:EpochTime,aws:Referer,aws:UserAgent,s3:prefix,s3:delimiter,s3:max-keys. - Values: strings, numbers or booleans of up to 1,024 characters.
Limits
Per sub-user and region. Every statement counts, including companions. A rule that doesn't fit is refused as a whole.
| Limit | Value | Error |
|---|---|---|
| Statements | 64 | TOO_MANY_STATEMENTS, or INLINE_RULE_TOO_LARGE for a rule |
| Actions per statement | 64 | TOO_MANY_ACTIONS |
| Resources per statement | 64 | TOO_MANY_RESOURCES |
| Buckets | 64 | TOO_MANY_BUCKETS |
| Size of your part of the policy | 32 KB | DOCUMENT_TOO_LARGE, or INLINE_RULE_TOO_LARGE for a rule |
Sid | 1-100 characters: letters, digits, _, -; unique; Zata's own Sids are reserved | SID_INVALID, SID_DUPLICATE, SID_RESERVED |
Inside the 400 INLINE_POLICY_INVALID answer, these codes appear in the errors list.
expected_hash
Every policy has a hash (policy.hash in the read answers). Send it back as expected_hash on a write to make sure nobody changed the policy since you read it. If it changed, the write is refused with 409 INLINE_POLICY_STALE and the body has current_hash. Read again, then retry.
expected_hash is optional on the rule endpoints and required on Replace an inline policy once the sub-user has a policy in that region.
Errors on writes
Every write on this page can answer:
| Status | Code | When |
|---|---|---|
| 400 | INLINE_POLICY_INVALID | The rule or statements are not valid. error has the first problem, errors all of them. |
| 400 | EFFECT_INVALID, BUCKETS_EMPTY, BUCKET_DUPLICATE, BUCKET_SCOPES_MISMATCH, SCOPE_INVALID, RESOURCE_EMPTY, ACTION_EMPTY, ACTION_NOT_ALLOWED, PREFIX_SCOPE_ACTION_FORBIDDEN | A problem in the rule. error says what. |
| 400 | RESOURCE_NOT_ALLOWED | A bucket you add is not yours, or doesn't exist, in that region. The body lists buckets. |
| 400 | INLINE_RULE_TOO_LARGE | The rule does not fit in the limits. Use fewer buckets or folders, or split it. |
| 400 | REGION_REQUIRED | The region is missing or unknown. |
| 403 | REGION_NOT_ALLOWED | The region is not available. |
| 403 | FORBIDDEN | The sub-user is not yours. |
| 404 | SUBUSER_NOT_FOUND | No such sub-user. |
| 409 | INLINE_POLICY_STALE | expected_hash no longer matches. The body has current_hash. |
| 409 | LOG_BUCKET_CANNOT_BE_SHARED | A bucket you add receives access logs. |
| 409 | OBJECT_LOCK_OPT_IN_REQUIRED | Upload, retention or legal hold on an Object Lock bucket whose sub-user Object Lock setting is off. Turn it on in the console first. |
| 409 | INLINE_POLICY_LOCK_LOST | Another change landed at the same time. Nothing was changed. Retry. |
| 409 | BASELINE_TOO_LARGE | Zata's own statements for this sub-user would grow too large. |
| 503 | INLINE_POLICY_ADMIN_NOT_CONFIGURED | Inline policies are not available in this region right now. Use a bucket policy rule. |
| 503 | INLINE_POLICY_OWNER_CHECK_FAILED, INLINE_POLICY_LOCK_UNAVAILABLE, INLINE_POLICY_OUT_OF_SYNC, OBJECT_LOCK_CHECK_FAILED | A temporary problem. Nothing was changed. Retry. |
| 502 | INLINE_POLICY_VERIFY_FAILED, INLINE_POLICY_RGW_ERROR | Storage did not keep or answer the write. Read the policy again before you retry. |
Get the catalog
/inline-policies/catalogReturns what a rule may contain: the actions sub-users can have, grouped (Read, Write, Delete, Bucket info, Object lock), the presets, the actions that are never allowed and why, Zata's own statements, the condition operators and keys, the limits, and whether inline policies are available in each region. The same actions are allowed in bucket policy rules for sub-users.
- curl
- Python
curl --aws-sigv4 "aws:amz:us-east-1:zata" \
--user "$ZATA_ACCESS_KEY:$ZATA_SECRET_KEY" \
"https://cli.zata.ai/cli/v1/inline-policies/catalog"
status, catalog = call("GET", "/inline-policies/catalog")
allowed = [a["action"] for a in catalog["actions"]]
200 OK
{
"version": 1,
"groups": [
{ "key": "read", "label": "Read" },
{ "key": "write", "label": "Write" }
],
"actions": [
{ "action": "s3:ListBucket", "label": "List files", "group": "read", "arn": "bucket", "entireBucketOnly": false },
{ "action": "s3:GetObject", "label": "Download files", "group": "read", "arn": "object", "entireBucketOnly": false }
],
"presets": {
"allow": [
{
"id": "view",
"label": "View & Download",
"description": "Browse and download files.",
"actions": ["s3:ListBucket", "s3:GetObject", "s3:GetObjectVersion"]
}
],
"deny": [
{
"id": "deny_writes",
"label": "Block writes",
"description": "No uploads, overwrites or deletes, whatever else allows them.",
"actions": [
"s3:PutObject", "s3:DeleteObject", "s3:DeleteObjectVersion", "s3:AbortMultipartUpload",
"s3:RestoreObject", "s3:DeleteObjectTagging", "s3:PutObjectRetention", "s3:PutObjectLegalHold"
]
}
]
},
"limits": {
"maxDocumentBytes": 32768,
"maxStatements": 64,
"maxActionsPerStatement": 64,
"maxResourcesPerStatement": 64,
"maxBucketsPerPolicy": 64,
"maxSidLength": 100,
"maxConditionValueLength": 1024
},
"regions": {
"idr01": { "available": true },
"bom01": { "available": true }
},
"note": "Allows from both are combined; any Deny wins."
}
Shortened: groups, actions and the presets list only their first entries, and some fields are left out. Read the live catalog for the exact values.
Errors: none specific to this endpoint.
Get all inline policies of a sub-user
/subusers/{subuserId}/inline-policyReturns the sub-user's inline policy in each of its regions, in the same form as Get an inline policy, without KC_id on each entry.
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/inline-policy"
status, body = call("GET", f"/subusers/{SUBUSER_ID}/inline-policy")
200 OK
{
"KC_id": "5f2c8a1e-0000-4000-8000-000000000001",
"regions": [
{ "region": "idr01", "available": true, "policy": null }
]
}
policy is null when the sub-user has no inline policy rules in that region yet.
Errors
| Status | Code | When |
|---|---|---|
| 403 | FORBIDDEN | The sub-user is not yours. |
| 404 | SUBUSER_NOT_FOUND | No such sub-user. |
Get an inline policy
/subusers/{subuserId}/inline-policy/{region}Returns the sub-user's inline policy in one region: its statements, the rules they form (active and suspended), and the hash to send as expected_hash. available: false means inline policies are not available in that region right now.
Path parameters
| Name | Description |
|---|---|
subuserId | The sub-user's KC_id. |
region | idr01 or 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/inline-policy/idr01"
status, body = call("GET", f"/subusers/{SUBUSER_ID}/inline-policy/idr01")
HASH = body["policy"]["hash"] if body["policy"] else None
200 OK
{
"KC_id": "5f2c8a1e-0000-4000-8000-000000000001",
"region": "idr01",
"available": true,
"policy": {
"statements": [
{
"Sid": "e8b1c4a7-0000-4000-8000-000000000004",
"Effect": "Allow",
"Action": ["s3:ListBucket", "s3:GetObject"],
"Resource": [
"arn:aws:s3:::reports",
"arn:aws:s3:::reports/*",
"arn:aws:s3:::invoices",
"arn:aws:s3:::invoices/*"
]
}
],
"rules": [
{
"sid": "e8b1c4a7-0000-4000-8000-000000000004",
"custom": false,
"effect": "Allow",
"buckets": ["reports", "invoices"],
"actions": ["s3:ListBucket", "s3:GetObject"],
"scope_type": "bucket",
"resources": null,
"scopes": [
{ "bucket": "reports", "scope_type": "bucket", "resources": null },
{ "bucket": "invoices", "scope_type": "bucket", "resources": null }
],
"conditions": null,
"status": "active"
}
],
"hash": "4f1c2b9a7d3e5f60718293a4b5c6d7e8f9011a2b3c4d5e6f708192a3b4c5d6e7",
"buckets": ["invoices", "reports"],
"createdAt": "2026-11-25T10:30:00.000Z",
"updatedAt": "2026-11-25T10:30:00.000Z"
}
}
Shortened: policy has more fields, such as summaries (one row per rule and bucket). A rule Zata can't map to the rule object (a statement you wrote in JSON) shows "custom": true and "scope_type": "custom". scope_type is per_bucket when the buckets have different scopes.
Errors
| Status | Code | When |
|---|---|---|
| 400 | REGION_REQUIRED | The region is missing or unknown. |
| 403 | FORBIDDEN | The sub-user is not yours. |
| 404 | SUBUSER_NOT_FOUND | No such sub-user. |
Replace an inline policy
/subusers/{subuserId}/inline-policy/{region}Replaces all active statements of the inline policy with yours (JSON mode). Suspended rules are kept. Zata's own statements are added for you; don't send them. Rules that disappear lose their pending access requests.
Path parameters
| Name | Description |
|---|---|
subuserId | The sub-user's KC_id. |
region | idr01 or bom01. |
Body
| Field | Type | Required | Description |
|---|---|---|---|
statements | array of objects | Yes | Each { "Sid", "Effect", "Action", "Resource", "Condition" }, and nothing else: no Principal, NotAction or NotResource. Resource is arn:aws:s3:::<bucket> or arn:aws:s3:::<bucket>/<pattern>, with an exact bucket name that is yours in the region. |
expected_hash | string | Once a policy exists | The hash from your last read. See expected_hash. |
- 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 '{
"statements": [{
"Sid": "ReadReports",
"Effect": "Allow",
"Action": ["s3:ListBucket", "s3:GetObject"],
"Resource": ["arn:aws:s3:::reports", "arn:aws:s3:::reports/*"]
}],
"expected_hash": "'"$HASH"'"
}' \
"https://cli.zata.ai/cli/v1/subusers/$SUBUSER_ID/inline-policy/idr01"
status, body = call("PUT", f"/subusers/{SUBUSER_ID}/inline-policy/idr01", {
"statements": [{
"Sid": "ReadReports",
"Effect": "Allow",
"Action": ["s3:ListBucket", "s3:GetObject"],
"Resource": ["arn:aws:s3:::reports", "arn:aws:s3:::reports/*"],
}],
"expected_hash": HASH,
})
200 OK
The same body as Get an inline policy, showing the policy after the change.
Errors: the errors on writes, plus:
| Status | Code | When |
|---|---|---|
| 428 | EXPECTED_HASH_REQUIRED | The sub-user already has a policy here and you sent no expected_hash. The body has current_hash. |
| 409 | SID_DUPLICATE | A Sid you send belongs to a suspended rule. Resume or delete that rule instead. |
Add a rule
/subusers/{subuserId}/inline-policy/{region}/rulesAdds one inline policy rule. Zata picks its sid and returns it. The sub-user gets a notification.
Path parameters
| Name | Description |
|---|---|
subuserId | The sub-user's KC_id. |
region | idr01 or bom01. |
Body
| Field | Type | Required | Description |
|---|---|---|---|
rule | object | Yes | See The rule object. |
expected_hash | string | No | See expected_hash. |
- 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 '{"rule": {
"effect": "Allow",
"buckets": ["reports", "invoices"],
"actions": ["s3:ListBucket", "s3:GetObject"]
}}' \
"https://cli.zata.ai/cli/v1/subusers/$SUBUSER_ID/inline-policy/idr01/rules"
status, body = call("POST", f"/subusers/{SUBUSER_ID}/inline-policy/idr01/rules", {"rule": {
"effect": "Allow",
"buckets": ["reports", "invoices"],
"actions": ["s3:ListBucket", "s3:GetObject"],
}})
SID = body["sid"]
201 Created
{
"KC_id": "5f2c8a1e-0000-4000-8000-000000000001",
"sid": "e8b1c4a7-0000-4000-8000-000000000004",
"region": "idr01",
"available": true,
"policy": { "hash": "4f1c2b9a7d3e5f60718293a4b5c6d7e8f9011a2b3c4d5e6f708192a3b4c5d6e7" }
}
Shortened: policy is the full policy, as in Get an inline policy.
Errors: the errors on writes.
Change a rule
/subusers/{subuserId}/inline-policy/{region}/rules/{sid}Replaces a rule, active or suspended, with a new rule. A suspended rule stays suspended; it is checked again when you resume it.
Path parameters
| Name | Description |
|---|---|
subuserId | The sub-user's KC_id. |
region | idr01 or bom01. |
sid | The rule's sid. |
Body
| Field | Type | Required | Description |
|---|---|---|---|
rule | object | Yes | The whole new rule. See The rule object. |
expected_hash | string | No | See expected_hash. |
- 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 '{"rule": {
"effect": "Allow",
"scopes": [
{"bucket": "reports", "scope_type": "bucket"},
{"bucket": "invoices", "scope_type": "prefix", "resources": ["2026/"]}
],
"actions": ["s3:ListBucket", "s3:GetObject"]
}}' \
"https://cli.zata.ai/cli/v1/subusers/$SUBUSER_ID/inline-policy/idr01/rules/$SID"
status, body = call("PUT", f"/subusers/{SUBUSER_ID}/inline-policy/idr01/rules/{SID}", {"rule": {
"effect": "Allow",
"scopes": [
{"bucket": "reports", "scope_type": "bucket"},
{"bucket": "invoices", "scope_type": "prefix", "resources": ["2026/"]},
],
"actions": ["s3:ListBucket", "s3:GetObject"],
}})
200 OK
KC_id, sid, and the policy after the change, as in Get an inline policy.
Errors: the errors on writes, plus:
| Status | Code | When |
|---|---|---|
| 404 | INLINE_RULE_NOT_FOUND | No rule with that sid. |
Delete a rule
/subusers/{subuserId}/inline-policy/{region}/rules/{sid}Deletes a rule, active or suspended. Pending access requests on it are cancelled. The sub-user gets a notification when an active Allow rule is deleted.
Path parameters
| Name | Description |
|---|---|
subuserId | The sub-user's KC_id. |
region | idr01 or bom01. |
sid | The rule's sid. |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
expected_hash | string | No | See expected_hash. It can also go in a JSON body. |
- 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/inline-policy/idr01/rules/$SID"
status, body = call("DELETE", f"/subusers/{SUBUSER_ID}/inline-policy/idr01/rules/{SID}")
200 OK
KC_id and the policy after the change, as in Get an inline policy.
Errors: the errors on writes, plus:
| Status | Code | When |
|---|---|---|
| 404 | INLINE_RULE_NOT_FOUND | No rule with that sid. |
Suspend a rule
/subusers/{subuserId}/inline-policy/{region}/rules/{sid}/suspendTakes the rule out of the live policy but keeps it, so you can resume it. The sub-user gets a notification for each bucket. Suspending a suspended rule changes nothing and answers "already": true.
Path parameters
| Name | Description |
|---|---|
subuserId | The sub-user's KC_id. |
region | idr01 or bom01. |
sid | The rule's sid. |
Body
| Field | Type | Required | Description |
|---|---|---|---|
reason | string | No | Up to 500 characters. Default manual. |
expected_hash | string | No | See expected_hash. |
- 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 '{"reason": "Audit in progress"}' \
"https://cli.zata.ai/cli/v1/subusers/$SUBUSER_ID/inline-policy/idr01/rules/$SID/suspend"
status, body = call("POST", f"/subusers/{SUBUSER_ID}/inline-policy/idr01/rules/{SID}/suspend",
{"reason": "Audit in progress"})
200 OK
KC_id, sid, already (true if it was already suspended) and the policy after the change, as in Get an inline policy.
Errors: the errors on writes, plus:
| Status | Code | When |
|---|---|---|
| 404 | INLINE_RULE_NOT_FOUND | No rule with that sid. |
Resume a rule
/subusers/{subuserId}/inline-policy/{region}/rules/{sid}/resumePuts a suspended rule back. It is checked again as if it were new: the buckets must still be yours, and it must fit in the limits. Resuming an active rule answers "already": true.
Path parameters
| Name | Description |
|---|---|
subuserId | The sub-user's KC_id. |
region | idr01 or bom01. |
sid | The rule's sid. |
Body
| Field | Type | Required | Description |
|---|---|---|---|
expected_hash | string | No | See expected_hash. |
- 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/inline-policy/idr01/rules/$SID/resume"
status, body = call("POST", f"/subusers/{SUBUSER_ID}/inline-policy/idr01/rules/{SID}/resume")
200 OK
KC_id, sid, already and the policy after the change, as in Get an inline policy.
Errors: the errors on writes, plus:
| Status | Code | When |
|---|---|---|
| 404 | INLINE_RULE_NOT_FOUND | No rule with that sid. |
Change a rule's type
/subusers/{subuserId}/access-rules/{region}/change-typeTurns a bucket policy rule into an inline policy rule, or the other way round, in one step. If a step fails, the change is undone. A suspended rule stays suspended. Pending access requests on the rule are carried over or cancelled, and the answer counts them.
An inline policy rule that covers several buckets becomes one bucket policy rule per bucket only when you send "split": true. A rule written in JSON that Zata can't map to the rule object cannot change type.
Path parameters
| Name | Description |
|---|---|
subuserId | The sub-user's KC_id. |
region | idr01 or bom01. |
Body
| Field | Type | Required | Description |
|---|---|---|---|
rule_id | string | Yes | A bucket policy rule's id, or an inline policy rule as inline:<region>:<sid>. |
to | string | Yes | inline or bucket_policy. |
split | boolean | No | true lets a multi-bucket inline policy rule become one bucket policy rule per bucket. |
- 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 '{"rule_id": "inline:idr01:'"$SID"'", "to": "bucket_policy", "split": true}' \
"https://cli.zata.ai/cli/v1/subusers/$SUBUSER_ID/access-rules/idr01/change-type"
status, body = call("POST", f"/subusers/{SUBUSER_ID}/access-rules/idr01/change-type", {
"rule_id": f"inline:idr01:{SID}",
"to": "bucket_policy",
"split": True,
})
200 OK
{
"KC_id": "5f2c8a1e-0000-4000-8000-000000000001",
"from": "inline",
"to": "bucket_policy",
"sid": "e8b1c4a7-0000-4000-8000-000000000004",
"split": true,
"rules": [
{ "id": "c3a9f6d1-0000-4000-8000-000000000008", "bucket_name": "reports", "type": "bucket_policy" },
{ "id": "c3a9f6d1-0000-4000-8000-000000000009", "bucket_name": "invoices", "type": "bucket_policy" }
],
"requests": { "carried": 0, "cancelled": 0 },
"region": "idr01",
"available": true
}
Shortened: each item of rules is a full bucket policy rule, and the answer also has policy, the inline policy after the change, as in Get an inline policy. split and rules appear only when converting to bucket_policy.
Errors
| Status | Code | When |
|---|---|---|
| 400 | RULE_ID_REQUIRED | rule_id is missing. |
| 400 | RULE_TYPE_INVALID | to is not inline or bucket_policy. |
| 400 | RULE_TYPE_SAME | The rule already has that type. |
| 400 | SUBUSER_REGION_MISMATCH | The inline: id names another region than {region}. |
| 404 | ACCESS_RULE_NOT_FOUND, INLINE_RULE_NOT_FOUND | No such rule for this sub-user in this region. |
| 409 | INLINE_RULE_MULTI_BUCKET | The inline policy rule covers several buckets. Send "split": true. The body lists buckets. |
| 409 | INLINE_RULE_NOT_CONVERTIBLE | A rule written in JSON can't change type. |
| 502 | RULE_TYPE_CHANGE_FAILED, RULE_TYPE_CHANGE_VERIFY_FAILED | The change failed and was undone. Retry. |
| 502 | RULE_TYPE_CHANGE_INCOMPLETE | The rule is now an inline policy rule but is suspended. Resume it to restore the access. |
Plus the errors on writes for the new rule.
Get effective access
/subusers/{subuserId}/effective-access/{region}Shows everything that decides what the sub-user can do in a region, read live: its inline policy with Zata's own statements, and every bucket policy statement that names it. The answer may be up to 30 seconds old.
Path parameters
| Name | Description |
|---|---|
subuserId | The sub-user's KC_id. |
region | idr01 or 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/effective-access/idr01"
status, body = call("GET", f"/subusers/{SUBUSER_ID}/effective-access/idr01")
200 OK
| Field | Contents |
|---|---|
KC_id, region, subuser | Who and where. |
note | "Allows from both are combined; any Deny wins." |
inline | The live inline policy (policy), its active rules and its suspended rules. |
bucket_policies | Per bucket, the bucket policy statements that name the sub-user, each with managed, rule_id, status and permission_display. |
bucket_policy_suspended | The sub-user's suspended bucket policy rules. |
read_at | When this was read. |
Errors
| Status | Code | When |
|---|---|---|
| 400 | REGION_REQUIRED | The region is missing or unknown. |
| 403 | FORBIDDEN | The sub-user is not yours. |
| 404 | SUBUSER_NOT_FOUND | No such sub-user. |
See who has access to a bucket
/buckets/{bucket}/subuser-accessLists every sub-user that has access to the bucket, with rules of both types, read live.
Path parameters
| Name | Description |
|---|---|
bucket | The bucket name. |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
region | string | Yes | idr01 or 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/buckets/reports/subuser-access?region=idr01"
status, body = call("GET", "/buckets/reports/subuser-access?region=idr01")
200 OK
{
"bucket": "reports",
"region": "idr01",
"note": "Allows from both are combined; any Deny wins.",
"entries": [
{
"type": "inline",
"subuser_id": "5f2c8a1e-0000-4000-8000-000000000001",
"username": "sub0abc-backup-job",
"rule_id": "inline:idr01:e8b1c4a7-0000-4000-8000-000000000004:reports",
"sid": "e8b1c4a7-0000-4000-8000-000000000004",
"managed": true,
"effect": "Allow",
"actions": ["s3:ListBucket", "s3:GetObject"],
"scope_type": "bucket",
"resources": null,
"status": "active",
"permission_display": "View Only",
"scope_display": "Entire bucket",
"buckets": ["reports", "invoices"]
}
],
"read_at": "2026-11-25T10:40:00.000Z"
}
managed: false marks a bucket policy statement that names the sub-user but was not made as a Zata rule, for example one you wrote with an S3 tool.
Errors
| Status | Code | When |
|---|---|---|
| 400 | REGION_REQUIRED | region is missing or unknown. |
| 404 | BUCKET_NOT_FOUND | No such bucket in the region, or it isn't yours. |
| 502 | BUCKET_INFO_FAILED | The bucket could not be read. Retry. |
Remove all sub-users from a bucket
/buckets/{bucket}/subuser-access/revoke-allRemoves every sub-user's access to the bucket: it deletes all bucket policy rules for sub-users on it, and removes the bucket from every inline policy rule that names it. The sub-users get a notification.
Path parameters
| Name | Description |
|---|---|
bucket | The bucket name. |
Body
| Field | Type | Required | Description |
|---|---|---|---|
region | string | Yes | idr01 or bom01. It can also go in the query string. |
- 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/buckets/reports/subuser-access/revoke-all"
status, body = call("POST", "/buckets/reports/subuser-access/revoke-all", {"region": "idr01"})
200 OK
{
"bucket": "reports",
"region": "idr01",
"bucket_policy": {
"removed": [
{ "id": "c3a9f6d1-0000-4000-8000-000000000003", "subuser": "5f2c8a1e-0000-4000-8000-000000000001" }
],
"failed": []
},
"inline": [
{
"subuser": "5f2c8a1e-0000-4000-8000-000000000001",
"username": "sub0abc-backup-job",
"rules": ["e8b1c4a7-0000-4000-8000-000000000004"]
}
]
}
Check bucket_policy.failed: each entry has the rule id, the subuser and an error. Run the call again to retry them.
Errors
| Status | Code | When |
|---|---|---|
| 400 | REGION_REQUIRED | region is missing or unknown. |
| 404 | BUCKET_NOT_FOUND | No such bucket in the region, or it isn't yours. |
| 409, 502, 503 | INLINE_POLICY_CLEANUP_FAILED | The bucket could not be removed from a sub-user's inline policy. Retry. |
| 502 | BUCKET_INFO_FAILED | The bucket could not be read. Retry. |