API reference
Read sessions, conversations, runs, and exact artifact versions, or submit a command to a session. Start with the quickstart for your first request. The OpenAPI JSON is the machine-readable contract and also covers deployment observations.
Authentication and paths
Send Authorization: Bearer $WALLIE_API_TOKEN with a scoped machine token or a Wallie OAuth access token issued for the HTTP API. See authentication in the quickstart. The grant limits access to one factory and its approved writable repository. Reads only show sessions with a pinned definition or verified Git root in that repository.
Every operation below starts with /api/v1/workspaces/{workspaceId}/factories/{factoryId}. Both path IDs are required Wallie UUIDs, not slugs. A session’s UUID is id, not its display number. Detail reads and writes take no query parameters.
Use Bash and curl for these examples. Set WALLIE_API_TOKEN privately and keep shell tracing off. Replace the example UUIDs and cursor strings with values from your own Wallie instance; the samples are independent. For a qualified self-hosted instance, set WALLIE_API_ORIGIN to its trusted HTTPS origin. The default uses the final hosted origin so bearer requests do not need to follow a redirect.
WALLIE_WORKSPACE_ID=11111111-1111-4111-8111-111111111111
WALLIE_FACTORY_ID=22222222-2222-4222-8222-222222222222
SESSION_ID=33333333-3333-4333-8333-333333333333
ORIGIN="${WALLIE_API_ORIGIN:-https://www.wallie.dev}"
BASE="${ORIGIN%/}/api/v1/workspaces/$WALLIE_WORKSPACE_ID/factories/$WALLIE_FACTORY_ID"Use a returned session, run, artifact, or clarification ID to set SESSION_ID, RUN_ID, ARTIFACT_ID, or CLARIFICATION_ID for the corresponding example. Add -i to a curl command to see the status and headers.
Pagination and conversation resume
List responses include items and a nullable nextCursor. Pass a non-null nextCursor as cursor on the same endpoint, workspace, factory, and filters. For runs, keep the same sessionId filter. Treat cursors as opaque; do not edit them or reuse them across resources. The empty sessions page {"items":[],"nextCursor":null} is a successful 200 response.
Conversation pages default to direction=before. Use nextCursor in the same direction to continue paging. Separately, save the resumeCursor from the newest page you processed and pass direction=after&cursor=<resumeCursor> to fetch newer messages. Keep that forward checkpoint when reading older pages. An empty page still provides a resume cursor, even if nextCursor is null.
Session status and human review
Session status is in_progress, awaiting_review, approved, or rejected. Run status is separate: queued, started, running, success, error, or canceled. A run can publish an artifact, moving the session to awaiting_review. Read the session or run again for its current state after a command. Timestamps use ISO 8601.
When review is present, send the human reviewer to review.href, relative to the Wallie origin. The signed-in Workbench targets that artifact version and review revision. If it’s superseded, the old review opens read-only; fetch the session again for the current review. A follow-up or clarification is not an approval. Artifact approval, delivery readiness, and a GitHub merge are separate outcomes.
Write requests and idempotency
Every POST sends Content-Type: application/json with a body of at most 256 KiB and a required Idempotency-Key UUID. Text limits count Unicode code points after trimming. Set IDEMPOTENCY_KEY to a fresh UUID for each new intent and keep it with the exact URL and body.
After a timeout or lost reply, retry the same intent with the same key. Wallie rechecks current access and quota before returning an already committed receipt. Changing the intent under the same key returns 409 idempotency_conflict. For 409 stale_intent, fetch the session again, decide whether to act on the new state, and use a new key for that new intent.
A receipt identifies the command (receiptId) and its session. phaseStatus records the session state at commit, not its live state. replayed tells you if the receipt came from a prior request. canonicalUrl opens the session in Wallie and conversationUrl points to its API conversation, which requires sessions:read. If a follow-up or answer returns executionExhausted: true, the input was recorded but no successor job or run was queued.
List sessions
GET /sessions
Required scope: sessions:read
Lists sessions in the approved repository, newest first. Use items[0].id to read the first session, if present.
| Field | Location | Use |
|---|---|---|
cursor | Query | Optional opaque nextCursor from the previous page. |
limit | Query | Optional maximum results per page. Integer from 1 to 50; default 25. |
curl -q -sS --proto '=https' \
--header @<(printf 'Authorization: Bearer %s\n' "$WALLIE_API_TOKEN") \
"$BASE/sessions?limit=1"{
"items": [
{
"id": "33333333-3333-4333-8333-333333333333",
"number": 42,
"title": "Add a health check",
"status": "awaiting_review",
"archivedAt": null,
"createdAt": "2026-01-01T12:00:00Z",
"updatedAt": "2026-01-01T12:04:00Z",
"currentStageId": "44444444-4444-4444-8444-444444444444",
"currentRunId": "66666666-6666-4666-8666-666666666666",
"specificationStageId": null,
"canonicalUrl": "/w/example-workspace/sessions/42",
"review": {
"artifactId": "55555555-5555-4555-8555-555555555555",
"artifactVersion": 2,
"reviewRevision": 3,
"stageId": "44444444-4444-4444-8444-444444444444",
"stageSlug": "plan",
"runId": "66666666-6666-4666-8666-666666666666",
"attemptCount": 1,
"checkpointRunId": "66666666-6666-4666-8666-666666666666",
"clarification": null,
"href": "/w/example-workspace/sessions/42?artifactStage=plan&artifactId=55555555-5555-4555-8555-555555555555&artifactVersion=2&reviewStageId=44444444-4444-4444-8444-444444444444&reviewRevision=3"
}
}
],
"nextCursor": null
}Get a session
GET /sessions
Required scope: sessions:read
Returns the same session record as the list, with timestamps, current stage and run IDs, and the browser canonicalUrl. The review field is null when there is no available current review. Otherwise it identifies the exact stage, artifact version, producing attempt, and review revision, plus any pending clarification.
| Field | Location | Use |
|---|---|---|
session | Path | Required session UUID, not the display number. |
curl -q -sS --proto '=https' \
--header @<(printf 'Authorization: Bearer %s\n' "$WALLIE_API_TOKEN") \
"$BASE/sessions/$SESSION_ID"{
"id": "33333333-3333-4333-8333-333333333333",
"number": 42,
"title": "Add a health check",
"status": "awaiting_review",
"archivedAt": null,
"createdAt": "2026-01-01T12:00:00Z",
"updatedAt": "2026-01-01T12:04:00Z",
"currentStageId": "44444444-4444-4444-8444-444444444444",
"currentRunId": "66666666-6666-4666-8666-666666666666",
"specificationStageId": null,
"canonicalUrl": "/w/example-workspace/sessions/42",
"review": {
"artifactId": "55555555-5555-4555-8555-555555555555",
"artifactVersion": 2,
"reviewRevision": 3,
"stageId": "44444444-4444-4444-8444-444444444444",
"stageSlug": "plan",
"runId": "66666666-6666-4666-8666-666666666666",
"attemptCount": 1,
"checkpointRunId": "66666666-6666-4666-8666-666666666666",
"clarification": null,
"href": "/w/example-workspace/sessions/42?artifactStage=plan&artifactId=55555555-5555-4555-8555-555555555555&artifactVersion=2&reviewStageId=44444444-4444-4444-8444-444444444444&reviewRevision=3"
}
}List conversation messages
GET /sessions
Required scope: sessions:read
Returns messages in ascending sequence within a page, along with related sources. Message bodyHtml is sanitized HTML, not Markdown. Messages can include a source, run, attempt, or artifact reference, and bodyTruncated indicates that text was shortened.
| Field | Location | Use |
|---|---|---|
session | Path | Required session UUID, not the display number. |
cursor | Query | Optional nextCursor for the same direction, or resumeCursor with after. |
limit | Query | Optional maximum results per page. Integer from 1 to 50; default 25. |
direction | Query | Optional; defaults to before (newest page without a cursor). Use after to read forward. |
curl -q -sS --proto '=https' \
--header @<(printf 'Authorization: Bearer %s\n' "$WALLIE_API_TOKEN") \
"$BASE/sessions/$SESSION_ID/conversation"{
"canonicalUrl": "/w/example-workspace/sessions/42",
"items": [
{
"sequence": 1,
"kind": "initial_prompt",
"authorKind": "user",
"authorLabel": "Requester",
"createdAt": "2026-01-01T12:00:00Z",
"bodyHtml": "<p>Add a health check.</p>",
"bodyTruncated": false,
"runId": null,
"attemptCount": null,
"artifactId": null,
"source": null
}
],
"sources": [],
"nextCursor": null,
"resumeCursor": "example-resume-cursor"
}List runs
GET /runs
Required scope: sessions:read
Lists runs in the approved repository, newest first. Filter to one session with its UUID, and keep that filter when following the cursor.
| Field | Location | Use |
|---|---|---|
cursor | Query | Optional opaque nextCursor from the previous page. |
limit | Query | Optional maximum results per page. Integer from 1 to 50; default 25. |
session | Query | Optional session UUID. Omit to list runs across eligible sessions. |
curl -q -sS --proto '=https' \
--header @<(printf 'Authorization: Bearer %s\n' "$WALLIE_API_TOKEN") \
"$BASE/runs?sessionId=33333333-3333-4333-8333-333333333333&limit=1"{
"items": [
{
"id": "66666666-6666-4666-8666-666666666666",
"sessionId": "33333333-3333-4333-8333-333333333333",
"sessionNumber": 42,
"stageId": "44444444-4444-4444-8444-444444444444",
"stageName": "Plan",
"stageSlug": "plan",
"status": "success",
"attemptCount": 1,
"createdAt": "2026-01-01T12:00:00Z",
"startedAt": "2026-01-01T12:01:00Z",
"completedAt": "2026-01-01T12:04:00Z",
"artifactId": "55555555-5555-4555-8555-555555555555",
"artifactCoverage": "available",
"transcriptAvailability": "not_exposed",
"canonicalUrl": "/w/example-workspace/sessions/42#wallie-run-66666666-6666-4666-8666-666666666666"
}
],
"nextCursor": null
}Get a run
GET /runs
Required scope: sessions:read
Returns the run's stage, status, attempt count, and timestamps. artifactCoverage is available or unavailable. If artifactId is present, use it with sessionId to fetch that version. transcriptAvailability is expired or not_exposed; no transcript body is returned.
| Field | Location | Use |
|---|---|---|
run | Path | Required run UUID from a run, session, or command receipt. |
curl -q -sS --proto '=https' \
--header @<(printf 'Authorization: Bearer %s\n' "$WALLIE_API_TOKEN") \
"$BASE/runs/$RUN_ID"{
"id": "66666666-6666-4666-8666-666666666666",
"sessionId": "33333333-3333-4333-8333-333333333333",
"sessionNumber": 42,
"stageId": "44444444-4444-4444-8444-444444444444",
"stageName": "Plan",
"stageSlug": "plan",
"status": "success",
"attemptCount": 1,
"createdAt": "2026-01-01T12:00:00Z",
"startedAt": "2026-01-01T12:01:00Z",
"completedAt": "2026-01-01T12:04:00Z",
"artifactId": "55555555-5555-4555-8555-555555555555",
"artifactCoverage": "available",
"transcriptAvailability": "not_exposed",
"canonicalUrl": "/w/example-workspace/sessions/42#wallie-run-66666666-6666-4666-8666-666666666666"
}Get an artifact version
GET /sessions
Required scope: sessions:read
Returns one immutable artifact version, not the latest for the stage. bodyHtml is sanitized HTML. Provenance includes the producing run and attempt, the checkpoint run, and the recorded 40-character commit SHA. href opens this version in Wallie.
| Field | Location | Use |
|---|---|---|
session | Path | Required session UUID, not the display number. |
artifact | Path | Required UUID of the exact version, as returned by a review or run. |
curl -q -sS --proto '=https' \
--header @<(printf 'Authorization: Bearer %s\n' "$WALLIE_API_TOKEN") \
"$BASE/sessions/$SESSION_ID/artifacts/$ARTIFACT_ID"{
"id": "55555555-5555-4555-8555-555555555555",
"sessionId": "33333333-3333-4333-8333-333333333333",
"sessionNumber": 42,
"stageId": "44444444-4444-4444-8444-444444444444",
"stageSlug": "plan",
"version": 2,
"createdAt": "2026-01-01T12:04:00Z",
"bodyHtml": "<p>Check service health.</p>",
"provenance": {
"runId": "66666666-6666-4666-8666-666666666666",
"attemptCount": 1,
"checkpointRunId": "66666666-6666-4666-8666-666666666666",
"commitSha": "1234567890123456789012345678901234567890"
},
"canonicalUrl": "/w/example-workspace/sessions/42",
"href": "/w/example-workspace/sessions/42?artifactStage=plan&artifactId=55555555-5555-4555-8555-555555555555&artifactVersion=2"
}Create a session
POST /sessions
Required scope: sessions:create
Creates a session with phaseStatus: in_progress and queues its initial job and run. Use a published agent and the writable repository allowed by the grant. A new session returns 201; replaying the same command returns 200 and the original receipt with replayed: true. Neither response confirms execution or delivery.
| Field | Location | Use |
|---|---|---|
title | JSON | Required text, up to 200 characters. |
prompt | JSON | Required text, up to 20,000 characters. |
agent | JSON | Required published agent UUID. |
repository | JSON | Required Wallie repository UUID matching the grant. |
draft | JSON | Optional boolean. Default false; set true to draft a specification. |
workflow | JSON | Optional exact published selection: an object with workflowId and activationId (both UUIDs). Omit when draftSpecification is true. |
curl -q -sS --proto '=https' --request POST \
--header @<(printf 'Authorization: Bearer %s\n' "$WALLIE_API_TOKEN") \
--header "Content-Type: application/json" \
--header "Idempotency-Key: $IDEMPOTENCY_KEY" \
--data-binary @- "$BASE/sessions" <<'JSON'
{
"title": "Add a health check",
"prompt": "Plan a health check for the service.",
"agentId": "bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb",
"repositoryId": "cccccccc-cccc-4ccc-8ccc-cccccccccccc"
}
JSON{
"receiptId": "99999999-9999-4999-8999-999999999999",
"sessionId": "33333333-3333-4333-8333-333333333333",
"sessionNumber": 42,
"workspaceSlug": "example-workspace",
"canonicalUrl": "/w/example-workspace/sessions/42",
"conversationUrl": "/api/v1/workspaces/11111111-1111-4111-8111-111111111111/factories/22222222-2222-4222-8222-222222222222/sessions/33333333-3333-4333-8333-333333333333/conversation",
"replayed": false,
"phaseStatus": "in_progress",
"jobId": "88888888-8888-4888-8888-888888888888",
"runId": "66666666-6666-4666-8666-666666666666"
}Request a follow-up
POST /sessions
Required scope: sessions:follow-up
Records feedback on the exact current review and requests a rerun of the same stage. The receipt has phaseStatus: rejected, even if a successor run is queued. If a clarification is pending, answer it first; a follow-up will return 409 clarification_required.
| Field | Location | Use |
|---|---|---|
session | Path | Required session UUID, not the display number. |
stage | JSON | Required stage UUID from the current review. |
artifact | JSON | Required artifact UUID from the current review. |
artifact | JSON | Required artifact version from the current review. Positive integer. |
review | JSON | Required review revision from the current review. Non-negative integer. |
feedback | JSON | Required feedback text, up to 4,000 characters. |
curl -q -sS --proto '=https' --request POST \
--header @<(printf 'Authorization: Bearer %s\n' "$WALLIE_API_TOKEN") \
--header "Content-Type: application/json" \
--header "Idempotency-Key: $IDEMPOTENCY_KEY" \
--data-binary @- "$BASE/sessions/$SESSION_ID/follow-ups" <<'JSON'
{
"stageId": "44444444-4444-4444-8444-444444444444",
"artifactId": "55555555-5555-4555-8555-555555555555",
"artifactVersion": 2,
"reviewRevision": 3,
"feedback": "Include the failure response."
}
JSON{
"receiptId": "99999999-9999-4999-8999-999999999999",
"sessionId": "33333333-3333-4333-8333-333333333333",
"sessionNumber": 42,
"workspaceSlug": "example-workspace",
"canonicalUrl": "/w/example-workspace/sessions/42",
"conversationUrl": "/api/v1/workspaces/11111111-1111-4111-8111-111111111111/factories/22222222-2222-4222-8222-222222222222/sessions/33333333-3333-4333-8333-333333333333/conversation",
"replayed": false,
"phaseStatus": "rejected",
"jobId": "88888888-8888-4888-8888-888888888888",
"runId": "77777777-7777-4777-8777-777777777777",
"feedbackBatchId": "dddddddd-dddd-4ddd-8ddd-dddddddddddd",
"executionExhausted": false
}Answer a clarification
POST /sessions
Required scope: sessions:clarify
Records an answer to the current specification question and requests a rerun of that stage. Use the pending clarification and exact artifact fields from the same review. The receipt has phaseStatus: rejected and includes the clarificationId.
| Field | Location | Use |
|---|---|---|
session | Path | Required session UUID, not the display number. |
clarification | Path | Required UUID from review.clarification.id. |
artifact | JSON | Required artifact UUID from the current review. |
artifact | JSON | Required artifact version from the current review. Positive integer. |
review | JSON | Required review revision from the current review. Non-negative integer. |
answer | JSON | Required answer text, up to 2,000 characters. |
curl -q -sS --proto '=https' --request POST \
--header @<(printf 'Authorization: Bearer %s\n' "$WALLIE_API_TOKEN") \
--header "Content-Type: application/json" \
--header "Idempotency-Key: $IDEMPOTENCY_KEY" \
--data-binary @- "$BASE/sessions/$SESSION_ID/clarifications/$CLARIFICATION_ID/answers" <<'JSON'
{
"artifactId": "55555555-5555-4555-8555-555555555555",
"artifactVersion": 2,
"reviewRevision": 3,
"answer": "Return 503 if the service is not ready."
}
JSON{
"receiptId": "99999999-9999-4999-8999-999999999999",
"sessionId": "33333333-3333-4333-8333-333333333333",
"sessionNumber": 42,
"workspaceSlug": "example-workspace",
"canonicalUrl": "/w/example-workspace/sessions/42",
"conversationUrl": "/api/v1/workspaces/11111111-1111-4111-8111-111111111111/factories/22222222-2222-4222-8222-222222222222/sessions/33333333-3333-4333-8333-333333333333/conversation",
"replayed": false,
"phaseStatus": "rejected",
"jobId": "88888888-8888-4888-8888-888888888888",
"runId": "77777777-7777-4777-8777-777777777777",
"feedbackBatchId": "dddddddd-dddd-4ddd-8ddd-dddddddddddd",
"executionExhausted": false,
"clarificationId": "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa"
}Cancel a run
POST /sessions
Required scope: sessions:cancel
Cancels active work for an in-progress session only if it still matches the expected run. A run can be queued, started, or running. The run becomes canceled and the session goes to rejected. The receipt reports jobIds and runIds. This does not roll back an artifact, commit, or delivery.
| Field | Location | Use |
|---|---|---|
session | Path | Required session UUID, not the display number. |
expected | JSON | Required UUID of the current run you intend to stop. |
curl -q -sS --proto '=https' --request POST \
--header @<(printf 'Authorization: Bearer %s\n' "$WALLIE_API_TOKEN") \
--header "Content-Type: application/json" \
--header "Idempotency-Key: $IDEMPOTENCY_KEY" \
--data-binary @- "$BASE/sessions/$SESSION_ID/cancel" <<'JSON'
{
"expectedRunId": "66666666-6666-4666-8666-666666666666"
}
JSON{
"receiptId": "99999999-9999-4999-8999-999999999999",
"sessionId": "33333333-3333-4333-8333-333333333333",
"sessionNumber": 42,
"workspaceSlug": "example-workspace",
"canonicalUrl": "/w/example-workspace/sessions/42",
"conversationUrl": "/api/v1/workspaces/11111111-1111-4111-8111-111111111111/factories/22222222-2222-4222-8222-222222222222/sessions/33333333-3333-4333-8333-333333333333/conversation",
"replayed": false,
"phaseStatus": "rejected",
"jobIds": [
"88888888-8888-4888-8888-888888888888"
],
"runIds": [
"66666666-6666-4666-8666-666666666666"
]
}Errors and limits
Protected responses are private and non-cacheable. Errors return JSON with a stable code, a human-readable error, and sometimes retryAfterSeconds.
| Status | Meaning |
|---|---|
| 400 | A path, query parameter, cursor, key, or JSON body is invalid. |
| 401 | A live Wallie bearer credential is required. The response includes WWW-Authenticate: Bearer. |
| 403 | The credential lacks the requested scope or factory access. |
| 404 | The requested resource is absent, deleted, or outside the approved scope. |
| 409 | The request or admission conflicts, or the write intent is stale. Check code before retrying. |
| 410 | The read target is retained but lacks readable content or provenance. |
| 413 | The write body exceeds 256 KiB (262,144 bytes). |
| 415 | The write requires application/json. |
| 422 | The current factory or agent configuration cannot admit the session. |
| 429 | A workspace or service principal rate or concurrency limit applies. Wait for Retry-After. |
| 503 | The service is temporarily unavailable. Back off before retrying. |
By default, a workspace has 120 requests per rolling 60 seconds and 12 concurrent requests. Each service principal also has 60 requests per rolling 60 seconds and 4 concurrent requests, shared across its credentials. The default concurrency lease is 60 seconds. Deployments can configure different limits. These are API request limits, not limits on background runs.
On 429 rate_limited or 429 concurrency_limited, wait at least the number of seconds in Retry-After (also returned as retryAfterSeconds) before trying again. If retrying a POST, keep the same key and intent.