Create Policy
Create Policy creates a new policy in Guardian
Query Parameters
dryRun boolean
application/json
Request Body required
id string
Policy unique identifier
version int64
Policy version. Auto-incremented when policy is updated
description string
steps object[]
labels object
createdAt date-time
Policy creation timestamp
updatedAt date-time
Policy last update timestamp
requirements object[]
iam object
appeal object
Responses
- 200
- 400
- 401
- 403
- 404
- 500
- default
A successful response.
application/json
Schema
Example (from schema)
Schema
policy object
{
"policy": {
"id": "f4b7a3c0-9f9b-4b9b-9b0a-9e4b1a1b1b1b",
"version": 1,
"description": "string",
"steps": [
{
"name": "Step 1",
"description": "Step 1 description",
"allowFailed": true,
"when": "string",
"strategy": "auto",
"approveIf": "string",
"approvers": [
"string"
],
"rejectionReason": "string"
}
],
"labels": {},
"createdAt": "2023-06-07T05:39:56.961Z",
"updatedAt": "2023-06-07T05:39:56.961Z",
"requirements": [
{
"on": {
"providerType": "string",
"providerUrn": "string",
"resourceType": "string",
"resourceUrn": "string",
"role": "string",
"conditions": [
{
"field": "string",
"match": {
"eq": {}
}
}
],
"expression": "string"
},
"appeals": [
{
"resource": {
"providerType": "string",
"providerUrn": "string",
"type": "string",
"urn": "string",
"id": "string"
},
"role": "string",
"options": {
"expirationDate": "2023-10-24T20:41:02.817Z",
"duration": "string"
},
"policy": {
"id": "string",
"version": 0
}
}
]
}
],
"iam": {
"provider": "bigquery",
"schema": {}
},
"appeal": {
"durationOptions": [
{
"name": "string",
"value": "string"
}
],
"allowOnBehalf": true,
"allowPermanentAccess": true,
"allowActiveAccessExtensionIn": "string",
"questions": [
{
"key": "string",
"question": "string",
"required": true,
"description": "string"
}
],
"allowCreatorDetailsFailure": true
}
}
}
Bad Request - The request was malformed or contained invalid parameters.
application/json
Schema
Example (from schema)
Schema
code int32
message string
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
Unauthorized - Authentication is required
application/json
Schema
Example (from schema)
Schema
code int32
message string
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
Forbidden - User does not have permission to access the resource
application/json
Schema
Example (from schema)
Schema
code int32
message string
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
Not Found - The requested resource was not found
application/json
Schema
Example (from schema)
Schema
code int32
message string
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
Internal Server Error. Returned when theres is something wrong with Frontier server.
application/json
Schema
Example (from schema)
Schema
code int32
message string
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
An unexpected error response.
application/json
Schema
Example (from schema)
Schema
code int32
message string
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
POST /v1beta1/policies
Authorization
name: X-Auth-Emailtype: apiKeydescription: Email address of the userin: header
Request
Request
curl / cURL
curl -L -X POST 'http://127.0.0.1:7400/v1beta1/policies' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-Auth-Email: <API_KEY_VALUE>' \
--data-raw '{
"id": "f4b7a3c0-9f9b-4b9b-9b0a-9e4b1a1b1b1b",
"version": 1,
"description": "string",
"steps": [
{
"name": "Step 1",
"description": "Step 1 description",
"allowFailed": true,
"when": "string",
"strategy": "auto",
"approveIf": "string",
"approvers": [
"string"
],
"rejectionReason": "string"
}
],
"labels": {},
"createdAt": "2023-06-07T05:39:56.961Z",
"updatedAt": "2023-06-07T05:39:56.961Z",
"requirements": [
{
"on": {
"providerType": "string",
"providerUrn": "string",
"resourceType": "string",
"resourceUrn": "string",
"role": "string",
"conditions": [
{
"field": "string",
"match": {
"eq": {}
}
}
],
"expression": "string"
},
"appeals": [
{
"resource": {
"providerType": "string",
"providerUrn": "string",
"type": "string",
"urn": "string",
"id": "string"
},
"role": "string",
"options": {
"expirationDate": "2023-10-24T20:41:02.734Z",
"duration": "string"
},
"policy": {
"id": "string",
"version": 0
}
}
]
}
],
"iam": {
"provider": "bigquery",
"schema": {}
},
"appeal": {
"durationOptions": [
{
"name": "string",
"value": "string"
}
],
"allowOnBehalf": true,
"allowPermanentAccess": true,
"allowActiveAccessExtensionIn": "string",
"questions": [
{
"key": "string",
"question": "string",
"required": true,
"description": "string"
}
],
"allowCreatorDetailsFailure": true
}
}'
python / requests
curl -L -X POST 'http://127.0.0.1:7400/v1beta1/policies' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-Auth-Email: <API_KEY_VALUE>' \
--data-raw '{
"id": "f4b7a3c0-9f9b-4b9b-9b0a-9e4b1a1b1b1b",
"version": 1,
"description": "string",
"steps": [
{
"name": "Step 1",
"description": "Step 1 description",
"allowFailed": true,
"when": "string",
"strategy": "auto",
"approveIf": "string",
"approvers": [
"string"
],
"rejectionReason": "string"
}
],
"labels": {},
"createdAt": "2023-06-07T05:39:56.961Z",
"updatedAt": "2023-06-07T05:39:56.961Z",
"requirements": [
{
"on": {
"providerType": "string",
"providerUrn": "string",
"resourceType": "string",
"resourceUrn": "string",
"role": "string",
"conditions": [
{
"field": "string",
"match": {
"eq": {}
}
}
],
"expression": "string"
},
"appeals": [
{
"resource": {
"providerType": "string",
"providerUrn": "string",
"type": "string",
"urn": "string",
"id": "string"
},
"role": "string",
"options": {
"expirationDate": "2023-10-24T20:41:02.734Z",
"duration": "string"
},
"policy": {
"id": "string",
"version": 0
}
}
]
}
],
"iam": {
"provider": "bigquery",
"schema": {}
},
"appeal": {
"durationOptions": [
{
"name": "string",
"value": "string"
}
],
"allowOnBehalf": true,
"allowPermanentAccess": true,
"allowActiveAccessExtensionIn": "string",
"questions": [
{
"key": "string",
"question": "string",
"required": true,
"description": "string"
}
],
"allowCreatorDetailsFailure": true
}
}'
go / native
curl -L -X POST 'http://127.0.0.1:7400/v1beta1/policies' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-Auth-Email: <API_KEY_VALUE>' \
--data-raw '{
"id": "f4b7a3c0-9f9b-4b9b-9b0a-9e4b1a1b1b1b",
"version": 1,
"description": "string",
"steps": [
{
"name": "Step 1",
"description": "Step 1 description",
"allowFailed": true,
"when": "string",
"strategy": "auto",
"approveIf": "string",
"approvers": [
"string"
],
"rejectionReason": "string"
}
],
"labels": {},
"createdAt": "2023-06-07T05:39:56.961Z",
"updatedAt": "2023-06-07T05:39:56.961Z",
"requirements": [
{
"on": {
"providerType": "string",
"providerUrn": "string",
"resourceType": "string",
"resourceUrn": "string",
"role": "string",
"conditions": [
{
"field": "string",
"match": {
"eq": {}
}
}
],
"expression": "string"
},
"appeals": [
{
"resource": {
"providerType": "string",
"providerUrn": "string",
"type": "string",
"urn": "string",
"id": "string"
},
"role": "string",
"options": {
"expirationDate": "2023-10-24T20:41:02.734Z",
"duration": "string"
},
"policy": {
"id": "string",
"version": 0
}
}
]
}
],
"iam": {
"provider": "bigquery",
"schema": {}
},
"appeal": {
"durationOptions": [
{
"name": "string",
"value": "string"
}
],
"allowOnBehalf": true,
"allowPermanentAccess": true,
"allowActiveAccessExtensionIn": "string",
"questions": [
{
"key": "string",
"question": "string",
"required": true,
"description": "string"
}
],
"allowCreatorDetailsFailure": true
}
}'
nodejs / axios
curl -L -X POST 'http://127.0.0.1:7400/v1beta1/policies' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-Auth-Email: <API_KEY_VALUE>' \
--data-raw '{
"id": "f4b7a3c0-9f9b-4b9b-9b0a-9e4b1a1b1b1b",
"version": 1,
"description": "string",
"steps": [
{
"name": "Step 1",
"description": "Step 1 description",
"allowFailed": true,
"when": "string",
"strategy": "auto",
"approveIf": "string",
"approvers": [
"string"
],
"rejectionReason": "string"
}
],
"labels": {},
"createdAt": "2023-06-07T05:39:56.961Z",
"updatedAt": "2023-06-07T05:39:56.961Z",
"requirements": [
{
"on": {
"providerType": "string",
"providerUrn": "string",
"resourceType": "string",
"resourceUrn": "string",
"role": "string",
"conditions": [
{
"field": "string",
"match": {
"eq": {}
}
}
],
"expression": "string"
},
"appeals": [
{
"resource": {
"providerType": "string",
"providerUrn": "string",
"type": "string",
"urn": "string",
"id": "string"
},
"role": "string",
"options": {
"expirationDate": "2023-10-24T20:41:02.734Z",
"duration": "string"
},
"policy": {
"id": "string",
"version": 0
}
}
]
}
],
"iam": {
"provider": "bigquery",
"schema": {}
},
"appeal": {
"durationOptions": [
{
"name": "string",
"value": "string"
}
],
"allowOnBehalf": true,
"allowPermanentAccess": true,
"allowActiveAccessExtensionIn": "string",
"questions": [
{
"key": "string",
"question": "string",
"required": true,
"description": "string"
}
],
"allowCreatorDetailsFailure": true
}
}'
ruby / Net::HTTP
curl -L -X POST 'http://127.0.0.1:7400/v1beta1/policies' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-Auth-Email: <API_KEY_VALUE>' \
--data-raw '{
"id": "f4b7a3c0-9f9b-4b9b-9b0a-9e4b1a1b1b1b",
"version": 1,
"description": "string",
"steps": [
{
"name": "Step 1",
"description": "Step 1 description",
"allowFailed": true,
"when": "string",
"strategy": "auto",
"approveIf": "string",
"approvers": [
"string"
],
"rejectionReason": "string"
}
],
"labels": {},
"createdAt": "2023-06-07T05:39:56.961Z",
"updatedAt": "2023-06-07T05:39:56.961Z",
"requirements": [
{
"on": {
"providerType": "string",
"providerUrn": "string",
"resourceType": "string",
"resourceUrn": "string",
"role": "string",
"conditions": [
{
"field": "string",
"match": {
"eq": {}
}
}
],
"expression": "string"
},
"appeals": [
{
"resource": {
"providerType": "string",
"providerUrn": "string",
"type": "string",
"urn": "string",
"id": "string"
},
"role": "string",
"options": {
"expirationDate": "2023-10-24T20:41:02.734Z",
"duration": "string"
},
"policy": {
"id": "string",
"version": 0
}
}
]
}
],
"iam": {
"provider": "bigquery",
"schema": {}
},
"appeal": {
"durationOptions": [
{
"name": "string",
"value": "string"
}
],
"allowOnBehalf": true,
"allowPermanentAccess": true,
"allowActiveAccessExtensionIn": "string",
"questions": [
{
"key": "string",
"question": "string",
"required": true,
"description": "string"
}
],
"allowCreatorDetailsFailure": true
}
}'
csharp / RestSharp
curl -L -X POST 'http://127.0.0.1:7400/v1beta1/policies' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-Auth-Email: <API_KEY_VALUE>' \
--data-raw '{
"id": "f4b7a3c0-9f9b-4b9b-9b0a-9e4b1a1b1b1b",
"version": 1,
"description": "string",
"steps": [
{
"name": "Step 1",
"description": "Step 1 description",
"allowFailed": true,
"when": "string",
"strategy": "auto",
"approveIf": "string",
"approvers": [
"string"
],
"rejectionReason": "string"
}
],
"labels": {},
"createdAt": "2023-06-07T05:39:56.961Z",
"updatedAt": "2023-06-07T05:39:56.961Z",
"requirements": [
{
"on": {
"providerType": "string",
"providerUrn": "string",
"resourceType": "string",
"resourceUrn": "string",
"role": "string",
"conditions": [
{
"field": "string",
"match": {
"eq": {}
}
}
],
"expression": "string"
},
"appeals": [
{
"resource": {
"providerType": "string",
"providerUrn": "string",
"type": "string",
"urn": "string",
"id": "string"
},
"role": "string",
"options": {
"expirationDate": "2023-10-24T20:41:02.734Z",
"duration": "string"
},
"policy": {
"id": "string",
"version": 0
}
}
]
}
],
"iam": {
"provider": "bigquery",
"schema": {}
},
"appeal": {
"durationOptions": [
{
"name": "string",
"value": "string"
}
],
"allowOnBehalf": true,
"allowPermanentAccess": true,
"allowActiveAccessExtensionIn": "string",
"questions": [
{
"key": "string",
"question": "string",
"required": true,
"description": "string"
}
],
"allowCreatorDetailsFailure": true
}
}'
php / cURL
curl -L -X POST 'http://127.0.0.1:7400/v1beta1/policies' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-Auth-Email: <API_KEY_VALUE>' \
--data-raw '{
"id": "f4b7a3c0-9f9b-4b9b-9b0a-9e4b1a1b1b1b",
"version": 1,
"description": "string",
"steps": [
{
"name": "Step 1",
"description": "Step 1 description",
"allowFailed": true,
"when": "string",
"strategy": "auto",
"approveIf": "string",
"approvers": [
"string"
],
"rejectionReason": "string"
}
],
"labels": {},
"createdAt": "2023-06-07T05:39:56.961Z",
"updatedAt": "2023-06-07T05:39:56.961Z",
"requirements": [
{
"on": {
"providerType": "string",
"providerUrn": "string",
"resourceType": "string",
"resourceUrn": "string",
"role": "string",
"conditions": [
{
"field": "string",
"match": {
"eq": {}
}
}
],
"expression": "string"
},
"appeals": [
{
"resource": {
"providerType": "string",
"providerUrn": "string",
"type": "string",
"urn": "string",
"id": "string"
},
"role": "string",
"options": {
"expirationDate": "2023-10-24T20:41:02.734Z",
"duration": "string"
},
"policy": {
"id": "string",
"version": 0
}
}
]
}
],
"iam": {
"provider": "bigquery",
"schema": {}
},
"appeal": {
"durationOptions": [
{
"name": "string",
"value": "string"
}
],
"allowOnBehalf": true,
"allowPermanentAccess": true,
"allowActiveAccessExtensionIn": "string",
"questions": [
{
"key": "string",
"question": "string",
"required": true,
"description": "string"
}
],
"allowCreatorDetailsFailure": true
}
}'
java / OkHttp
curl -L -X POST 'http://127.0.0.1:7400/v1beta1/policies' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-Auth-Email: <API_KEY_VALUE>' \
--data-raw '{
"id": "f4b7a3c0-9f9b-4b9b-9b0a-9e4b1a1b1b1b",
"version": 1,
"description": "string",
"steps": [
{
"name": "Step 1",
"description": "Step 1 description",
"allowFailed": true,
"when": "string",
"strategy": "auto",
"approveIf": "string",
"approvers": [
"string"
],
"rejectionReason": "string"
}
],
"labels": {},
"createdAt": "2023-06-07T05:39:56.961Z",
"updatedAt": "2023-06-07T05:39:56.961Z",
"requirements": [
{
"on": {
"providerType": "string",
"providerUrn": "string",
"resourceType": "string",
"resourceUrn": "string",
"role": "string",
"conditions": [
{
"field": "string",
"match": {
"eq": {}
}
}
],
"expression": "string"
},
"appeals": [
{
"resource": {
"providerType": "string",
"providerUrn": "string",
"type": "string",
"urn": "string",
"id": "string"
},
"role": "string",
"options": {
"expirationDate": "2023-10-24T20:41:02.734Z",
"duration": "string"
},
"policy": {
"id": "string",
"version": 0
}
}
]
}
],
"iam": {
"provider": "bigquery",
"schema": {}
},
"appeal": {
"durationOptions": [
{
"name": "string",
"value": "string"
}
],
"allowOnBehalf": true,
"allowPermanentAccess": true,
"allowActiveAccessExtensionIn": "string",
"questions": [
{
"key": "string",
"question": "string",
"required": true,
"description": "string"
}
],
"allowCreatorDetailsFailure": true
}
}'
powershell / RestMethod
curl -L -X POST 'http://127.0.0.1:7400/v1beta1/policies' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-Auth-Email: <API_KEY_VALUE>' \
--data-raw '{
"id": "f4b7a3c0-9f9b-4b9b-9b0a-9e4b1a1b1b1b",
"version": 1,
"description": "string",
"steps": [
{
"name": "Step 1",
"description": "Step 1 description",
"allowFailed": true,
"when": "string",
"strategy": "auto",
"approveIf": "string",
"approvers": [
"string"
],
"rejectionReason": "string"
}
],
"labels": {},
"createdAt": "2023-06-07T05:39:56.961Z",
"updatedAt": "2023-06-07T05:39:56.961Z",
"requirements": [
{
"on": {
"providerType": "string",
"providerUrn": "string",
"resourceType": "string",
"resourceUrn": "string",
"role": "string",
"conditions": [
{
"field": "string",
"match": {
"eq": {}
}
}
],
"expression": "string"
},
"appeals": [
{
"resource": {
"providerType": "string",
"providerUrn": "string",
"type": "string",
"urn": "string",
"id": "string"
},
"role": "string",
"options": {
"expirationDate": "2023-10-24T20:41:02.734Z",
"duration": "string"
},
"policy": {
"id": "string",
"version": 0
}
}
]
}
],
"iam": {
"provider": "bigquery",
"schema": {}
},
"appeal": {
"durationOptions": [
{
"name": "string",
"value": "string"
}
],
"allowOnBehalf": true,
"allowPermanentAccess": true,
"allowActiveAccessExtensionIn": "string",
"questions": [
{
"key": "string",
"question": "string",
"required": true,
"description": "string"
}
],
"allowCreatorDetailsFailure": true
}
}'