Sessions
Create Turn
Propose an action. Creates a turn + a backing HITL request + dispatches push to loop reviewers.
POST
/
v1
/
api
/
sessions
/
{id}
/
turns
Create Turn
curl --request POST \
--url https://api.hitl.sh/v1/api/sessions/{id}/turns \
--header 'Content-Type: application/json' \
--data '
{
"action_type": "<string>",
"agent_prompt": "<string>",
"proposed_tool": "<string>",
"proposed_args": {}
}
'import requests
url = "https://api.hitl.sh/v1/api/sessions/{id}/turns"
payload = {
"action_type": "<string>",
"agent_prompt": "<string>",
"proposed_tool": "<string>",
"proposed_args": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
action_type: '<string>',
agent_prompt: '<string>',
proposed_tool: '<string>',
proposed_args: {}
})
};
fetch('https://api.hitl.sh/v1/api/sessions/{id}/turns', 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/sessions/{id}/turns",
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([
'action_type' => '<string>',
'agent_prompt' => '<string>',
'proposed_tool' => '<string>',
'proposed_args' => [
]
]),
CURLOPT_HTTPHEADER => [
"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/sessions/{id}/turns"
payload := strings.NewReader("{\n \"action_type\": \"<string>\",\n \"agent_prompt\": \"<string>\",\n \"proposed_tool\": \"<string>\",\n \"proposed_args\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
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/sessions/{id}/turns")
.header("Content-Type", "application/json")
.body("{\n \"action_type\": \"<string>\",\n \"agent_prompt\": \"<string>\",\n \"proposed_tool\": \"<string>\",\n \"proposed_args\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hitl.sh/v1/api/sessions/{id}/turns")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"action_type\": \"<string>\",\n \"agent_prompt\": \"<string>\",\n \"proposed_tool\": \"<string>\",\n \"proposed_args\": {}\n}"
response = http.request(request)
puts response.read_body{
"error": false,
"msg": "turn created",
"data": {
"turn": {
"id": "663f9...",
"session_id": "663f8...",
"turn_number": 4,
"request_id": "663fa...",
"action_type": "git_push",
"agent_prompt": "Run shell command: git push origin preview",
"proposed_tool": "Bash",
"proposed_args": { "command": "git push origin preview" },
"created_at": "2026-04-23T18:14:22Z"
}
}
}
Path
string
required
Session id.
Body
string
required
One of
file_write · file_delete · command_exec · git_commit · git_push · dependency_install · migration_run · bypass.string
Human-readable summary (e.g.
"Write file /src/server.ts" or "Run shell command: git push origin main").string
Name of the tool the agent wants to call (e.g.
Write, Edit, Bash).object
Raw tool arguments. For
Bash this typically includes command; for Write/Edit, file_path + content.Response
object
The created turn.
turn.request_id is set to the backing HITL request id — that request is what renders in the mobile reviewer app.Side effects
- Creates a HITL
requestin the session’s loop withresponse_type=single_select, options[approve, modify, reject, escalate]. Priority ishighfor destructive action types andmediumotherwise. - Sends FCM push to every active loop member’s device.
{
"error": false,
"msg": "turn created",
"data": {
"turn": {
"id": "663f9...",
"session_id": "663f8...",
"turn_number": 4,
"request_id": "663fa...",
"action_type": "git_push",
"agent_prompt": "Run shell command: git push origin preview",
"proposed_tool": "Bash",
"proposed_args": { "command": "git push origin preview" },
"created_at": "2026-04-23T18:14:22Z"
}
}
}
⌘I
Create Turn
curl --request POST \
--url https://api.hitl.sh/v1/api/sessions/{id}/turns \
--header 'Content-Type: application/json' \
--data '
{
"action_type": "<string>",
"agent_prompt": "<string>",
"proposed_tool": "<string>",
"proposed_args": {}
}
'import requests
url = "https://api.hitl.sh/v1/api/sessions/{id}/turns"
payload = {
"action_type": "<string>",
"agent_prompt": "<string>",
"proposed_tool": "<string>",
"proposed_args": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
action_type: '<string>',
agent_prompt: '<string>',
proposed_tool: '<string>',
proposed_args: {}
})
};
fetch('https://api.hitl.sh/v1/api/sessions/{id}/turns', 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/sessions/{id}/turns",
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([
'action_type' => '<string>',
'agent_prompt' => '<string>',
'proposed_tool' => '<string>',
'proposed_args' => [
]
]),
CURLOPT_HTTPHEADER => [
"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/sessions/{id}/turns"
payload := strings.NewReader("{\n \"action_type\": \"<string>\",\n \"agent_prompt\": \"<string>\",\n \"proposed_tool\": \"<string>\",\n \"proposed_args\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
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/sessions/{id}/turns")
.header("Content-Type", "application/json")
.body("{\n \"action_type\": \"<string>\",\n \"agent_prompt\": \"<string>\",\n \"proposed_tool\": \"<string>\",\n \"proposed_args\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hitl.sh/v1/api/sessions/{id}/turns")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"action_type\": \"<string>\",\n \"agent_prompt\": \"<string>\",\n \"proposed_tool\": \"<string>\",\n \"proposed_args\": {}\n}"
response = http.request(request)
puts response.read_body{
"error": false,
"msg": "turn created",
"data": {
"turn": {
"id": "663f9...",
"session_id": "663f8...",
"turn_number": 4,
"request_id": "663fa...",
"action_type": "git_push",
"agent_prompt": "Run shell command: git push origin preview",
"proposed_tool": "Bash",
"proposed_args": { "command": "git push origin preview" },
"created_at": "2026-04-23T18:14:22Z"
}
}
}