Skip to main content
POST
Error

Authorizations

Authorization
string
header
required

A StarTree API token or a service token (st-<accessKey>-<secretKey>).

Body

application/json
name
string
required

Unique policy name. Becomes the identifier in the SRN srn2:policy#<name> and cannot be changed later.

Example:

"my-read-only-policy"

policyDocumentJson
string
required

The policy document as a JSON string (escape the inner quotes). See Custom Policy Configuration for the format.

Example:

"{\"version\":\"v1\",\"statements\":[{\"effect\":\"allow\",\"actions\":[\"query\"],\"resources\":[\"srn2:cluster#*:table#myTable\"]}]}"

description
string
Example:

"Policy allowing query on myTable"

Response

The created policy.

srn
string
Example:

"srn2:policy#my-read-only-policy"

name
string
Example:

"my-read-only-policy"

description
string
Example:

"Policy allowing query on myTable"

policyDocumentJson
string

The policy document as a JSON string (escape the inner quotes). See Custom Policy Configuration for the format.

Example:

"{\"version\":\"v1\",\"statements\":[{\"effect\":\"allow\",\"actions\":[\"query\"],\"resources\":[\"srn2:cluster#*:table#myTable\"]}]}"

createdAt
string<date-time>
Example:

"2024-09-04T00:28:30.876+00:00"

lastUpdatedAt
string<date-time>
Example:

"2024-09-04T00:28:30.876+00:00"

createdBy
string

SRN of the principal that created the resource. Predefined StarTree resources show startree-rbac-manager.

Example:

"srn:zone:user:default:abcd1234"

lastUpdatedBy
string
Example:

"srn:zone:user:default:abcd1234"