curl --request POST \
--url https://api.hyperline.co/v1/approvals/workflows \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Enterprise quote approval",
"applicable_flows": [
"quote_subscription"
],
"is_active": true,
"priority": 10,
"step_execution": "sequential",
"rules": [
{
"operator": "and",
"conditions": [
{
"field": "total_amount",
"operator": "gte",
"value": 100000
}
]
}
],
"steps": [
{
"name": "Finance approval",
"order": 1,
"approver_requirement": "any",
"approver_role_ids": [
"rol_DKL4Xcb5VSa8CQ"
],
"approver_user_ids": [
"usr_DKL4Xcb5VSa8CQ"
]
}
],
"description": "Requires approval for high-value subscription quotes.",
"email_notification_enabled": true
}
'import requests
url = "https://api.hyperline.co/v1/approvals/workflows"
payload = {
"name": "Enterprise quote approval",
"applicable_flows": ["quote_subscription"],
"is_active": True,
"priority": 10,
"step_execution": "sequential",
"rules": [
{
"operator": "and",
"conditions": [
{
"field": "total_amount",
"operator": "gte",
"value": 100000
}
]
}
],
"steps": [
{
"name": "Finance approval",
"order": 1,
"approver_requirement": "any",
"approver_role_ids": ["rol_DKL4Xcb5VSa8CQ"],
"approver_user_ids": ["usr_DKL4Xcb5VSa8CQ"]
}
],
"description": "Requires approval for high-value subscription quotes.",
"email_notification_enabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Enterprise quote approval',
applicable_flows: ['quote_subscription'],
is_active: true,
priority: 10,
step_execution: 'sequential',
rules: [
{
operator: 'and',
conditions: [{field: 'total_amount', operator: 'gte', value: 100000}]
}
],
steps: [
{
name: 'Finance approval',
order: 1,
approver_requirement: 'any',
approver_role_ids: ['rol_DKL4Xcb5VSa8CQ'],
approver_user_ids: ['usr_DKL4Xcb5VSa8CQ']
}
],
description: 'Requires approval for high-value subscription quotes.',
email_notification_enabled: true
})
};
fetch('https://api.hyperline.co/v1/approvals/workflows', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hyperline.co/v1/approvals/workflows",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Enterprise quote approval',
'applicable_flows' => [
'quote_subscription'
],
'is_active' => true,
'priority' => 10,
'step_execution' => 'sequential',
'rules' => [
[
'operator' => 'and',
'conditions' => [
[
'field' => 'total_amount',
'operator' => 'gte',
'value' => 100000
]
]
]
],
'steps' => [
[
'name' => 'Finance approval',
'order' => 1,
'approver_requirement' => 'any',
'approver_role_ids' => [
'rol_DKL4Xcb5VSa8CQ'
],
'approver_user_ids' => [
'usr_DKL4Xcb5VSa8CQ'
]
]
],
'description' => 'Requires approval for high-value subscription quotes.',
'email_notification_enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hyperline.co/v1/approvals/workflows"
payload := strings.NewReader("{\n \"name\": \"Enterprise quote approval\",\n \"applicable_flows\": [\n \"quote_subscription\"\n ],\n \"is_active\": true,\n \"priority\": 10,\n \"step_execution\": \"sequential\",\n \"rules\": [\n {\n \"operator\": \"and\",\n \"conditions\": [\n {\n \"field\": \"total_amount\",\n \"operator\": \"gte\",\n \"value\": 100000\n }\n ]\n }\n ],\n \"steps\": [\n {\n \"name\": \"Finance approval\",\n \"order\": 1,\n \"approver_requirement\": \"any\",\n \"approver_role_ids\": [\n \"rol_DKL4Xcb5VSa8CQ\"\n ],\n \"approver_user_ids\": [\n \"usr_DKL4Xcb5VSa8CQ\"\n ]\n }\n ],\n \"description\": \"Requires approval for high-value subscription quotes.\",\n \"email_notification_enabled\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.hyperline.co/v1/approvals/workflows")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Enterprise quote approval\",\n \"applicable_flows\": [\n \"quote_subscription\"\n ],\n \"is_active\": true,\n \"priority\": 10,\n \"step_execution\": \"sequential\",\n \"rules\": [\n {\n \"operator\": \"and\",\n \"conditions\": [\n {\n \"field\": \"total_amount\",\n \"operator\": \"gte\",\n \"value\": 100000\n }\n ]\n }\n ],\n \"steps\": [\n {\n \"name\": \"Finance approval\",\n \"order\": 1,\n \"approver_requirement\": \"any\",\n \"approver_role_ids\": [\n \"rol_DKL4Xcb5VSa8CQ\"\n ],\n \"approver_user_ids\": [\n \"usr_DKL4Xcb5VSa8CQ\"\n ]\n }\n ],\n \"description\": \"Requires approval for high-value subscription quotes.\",\n \"email_notification_enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperline.co/v1/approvals/workflows")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Enterprise quote approval\",\n \"applicable_flows\": [\n \"quote_subscription\"\n ],\n \"is_active\": true,\n \"priority\": 10,\n \"step_execution\": \"sequential\",\n \"rules\": [\n {\n \"operator\": \"and\",\n \"conditions\": [\n {\n \"field\": \"total_amount\",\n \"operator\": \"gte\",\n \"value\": 100000\n }\n ]\n }\n ],\n \"steps\": [\n {\n \"name\": \"Finance approval\",\n \"order\": 1,\n \"approver_requirement\": \"any\",\n \"approver_role_ids\": [\n \"rol_DKL4Xcb5VSa8CQ\"\n ],\n \"approver_user_ids\": [\n \"usr_DKL4Xcb5VSa8CQ\"\n ]\n }\n ],\n \"description\": \"Requires approval for high-value subscription quotes.\",\n \"email_notification_enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "apw_DKL4Xcb5VSa8CQ",
"name": "Enterprise quote approval",
"description": "Requires approval for high-value subscription quotes.",
"applicable_flows": [
"quote_subscription"
],
"is_active": true,
"priority": 10,
"rules": [
{
"id": "apr_DKL4Xcb5VSa8CQ",
"operator": "and",
"conditions": [
{
"field": "total_amount",
"operator": "gte",
"value": 100000
}
]
}
],
"step_execution": "sequential",
"email_notification_enabled": true,
"steps": [
{
"id": "aps_DKL4Xcb5VSa8CQ",
"name": "Finance approval",
"order": 1,
"approver_requirement": "any",
"approver_role_ids": [
"rol_DKL4Xcb5VSa8CQ"
],
"approver_user_ids": [
"usr_DKL4Xcb5VSa8CQ"
]
}
],
"version": 1,
"original_workflow_id": null,
"created_at": "2024-12-20T16:04:11Z"
}Create approval workflow
Create a new approval workflow.
curl --request POST \
--url https://api.hyperline.co/v1/approvals/workflows \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Enterprise quote approval",
"applicable_flows": [
"quote_subscription"
],
"is_active": true,
"priority": 10,
"step_execution": "sequential",
"rules": [
{
"operator": "and",
"conditions": [
{
"field": "total_amount",
"operator": "gte",
"value": 100000
}
]
}
],
"steps": [
{
"name": "Finance approval",
"order": 1,
"approver_requirement": "any",
"approver_role_ids": [
"rol_DKL4Xcb5VSa8CQ"
],
"approver_user_ids": [
"usr_DKL4Xcb5VSa8CQ"
]
}
],
"description": "Requires approval for high-value subscription quotes.",
"email_notification_enabled": true
}
'import requests
url = "https://api.hyperline.co/v1/approvals/workflows"
payload = {
"name": "Enterprise quote approval",
"applicable_flows": ["quote_subscription"],
"is_active": True,
"priority": 10,
"step_execution": "sequential",
"rules": [
{
"operator": "and",
"conditions": [
{
"field": "total_amount",
"operator": "gte",
"value": 100000
}
]
}
],
"steps": [
{
"name": "Finance approval",
"order": 1,
"approver_requirement": "any",
"approver_role_ids": ["rol_DKL4Xcb5VSa8CQ"],
"approver_user_ids": ["usr_DKL4Xcb5VSa8CQ"]
}
],
"description": "Requires approval for high-value subscription quotes.",
"email_notification_enabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Enterprise quote approval',
applicable_flows: ['quote_subscription'],
is_active: true,
priority: 10,
step_execution: 'sequential',
rules: [
{
operator: 'and',
conditions: [{field: 'total_amount', operator: 'gte', value: 100000}]
}
],
steps: [
{
name: 'Finance approval',
order: 1,
approver_requirement: 'any',
approver_role_ids: ['rol_DKL4Xcb5VSa8CQ'],
approver_user_ids: ['usr_DKL4Xcb5VSa8CQ']
}
],
description: 'Requires approval for high-value subscription quotes.',
email_notification_enabled: true
})
};
fetch('https://api.hyperline.co/v1/approvals/workflows', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hyperline.co/v1/approvals/workflows",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Enterprise quote approval',
'applicable_flows' => [
'quote_subscription'
],
'is_active' => true,
'priority' => 10,
'step_execution' => 'sequential',
'rules' => [
[
'operator' => 'and',
'conditions' => [
[
'field' => 'total_amount',
'operator' => 'gte',
'value' => 100000
]
]
]
],
'steps' => [
[
'name' => 'Finance approval',
'order' => 1,
'approver_requirement' => 'any',
'approver_role_ids' => [
'rol_DKL4Xcb5VSa8CQ'
],
'approver_user_ids' => [
'usr_DKL4Xcb5VSa8CQ'
]
]
],
'description' => 'Requires approval for high-value subscription quotes.',
'email_notification_enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hyperline.co/v1/approvals/workflows"
payload := strings.NewReader("{\n \"name\": \"Enterprise quote approval\",\n \"applicable_flows\": [\n \"quote_subscription\"\n ],\n \"is_active\": true,\n \"priority\": 10,\n \"step_execution\": \"sequential\",\n \"rules\": [\n {\n \"operator\": \"and\",\n \"conditions\": [\n {\n \"field\": \"total_amount\",\n \"operator\": \"gte\",\n \"value\": 100000\n }\n ]\n }\n ],\n \"steps\": [\n {\n \"name\": \"Finance approval\",\n \"order\": 1,\n \"approver_requirement\": \"any\",\n \"approver_role_ids\": [\n \"rol_DKL4Xcb5VSa8CQ\"\n ],\n \"approver_user_ids\": [\n \"usr_DKL4Xcb5VSa8CQ\"\n ]\n }\n ],\n \"description\": \"Requires approval for high-value subscription quotes.\",\n \"email_notification_enabled\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.hyperline.co/v1/approvals/workflows")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Enterprise quote approval\",\n \"applicable_flows\": [\n \"quote_subscription\"\n ],\n \"is_active\": true,\n \"priority\": 10,\n \"step_execution\": \"sequential\",\n \"rules\": [\n {\n \"operator\": \"and\",\n \"conditions\": [\n {\n \"field\": \"total_amount\",\n \"operator\": \"gte\",\n \"value\": 100000\n }\n ]\n }\n ],\n \"steps\": [\n {\n \"name\": \"Finance approval\",\n \"order\": 1,\n \"approver_requirement\": \"any\",\n \"approver_role_ids\": [\n \"rol_DKL4Xcb5VSa8CQ\"\n ],\n \"approver_user_ids\": [\n \"usr_DKL4Xcb5VSa8CQ\"\n ]\n }\n ],\n \"description\": \"Requires approval for high-value subscription quotes.\",\n \"email_notification_enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperline.co/v1/approvals/workflows")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Enterprise quote approval\",\n \"applicable_flows\": [\n \"quote_subscription\"\n ],\n \"is_active\": true,\n \"priority\": 10,\n \"step_execution\": \"sequential\",\n \"rules\": [\n {\n \"operator\": \"and\",\n \"conditions\": [\n {\n \"field\": \"total_amount\",\n \"operator\": \"gte\",\n \"value\": 100000\n }\n ]\n }\n ],\n \"steps\": [\n {\n \"name\": \"Finance approval\",\n \"order\": 1,\n \"approver_requirement\": \"any\",\n \"approver_role_ids\": [\n \"rol_DKL4Xcb5VSa8CQ\"\n ],\n \"approver_user_ids\": [\n \"usr_DKL4Xcb5VSa8CQ\"\n ]\n }\n ],\n \"description\": \"Requires approval for high-value subscription quotes.\",\n \"email_notification_enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "apw_DKL4Xcb5VSa8CQ",
"name": "Enterprise quote approval",
"description": "Requires approval for high-value subscription quotes.",
"applicable_flows": [
"quote_subscription"
],
"is_active": true,
"priority": 10,
"rules": [
{
"id": "apr_DKL4Xcb5VSa8CQ",
"operator": "and",
"conditions": [
{
"field": "total_amount",
"operator": "gte",
"value": 100000
}
]
}
],
"step_execution": "sequential",
"email_notification_enabled": true,
"steps": [
{
"id": "aps_DKL4Xcb5VSa8CQ",
"name": "Finance approval",
"order": 1,
"approver_requirement": "any",
"approver_role_ids": [
"rol_DKL4Xcb5VSa8CQ"
],
"approver_user_ids": [
"usr_DKL4Xcb5VSa8CQ"
]
}
],
"version": 1,
"original_workflow_id": null,
"created_at": "2024-12-20T16:04:11Z"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Approval workflow creation payload.
Approval workflow name.
1"Enterprise quote approval"
Quote or subscription flows where the workflow applies.
1quote_subscription, quote_subscription_update, quote_one_off, subscription_update ["quote_subscription"]
Whether the workflow is active.
true
Workflow priority. Lower values are evaluated first when multiple workflows match.
10
How workflow steps execute. Sequential steps run by order; parallel steps run together.
sequential, parallel "sequential"
Rules that determine when the workflow applies.
1Show child attributes
Show child attributes
Approval steps required by the workflow.
1Show child attributes
Show child attributes
Approval workflow description.
"Requires approval for high-value subscription quotes."
Whether approvers receive email notifications for this workflow.
true
Response
Approval workflow ID.
"apw_DKL4Xcb5VSa8CQ"
Approval workflow name.
"Enterprise quote approval"
Approval workflow description.
"Requires approval for high-value subscription quotes."
Quote or subscription flows where the workflow applies.
quote_subscription, quote_subscription_update, quote_one_off, subscription_update ["quote_subscription"]
Whether the workflow is active.
true
Workflow priority. Lower values are evaluated first when multiple workflows match.
10
Rules that determine when the workflow applies.
Show child attributes
Show child attributes
How workflow steps execute. Sequential steps run by order; parallel steps run together.
sequential, parallel "sequential"
Whether approvers receive email notifications for this workflow.
true
Approval steps required by the workflow.
Show child attributes
Show child attributes
Workflow version number.
1
Original workflow ID when this workflow is an archived version.
null
Was this page helpful?

