Levain LabsLevain Labs
API ReferenceAgents

List Agent Drafts

List draft versions of an agent with the issues motivating each.

Returns every non-archived draft version for the agent, ordered from newest to oldest. Each draft carries the list of issues the build was dispatched to address — issue_id, current title, current status, occurrence count, and the rationale recorded when the build was triggered. Drafts that were created manually (no attribution) come back with an empty issues list.

Use this to surface auto-generated drafts in a review surface: one card per draft, the issues underneath as context for what changed and why. Publishing a draft is PATCH /api/v1/versions/{version_id} with {"status": "active"}.

GET
/api/v1/agents/{agent_id}/drafts

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

agent_id*Agent Id

Header Parameters

X-API-Key?string|null

Response Body

application/json

application/json

curl -X GET "https://api.levainlabs.com/api/v1/agents/string/drafts"
{
  "drafts": [
    {
      "version_id": "string",
      "version": 0,
      "parent_version": 0,
      "created_at": "string",
      "issues": [
        {
          "issue_id": "string",
          "issue_title": "string",
          "issue_status": "string",
          "occurrence_count": 0,
          "rationale": "string"
        }
      ]
    }
  ]
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}