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

# API: Build Tasks

> Connect repositories and evals, and generate tasks from merged PRs or described vibe evals.

`{repo}` is `/api/orgs/{org}/repos/{owner}/{name}`. See [Conventions](https://docs.selfbench.dev/api/overview.md#conventions).

| Method | Route | Does |
| - | - | - |
| `GET`, `POST` | `/api/orgs/{org}/repos` | List, or connect a repository |
| `GET`, `PATCH`, `DELETE` | `{repo}` | Read, set `agentMinutes`, or disconnect |
| `POST` | `/api/orgs/{org}/evals` | Create a workspace eval |
| `GET` | `{repo}/pull-requests?page=N` | Merged pull requests |
| `GET` | `{repo}/generation-options` | Models, sandboxes, and credentials for generation |
| `GET`, `POST` | `{repo}/batches` | List or start batches |
| `GET` | `{repo}/batches/{runId}` | A batch's progress |
| `POST` | `{repo}/batches/{runId}/cancel` | Stop a batch |
| `POST` | `{repo}/tasks/from-pr` | A task from one merged PR |
| `POST` | `{repo}/tasks/from-scenario` | A task from a described vibe eval |

## Request Bodies

| Route | Body |
| - | - |
| `POST /api/orgs/{org}/repos` | `{ fullName: "owner/name" }` |
| `PATCH {repo}` | `{ agentMinutes }` |
| `POST /api/orgs/{org}/evals` | `{ name }` |
| `POST {repo}/batches` | `{ candidateCounts: { easy, medium, hard } (1–300 total), focus?, generation }` |
| `POST {repo}/tasks/from-pr` | `{ pr: number or URL, generation }` |
| `POST {repo}/tasks/from-scenario` | `{ title (≤120), scenario (≤20,000 chars), commit? (repositories only: SHA, branch, or HEAD), difficulty?: easy\|medium\|hard, attachments?: [{ name, content: base64 }] (≤20 files, 20 MB), generation }` |


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