curl --request POST \
--url https://api.ishlabs.io/api/v1/sessions/{session_id}/turns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"observation": [
{
"data": "<string>"
}
],
"turn_index": 1,
"valid_actions": [
{
"description": "<string>",
"name": "<string>",
"parameters": {},
"resolver_hint": "<string>"
}
],
"frame_age_ms": 1
}
'import requests
url = "https://api.ishlabs.io/api/v1/sessions/{session_id}/turns"
payload = {
"observation": [{ "data": "<string>" }],
"turn_index": 1,
"valid_actions": [
{
"description": "<string>",
"name": "<string>",
"parameters": {},
"resolver_hint": "<string>"
}
],
"frame_age_ms": 1
}
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({
observation: [{data: '<string>'}],
turn_index: 1,
valid_actions: [
{
description: '<string>',
name: '<string>',
parameters: {},
resolver_hint: '<string>'
}
],
frame_age_ms: 1
})
};
fetch('https://api.ishlabs.io/api/v1/sessions/{session_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.ishlabs.io/api/v1/sessions/{session_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([
'observation' => [
[
'data' => '<string>'
]
],
'turn_index' => 1,
'valid_actions' => [
[
'description' => '<string>',
'name' => '<string>',
'parameters' => [
],
'resolver_hint' => '<string>'
]
],
'frame_age_ms' => 1
]),
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.ishlabs.io/api/v1/sessions/{session_id}/turns"
payload := strings.NewReader("{\n \"observation\": [\n {\n \"data\": \"<string>\"\n }\n ],\n \"turn_index\": 1,\n \"valid_actions\": [\n {\n \"description\": \"<string>\",\n \"name\": \"<string>\",\n \"parameters\": {},\n \"resolver_hint\": \"<string>\"\n }\n ],\n \"frame_age_ms\": 1\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.ishlabs.io/api/v1/sessions/{session_id}/turns")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"observation\": [\n {\n \"data\": \"<string>\"\n }\n ],\n \"turn_index\": 1,\n \"valid_actions\": [\n {\n \"description\": \"<string>\",\n \"name\": \"<string>\",\n \"parameters\": {},\n \"resolver_hint\": \"<string>\"\n }\n ],\n \"frame_age_ms\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ishlabs.io/api/v1/sessions/{session_id}/turns")
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 \"observation\": [\n {\n \"data\": \"<string>\"\n }\n ],\n \"turn_index\": 1,\n \"valid_actions\": [\n {\n \"description\": \"<string>\",\n \"name\": \"<string>\",\n \"parameters\": {},\n \"resolver_hint\": \"<string>\"\n }\n ],\n \"frame_age_ms\": 1\n}"
response = http.request(request)
puts response.read_body{
"decision": {
"action_name": "<string>",
"comment": "<string>",
"felt_intensity": "mild",
"sentiment": "Delighted",
"status": "continue",
"arguments": {},
"intent": "<string>",
"noticed": [
{
"detail": "<string>",
"label": "<string>"
}
],
"resolution": "matched",
"unmet_expectation": "<string>"
},
"session_status": "open",
"turn_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"turn_index": 123,
"usage": {}
}{
"detail": "<string>",
"request_id": "<string>",
"docs_url": "<string>"
}{
"detail": "<string>",
"request_id": "<string>",
"docs_url": "<string>"
}{
"detail": "<string>",
"request_id": "<string>",
"docs_url": "<string>"
}{
"detail": "<string>",
"request_id": "<string>",
"docs_url": "<string>"
}{
"detail": "<string>",
"request_id": "<string>",
"docs_url": "<string>"
}{
"detail": "<string>",
"error": "<string>",
"error_code": "<string>",
"errors": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"allowed_values": [
"<unknown>"
],
"input": "<string>"
}
],
"retryable": true,
"status": 123,
"suggestions": [
"<string>"
]
}{
"detail": "<string>",
"request_id": "<string>",
"docs_url": "<string>"
}{
"detail": "<string>",
"request_id": "<string>",
"docs_url": "<string>"
}{
"detail": "<string>",
"request_id": "<string>",
"docs_url": "<string>"
}Submit Turn
Submit one observation + declared action set; get the person’s choice.
curl --request POST \
--url https://api.ishlabs.io/api/v1/sessions/{session_id}/turns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"observation": [
{
"data": "<string>"
}
],
"turn_index": 1,
"valid_actions": [
{
"description": "<string>",
"name": "<string>",
"parameters": {},
"resolver_hint": "<string>"
}
],
"frame_age_ms": 1
}
'import requests
url = "https://api.ishlabs.io/api/v1/sessions/{session_id}/turns"
payload = {
"observation": [{ "data": "<string>" }],
"turn_index": 1,
"valid_actions": [
{
"description": "<string>",
"name": "<string>",
"parameters": {},
"resolver_hint": "<string>"
}
],
"frame_age_ms": 1
}
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({
observation: [{data: '<string>'}],
turn_index: 1,
valid_actions: [
{
description: '<string>',
name: '<string>',
parameters: {},
resolver_hint: '<string>'
}
],
frame_age_ms: 1
})
};
fetch('https://api.ishlabs.io/api/v1/sessions/{session_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.ishlabs.io/api/v1/sessions/{session_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([
'observation' => [
[
'data' => '<string>'
]
],
'turn_index' => 1,
'valid_actions' => [
[
'description' => '<string>',
'name' => '<string>',
'parameters' => [
],
'resolver_hint' => '<string>'
]
],
'frame_age_ms' => 1
]),
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.ishlabs.io/api/v1/sessions/{session_id}/turns"
payload := strings.NewReader("{\n \"observation\": [\n {\n \"data\": \"<string>\"\n }\n ],\n \"turn_index\": 1,\n \"valid_actions\": [\n {\n \"description\": \"<string>\",\n \"name\": \"<string>\",\n \"parameters\": {},\n \"resolver_hint\": \"<string>\"\n }\n ],\n \"frame_age_ms\": 1\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.ishlabs.io/api/v1/sessions/{session_id}/turns")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"observation\": [\n {\n \"data\": \"<string>\"\n }\n ],\n \"turn_index\": 1,\n \"valid_actions\": [\n {\n \"description\": \"<string>\",\n \"name\": \"<string>\",\n \"parameters\": {},\n \"resolver_hint\": \"<string>\"\n }\n ],\n \"frame_age_ms\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ishlabs.io/api/v1/sessions/{session_id}/turns")
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 \"observation\": [\n {\n \"data\": \"<string>\"\n }\n ],\n \"turn_index\": 1,\n \"valid_actions\": [\n {\n \"description\": \"<string>\",\n \"name\": \"<string>\",\n \"parameters\": {},\n \"resolver_hint\": \"<string>\"\n }\n ],\n \"frame_age_ms\": 1\n}"
response = http.request(request)
puts response.read_body{
"decision": {
"action_name": "<string>",
"comment": "<string>",
"felt_intensity": "mild",
"sentiment": "Delighted",
"status": "continue",
"arguments": {},
"intent": "<string>",
"noticed": [
{
"detail": "<string>",
"label": "<string>"
}
],
"resolution": "matched",
"unmet_expectation": "<string>"
},
"session_status": "open",
"turn_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"turn_index": 123,
"usage": {}
}{
"detail": "<string>",
"request_id": "<string>",
"docs_url": "<string>"
}{
"detail": "<string>",
"request_id": "<string>",
"docs_url": "<string>"
}{
"detail": "<string>",
"request_id": "<string>",
"docs_url": "<string>"
}{
"detail": "<string>",
"request_id": "<string>",
"docs_url": "<string>"
}{
"detail": "<string>",
"request_id": "<string>",
"docs_url": "<string>"
}{
"detail": "<string>",
"error": "<string>",
"error_code": "<string>",
"errors": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"allowed_values": [
"<unknown>"
],
"input": "<string>"
}
],
"retryable": true,
"status": 123,
"suggestions": [
"<string>"
]
}{
"detail": "<string>",
"request_id": "<string>",
"docs_url": "<string>"
}{
"detail": "<string>",
"request_id": "<string>",
"docs_url": "<string>"
}{
"detail": "<string>",
"request_id": "<string>",
"docs_url": "<string>"
}Authorizations
Workspace API key as a bearer token: Authorization: Bearer ish_sk_live_.... Keys are workspace-scoped machine principals minted in Settings > Developers (shown once at mint). Scopes: sessions:run (create a session, submit turns, close), sessions:read (read the session and its decision trace), environments:read and environments:write (manage the workspace's registered environments), tasks:read and tasks:write (manage the workspace's registered tasks), people:read and people:write (the people the workspace can run a session for), and usage:read (the workspace's own consumption, spend limits and rate-limit budgets). A key is minted with sessions:run, sessions:read, and tasks:read by default; every other scope must be requested, people:read and usage:read included. An ish user access token also works on the same header for personal scripts.
Path Parameters
Body
Human-sensory observation blocks (image now; error carries execution feedback). New block type values may be added. Open union: new values may be added over time; clients must tolerate unknown values rather than failing on them.
1Show child attributes
Show child attributes
x >= 0Show child attributes
Show child attributes
x >= 0Response
Successful Response
What the person decided this turn, and how it felt.
action_name names the action to execute, and is null when there is nothing to run: the person found no action that fits, or judged that none was needed. comment, sentiment and felt_intensity are the experiential half and are always present, including on a turn with no action. status says whether they intend to keep going.
intent, resolution and unmet_expectation are populated only when the session runs in intent decision mode; they are null in direct mode.
Show child attributes
Show child attributes
Session status after this turn. Open union: new values may be added over time; clients must tolerate unknown values rather than failing on them.
open, completed, gave_up, closed, max_turns, spend_cap_reached, balance_exhausted