Policy API
Create a policy draft
POST
/
v1
/
organization
/
policies
Create a policy draft
curl --request POST \
--url https://api.abliteration.ai/v1/organization/policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"name": "<string>",
"rule": "<string>",
"description": "",
"mode": "monitoring",
"project_ids": [
"<string>"
],
"match_threshold_basis_points": 5000
}
'import requests
url = "https://api.abliteration.ai/v1/organization/policies"
payload = {
"name": "<string>",
"rule": "<string>",
"description": "",
"mode": "monitoring",
"project_ids": ["<string>"],
"match_threshold_basis_points": 5000
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
rule: '<string>',
description: '',
mode: 'monitoring',
project_ids: ['<string>'],
match_threshold_basis_points: 5000
})
};
fetch('https://api.abliteration.ai/v1/organization/policies', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"state": "draft",
"revision": 123,
"has_unpublished_changes": true,
"created_at": 123,
"updated_at": 123,
"draft": {
"rule": "<string>",
"direction": "request",
"mode": "monitoring",
"scope": "organization",
"project_ids": [
"<string>"
],
"match_threshold_basis_points": 123,
"base_version": 123
},
"object": "organization.policy",
"current_version": 123,
"published": {
"id": "<string>",
"version": 123,
"direction": "request",
"mode": "monitoring",
"scope": "organization",
"project_ids": [
"<string>"
],
"published_at": 123,
"current": true,
"rule": "<string>",
"object": "organization.policy.version",
"match_threshold_basis_points": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}Authorizations
Server-side organization-owned Abliteration Admin API key. Never expose this credential in browser code.
Headers
Client-generated key used to safely retry this mutation.
Required string length:
8 - 200Body
application/json
Required string length:
1 - 80Required string length:
1 - 20000Available options:
request, response, both Available options:
organization, projects, unattached Maximum string length:
240Available options:
monitoring, enforcing Maximum array length:
1000Required range:
1 <= x <= 9999Response
Successful Response
Available options:
draft, monitoring, enforcing, paused Show child attributes
Show child attributes
Allowed value:
"organization.policy"Show child attributes
Show child attributes
⌘I
Create a policy draft
curl --request POST \
--url https://api.abliteration.ai/v1/organization/policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"name": "<string>",
"rule": "<string>",
"description": "",
"mode": "monitoring",
"project_ids": [
"<string>"
],
"match_threshold_basis_points": 5000
}
'import requests
url = "https://api.abliteration.ai/v1/organization/policies"
payload = {
"name": "<string>",
"rule": "<string>",
"description": "",
"mode": "monitoring",
"project_ids": ["<string>"],
"match_threshold_basis_points": 5000
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
rule: '<string>',
description: '',
mode: 'monitoring',
project_ids: ['<string>'],
match_threshold_basis_points: 5000
})
};
fetch('https://api.abliteration.ai/v1/organization/policies', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"state": "draft",
"revision": 123,
"has_unpublished_changes": true,
"created_at": 123,
"updated_at": 123,
"draft": {
"rule": "<string>",
"direction": "request",
"mode": "monitoring",
"scope": "organization",
"project_ids": [
"<string>"
],
"match_threshold_basis_points": 123,
"base_version": 123
},
"object": "organization.policy",
"current_version": 123,
"published": {
"id": "<string>",
"version": 123,
"direction": "request",
"mode": "monitoring",
"scope": "organization",
"project_ids": [
"<string>"
],
"published_at": 123,
"current": true,
"rule": "<string>",
"object": "organization.policy.version",
"match_threshold_basis_points": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "auth_error",
"request_id": "<string>",
"param": "<string>",
"doc_url": "<string>"
}
}