curl --request GET \
--url https://api.ishlabs.io/api/v1/workspaces/{workspace_id}/sessions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.ishlabs.io/api/v1/workspaces/{workspace_id}/sessions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ishlabs.io/api/v1/workspaces/{workspace_id}/sessions', 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/workspaces/{workspace_id}/sessions",
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.ishlabs.io/api/v1/workspaces/{workspace_id}/sessions"
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.ishlabs.io/api/v1/workspaces/{workspace_id}/sessions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ishlabs.io/api/v1/workspaces/{workspace_id}/sessions")
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{
"has_more": true,
"items": [
{
"accrued_credits": 123,
"created_at": "2023-11-07T05:31:56Z",
"created_by_api_key_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"decision_mode": "direct",
"ended_at": "2023-11-07T05:31:56Z",
"ended_reason": "<string>",
"environment": {
"kind": "<string>",
"name": "<string>"
},
"environment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"environment_revision": 123,
"environment_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"environment_version_label": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"max_turns": 123,
"status": "open",
"task": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"instructions": "<string>",
"name": "<string>",
"revision": 123
},
"turn_count": 123,
"updated_at": "2023-11-07T05:31:56Z",
"participant": {
"name": "<string>",
"person_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "<string>"
},
"settled_at": "2023-11-07T05:31:56Z"
}
],
"next_cursor": "<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>"
}List Sessions
List a workspace’s sessions, newest first (keyset-paginated).
Ordered created_at DESC, id DESC. Page forward with after set to the
prior response’s next_cursor; has_more signals another page. Each row
is a summary (status, instructions, environment, person, turn counts, key
attribution, accrued credits, timestamps). The per-turn decision trace lives
on the detail GET.
curl --request GET \
--url https://api.ishlabs.io/api/v1/workspaces/{workspace_id}/sessions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.ishlabs.io/api/v1/workspaces/{workspace_id}/sessions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ishlabs.io/api/v1/workspaces/{workspace_id}/sessions', 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/workspaces/{workspace_id}/sessions",
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.ishlabs.io/api/v1/workspaces/{workspace_id}/sessions"
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.ishlabs.io/api/v1/workspaces/{workspace_id}/sessions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ishlabs.io/api/v1/workspaces/{workspace_id}/sessions")
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{
"has_more": true,
"items": [
{
"accrued_credits": 123,
"created_at": "2023-11-07T05:31:56Z",
"created_by_api_key_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"decision_mode": "direct",
"ended_at": "2023-11-07T05:31:56Z",
"ended_reason": "<string>",
"environment": {
"kind": "<string>",
"name": "<string>"
},
"environment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"environment_revision": 123,
"environment_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"environment_version_label": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"max_turns": 123,
"status": "open",
"task": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"instructions": "<string>",
"name": "<string>",
"revision": 123
},
"turn_count": 123,
"updated_at": "2023-11-07T05:31:56Z",
"participant": {
"name": "<string>",
"person_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "<string>"
},
"settled_at": "2023-11-07T05:31:56Z"
}
],
"next_cursor": "<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>"
}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
Query Parameters
Filter by session status (repeatable).
open, completed, gave_up, closed, max_turns, spend_cap_reached, balance_exhausted Filter to sessions opened by this API key.
Filter to sessions run in this registered environment. Matches on the environment's id, so a renamed environment still returns its older sessions; sessions opened with an inline environment descriptor have no id and are never matched, and sessions whose environment was since deleted no longer match (their reference is cleared; the frozen snapshot stays on the session).
Filter to sessions pinned to this declared environment version, as resolved at open. Narrower than environment_id and independent of it: a session that ran the same environment UNVERSIONED is never matched.
Filter to sessions bound to this registered task. Matches on the task's id: a renamed task still returns its older sessions, inline-instruction sessions are never matched, and an archived task's sessions keep matching (archive clears nothing; the frozen instructions stays on each session).
Free-text filter: matches a session id by PREFIX or the frozen instructions by case-insensitive substring. One term, no ranking.
200Only sessions created at/after this ISO 8601 instant.
Only sessions created at/before this ISO 8601 instant.
Opaque keyset cursor from a prior page's next_cursor.
1 <= x <= 100Response
Successful Response
A keyset-paginated page of a workspace's sessions.
Ordered created_at DESC, id DESC. next_cursor is an opaque token
(base64 of the last row's keyset); pass it back as after to fetch the
next page, and it is null on the final page. Never an offset: rows keep
inserting, so an offset would skip/duplicate across pages.