API Documentation

API Endpoint

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:

ApprovalPolicy diagram

Supported filter params

  • id

  • custom (boolean)

  • status (active: 1, archived: 2)

  • type_id (event: 1, budget: 2)

GET /api/v2/approval_policies
Requestsreturns approval policies

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
Responses200
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 policies
GET/api/v2/approval_policies


GET /api/v2/approval_policies/1
Requestsreturns approval policy

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
Responses200
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 policy
GET/api/v2/approval_policies/{id}

URI Parameters
HideShow
id
number (required) Example: 1

approval policy id


POST /api/v2/approval_policies
Requestscreates the approval policyreturns validation error

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
    }
  }
}
Responses201
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
    }
  }
}
Responses422
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 policy
POST/api/v2/approval_policies

URI Parameters
HideShow
name
string (optional) Example: Example+approval+policy

name of the approval policy

description
string (optional) Example: Some+description

description of the approval policy

type_id
number (required) Example: 1

type of the approval policy (1: event)

custom
boolean (optional) Example: false

flag that tells if approval policy is custom or generic

default
boolean (optional) Example: false

flag that tells if generic approval policy is organization default


PATCH /api/v2/approval_policies/
Requestsupdates approval policyreturns error

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"
    }
  }
}
Responses200
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
    }
  }
}
Responses422
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 policy
PATCH/api/v2/approval_policies/

URI Parameters
HideShow
name
string (optional) Example: Example+approval+policy

name of the approval policy

description
string (optional) Example: Some+description

description of the approval policy

type_id
number (required) Example: 1

type of the approval policy (1: event)

custom
boolean (optional) Example: false

flag that tells if approval policy is custom or generic

default
boolean (optional) Example: false

flag that tells if generic approval policy is organization default


PATCH /api/v2/approval_policies/1/archive
Requestsarchives approval policyreturns error when approval policy already archived

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
Responses200
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
Responses409
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 policy
PATCH/api/v2/approval_policies/{id}/archive

URI Parameters
HideShow
id
number (required) Example: 1

approval policy id


PATCH /api/v2/approval_policies/1/restore
Requestsrestores approval policyreturns error when approval policy not archived

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
Responses200
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
Responses409
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 policy
PATCH/api/v2/approval_policies/{id}/restore

URI Parameters
HideShow
id
number (required) Example: 1

approval policy id


Generated by aglio on 01 Aug 2025