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

# Detail REST API: programmatic access to bug findings

> Explore the Detail REST API to automate triage, sync bug findings to internal tools, and build dashboards with scan and repository data.

The Detail REST API gives you programmatic access to bug findings, scan history, repository info, and custom rules. Use it to automate triage workflows, sync findings to internal tools, or build custom dashboards on top of Detail's analysis engine.

## Base URL

All API requests go to:

```
https://api.detail.dev
```

Every endpoint is prefixed with `/public/v1/`. A full request URL looks like:

```
https://api.detail.dev/public/v1/bugs
```

## Authentication

The API uses Bearer token authentication. Pass your API key in the `Authorization` header on every request. See [Authentication](/api/authentication) for details on obtaining and using keys.

```
Authorization: Bearer dtl_live_YOUR_KEY
```

## Request and response format

All request bodies and responses use JSON. Set `Content-Type: application/json` when sending a request body.

## Pagination

Endpoints that return lists accept `limit` and `offset` query parameters and include a `total` field in the response.

| Parameter | Type    | Default | Maximum | Description                 |
| --------- | ------- | ------- | ------- | --------------------------- |
| `limit`   | integer | `50`    | `100`   | Number of results to return |
| `offset`  | integer | `0`     | —       | Number of results to skip   |

The response `total` field tells you how many records exist in total, so you can calculate subsequent offsets.

```bash theme={null}
# Fetch the second page of 25 results
curl "https://api.detail.dev/public/v1/bugs?repo_id=repo_abc123&status=pending&limit=25&offset=25" \
  -H "Authorization: Bearer dtl_live_YOUR_KEY"
```

## Available endpoints

| Method | Path                                 | Description                          |
| ------ | ------------------------------------ | ------------------------------------ |
| `GET`  | `/public/v1/user`                    | Authenticated user info              |
| `GET`  | `/public/v1/bugs`                    | List bugs for a repository           |
| `GET`  | `/public/v1/bugs/{bug_id}`           | Get a single bug                     |
| `POST` | `/public/v1/bugs/{bug_id}/review`    | Resolve or dismiss a bug             |
| `GET`  | `/public/v1/scans`                   | List scans for a repository          |
| `GET`  | `/public/v1/repos`                   | List connected repositories          |
| `POST` | `/public/v1/rules`                   | Start an async rule creation job     |
| `GET`  | `/public/v1/rules`                   | List completed rules                 |
| `GET`  | `/public/v1/rules/{rule_id}`         | Get a single rule with file contents |
| `GET`  | `/public/v1/rules/requests`          | List rule creation requests          |
| `GET`  | `/public/v1/rules/requests/{rcr_id}` | Get a rule creation request status   |

## Error codes

All errors return an `ApiError` JSON object with `type`, `message`, and `statusCode` fields.

```json theme={null}
{
  "type": "NOT_FOUND",
  "message": "Bug not found",
  "statusCode": 404
}
```

| Status | Type                                            | Meaning                                           |
| ------ | ----------------------------------------------- | ------------------------------------------------- |
| `400`  | `INVALID_REQUEST_BODY` / `INVALID_QUERY_PARAMS` | Malformed request body or query parameters        |
| `401`  | `DETAIL_AUTHENTICATION_ERROR`                   | Missing or invalid API key                        |
| `403`  | `AUTHORIZATION_ERROR`                           | Valid key but insufficient permissions            |
| `404`  | `NOT_FOUND`                                     | The requested resource does not exist             |
| `400`  | `UNKNOWN_WORKFLOW_REQUEST`                      | The referenced workflow request ID does not exist |
| `500`  | `INTERNAL_ERROR`                                | Unexpected server error                           |
