API Documentation
Approval Policies ¶
Approval Policy ¶
ApprovalPolicy is an entity that integrates multiple Approval workflows and acts as a parent object which defines who is responsible for approving corresponding approval requests. Each ApprovalPolicy can be linked to an individual target through ApprovalPolicyAssignments. The target can be either a person or a budget, depending on the type of approval policy. Time-off approval policies have type_id set to 1, while budget policies have type_id set to 2. We distinguish between generic approval policies and custom approval policies. Generic approval policies are defined at the organizational level and these policies can be assigned to multiple individuals simultaneously. Custom approval policies are tailored for specific individuals and these policies can only be assigned to one target at a time.
Following diagram shows approval policies in our data hierarchy:
Supported filter params
-
id
-
custom (boolean)
-
status (active: 1, archived: 2)
-
type_id (event: 1, budget: 2)
GET /api/v2/approval_policies
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
"data": [
{
"id": "16",
"type": "approval_policies",
"attributes": {
"archived_at": null,
"custom": false,
"default": false,
"description": "description",
"name": "approval policy",
"type_id": 1
},
"relationships": {
"organization": {
"data": {
"type": "organizations",
"id": "2301"
}
}
}
},
{
"id": "17",
"type": "approval_policies",
"attributes": {
"archived_at": null,
"custom": false,
"default": false,
"description": "description",
"name": "approval policy",
"type_id": 1
},
"relationships": {
"organization": {
"data": {
"type": "organizations",
"id": "2301"
}
}
}
}
],
"links": {
"first": "http://api-test.productive.io/api/v2/approval_policies?page%5Bnumber%5D=1&page%5Bsize%5D=30",
"last": "http://api-test.productive.io/api/v2/approval_policies?page%5Bnumber%5D=1&page%5Bsize%5D=30"
},
"meta": {
"current_page": 1,
"total_pages": 1,
"total_count": 2,
"page_size": 30,
"max_page_size": 200
}
}
Get approval policiesGET/api/v2/approval_policies
GET /api/v2/approval_policies/18
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
"data": {
"id": "18",
"type": "approval_policies",
"attributes": {
"archived_at": null,
"custom": false,
"default": false,
"description": "description",
"name": "approval policy",
"type_id": 1
},
"relationships": {
"organization": {
"data": {
"type": "organizations",
"id": "2302"
}
}
}
},
"meta": {}
}
Gets the approval policyGET/api/v2/approval_policies/{id}
- id
number
(required) Example: 1approval policy id
POST /api/v2/approval_policies
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
"data": {
"type": "approval_policies",
"attributes": {
"name": "Vacation policy",
"type_id": 1
}
}
}
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
"data": {
"id": "19",
"type": "approval_policies",
"attributes": {
"archived_at": null,
"custom": false,
"default": false,
"description": null,
"name": "Vacation policy",
"type_id": 1
},
"relationships": {
"organization": {
"data": {
"type": "organizations",
"id": "2303"
}
}
}
},
"meta": {}
}
POST /api/v2/approval_policies
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
"data": {
"type": "approval_policies",
"attributes": {
"name": "Vacation policy",
"type_id": 0
}
}
}
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
"errors": [
{
"status": "422",
"code": "invalid_attribute",
"title": "Invalid Attribute",
"detail": "is not included in the list",
"source": {
"pointer": "data/attributes/type_id"
}
}
]
}
Creates the approval policyPOST/api/v2/approval_policies
- name
string
(optional) Example: Example+approval+policyname of the approval policy
- description
string
(optional) Example: Some+descriptiondescription of the approval policy
- type_id
number
(required) Example: 1type of the approval policy (1: event)
- custom
boolean
(optional) Example: falseflag that tells if approval policy is custom or generic
- default
boolean
(optional) Example: falseflag that tells if generic approval policy is organization default
PATCH /api/v2/approval_policies/20
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
"data": {
"type": "approval_policies",
"attributes": {
"name": "Updated name"
}
}
}
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
"data": {
"id": "20",
"type": "approval_policies",
"attributes": {
"archived_at": null,
"custom": false,
"default": false,
"description": "description",
"name": "Updated name",
"type_id": 1
},
"relationships": {
"organization": {
"data": {
"type": "organizations",
"id": "2305"
}
}
}
},
"meta": {}
}
PATCH /api/v2/approval_policies/21
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
"data": {
"type": "approval_policies",
"attributes": {
"type_id": null
}
}
}
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
"errors": [
{
"status": "422",
"code": "invalid_attribute",
"title": "Invalid Attribute",
"detail": "can't be blank",
"source": {
"pointer": "data/attributes/type_id"
}
},
{
"status": "422",
"code": "invalid_attribute",
"title": "Invalid Attribute",
"detail": "is not included in the list",
"source": {
"pointer": "data/attributes/type_id"
}
}
]
}
Updates the approval policyPATCH/api/v2/approval_policies/
- name
string
(optional) Example: Example+approval+policyname of the approval policy
- description
string
(optional) Example: Some+descriptiondescription of the approval policy
- type_id
number
(required) Example: 1type of the approval policy (1: event)
- custom
boolean
(optional) Example: falseflag that tells if approval policy is custom or generic
- default
boolean
(optional) Example: falseflag that tells if generic approval policy is organization default
PATCH /api/v2/approval_policies/22/archive
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
"data": {
"id": "22",
"type": "approval_policies",
"attributes": {
"archived_at": "2025-08-01T06:24:22.000+02:00",
"custom": false,
"default": false,
"description": "description",
"name": "approval policy",
"type_id": 1
},
"relationships": {
"organization": {
"data": {
"type": "organizations",
"id": "2307"
}
}
}
},
"meta": {}
}
PATCH /api/v2/approval_policies/23/archive
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
"errors": [
{
"status": "409",
"code": "record_already_archived",
"title": "Conflict error",
"source": {}
}
]
}
Archives the approval policyPATCH/api/v2/approval_policies/{id}/archive
- id
number
(required) Example: 1approval policy id
PATCH /api/v2/approval_policies/24/restore
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
"data": {
"id": "24",
"type": "approval_policies",
"attributes": {
"archived_at": null,
"custom": false,
"default": false,
"description": "description",
"name": "approval policy",
"type_id": 1
},
"relationships": {
"organization": {
"data": {
"type": "organizations",
"id": "2309"
}
}
}
},
"meta": {}
}
PATCH /api/v2/approval_policies/25/restore
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
"errors": [
{
"status": "409",
"code": "record_not_archived",
"title": "Conflict error",
"source": {}
}
]
}
Restores the approval policyPATCH/api/v2/approval_policies/{id}/restore
- id
number
(required) Example: 1approval policy id
Generated by aglio on 01 Aug 2025