Sessions
Sessions endpoints of the Ellipsis REST API.
| Method | Path | Required permissions |
|---|---|---|
| POST | /v1/sessions | write:sessions |
- API key
- Supported.
- CLI user token
- Supported.
- Sandbox token
- Requires the ellipsis:api scope and the required grants in the token's permissions.ellipsis configuration.
Higher permission levels include lower levels: read < write < delete.
Grant match patterns can further restrict access to individual resources.
Select a harness explicitly. Omit environment to use the basic sandbox, or name a saved environment. Set interactive to false for one-shot work.
curl -X POST "https://api.ellipsis.dev/v1/sessions" \
-H "Authorization: Bearer $ELLIPSIS_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"harness": {
"type": "claude_code"
},
"environment": "api-environment",
"prompt": "Run the tests and report failures.",
"interactive": false,
"budget": 3
}'import os
from ellipsis import Ellipsis
from ellipsis import models
client = Ellipsis(api_key=os.environ["ELLIPSIS_API_TOKEN"])
request = models.StartSessionRequest.model_validate(
{
"harness": {
"type": "claude_code"
},
"environment": "api-environment",
"prompt": "Run the tests and report failures.",
"interactive": False,
"budget": 3
}
)
result = client.sessions.start(
request.harness,
budget=request.budget,
environment=request.environment,
interactive=request.interactive,
prompt=request.prompt,
)
print(result)import { Ellipsis } from '@ellipsis-dev/sdk';
const client = new Ellipsis({
apiKey: process.env.ELLIPSIS_API_TOKEN!,
});
const request: Parameters<typeof client.sessions.start>[0] = {
"harness": {
"type": "claude_code"
},
"environment": "api-environment",
"prompt": "Run the tests and report failures.",
"interactive": false,
"budget": 3
};
const result = await client.sessions.start(request);
console.log(result);Request
Body parameters
The most this session may spend, in US dollars. Omitted, the organization's default applies. Above the organization's per-session ceiling is a 400.
Where the session runs. A STRING is a saved environment's name or `env_...` id, substituted wholesale. An OBJECT is the whole environment for this session , `{}` is the bare sandbox. Omitted, the session runs in the built-in basic sandbox , nothing outside the request picks the environment.
falsebooleanSkip the image cache for this session's initial provision: a fresh full build whose snapshot then refreshes the cache for later runs.
The explicitly selected harness and its native options.
Images attached to the first message, base64 inline. Requires the model's images capability, which is not currently certified. Each becomes an `[Image #N]` placeholder in the prompt and an image block on turn 0. Up to 10, 5 MiB each; PNG, JPEG, GIF, or WebP.
Instructions appended to the harness's own prompt. Text and repository file references are resolved in order.
truebooleanWhether the session stays open for messages after its first turn. Defaults to true and requires the model's interactive capability. Set false for a one-shot run, which must carry a prompt. See GET /v1/account/models for supported combinations.
{}objectArbitrary string key/value metadata stored on the session.
The structured-output exit contract for this session.
What the session may touch, per minted credential.
The session's first message. Omit it and the session starts idle: the sandbox spins up, the agent waits at the prompt, and the first message you send opens turn 0.
Repositories to check out in addition to the environment's own, as `owner/name` or a bare `name` (the account's).
Skills installed for this session.
Response
| Method | Path | Required permissions |
|---|---|---|
| GET | /v1/sessions | read:sessions |
- API key
- Supported.
- CLI user token
- Supported.
- Sandbox token
- Requires the ellipsis:api scope and the required grants in the token's permissions.ellipsis configuration.
Higher permission levels include lower levels: read < write < delete.
Grant match patterns can further restrict access to individual resources.
Query parameters
An automation id, or its name: only sessions that automation started.
Service that triggered the session. Includes built-in responders and legacy sessions without a saved handler.
slackgithublinearsentrySaved handler id captured when the session started.
50integerA GitHub account id (see GET /v1/integrations/github/members); scopes the list to sessions attributed to that developer.
"owner/name" (exact) or a bare repo name. Sessions whose repository is named only inside their automation , dashboard starts, cron , do not match.
falsebooleanKeep only sessions whose conversation is still going , live or idle , dropping the ones that completed, errored, or were stopped or cancelled. A session parked between turns counts as unfinished.
falsebooleancurl "https://api.ellipsis.dev/v1/sessions" \
-H "Authorization: Bearer $ELLIPSIS_API_TOKEN"import os
from ellipsis import Ellipsis
client = Ellipsis(api_key=os.environ["ELLIPSIS_API_TOKEN"])
for item in client.sessions.list():
print(item)import { Ellipsis } from '@ellipsis-dev/sdk';
const client = new Ellipsis({
apiKey: process.env.ELLIPSIS_API_TOKEN!,
});
for await (const item of await client.sessions.list()) {
console.log(item);
}Request
Response
| Method | Path | Required permissions |
|---|---|---|
| GET | /v1/sessions/search | read:sessions |
- API key
- Supported.
- CLI user token
- Supported.
- Sandbox token
- Requires the ellipsis:api scope and the required grants in the token's permissions.ellipsis configuration.
Higher permission levels include lower levels: read < write < delete.
Grant match patterns can further restrict access to individual resources.
Supply q and filter by service, handler, or source.
Query parameters
What text a search query is matched against: the session log's record text, the session recaps (summaries), or both.
recordsrecapsbothService whose mention or event started the session.
slackgithublinearsentryExact saved handler id recorded when the session started.
Attributed GitHub user account ids.
Saved automation ids (ORed with author_id).
"owner/name" (exact) or a bare repo name; ORed.
20integercurl "https://api.ellipsis.dev/v1/sessions/search?q=..." \
-H "Authorization: Bearer $ELLIPSIS_API_TOKEN"import os
from ellipsis import Ellipsis
client = Ellipsis(api_key=os.environ["ELLIPSIS_API_TOKEN"])
result = client.sessions.search(q="validation")
print(result)import { Ellipsis } from '@ellipsis-dev/sdk';
const client = new Ellipsis({
apiKey: process.env.ELLIPSIS_API_TOKEN!,
});
const result = await client.sessions.search({ q: "validation" });
console.log(result);Request
Response
| Method | Path | Required permissions |
|---|---|---|
| GET | /v1/sessions/{session_id} | read:sessions |
- API key
- Supported.
- CLI user token
- Supported.
- Sandbox token
- Requires the ellipsis:api scope and the required grants in the token's permissions.ellipsis configuration.
Higher permission levels include lower levels: read < write < delete.
Grant match patterns can further restrict access to individual resources.
Path parameters
curl "https://api.ellipsis.dev/v1/sessions/{session_id}" \
-H "Authorization: Bearer $ELLIPSIS_API_TOKEN"import os
from ellipsis import Ellipsis
client = Ellipsis(api_key=os.environ["ELLIPSIS_API_TOKEN"])
result = client.sessions.get("session_example")
print(result)import { Ellipsis } from '@ellipsis-dev/sdk';
const client = new Ellipsis({
apiKey: process.env.ELLIPSIS_API_TOKEN!,
});
const result = await client.sessions.get("session_example");
console.log(result);Request
Response
| Method | Path | Required permissions |
|---|---|---|
| GET | /v1/sessions/{session_id}/diff | read:sessions |
- API key
- Supported.
- CLI user token
- Supported.
- Sandbox token
- Requires the ellipsis:api scope and the required grants in the token's permissions.ellipsis configuration. Only the token's own session.
Higher permission levels include lower levels: read < write < delete.
Grant match patterns can further restrict access to individual resources.
Path parameters
curl "https://api.ellipsis.dev/v1/sessions/{session_id}/diff" \
-H "Authorization: Bearer $ELLIPSIS_API_TOKEN"import os
from ellipsis import Ellipsis
client = Ellipsis(api_key=os.environ["ELLIPSIS_API_TOKEN"])
result = client.sessions.diff("session_example")
print(result)import { Ellipsis } from '@ellipsis-dev/sdk';
const client = new Ellipsis({
apiKey: process.env.ELLIPSIS_API_TOKEN!,
});
const result = await client.sessions.diff("session_example");
console.log(result);Request
Response
| Method | Path | Required permissions |
|---|---|---|
| GET | /v1/sessions/{session_id}/executions | read:sessions |
- API key
- Supported.
- CLI user token
- Supported.
- Sandbox token
- Requires the ellipsis:api scope and the required grants in the token's permissions.ellipsis configuration.
Higher permission levels include lower levels: read < write < delete.
Grant match patterns can further restrict access to individual resources.
Path parameters
curl "https://api.ellipsis.dev/v1/sessions/{session_id}/executions" \
-H "Authorization: Bearer $ELLIPSIS_API_TOKEN"import os
from ellipsis import Ellipsis
client = Ellipsis(api_key=os.environ["ELLIPSIS_API_TOKEN"])
result = client.sessions.executions("session_example")
print(result)import { Ellipsis } from '@ellipsis-dev/sdk';
const client = new Ellipsis({
apiKey: process.env.ELLIPSIS_API_TOKEN!,
});
const result = await client.sessions.executions("session_example");
console.log(result);Request
Response
| Method | Path | Required permissions |
|---|---|---|
| GET | /v1/sessions/{session_id}/export | read:sessions |
- API key
- Supported.
- CLI user token
- Supported.
- Sandbox token
- Requires the ellipsis:api scope and the required grants in the token's permissions.ellipsis configuration.
Higher permission levels include lower levels: read < write < delete.
Grant match patterns can further restrict access to individual resources.
Path parameters
curl "https://api.ellipsis.dev/v1/sessions/{session_id}/export" \
-H "Authorization: Bearer $ELLIPSIS_API_TOKEN"import os
from ellipsis import Ellipsis
client = Ellipsis(api_key=os.environ["ELLIPSIS_API_TOKEN"])
result = client.sessions.export("session_example")
print(result)import { Ellipsis } from '@ellipsis-dev/sdk';
const client = new Ellipsis({
apiKey: process.env.ELLIPSIS_API_TOKEN!,
});
const result = await client.sessions.export("session_example");
console.log(result);Request
Response
| Method | Path | Required permissions |
|---|---|---|
| GET | /v1/sessions/{session_id}/git | read:sessions |
- API key
- Supported.
- CLI user token
- Supported.
- Sandbox token
- Requires the ellipsis:api scope and the required grants in the token's permissions.ellipsis configuration.
Higher permission levels include lower levels: read < write < delete.
Grant match patterns can further restrict access to individual resources.
Path parameters
curl "https://api.ellipsis.dev/v1/sessions/{session_id}/git" \
-H "Authorization: Bearer $ELLIPSIS_API_TOKEN"import os
from ellipsis import Ellipsis
client = Ellipsis(api_key=os.environ["ELLIPSIS_API_TOKEN"])
result = client.sessions.git("session_example")
print(result)import { Ellipsis } from '@ellipsis-dev/sdk';
const client = new Ellipsis({
apiKey: process.env.ELLIPSIS_API_TOKEN!,
});
const result = await client.sessions.git("session_example");
console.log(result);Request
Response
| Method | Path | Required permissions |
|---|---|---|
| POST | /v1/sessions/{session_id}/messages | write:sessions |
- API key
- Supported.
- CLI user token
- Supported.
- Sandbox token
- Requires the ellipsis:api scope and the required grants in the token's permissions.ellipsis configuration.
Higher permission levels include lower levels: read < write < delete.
Grant match patterns can further restrict access to individual resources.
Messages received during a turn wait for the next turn. Reuse an idempotency key when retrying the same message.
Path parameters
curl -X POST "https://api.ellipsis.dev/v1/sessions/{session_id}/messages" \
-H "Authorization: Bearer $ELLIPSIS_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"message": "Add a regression test.",
"idempotency_key": "add-test"
}'import os
from ellipsis import Ellipsis
from ellipsis import models
client = Ellipsis(api_key=os.environ["ELLIPSIS_API_TOKEN"])
request = models.SendSessionMessageRequest.model_validate(
{
"message": "Add a regression test.",
"idempotency_key": "add-test"
}
)
result = client.sessions.send_message(
"session_example",
request.message,
idempotency_key=request.idempotency_key,
)
print(result)import { Ellipsis } from '@ellipsis-dev/sdk';
const client = new Ellipsis({
apiKey: process.env.ELLIPSIS_API_TOKEN!,
});
const request: Parameters<typeof client.sessions.sendMessage>[1] = {
"message": "Add a regression test.",
"idempotency_key": "add-test"
};
const result = await client.sessions.sendMessage("session_example", request);
console.log(result);Request
Body parameters
Optional retry-safety key, unique per (session, key): a retry with the same key returns the original message , no duplicate message, no double turn, no double spend. The SDK auto-generates one per send.
Images attached to the message, base64 inline. Requires the model's images capability, which is not currently certified. Each becomes an `[Image #N]` placeholder in the stored body and an image block on the next turn. Up to 10, 5 MiB each; PNG, JPEG, GIF, or WebP.
The message text. May be empty when `images` is not.
Response
| Method | Path | Required permissions |
|---|---|---|
| GET | /v1/sessions/{session_id}/output | read:sessions |
- API key
- Supported.
- CLI user token
- Supported.
- Sandbox token
- Requires the ellipsis:api scope and the required grants in the token's permissions.ellipsis configuration.
Higher permission levels include lower levels: read < write < delete.
Grant match patterns can further restrict access to individual resources.
Path parameters
curl "https://api.ellipsis.dev/v1/sessions/{session_id}/output" \
-H "Authorization: Bearer $ELLIPSIS_API_TOKEN"import os
from ellipsis import Ellipsis
client = Ellipsis(api_key=os.environ["ELLIPSIS_API_TOKEN"])
result = client.sessions.output("session_example")
print(result)import { Ellipsis } from '@ellipsis-dev/sdk';
const client = new Ellipsis({
apiKey: process.env.ELLIPSIS_API_TOKEN!,
});
const result = await client.sessions.output("session_example");
console.log(result);Request
Response
| Method | Path | Required permissions |
|---|---|---|
| GET | /v1/sessions/{session_id}/records | read:sessions |
- API key
- Supported.
- CLI user token
- Supported.
- Sandbox token
- Requires the ellipsis:api scope and the required grants in the token's permissions.ellipsis configuration.
Higher permission levels include lower levels: read < write < delete.
Grant match patterns can further restrict access to individual resources.
Partial text deltas are live-only.
Path parameters
Query parameters
curl "https://api.ellipsis.dev/v1/sessions/{session_id}/records" \
-H "Authorization: Bearer $ELLIPSIS_API_TOKEN"import os
from ellipsis import Ellipsis
client = Ellipsis(api_key=os.environ["ELLIPSIS_API_TOKEN"])
for item in client.sessions.records("session_example"):
print(item)import { Ellipsis } from '@ellipsis-dev/sdk';
const client = new Ellipsis({
apiKey: process.env.ELLIPSIS_API_TOKEN!,
});
for await (const item of await client.sessions.records("session_example")) {
console.log(item);
}Request
Response
| Method | Path | Required permissions |
|---|---|---|
| POST | /v1/sessions/{session_id}/stop | write:sessions |
- API key
- Supported.
- CLI user token
- Supported.
- Sandbox token
- Requires the ellipsis:api scope and the required grants in the token's permissions.ellipsis configuration.
Higher permission levels include lower levels: read < write < delete.
Grant match patterns can further restrict access to individual resources.
Its recorded history remains available.
Path parameters
curl -X POST "https://api.ellipsis.dev/v1/sessions/{session_id}/stop" \
-H "Authorization: Bearer $ELLIPSIS_API_TOKEN"import os
from ellipsis import Ellipsis
client = Ellipsis(api_key=os.environ["ELLIPSIS_API_TOKEN"])
result = client.sessions.stop("session_example")
print(result)import { Ellipsis } from '@ellipsis-dev/sdk';
const client = new Ellipsis({
apiKey: process.env.ELLIPSIS_API_TOKEN!,
});
const result = await client.sessions.stop("session_example");
console.log(result);