Skip to main content
POST
/
v1
/
policies
Create an access policy
curl --request POST \
  --url https://grantex-auth-dd4mtrt2gq-uc.a.run.app/v1/policies \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "effect": "allow",
  "priority": 0,
  "agentId": "<string>",
  "principalId": "<string>",
  "scopes": [
    "<string>"
  ],
  "timeOfDayStart": "<string>",
  "timeOfDayEnd": "<string>"
}
'
{
  "id": "<string>",
  "name": "<string>",
  "effect": "allow",
  "priority": 123,
  "agentId": "<string>",
  "principalId": "<string>",
  "scopes": [
    "<string>"
  ],
  "timeOfDayStart": "<string>",
  "timeOfDayEnd": "<string>",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Developer API key

Body

application/json
name
string
required
effect
enum<string>
required
Available options:
allow,
deny
priority
integer
default:0

Higher priority policies are evaluated first

agentId
string
principalId
string
scopes
string[]
timeOfDayStart
string

HH:mm format

timeOfDayEnd
string

HH:mm format

Response

Policy created

id
string
name
string
effect
enum<string>
Available options:
allow,
deny
priority
integer
agentId
string
principalId
string
scopes
string[]
timeOfDayStart
string
timeOfDayEnd
string
createdAt
string<date-time>
updatedAt
string<date-time>