Workflows
Get a workflow's input fields
Every {{trigger.body.<path>}} the steps read (and condition fields on trigger.body), the steps that read each one, an example body, and a form description that integrations use to build their input fields. Fields not listed are still accepted and passed through.
GET
/
api
/
workflows
/
{id}
/
input
Get a workflow's input fields
curl --request GET \
--url https://api.hitl.sh/v1/api/workflows/{id}/input \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.hitl.sh/v1/api/workflows/{id}/input"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.hitl.sh/v1/api/workflows/{id}/input', 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.hitl.sh/v1/api/workflows/{id}/input",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.hitl.sh/v1/api/workflows/{id}/input"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.hitl.sh/v1/api/workflows/{id}/input")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hitl.sh/v1/api/workflows/{id}/input")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"example": {
"amount": "",
"currency": "",
"customer": {
"email": "",
"name": ""
},
"order_id": "",
"reason": ""
},
"fields": [
{
"path": "amount",
"used_by": [
"action-1",
"review-1"
]
},
{
"path": "currency",
"used_by": [
"review-1"
]
},
{
"path": "customer.email",
"used_by": [
"review-1"
]
},
{
"path": "customer.name",
"used_by": [
"review-1"
]
},
{
"path": "order_id",
"used_by": [
"action-1",
"action-2",
"review-1"
]
},
{
"path": "reason",
"used_by": [
"review-1"
]
}
],
"form": [
{
"name": "amount",
"label": "Amount",
"type": "text"
},
{
"name": "currency",
"label": "Currency",
"type": "text"
},
{
"name": "customer",
"label": "Customer",
"type": "collection",
"spec": [
{
"name": "email",
"label": "Email",
"type": "text"
},
{
"name": "name",
"label": "Name",
"type": "text"
}
]
},
{
"name": "order_id",
"label": "Order id",
"type": "text"
},
{
"name": "reason",
"label": "Reason",
"type": "text"
}
],
"note": "Fields the workflow's steps read as {{trigger.body.<path>}}. Other fields are accepted and passed through.",
"workflow_id": "6af2ce4e8207961501f59472"
},
"error": false,
"msg": "Workflow input retrieved"
}{
"error": true,
"msg": "Invalid API key"
}{
"error": true,
"msg": "Workflow not found"
}⌘I
Get a workflow's input fields
curl --request GET \
--url https://api.hitl.sh/v1/api/workflows/{id}/input \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.hitl.sh/v1/api/workflows/{id}/input"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.hitl.sh/v1/api/workflows/{id}/input', 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.hitl.sh/v1/api/workflows/{id}/input",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.hitl.sh/v1/api/workflows/{id}/input"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.hitl.sh/v1/api/workflows/{id}/input")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hitl.sh/v1/api/workflows/{id}/input")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"example": {
"amount": "",
"currency": "",
"customer": {
"email": "",
"name": ""
},
"order_id": "",
"reason": ""
},
"fields": [
{
"path": "amount",
"used_by": [
"action-1",
"review-1"
]
},
{
"path": "currency",
"used_by": [
"review-1"
]
},
{
"path": "customer.email",
"used_by": [
"review-1"
]
},
{
"path": "customer.name",
"used_by": [
"review-1"
]
},
{
"path": "order_id",
"used_by": [
"action-1",
"action-2",
"review-1"
]
},
{
"path": "reason",
"used_by": [
"review-1"
]
}
],
"form": [
{
"name": "amount",
"label": "Amount",
"type": "text"
},
{
"name": "currency",
"label": "Currency",
"type": "text"
},
{
"name": "customer",
"label": "Customer",
"type": "collection",
"spec": [
{
"name": "email",
"label": "Email",
"type": "text"
},
{
"name": "name",
"label": "Name",
"type": "text"
}
]
},
{
"name": "order_id",
"label": "Order id",
"type": "text"
},
{
"name": "reason",
"label": "Reason",
"type": "text"
}
],
"note": "Fields the workflow's steps read as {{trigger.body.<path>}}. Other fields are accepted and passed through.",
"workflow_id": "6af2ce4e8207961501f59472"
},
"error": false,
"msg": "Workflow input retrieved"
}{
"error": true,
"msg": "Invalid API key"
}{
"error": true,
"msg": "Workflow not found"
}