API Documentation

API Endpoint

Approval Workflows

Approval Workflow

The ApprovalWorkflow entity serves as the core component of the ApprovalPolicy object. It defines and manages information about approvers and subscribers, including the explicit and dynamic approvers and subscribers. Explicit approvers or subscribers can be assigned using the approver_ids or subscriber_ids arrays, which contain the IDs of the respective person objects designated as approvers or subscribers. Dynamic approvers and subscribers can be configured using the dynamic_approvers_ids or dynamic_subscriber_ids arrays, which include the ID of one of the following options:

  • Manager (id: 1) – The person’s manager is automatically assigned as the approver or subscriber for the corresponding request.

When creating an approval workflow, it is necessary to define the approval_requirement_id, which determines whether approval is required for the corresponding requests and, if so, it defines the level of the needed approval. The available values for approval_requirement_id are:

  • approval_requirement_id: 1 - None -> No approval is required for the request to be considered approved.

  • approval_requirement_id: 2 - Any of the listed approvers -> Approval from at least one approver is sufficient for the request to be considered approved.

  • approval_requirement_id: 3 - All listed approvers -> Approval from all listed approvers is required for the request to be considered approved.

Following diagram shows approval workflows in our data hierarchy:

ApprovalWorkflow diagram

Supported filter params

  • id (array)

  • event_id (array)

  • approval_policy_id (array)

GET /api/v2/approval_workflows
Requestsreturns approval workflows

GET  /api/v2/approval_workflows

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": "1",
      "type": "approval_workflows",
      "attributes": {
        "approval_requirement_id": 3,
        "target_type_id": 1,
        "dynamic_approver_ids": [],
        "dynamic_subscriber_ids": []
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": "5"
          }
        },
        "event": {
          "meta": {
            "included": false
          }
        },
        "approval_policy": {
          "meta": {
            "included": false
          }
        },
        "approvers": {
          "meta": {
            "included": false
          }
        },
        "subscribers": {
          "meta": {
            "included": false
          }
        }
      }
    },
    {
      "id": "2",
      "type": "approval_workflows",
      "attributes": {
        "approval_requirement_id": 3,
        "target_type_id": 3,
        "dynamic_approver_ids": [],
        "dynamic_subscriber_ids": []
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": "5"
          }
        },
        "event": {
          "meta": {
            "included": false
          }
        },
        "approval_policy": {
          "meta": {
            "included": false
          }
        },
        "approvers": {
          "meta": {
            "included": false
          }
        },
        "subscribers": {
          "meta": {
            "included": false
          }
        }
      }
    },
    {
      "id": "3",
      "type": "approval_workflows",
      "attributes": {
        "approval_requirement_id": 3,
        "target_type_id": 2,
        "dynamic_approver_ids": [],
        "dynamic_subscriber_ids": []
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": "5"
          }
        },
        "event": {
          "meta": {
            "included": false
          }
        },
        "approval_policy": {
          "meta": {
            "included": false
          }
        },
        "approvers": {
          "meta": {
            "included": false
          }
        },
        "subscribers": {
          "meta": {
            "included": false
          }
        }
      }
    },
    {
      "id": "4",
      "type": "approval_workflows",
      "attributes": {
        "approval_requirement_id": 3,
        "target_type_id": 1,
        "dynamic_approver_ids": [],
        "dynamic_subscriber_ids": []
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": "5"
          }
        },
        "event": {
          "meta": {
            "included": false
          }
        },
        "approval_policy": {
          "meta": {
            "included": false
          }
        },
        "approvers": {
          "meta": {
            "included": false
          }
        },
        "subscribers": {
          "meta": {
            "included": false
          }
        }
      }
    }
  ],
  "links": {
    "first": "http://api-test.productive.io/api/v2/approval_workflows?page%5Bnumber%5D=1&page%5Bsize%5D=30",
    "last": "http://api-test.productive.io/api/v2/approval_workflows?page%5Bnumber%5D=1&page%5Bsize%5D=30"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 4,
    "page_size": 30,
    "max_page_size": 200
  }
}

Get approval workflows
GET/api/v2/approval_workflows


