Skip to main content
POST
/
v2
/
PolicyCreate
Create a new policy
curl --request POST \
  --url http://localhost:3000/v2/PolicyCreate \
  --header 'Content-Type: application/json' \
  --header 'X-Bunker-Token: <api-key>' \
  --data '
{
  "policyname": "<string>",
  "policy": {
    "Effect": "Allow",
    "Principal": {},
    "Action": [
      "<string>"
    ],
    "Resource": [
      "<string>"
    ],
    "Condition": {}
  },
  "policydesc": "<string>",
  "request_metadata": {}
}
'
{
  "status": "ok",
  "policyid": 123
}

Authorizations

X-Bunker-Token
string
header
required

API token for authentication

Body

application/json
policyname
string
required

Name of the policy

policy
object
required

Policy definition

policydesc
string

Description of the policy

request_metadata
object

Additional metadata for the request

Response

200 - application/json

Policy created successfully

status
string
Example:

"ok"

policyid
integer

ID of the created policy