> For the complete documentation index, see [llms.txt](https://docs.alpha-security.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.alpha-security.app/reference/api-endpoints.md).

# API Endpoints

Alpha's server exposes a REST API used by the web UI, the collector, and any third-party integrations. All endpoints require authentication (JWT bearer token) unless noted otherwise.

## Authentication

| Method | Path              | Description                  |
| ------ | ----------------- | ---------------------------- |
| POST   | `/auth/login`     | Log in (returns JWT)         |
| POST   | `/auth/login/mfa` | Complete MFA step            |
| POST   | `/auth/refresh`   | Refresh an auth token        |
| POST   | `/auth/logout`    | Invalidate the current token |
| PUT    | `/auth/password`  | Change your password         |

## Operators (admin only)

| Method | Path             | Description        |
| ------ | ---------------- | ------------------ |
| GET    | `/operators`     | List all operators |
| POST   | `/operators`     | Create an operator |
| PATCH  | `/operators/:id` | Update an operator |
| DELETE | `/operators/:id` | Delete an operator |

## Engagements

| Method | Path                      | Description                               |
| ------ | ------------------------- | ----------------------------------------- |
| GET    | `/engagements`            | List engagements (filtered by membership) |
| POST   | `/engagements`            | Create an engagement                      |
| GET    | `/engagements/:id`        | Get engagement details                    |
| PATCH  | `/engagements/:id`        | Update an engagement                      |
| DELETE | `/engagements/:id`        | Soft-delete an engagement                 |
| GET    | `/engagements/:id/events` | SSE stream for live updates               |

## Runs

| Method | Path                                   | Description                        |
| ------ | -------------------------------------- | ---------------------------------- |
| GET    | `/engagements/:id/runs`                | List runs                          |
| POST   | `/engagements/:id/runs`                | Submit a new run (collector)       |
| GET    | `/engagements/:id/runs/:runId`         | Get run details and output         |
| POST   | `/engagements/:id/runs/:runId/reparse` | Re-run the parser on this run      |
| GET    | `/engagements/:id/runs/search?q=`      | Full-text search across raw output |

## Entities (Nodes & Edges)

| Method | Path                             | Description                        |
| ------ | -------------------------------- | ---------------------------------- |
| GET    | `/engagements/:id/nodes`         | List nodes (filterable by kind)    |
| GET    | `/engagements/:id/nodes/:nodeId` | Get node details                   |
| GET    | `/engagements/:id/edges`         | List edges                         |
| GET    | `/engagements/:id/graph`         | Get the full graph (nodes + edges) |

## Findings

| Method | Path                             | Description      |
| ------ | -------------------------------- | ---------------- |
| GET    | `/engagements/:id/findings`      | List findings    |
| POST   | `/engagements/:id/findings`      | Create a finding |
| PATCH  | `/engagements/:id/findings/:fId` | Update a finding |
| DELETE | `/engagements/:id/findings/:fId` | Delete a finding |

## Loot & Credentials

| Method | Path                                | Description                             |
| ------ | ----------------------------------- | --------------------------------------- |
| GET    | `/engagements/:id/loot`             | List credentials (masked)               |
| GET    | `/engagements/:id/loot?reveal=true` | List credentials with secrets (audited) |

## Reports

| Method | Path                                     | Description            |
| ------ | ---------------------------------------- | ---------------------- |
| POST   | `/engagements/:id/reports/generate`      | Generate a report      |
| GET    | `/engagements/:id/reports`               | List generated reports |
| GET    | `/engagements/:id/reports/:rId/download` | Download a report      |

## Collector Tokens

| Method | Path                           | Description           |
| ------ | ------------------------------ | --------------------- |
| GET    | `/engagements/:id/tokens`      | List collector tokens |
| POST   | `/engagements/:id/tokens`      | Create a token        |
| DELETE | `/engagements/:id/tokens/:tId` | Revoke a token        |

## Audit Log

| Method | Path                         | Description            |
| ------ | ---------------------------- | ---------------------- |
| GET    | `/engagements/:id/audit-log` | View audit log entries |

## MFA

| Method | Path                | Description            |
| ------ | ------------------- | ---------------------- |
| POST   | `/auth/mfa/enroll`  | Start MFA enrollment   |
| POST   | `/auth/mfa/confirm` | Confirm MFA enrollment |
| DELETE | `/auth/mfa`         | Disable MFA            |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.alpha-security.app/reference/api-endpoints.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