GET /api/v2/approval_workflows/1
Requestsreturns approval workflow

GET  /api/v2/approval_workflows/9

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": "9",
    "type": "approval_workflows",
    "attributes": {
      "approval_requirement_id": 3,
      "target_type_id": 1,
      "dynamic_approver_ids": [],
      "dynamic_subscriber_ids": []
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": "7"
        }
      },
      "event": {
        "meta": {
          "included": false
        }
      },
      "approval_policy": {
        "meta": {
          "included": false
        }
      },
      "approvers": {
        "meta": {
          "included": false
        }
      },
      "subscribers": {
        "meta": {
          "included": false
        }
      }
    }
  },
  "meta": {}
}

Gets the approval workflow
GET/api/v2/approval_workflows/{id}

URI Parameters
HideShow
id
number (required) Example: 1

approval workflow id


POST /api/v2/approval_workflows
Requestscreates the approval workflow

POST  /api/v2/approval_workflows

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_workflows",
    "attributes": {
      "event_id": 11,
      "approval_policy_id": 11,
      "approval_requirement_id": 1
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "11",
    "type": "approval_workflows",
    "attributes": {
      "approval_requirement_id": 1,
      "target_type_id": 1,
      "dynamic_approver_ids": [],
      "dynamic_subscriber_ids": []
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": "8"
        }
      },
      "event": {
        "meta": {
          "included": false
        }
      },
      "approval_policy": {
        "meta": {
          "included": false
        }
      },
      "approvers": {
        "meta": {
          "included": false
        }
      },
      "subscribers": {
        "meta": {
          "included": false
        }
      }
    }
  },
  "meta": {}
}

Creates the approval workflow
POST/api/v2/approval_workflows

URI Parameters
HideShow
event_id
number (required) Example: 1

event id

approval_policy_id
number (required) Example: 1

approval policy id

target_type_id
number (required) Example: 1

target type id (1: event)

approval_requirement_id
number (required) Example: 1

approval requirement id (1: None, 2: Any of, 3: All of)

dynamic_approver_ids
array (optional) Example: %5B1%5D

ids of dynamic approvers option (1: Manager)

dynamic_subscriber_ids
array (optional) Example: %5B1%5D

ids of dynamic subsribers option (1: Manager)

approver_ids
array (optional) Example: %5B1%5D

ids of people who need to approve the request

subscriber_ids
array (optional) Example: %5B1%5D

ids of people who will be notified about the request


PATCH /api/v2/approval_workflows/1
Requestsupdates approval workflowreturns error

PATCH  /api/v2/approval_workflows/13

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_workflows",
    "attributes": {
      "approver_ids": [
        48
      ]
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "13",
    "type": "approval_workflows",
    "attributes": {
      "approval_requirement_id": 3,
      "target_type_id": 1,
      "dynamic_approver_ids": [],
      "dynamic_subscriber_ids": []
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": "10"
        }
      },
      "event": {
        "meta": {
          "included": false
        }
      },
      "approval_policy": {
        "meta": {
          "included": false
        }
      },
      "approvers": {
        "meta": {
          "included": false
        }
      },
      "subscribers": {
        "meta": {
          "included": false
        }
      }
    }
  },
  "meta": {}
}

PATCH  /api/v2/approval_workflows/14

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_workflows",
    "attributes": {
      "event_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/event"
      }
    },
    {
      "status": "422",
      "code": "invalid_attribute",
      "title": "Invalid Attribute",
      "detail": "approver list can't be empty",
      "source": {
        "pointer": "data/attributes/approver_ids"
      }
    }
  ]
}

Updates the approval workflow
PATCH/api/v2/approval_workflows/{id}

URI Parameters
HideShow
id
number (required) Example: 1

approval workflow id


DELETE /api/v2/approval_workflows/1
Requestsdeletes the approval workflow

DELETE  /api/v2/approval_workflows/15

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
Responses204
This response has no content.

Deletes the approval workflow
DELETE/api/v2/approval_workflows/{id}

URI Parameters
HideShow
id
number (required) Example: 1

approval workflow id


Generated by aglio on 01 Aug 2025