> ## 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.

# Preview Agent Branch Rebase

> Preview a branch rebase onto the current dev head.

### Overview

Dry-runs a three-way merge of the branch onto dev's current head and reports what a rebase would bring in from dev (`changes`) and where dev and the branch changed the same value differently (`conflicts`). This is a POST but it writes nothing and takes no body. Call it after [Merge Agent Branch](https://docs.bland.ai/api-v2/post/agents-id-branches-branch-id-merge.md) returns `409 BRANCH_BEHIND`, then pass the returned `dev_head_version_id` and a resolution for every conflict to [Rebase Agent Branch](https://docs.bland.ai/api-v2/post/agents-id-branches-branch-id-rebase.md).

Requires an admin, owner, operator, or prompter role.

### Headers

**authorization** `string` *required*

Your API key for authentication.

### Path Parameters

**agent\_id** `string` *required*

The agent's unique identifier.

**branch\_id** `string` *required*

The branch's unique identifier. Must be an open branch on this agent.

### Response

**data.dev\_head\_version\_id** `string | null`

The dev version the preview ran against. Pass this unchanged to Rebase Agent Branch. `null` when the agent has no dev versions.

**data.up\_to\_date** `boolean`

`true` when the branch's base is already dev's head (or the agent has no dev versions), so there is nothing to rebase and a merge would fast-forward. `changes` and `conflicts` are empty in that case.

**data.auto\_merged** `integer`

Number of entries in `changes`.

**data.changes** `array`

Dev-side edits the branch did not touch. They merge in automatically on rebase; nothing is required from you.

**change object**

**id** `string`

Stable identifier, `kind:key` or `kind:key#path`.

**kind** `string`

One of `node`, `edge`, `setting`, `contact`, `knowledge`.

**key** `string`

The node or edge ID, or the `settings`, `contact`, or `knowledge` field name.

**path** `string`

Dot path to the changed value inside that unit. Empty string when the whole unit changed, such as an added or deleted node.

**path\_labels** `array`

Display labels aligned with `path`, with element IDs replaced by names where available.

**label** `string`

Human-readable name of the unit, such as a node's name or a setting's field name.

**base** `any`

The value at `path` on the branch's base. Omitted when dev added the value.

**theirs** `any`

Dev's current value at `path`. Omitted when dev deleted the value.

**data.conflicts** `array`

Values changed differently on both sides. Each needs a resolution before the rebase succeeds; key your `resolutions` map by the conflict's `id`.

**conflict object**

**id** `string`

Stable identifier, `kind:key` or `kind:key#path`. Use it as the key in the `resolutions` body of Rebase Agent Branch.

**kind** `string`

One of `node`, `edge`, `setting`, `contact`, `knowledge`.

**key** `string`

The node or edge ID, or the `settings`, `contact`, or `knowledge` field name.

**path** `string`

Dot path to the conflicting value inside that unit. Empty string when the whole unit conflicts, such as one side deleting a node the other edited.

**path\_labels** `array`

Display labels aligned with `path`.

**label** `string`

Human-readable name of the unit.

**base** `any`

The value on the branch's base. Omitted when both sides added the value.

**theirs** `any`

Dev's value. Omitted when dev deleted it.

**ours** `any`

The branch's value. Omitted when the branch deleted it.

**errors** `null | array`

`null` on success, or a list of error objects if the request failed.

```json Response theme={null}
{
  "data": {
    "dev_head_version_id": "50dc2b1d-854f-4403-8c26-e845238cc03b",
    "up_to_date": false,
    "auto_merged": 1,
    "changes": [
      {
        "id": "node:40f4b50d-46a3-4235-99b7-09a299ce628c#data.rule",
        "kind": "node",
        "key": "40f4b50d-46a3-4235-99b7-09a299ce628c",
        "path": "data.rule",
        "path_labels": ["data", "rule"],
        "label": "Verify account",
        "base": "Ask for the account number and confirm the last four digits.",
        "theirs": "Ask for the account number, then confirm the last four digits and the billing zip code."
      }
    ],
    "conflicts": [
      {
        "id": "setting:systemPrompt",
        "kind": "setting",
        "key": "systemPrompt",
        "path": "",
        "path_labels": [],
        "label": "systemPrompt",
        "base": "You are the front desk assistant for Northwind Dental.",
        "theirs": "You are the front desk assistant for Northwind Dental. Keep answers under two sentences.",
        "ours": "You are the scheduling assistant for Northwind Dental. Always offer the next two open slots."
      }
    ]
  },
  "errors": null
}
```

```json Up To Date theme={null}
{
  "data": {
    "dev_head_version_id": "50dc2b1d-854f-4403-8c26-e845238cc03b",
    "up_to_date": true,
    "auto_merged": 0,
    "changes": [],
    "conflicts": []
  },
  "errors": null
}
```

```json Not Found theme={null}
{
  "data": null,
  "errors": [
    {
      "error": "NOT_FOUND",
      "message": "Agent or branch not found"
    }
  ]
}
```

***

Docs for agents: [llms.txt](https://docs.bland.ai/llms.txt)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.