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

# Pull Requests

> Read the GitHub pull requests agent sessions worked on, and report commits.

**Authorization** `string` *required*

`Bearer` plus a Management API key or user session.

**search** `string`

Matches repository, number, and title.

**limit** `integer` (default: 20)

Pull requests per page.

**offset** `integer` (default: 0)

Pull requests to skip.

```bash cURL theme={null}
curl "https://routing.dari.dev/v1/organizations/current/routing/activity/pull-requests?search=login" \
  -H "Authorization: Bearer $DARI_API_KEY"
```

## Endpoints

| Method and path | Who | What |
| - | - | - |
| `GET .../pull-requests` | Admin | Pull requests, latest linked first; `search`, `limit`, `offset`. |
| `GET .../pull-requests/{owner}/{repo}/{number}` | Admin | One pull request and its conversations. |
| `POST https://routing.dari.dev/[{router_id}/]v1/dari/git-events` | The session's routing key | Report commits a coding agent session made; `dari git-hook` sends these. |

## Pull Requests

Dari reads each session's pull requests from its tool output: one it opened with `gh pr create`, ran another `gh pr` command on, or whose branch it pushed. It also links a session to the pull request on the branch of each commit Dari's git hook reported for it. Every conversation summary carries them as `pull_requests`, each with `repository`, `number`, `url`, and `title` (when known). A conversation's detail also lists its reported `commits`, each with `repository`, `sha`, `branch`, `url`, and `reported_at`. A pull request summary holds its `branch`, `opened_at`, sessions, cost, tokens, steps, models, and people.

## Reporting Commits

The git hook reports a commit with the routing key the session's requests used, to the same router:

```bash cURL theme={null}
curl -X POST "https://routing.dari.dev/v1/dari/git-events" \
  -H "Authorization: Bearer $DARI_ROUTING_API_KEY" -H "Content-Type: application/json" \
  -d '{"harness": "claude_code", "session_id": "8f0c2a4e-1b3d-4c5e-9f60-7a8b9c0d1e2f",
       "commits": [{"repository": "acme/web", "branch": "fix-login", "sha": "1a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d", "pull_request": 7}]}'
```

`harness` is `claude_code` (the session is Claude Code's `CLAUDE_CODE_SESSION_ID`) or `codex` (its `CODEX_THREAD_ID`). Each commit needs a GitHub `repository`, its `branch`, and its full `sha`; `pull_request` and `title` name the branch's open pull request when known. A commit the session already has is stored once. Answers 204. A Codex subagent's commits go to its parent's session; when no request names the thread yet, the endpoint answers 409 `session_pending` so the hook asks again, and `"final": true` stores the commit under the thread itself.


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