Skip to content

Authorize a request

POST
/authorize
curl --request POST \
--url https://outpost-iad.zstrike.io/authorize \
--header 'Content-Type: application/json' \
--header 'X-Client-Token: <X-Client-Token>' \
--data '{ "principal": "User::\"alice\"", "action": "Action::\"read\"", "resource": "Document::\"doc-1\"", "context": {}, "entities": [ {} ] }'

Evaluates the Cedar policies of the project and returns Allow or Deny. The X-Client-Token header selects the project. If the project has an enabled trusted identity provider, send the user JWT (default header Authorization: Bearer <jwt>); the PDP then takes the principal from the JWT and denies the request if the body principal differs. A non-empty entities array requires an app token in x-app-token with the inline_entities: ["assert"] permission. Every error response carries a Deny decision.

Media typeapplication/json
object
principal
required
string

Example

User::"alice"
action
required
string

Example

Action::"read"
resource
required
string

Example

Document::"doc-1"
context
object
key
additional properties
any
entities

Caller-asserted entities (the resource and its ancestors). Requires x-app-token.

Array<object>
<= 16 items
object
key
additional properties
any

Decision (Allow or Deny)

Media typeapplication/json
object
code
required
integer
description
required
string
data
required
object
decision
required
string
Allowed values: Allow Deny
diagnostics
required
object
reason

IDs of the policies that decided the result

Array<string>
errors
Array<string>

Example

{
"code": 200,
"data": {
"decision": "Allow"
}
}

Invalid principal, action, resource, context, or inline entities

Media typeapplication/json
object
code
required
integer
description
required
string
data
required
object
decision
required
string
Allowed values: Allow Deny
diagnostics
required
object
reason

IDs of the policies that decided the result

Array<string>
errors
Array<string>

Example

{
"code": 200,
"data": {
"decision": "Allow"
}
}

Missing or unknown X-Client-Token, or JWT validation failed

Media typeapplication/json
object
code
required
integer
description
required
string
data
required
object
decision
required
string
Allowed values: Allow Deny
diagnostics
required
object
reason

IDs of the policies that decided the result

Array<string>
errors
Array<string>

Example

{
"code": 200,
"data": {
"decision": "Allow"
}
}

Body principal does not match the JWT, caller IP unavailable, or session state unavailable

Media typeapplication/json
object
code
required
integer
description
required
string
data
required
object
decision
required
string
Allowed values: Allow Deny
diagnostics
required
object
reason

IDs of the policies that decided the result

Array<string>
errors
Array<string>

Example

{
"code": 200,
"data": {
"decision": "Allow"
}
}

Authorization failed

Media typeapplication/json
object
code
required
integer
description
required
string
data
required
object
decision
required
string
Allowed values: Allow Deny
diagnostics
required
object
reason

IDs of the policies that decided the result

Array<string>
errors
Array<string>

Example

{
"code": 200,
"data": {
"decision": "Allow"
}
}