Bucket policy rules
Give a sub-user access to one bucket at a time, in that bucket's bucket policy, with the Sub-user API.
A bucket policy rule is an access rule that lives in one bucket's bucket policy and names one sub-user. It covers exactly one bucket, or some folders in it. To cover several buckets with one rule, use an inline policy rule instead. Allows from both types add up, and any Deny wins.
Through the Sub-user API, rules are for sub-users only:
grantee_typemust be"subuser"."public"or"external"answers403 CLI_NOT_AVAILABLE.- You can read public rules and rules for other accounts, but changing, suspending, resuming or deleting one answers
403 CLI_NOT_AVAILABLE. Use the console. - A write on a rule that isn't yours answers
404 CLI_RULE_NOT_FOUND.
A sub-user can only be given buckets in one of its own regions, and only the S3 actions sub-users may have. GET /inline-policies/catalog lists them: see Get the catalog.
Paths are relative to https://cli.zata.ai/cli/v1. {bucket} is the bucket name, {ruleId} the rule's id, and {subuserId} the sub-user's KC_id. Python examples use the call() helper from Authentication.
| Method | Path | What it does |
|---|---|---|
GET | /buckets/{bucket}/access | List a bucket's rules |
GET | /buckets/{bucket}/access/policy | Read the bucket's live bucket policy |
GET | /buckets/{bucket}/access/subuser/{subuserId} | One sub-user's active rules on a bucket |
POST | /buckets/{bucket}/access | Give a sub-user access to the bucket |
GET | /buckets/{bucket}/access/{ruleId} | Get one rule |
PUT | /buckets/{bucket}/access/{ruleId} | Change a rule |
DELETE | /buckets/{bucket}/access/{ruleId} | Remove the access |
POST | /buckets/{bucket}/access/{ruleId}/suspend | Turn a rule off for now |
POST | /buckets/{bucket}/access/{ruleId}/resume | Turn a suspended rule back on |
GET | /subusers/{subuserId}/buckets | Every bucket a sub-user can reach |
POST | /subusers/{subuserId}/access/bulk | Give a sub-user several buckets at once |
GET | /access/rules | All your rules, page by page |
GET | /access/permissions | Presets, actions and conditions |
POST | /access/validate-actions | Check a list of action names |
List a bucket's rules
/buckets/{bucket}/accessLists every rule in the bucket's bucket policy, for all grantees. Each rule has the fields shown in Create a rule.
Path parameters
| Name | Description |
|---|---|
bucket | The bucket name. |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
region | string | Yes | The bucket's region, as the exact code idr01 or bom01. |
include_external | string | No | true adds external_policies: { "hasExternal", "count" }, the number of rules on the bucket that were not created in Zata. |
- 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/access?region=idr01"
status, body = call("GET", "/buckets/reports/access?region=idr01")
200 OK
{
"bucket_name": "reports",
"region": "idr01",
"bucket_region": "idr01",
"rules_count": 1,
"rules": [
{
"id": "c3a9f6d1-0000-4000-8000-000000000003",
"grantee_type": "subuser",
"grantee_id": "5f2c8a1e-0000-4000-8000-000000000001",
"effect": "Allow",
"actions": ["s3:ListBucket", "s3:GetObject"],
"scope_type": "prefix",
"resources": ["monthly/*"],
"status": "active",
"permission_display": "Monthly reports",
"scope_display": "monthly/* only"
}
]
}
Shortened: each rule has all the fields shown under Create a rule.
Errors
| Status | Code | When |
|---|---|---|
| 400 | (none) | "Region is required". |
| 404 | BUCKET_NOT_FOUND | No such bucket in the region, or it isn't yours. |
| 409 | BUCKET_POLICY_MALFORMED | The bucket policy can't be read. Fix it in the console or with an S3 tool. |
Get a bucket's bucket policy
/buckets/{bucket}/access/policyReturns the bucket policy JSON exactly as it is now, including statements you wrote yourself. Read only: the Sub-user API cannot edit a bucket policy directly.
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/access/policy?region=idr01"
status, body = call("GET", "/buckets/reports/access/policy?region=idr01")
200 OK
{
"bucket_name": "reports",
"region": "idr01",
"bucket_region": "idr01",
"policy": {
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Zata-0d1e2f3a-0000-4000-8000-000000000006-list",
"Effect": "Allow",
"Principal": { "AWS": "arn:aws:iam:::user/5f2c8a1e-0000-4000-8000-000000000001" },
"Action": ["s3:ListBucket"],
"Resource": ["arn:aws:s3:::reports"],
"Condition": { "StringLike": { "s3:prefix": ["monthly/*"] } }
},
{
"Sid": "Zata-0d1e2f3a-0000-4000-8000-000000000006",
"Effect": "Allow",
"Principal": { "AWS": "arn:aws:iam:::user/5f2c8a1e-0000-4000-8000-000000000001" },
"Action": ["s3:GetObject"],
"Resource": ["arn:aws:s3:::reports/monthly/*"]
}
]
}
}
A folder rule is written as two statements: the -list one lets the sub-user list that folder. The policy may also hold other statements, such as ones you wrote yourself.
Errors
| Status | Code | When |
|---|---|---|
| 400 | (none) | "region is required". |
| 409 | BUCKET_POLICY_MALFORMED | The bucket policy can't be read. |
List a sub-user's rules on a bucket
/buckets/{bucket}/access/subuser/{subuserId}Lists one sub-user's active rules on one bucket, of both types: bucket policy rules and inline policy rules.
Path parameters
| Name | Description |
|---|---|
bucket | The bucket name. |
subuserId | The sub-user's KC_id. |
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/access/subuser/$SUBUSER_ID?region=idr01"
status, body = call("GET", f"/buckets/reports/access/subuser/{SUBUSER_ID}?region=idr01")
200 OK
{
"bucket_name": "reports",
"region": "idr01",
"bucket_region": "idr01",
"subuser_id": "5f2c8a1e-0000-4000-8000-000000000001",
"rules_count": 1,
"rules": [
{
"id": "c3a9f6d1-0000-4000-8000-000000000003",
"effect": "Allow",
"actions": ["s3:ListBucket", "s3:GetObject"],
"scope_type": "prefix",
"resources": ["monthly/*"],
"status": "active"
}
]
}
Shortened. An inline policy rule shows with "type": "inline" and an id of the form inline:<region>:<sid>:<bucket>.
Errors
| Status | Code | When |
|---|---|---|
| 400 | (none) | "Region is required". |
| 401 | (none) | The sub-user is not yours. |
Create a rule
/buckets/{bucket}/accessGives one sub-user access to this bucket, or to folders in it. The sub-user gets a notification.
scope_type defaults to bucket. To limit the rule to folders, send "scope_type": "prefix" together with resources. Sending resources alone is refused.
Path parameters
| Name | Description |
|---|---|
bucket | The bucket name. One bucket only. |
Body
| Field | Type | Required | Description |
|---|---|---|---|
grantee_type | string | Yes | "subuser". |
grantee_id | string | Yes | The sub-user's KC_id. |
region | string | Yes | The bucket's region, idr01 or bom01. It must be one of the sub-user's regions. bucket_region is accepted too. |
actions | array of strings | Yes | S3 actions such as s3:GetObject. Only the actions in the catalog; no wildcards. |
effect | string | No | Allow (default) or Deny. |
scope_type | string | No | bucket (default): the whole bucket. prefix: only the folders in resources. |
resources | array of strings | With prefix | Folders, such as monthly/. Stored as monthly/*. Must be empty with bucket. |
conditions | object | No | AWS-style conditions, such as {"IpAddress": {"aws:SourceIp": ["203.0.113.0/24"]}}. See below. |
permission_preset | string | No | A label such as view. It does not change the actions; always send actions. |
notes | string | No | A name for the rule, shown in the console. |
grantee_display_name | string | No | How the sub-user is shown on this rule. |
Conditions on a bucket policy rule:
- Operators:
StringEquals,StringNotEquals,StringLike,StringNotLike,IpAddress,NotIpAddress,Bool,DateGreaterThan,DateGreaterThanEquals,DateLessThan,DateLessThanEquals,NumericEquals,NumericLessThan,NumericLessThanEquals,NumericGreaterThan,NumericGreaterThanEquals. The…IfExistsforms work only in inline policy rules. - Keys:
aws:SourceIp,aws:SecureTransport,aws:CurrentTime,aws:EpochTime,aws:Referer,aws:UserAgent,s3:prefix,s3:delimiter,s3:max-keys. - At most 10 operators, 10 keys per operator, and 1 to 50 values per key. Each value is a non-empty string of up to 1,024 characters.
- For access that ends on a date, use
{"DateLessThan": {"aws:CurrentTime": "2026-12-31T23:59:59Z"}}.
- 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 '{
"grantee_type": "subuser",
"grantee_id": "'"$SUBUSER_ID"'",
"region": "idr01",
"actions": ["s3:ListBucket", "s3:GetObject"],
"scope_type": "prefix",
"resources": ["monthly/"],
"notes": "Monthly reports"
}' \
"https://cli.zata.ai/cli/v1/buckets/reports/access"
status, body = call("POST", "/buckets/reports/access", {
"grantee_type": "subuser",
"grantee_id": SUBUSER_ID,
"region": "idr01",
"actions": ["s3:ListBucket", "s3:GetObject"],
"scope_type": "prefix",
"resources": ["monthly/"],
"notes": "Monthly reports",
})
RULE_ID = body["rule"]["id"]
201 Created
{
"message": "Access rule created successfully",
"rule": {
"id": "c3a9f6d1-0000-4000-8000-000000000003",
"bucket_name": "reports",
"bucket_region": "idr01",
"grantee_type": "subuser",
"grantee_id": "5f2c8a1e-0000-4000-8000-000000000001",
"grantee_display_name": null,
"effect": "Allow",
"actions": ["s3:ListBucket", "s3:GetObject"],
"permission_preset": null,
"scope_type": "prefix",
"resources": ["monthly/*"],
"conditions": null,
"status": "active",
"suspended_reason": null,
"notes": "Monthly reports",
"createdAt": "2026-11-25T10:20:00.000Z",
"updatedAt": "2026-11-25T10:20:00.000Z",
"region": "idr01",
"permission_display": "Monthly reports",
"scope_display": "monthly/* only",
"restrictions_display": [],
"grantee_display": "5f2c8a1e-0000-4000-8000-000000000001",
"effect_display": "Allow"
}
}
Shortened: a few bookkeeping fields are left out.
Errors
| Status | Code | When |
|---|---|---|
| 400 | (none) | A required field is missing, or scope_type and resources don't match. error says which. |
| 400 | BUCKET_POLICY_SINGLE_BUCKET | The request names more than one bucket. Create one rule per bucket, or use an inline policy rule. |
| 400 | REGION_UNKNOWN | The region is not a Zata region. |
| 400 | INVALID_EFFECT, INVALID_ACTIONS, UNKNOWN_ACTION, ACTIONS_NOT_ALLOWED | effect or actions is not valid. |
| 400 | SUBUSER_ACTION_FORBIDDEN | An action sub-users may not have. |
| 400 | PREFIX_SCOPE_ACTION_FORBIDDEN | A bucket-wide action (such as s3:GetBucketVersioning) on a folder rule. |
| 400 | INVALID_CONDITIONS, CONDITION_NOT_ALLOWED | A condition operator, key or value is not allowed. |
| 400 | SUBUSER_NOT_FOUND | grantee_id is not one of your sub-users. |
| 400 | SUBUSER_REGION_MISMATCH | The sub-user is not in the bucket's region. |
| 403 | REGION_NOT_ALLOWED | The region is not available. |
| 404 | BUCKET_NOT_FOUND | No such bucket in the region, or it isn't yours. |
| 409 | LOG_BUCKET_CANNOT_BE_SHARED | The bucket receives access logs, so it can't be shared. |
| 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 | BUCKET_POLICY_TOO_LARGE | The bucket policy would grow past 256 KB. |
| 409 | BUCKET_POLICY_MALFORMED | The bucket policy can't be read. Nothing was written. |
| 409 | POLICY_LOCK_TIMEOUT, POLICY_LOCK_LOST, BUCKET_POLICY_CONFLICT | Another change to the bucket policy happened at the same time. Read the rules again and retry. |
Get a rule
/buckets/{bucket}/access/{ruleId}Returns one rule, with the fields shown in Create a rule.
Path parameters
| Name | Description |
|---|---|
bucket | The bucket name. |
ruleId | The rule's 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/buckets/reports/access/$RULE_ID"
status, rule = call("GET", f"/buckets/reports/access/{RULE_ID}")
200 OK
The rule object itself, as in the rule field of Create a rule.
Errors
| Status | Code | When |
|---|---|---|
| 404 | (none) | "Access rule not found". |
Change a rule
/buckets/{bucket}/access/{ruleId}Changes a rule. Send only the fields you change. actions replaces the whole list. An action the rule already has may stay even if it is no longer allowed for sub-users, but no new one may be added.
Path parameters
| Name | Description |
|---|---|
bucket | The bucket name. |
ruleId | The rule's id. |
Body
| Field | Type | Required | Description |
|---|---|---|---|
effect | string | No | Allow or Deny. |
actions | array of strings | No | The new list of actions. |
scope_type | string | No | bucket or prefix. |
resources | array of strings | No | Folders, for prefix. Sending resources alone switches the rule to prefix, or to bucket when the list is empty. |
conditions | object | No | As in Create a rule. |
permission_preset | string | No | Label only. |
notes | string | No | A name for the rule. |
grantee_display_name | string | No | How the sub-user is shown. |
- 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 '{"actions": ["s3:ListBucket", "s3:GetObject", "s3:PutObject"]}' \
"https://cli.zata.ai/cli/v1/buckets/reports/access/$RULE_ID"
status, body = call("PUT", f"/buckets/reports/access/{RULE_ID}", {
"actions": ["s3:ListBucket", "s3:GetObject", "s3:PutObject"],
})
200 OK
{
"message": "Access updated successfully",
"rule": {
"id": "c3a9f6d1-0000-4000-8000-000000000003",
"actions": ["s3:ListBucket", "s3:GetObject", "s3:PutObject"],
"status": "active"
}
}
Shortened: rule has all the fields shown in Create a rule.
Errors: those of Create a rule, plus:
| Status | Code | When |
|---|---|---|
| 404 | (none) | "Access rule not found". |
| 409 | CUSTOMER_STATEMENT_READ_ONLY | The rule is a statement you wrote yourself with an S3 tool. It can only be deleted. |
Delete a rule
/buckets/{bucket}/access/{ruleId}Removes the rule from the bucket policy, and the sub-user loses that access.
Path parameters
| Name | Description |
|---|---|
bucket | The bucket name. |
ruleId | The rule'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/buckets/reports/access/$RULE_ID"
status, body = call("DELETE", f"/buckets/reports/access/{RULE_ID}")
200 OK
{
"success": true,
"message": "Access rule deleted successfully"
}
Errors
| Status | Code | When |
|---|---|---|
| 404 | (none) | "Access rule not found". |
| 409 | BUCKET_POLICY_CONFLICT | The bucket policy still carries the rule after the write. The rule is kept; retry. |
| 409 | POLICY_LOCK_TIMEOUT, POLICY_LOCK_LOST | Another change to the bucket policy happened at the same time. Retry. |
Suspend a rule
/buckets/{bucket}/access/{ruleId}/suspendTakes the rule out of the bucket policy but keeps it, so you can resume it later. Suspending a suspended rule changes nothing.
Path parameters
| Name | Description |
|---|---|
bucket | The bucket name. |
ruleId | The rule's id. |
Body
| Field | Type | Required | Description |
|---|---|---|---|
reason | string | No | Why, shown as suspended_reason. Default manual. |
- 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": "Contract paused"}' \
"https://cli.zata.ai/cli/v1/buckets/reports/access/$RULE_ID/suspend"
status, body = call("POST", f"/buckets/reports/access/{RULE_ID}/suspend", {"reason": "Contract paused"})
200 OK
{
"message": "Access suspended",
"rule": {
"id": "c3a9f6d1-0000-4000-8000-000000000003",
"status": "suspended",
"suspended_reason": "Contract paused"
}
}
Shortened: rule has all the fields shown in Create a rule.
Errors
| Status | Code | When |
|---|---|---|
| 404 | (none) | "Access rule not found". |
| 409 | CUSTOMER_STATEMENT_READ_ONLY | A statement you wrote yourself. It can only be deleted. |
| 409 | POLICY_LOCK_TIMEOUT, POLICY_LOCK_LOST, BUCKET_POLICY_CONFLICT | Another change to the bucket policy happened at the same time. Retry. |
Resume a rule
/buckets/{bucket}/access/{ruleId}/resumePuts a suspended rule back into the bucket policy. It is checked again, as if it were new.
Path parameters
| Name | Description |
|---|---|
bucket | The bucket name. |
ruleId | The rule'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/buckets/reports/access/$RULE_ID/resume"
status, body = call("POST", f"/buckets/reports/access/{RULE_ID}/resume")
200 OK
{
"message": "Access resumed",
"rule": {
"id": "c3a9f6d1-0000-4000-8000-000000000003",
"status": "active"
}
}
Shortened: rule has all the fields shown in Create a rule.
Errors
| Status | Code | When |
|---|---|---|
| 400 | (none) | The rule was not found or is not suspended. This endpoint answers 400, not 404. |
| 409 | LOG_BUCKET_CANNOT_BE_SHARED | The bucket now receives access logs. |
| 409 | OBJECT_LOCK_OPT_IN_REQUIRED | The bucket's sub-user Object Lock setting is off. |
| 409 | CUSTOMER_STATEMENT_READ_ONLY | A statement you wrote yourself. |
List a sub-user's buckets
/subusers/{subuserId}/bucketsLists the rules of both types that give the sub-user access, one row per bucket. Deny rules are left out unless you ask for them, and so are buckets in regions where the sub-user is suspended.
Path parameters
| Name | Description |
|---|---|
subuserId | The sub-user's KC_id. |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
region | string | No | Only this region: idr01, bom01. |
include_denied | string | No | true also lists Deny rules. |
sync_mode | string | No | blocking (default) checks your rules against the live bucket policies before answering; async checks in the background; off skips the check. |
- 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/buckets?region=idr01"
status, body = call("GET", f"/subusers/{SUBUSER_ID}/buckets?region=idr01")
200 OK
{
"grantee_id": "5f2c8a1e-0000-4000-8000-000000000001",
"region": "idr01",
"rules_count": 1,
"rules": [
{
"id": "c3a9f6d1-0000-4000-8000-000000000003",
"bucket_name": "reports",
"bucket_region": "idr01",
"effect": "Allow",
"actions": ["s3:ListBucket", "s3:GetObject"],
"scope_type": "prefix",
"resources": ["monthly/*"],
"status": "active"
}
]
}
Shortened: each rule has the fields shown in Create a rule. Inline policy rules have "type": "inline".
Errors
| Status | Code | When |
|---|---|---|
| 400 | (none) | Invalid sync_mode. |
| 403 | SUBUSER_SUSPENDED | The sub-user is suspended in every region. |
| 404 | SUBUSER_NOT_FOUND | No such sub-user, or it isn't yours. |
Grant several buckets
/subusers/{subuserId}/access/bulkCreates one bucket policy rule per bucket for one sub-user, up to 20 in a call. Each share succeeds or fails on its own; the answer lists both. The sub-user gets one notification for the whole call. Here resources without scope_type makes a folder rule.
Path parameters
| Name | Description |
|---|---|
subuserId | The sub-user's KC_id. |
Body
| Field | Type | Required | Description |
|---|---|---|---|
shares | array of objects | Yes | 1 to 20 shares. |
shares[].bucket_name | string | Yes | The bucket. |
shares[].region | string | Yes | Its region, idr01 or bom01. |
shares[].actions | array of strings | Yes | As in Create a rule. |
shares[].effect | string | No | Allow (default) or Deny. |
shares[].scope_type | string | No | bucket or prefix. Inferred from resources when left out. |
shares[].resources | array of strings | No | Folders. |
shares[].conditions | object | No | As in Create a rule. |
shares[].permission_preset | string | No | Label only. |
shares[].notes | string | No | A name for the rule. |
- 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 '{"shares": [
{"bucket_name": "reports", "region": "idr01", "actions": ["s3:ListBucket", "s3:GetObject"]},
{"bucket_name": "invoices", "region": "bom01", "actions": ["s3:ListBucket", "s3:GetObject"], "resources": ["2026/"]}
]}' \
"https://cli.zata.ai/cli/v1/subusers/$SUBUSER_ID/access/bulk"
read = ["s3:ListBucket", "s3:GetObject"]
status, body = call("POST", f"/subusers/{SUBUSER_ID}/access/bulk", {"shares": [
{"bucket_name": "reports", "region": "idr01", "actions": read},
{"bucket_name": "invoices", "region": "bom01", "actions": read, "resources": ["2026/"]},
]})
for f in body.get("failed", []):
print(f["share"]["bucket_name"], f["error"])
201 Created
{
"total": 2,
"created_count": 1,
"failed_count": 1,
"created": [
{
"id": "c3a9f6d1-0000-4000-8000-000000000007",
"bucket_name": "reports",
"bucket_region": "idr01",
"scope_type": "bucket",
"resources": null,
"status": "active"
}
],
"failed": [
{
"share": {
"bucket_name": "invoices",
"bucket_region": "bom01",
"actions": ["s3:ListBucket", "s3:GetObject"],
"resources": ["2026/"],
"permission_preset": null,
"conditions": null,
"notes": null,
"grantee_type": "subuser",
"grantee_id": "5f2c8a1e-0000-4000-8000-000000000001"
},
"error": "This subuser is not in region bom01. A subuser can only be granted buckets in its own region."
}
]
}
Here the sub-user is only in idr01, so the bom01 share fails. Shortened: each created rule has the fields shown in Create a rule. A 201 can still contain failures; always check failed.
Errors
| Status | Code | When |
|---|---|---|
| 400 | (none) | shares is missing, empty, longer than 20, or a share lacks bucket_name or region. |
| 400 | BULK_ACCESS_FAILED | Every share failed. The body has created and failed as above. |
List all your rules
/access/rulesLists all your bucket policy rules across buckets, newest first, one page at a time. Pass next_cursor as cursor to get the next page.
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit | integer | No | Rules per page, 1 to 100. Default 20. |
cursor | string | No | next_cursor from the previous page. |
bucket_name | string | No | Only this bucket. |
bucket_region | string | No | Only this region. Needs bucket_name. |
status | string | No | active, suspended or expired. |
q | string | No | Search in the notes, display name, bucket name, preset, actions and folders. |
sync_mode | string | No | blocking (default), async or off. As in List a sub-user's buckets; only on the first page. |
include_inline | string | No | true also lists inline policy rules, on the first page only. |
- curl
- Python
curl --aws-sigv4 "aws:amz:us-east-1:zata" \
--user "$ZATA_ACCESS_KEY:$ZATA_SECRET_KEY" \
"https://cli.zata.ai/cli/v1/access/rules?limit=50&sync_mode=off"
path, rules = "/access/rules?limit=50&sync_mode=off", []
while path:
status, body = call("GET", path)
rules += body["items"]
path = f"/access/rules?limit=50&sync_mode=off&cursor={body['next_cursor']}" if body["has_more"] else None
200 OK
{
"items": [
{
"id": "c3a9f6d1-0000-4000-8000-000000000003",
"bucket_name": "reports",
"bucket_region": "idr01",
"grantee_type": "subuser",
"grantee_id": "5f2c8a1e-0000-4000-8000-000000000001",
"status": "active"
}
],
"has_more": false,
"next_cursor": null,
"sync": { "skipped": true, "reason": "off" },
"filters": {
"bucket_name": null,
"bucket_region": null,
"status": null,
"q": null,
"sync_mode": "off"
}
}
Shortened: each item has the fields shown in Create a rule.
Errors
| Status | Code | When |
|---|---|---|
| 400 | (none) | A bad parameter: limit, status, sync_mode, cursor, or bucket_region without bucket_name. |
Get the permission catalog
/access/permissionsReturns the presets, S3 actions, condition presets and resource patterns used by bucket policy rules in general. It also lists actions sub-users can't have. For the list sub-users can have, use GET /inline-policies/catalog.
- curl
- Python
curl --aws-sigv4 "aws:amz:us-east-1:zata" \
--user "$ZATA_ACCESS_KEY:$ZATA_SECRET_KEY" \
"https://cli.zata.ai/cli/v1/access/permissions"
status, body = call("GET", "/access/permissions")
200 OK
The body has four fields:
| Field | Contents |
|---|---|
presets | The permission presets, each with its actions. |
actions | object and bucket lists of actions, and dangerous (empty). |
conditions | Condition presets. |
resources | Resource patterns, each with id, name, description, requiresPrefix and requiresKey. |
Errors: none specific to this endpoint.
Check action names
/access/validate-actionsChecks a list of action names against the catalog of known S3 actions. It does not check which actions sub-users may have; creating the rule does that.
Body
| Field | Type | Required | Description |
|---|---|---|---|
actions | array of strings | Yes | The actions to check. Not empty. |
- 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 '{"actions": ["s3:GetObject", "s3:GetObjectz"]}' \
"https://cli.zata.ai/cli/v1/access/validate-actions"
status, body = call("POST", "/access/validate-actions", {"actions": ["s3:GetObject", "s3:GetObjectz"]})
200 OK
The body has valid (true or false), summary, issues with the unknown and dangerous actions, warnings, and safe_actions.
Errors
| Status | Code | When |
|---|---|---|
| 400 | (none) | actions is not an array, or is empty. |