Reviewers
Invite reviewers by email
Emails each address an invitation to review the workflow. People without a HITL account create one from the email. Needs humans:write.
POST
/
api
/
workflows
/
{id}
/
invitations
Invite reviewers by email
curl --request POST \
--url https://api.hitl.sh/v1/api/workflows/{id}/invitations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"emails": [
"sam.okafor@example.com",
"priya.shah@example.com"
]
}
'import requests
url = "https://api.hitl.sh/v1/api/workflows/{id}/invitations"
payload = { "emails": ["sam.okafor@example.com", "priya.shah@example.com"] }
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({emails: ['sam.okafor@example.com', 'priya.shah@example.com']})
};
fetch('https://api.hitl.sh/v1/api/workflows/{id}/invitations', 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}/invitations",
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([
'emails' => [
'sam.okafor@example.com',
'priya.shah@example.com'
]
]),
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.hitl.sh/v1/api/workflows/{id}/invitations"
payload := strings.NewReader("{\n \"emails\": [\n \"sam.okafor@example.com\",\n \"priya.shah@example.com\"\n ]\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.hitl.sh/v1/api/workflows/{id}/invitations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"emails\": [\n \"sam.okafor@example.com\",\n \"priya.shah@example.com\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hitl.sh/v1/api/workflows/{id}/invitations")
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 \"emails\": [\n \"sam.okafor@example.com\",\n \"priya.shah@example.com\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"error": false,
"msg": "Invitations sent",
"data": {
"sent": [
"sam.okafor@example.com"
],
"already_members": [
"priya.shah@example.com"
],
"invalid": [],
"declined_recently": [],
"failed": [],
"email_sent": true
}
}{
"error": true,
"msg": "Invalid execution id"
}{
"error": true,
"msg": "Invalid API key"
}{
"error": true,
"code": "confirmation_required",
"msg": "Confirm the signup first: ask your human for the code in the email"
}{
"error": true,
"msg": "Workflow not found"
}Authorizations
Your API key: hitl_live_…
Path Parameters
The workflow id
Example:
"6af2ce4e8207961501f59472"
Body
application/json
Response
OK
The response is of type object.
⌘I
Invite reviewers by email
curl --request POST \
--url https://api.hitl.sh/v1/api/workflows/{id}/invitations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"emails": [
"sam.okafor@example.com",
"priya.shah@example.com"
]
}
'import requests
url = "https://api.hitl.sh/v1/api/workflows/{id}/invitations"
payload = { "emails": ["sam.okafor@example.com", "priya.shah@example.com"] }
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({emails: ['sam.okafor@example.com', 'priya.shah@example.com']})
};
fetch('https://api.hitl.sh/v1/api/workflows/{id}/invitations', 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}/invitations",
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([
'emails' => [
'sam.okafor@example.com',
'priya.shah@example.com'
]
]),
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.hitl.sh/v1/api/workflows/{id}/invitations"
payload := strings.NewReader("{\n \"emails\": [\n \"sam.okafor@example.com\",\n \"priya.shah@example.com\"\n ]\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.hitl.sh/v1/api/workflows/{id}/invitations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"emails\": [\n \"sam.okafor@example.com\",\n \"priya.shah@example.com\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hitl.sh/v1/api/workflows/{id}/invitations")
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 \"emails\": [\n \"sam.okafor@example.com\",\n \"priya.shah@example.com\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"error": false,
"msg": "Invitations sent",
"data": {
"sent": [
"sam.okafor@example.com"
],
"already_members": [
"priya.shah@example.com"
],
"invalid": [],
"declined_recently": [],
"failed": [],
"email_sent": true
}
}{
"error": true,
"msg": "Invalid execution id"
}{
"error": true,
"msg": "Invalid API key"
}{
"error": true,
"code": "confirmation_required",
"msg": "Confirm the signup first: ask your human for the code in the email"
}{
"error": true,
"msg": "Workflow not found"
}