Skip to main content

Create an IAM policy

POST 

/v1/providers/:provider_id/orgs/:org_id/policies

Creates a new IAM policy with the given name and document. Returns 409 if a policy with the same name already exists — use Update Policy to modify existing policies.

The policy document follows the AWS IAM policy syntax.

After creating a policy, attach it to an access key using the Update Access Key endpoint with the add_policies field.

Example: Read-write access to a prefix
{
"name": "uploads-readwrite",
"document": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["s3:GetObject", "s3:PutObject", "s3:DeleteObject"],
"Resource": ["arn:aws:s3:::my-bucket/uploads/*"]
},
{
"Effect": "Allow",
"Action": ["s3:ListBucket"],
"Resource": ["arn:aws:s3:::my-bucket"]
}
]
}
}

Request

Responses

OK