> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bland.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Latest Agent Version

> Retrieve the newest saved version with its full snapshot.

### Overview

Returns the head of the agent's dev timeline, including the full configuration snapshot. Pass `branch` to read a branch's head instead; a branch with no saves of its own returns the version it was cut from. Use the returned `id` and `revision` as `parent_version_id` and `parent_revision` in [Create Agent Version](/api-v2/post/agents-id-versions) to save safely on top of it.

### Headers

<ParamField header="authorization" type="string" required>
  Your API key for authentication.
</ParamField>

### Path Parameters

<ParamField path="agent_id" type="string" required>
  The agent's unique identifier. A fresh agent with no saved versions returns `404 NO_VERSIONS`.
</ParamField>

### Query Parameters

<ParamField query="branch" type="string">
  An open branch's ID. Returns that branch's newest save, falling back to its base version when the branch has none. Returns `404 BRANCH_NOT_FOUND` if the branch is not open or does not belong to this agent.
</ParamField>

### Response

<ResponseField name="data" type="object">
  The newest version, with its snapshot.

  <Expandable title="version object">
    <ResponseField name="id" type="string">
      Unique identifier for the version.
    </ResponseField>

    <ResponseField name="org_id" type="string">
      The organization that owns the agent.
    </ResponseField>

    <ResponseField name="agent_id" type="string">
      The agent this version belongs to.
    </ResponseField>

    <ResponseField name="branch_id" type="string | null">
      The branch the version was saved onto, or `null` on the dev timeline. When `branch` falls back to the base version, this is `null` because the base lives on the dev timeline.
    </ResponseField>

    <ResponseField name="snapshot" type="object">
      The saved configuration: `behavior` (the node and edge graph), `settings` (agent-wide options), `contact` (`inboundNumbers`), and `knowledge` (`kbIds`) when present.
    </ResponseField>

    <ResponseField name="name" type="string | null">
      The version's display name, or `null` if none was given.
    </ResponseField>

    <ResponseField name="created_via" type="string">
      `manual` or `autosave`.
    </ResponseField>

    <ResponseField name="revision" type="integer">
      Incremented each time an autosave rewrites this row in place. Send it back as `parent_revision` when saving.
    </ResponseField>

    <ResponseField name="created_by" type="string | null">
      ID of the user who saved the version, or `null` when saved with an org-level key.
    </ResponseField>

    <ResponseField name="created_at" type="string">
      ISO 8601 timestamp of the first write.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="errors" type="null | array">
  `null` on success, or a list of error objects if the request failed.
</ResponseField>

<ResponseExample>
  ```json Response theme={null}
  {
    "data": {
      "id": "947368cd-ea03-48e1-8d14-84f62a1be090",
      "org_id": "4afedeaf-2bb5-4646-91d5-cb2b8d5e6bf2",
      "agent_id": "9f242ae9-7d90-49df-8bd9-8450a97f1504",
      "branch_id": null,
      "snapshot": {
        "behavior": {
          "nodes": [
            {
              "id": "3da34a58-ddf3-4571-b060-4cfd7787a8f5",
              "type": "start",
              "position": { "x": 0, "y": 0 },
              "data": {}
            },
            {
              "id": "c0b9fdb4-62e6-4950-a099-bc24604555c1",
              "type": "scenario",
              "position": { "x": 320, "y": 0 },
              "data": {
                "name": "Reschedule",
                "rule": "Find the caller's existing appointment and offer the next three open slots.",
                "target": { "kind": "dialogue", "label": "Reschedule" },
                "loopWhile": "",
                "variables": [],
                "entry": {
                  "mode": "llm",
                  "label": "Caller wants to move an appointment",
                  "description": "",
                  "alwaysPick": false,
                  "conditions": []
                }
              }
            }
          ],
          "edges": [
            {
              "id": "74c3c224-a701-44ea-bf53-fef3f6028dc1",
              "source": "3da34a58-ddf3-4571-b060-4cfd7787a8f5",
              "target": "c0b9fdb4-62e6-4950-a099-bc24604555c1"
            }
          ]
        },
        "settings": {
          "displayName": "Front desk",
          "systemPrompt": "You are the front desk assistant for a dental clinic.",
          "languages": ["en"],
          "enableMemory": false,
          "backgroundNoise": "off"
        },
        "contact": {
          "inboundNumbers": ["+14155550123"]
        },
        "knowledge": {
          "kbIds": []
        }
      },
      "name": null,
      "created_via": "autosave",
      "revision": 4,
      "created_by": "174ee50e-166c-41ff-8aa0-7c44ebb6e832",
      "created_at": "2026-09-10T23:41:07.902Z"
    },
    "errors": null
  }
  ```

  ```json No Versions theme={null}
  {
    "data": null,
    "errors": [
      {
        "error": "NO_VERSIONS",
        "message": "Agent has no versions yet"
      }
    ]
  }
  ```

  ```json Branch Not Found theme={null}
  {
    "data": null,
    "errors": [
      {
        "error": "BRANCH_NOT_FOUND",
        "message": "Branch not found"
      }
    ]
  }
  ```

  ```json Not Found theme={null}
  {
    "data": null,
    "errors": [
      {
        "error": "NOT_FOUND",
        "message": "Agent not found"
      }
    ]
  }
  ```
</ResponseExample>

***

Docs for agents: [llms.txt](/llms.txt)
