End Session
curl --request POST \
--url https://api.example.com/v0/workspaces/{id}/sessions/{sessionId}/endimport requests
url = "https://api.example.com/v0/workspaces/{id}/sessions/{sessionId}/end"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/v0/workspaces/{id}/sessions/{sessionId}/end', 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.example.com/v0/workspaces/{id}/sessions/{sessionId}/end",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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.example.com/v0/workspaces/{id}/sessions/{sessionId}/end"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/v0/workspaces/{id}/sessions/{sessionId}/end")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v0/workspaces/{id}/sessions/{sessionId}/end")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyWorkspaces
End Session
POST /v0/workspaces/:id/sessions/:sessionId/end — End a harness session, optionally leaving a markdown handoff
POST
/
v0
/
workspaces
/
{id}
/
sessions
/
{sessionId}
/
end
End Session
curl --request POST \
--url https://api.example.com/v0/workspaces/{id}/sessions/{sessionId}/endimport requests
url = "https://api.example.com/v0/workspaces/{id}/sessions/{sessionId}/end"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/v0/workspaces/{id}/sessions/{sessionId}/end', 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.example.com/v0/workspaces/{id}/sessions/{sessionId}/end",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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.example.com/v0/workspaces/{id}/sessions/{sessionId}/end"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/v0/workspaces/{id}/sessions/{sessionId}/end")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v0/workspaces/{id}/sessions/{sessionId}/end")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyEnds a session you started with Load, using the same API key. Ending disconnects any browser view paired to the session. MCP:
Send at most one of the two. Either one requires
workspace_session_end. CLI: rip workspace session end <workspace-id> <session-id> [--summary | --handoff-artifact-id].
Auth: Authorization: Bearer tr_... (an account API key). {id} and {sessionId} are UUIDs.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
summary | string | No | Creates a markdown handoff artifact in the workspace in the same transaction. Its audience is internal for internal members and shared for external members |
handoffArtifactId | string | No | Id or public id of an existing markdown artifact in this workspace to mark as the handoff instead. It must be active, visible to you, and not already a handoff |
writeHandoff; any member, viewers included, can end a session with neither.
Response (201)
{ "ok": true, "data": { "sessionId": "3e4f…", "status": "ended", "handoffArtifactId": "5c9e…", "endedAt": "2026-09-15T10:00:00.000Z" } }
handoffArtifactId is the handoff’s public artifact id, or null. Repeating the request with the same body returns the original result. The next Load lists the handoff under handoffs; handoffs are ordinary artifacts, follow audience rules, and outlive the session.
Errors
| Status | Code | Cause |
|---|---|---|
400 | INVALID_SUMMARY | summary is not a string |
400 | INVALID_HANDOFF | Both fields given, or handoffArtifactId is not unused, visible, active markdown in this workspace |
403 | WORKSPACE_SESSION_INVALID | The session is not yours, on this API key, in this workspace |
403 | WORKSPACE_FORBIDDEN | A handoff without writeHandoff, or you are no longer a member |
409 | SESSION_END_CONFLICT | The session was already ended with a different body |
409 | WORKSPACE_SESSION_EXPIRED | The session expired after 24 hours idle |
409 | WORKSPACE_SESSION_INACTIVE | The session was revoked or archived |
409 | WORKSPACE_ARCHIVED | The workspace is archived |