# link_ticket_branch

`tools/call` · `POST /clanker/v1/tickets:link-branch`

Link a ticket to the repository's branch you work on it in, so the plugin's hook names the ticket in sessions on that branch, Codex's thread panel opens on it, and the ticket page lists the branch. Link the branch as soon as you start work on a ticket in it. Linking it again changes nothing. Returns the ticket. Needs write access.

- Area: Planning
- Needs the write grant. Idempotent.

## Inputs

- `ticket` (string, required): A ticket ID, such as WEB-31.
- `repository` (string, required): The repository as owner/name, such as acme/web, or its GitHub URL.
- `branch` (string, required): The git branch, such as web-31-docs-search.

## Request

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "link_ticket_branch",
    "arguments": {
      "ticket": "WEB-31",
      "repository": "acme/web",
      "branch": "web-31-docs-search"
    }
  }
}
```

## HTTP request

The same call over the clanker HTTP API, with a clanker OAuth access token:

```bash
curl -X POST https://api.clankership.com/clanker/v1/tickets:link-branch \
  -H "Authorization: Bearer $CLANKER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "ticket": "WEB-31",
    "repository": "acme/web",
    "branch": "web-31-docs-search"
  }'
```
