Levain LabsLevain Labs
ApiSessions

Request Session Publish

Publish the draft version behind an agent-builder conversation.

Publish the draft version behind an agent-builder conversation.

Publishes immediately when the newest finished turn's verification verdict is green (checks passing, review approved, no open comments) — verification runs automatically after each build turn, or on demand via POST /sessions/{session_id}/review.

Only valid on a conversation with the agent builder whose version is still a draft. Returns 409 when the version is already published, a turn is running or queued, or the draft has not passed verification.

POST
/api/v1/sessions/{session_id}/publish

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

session_id*Session Id
Formatuuid

Header Parameters

X-API-Key?string|null

Response Body

application/json

application/json

curl -X POST "https://api.levainlabs.com/api/v1/sessions/497f6eca-6276-4993-bfeb-53cbbbba6f08/publish"
{
  "id": "string",
  "agent_id": "string",
  "agent_version_id": "string",
  "state": "string",
  "title": "string",
  "kind": "agent",
  "first_prompt": "string",
  "origin": "slack",
  "origin_provider": "string",
  "origin_provider_display": "string",
  "has_artifacts": true,
  "archived_at": "string",
  "created_at": "string",
  "last_activity_at": "string",
  "terminated_at": "string",
  "rounds": [],
  "events": [],
  "steered": true,
  "dispatched_run_id": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}