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

# API Reference

> Interact with the Hacken Extractor REST API to manage projects, contracts, detectors, triggers, and alerts programmatically from your own services.

## Base URL

```
https://extractor.hacken.dev
```

## Authentication

All requests require a Bearer token in the `Authorization` header.

```bash theme={null}
Authorization: Bearer <your-api-key>
```

<Info>
  Generate your API key from the Hacken Extractor dashboard under **Settings → API Keys**.
</Info>

## Response format

All endpoints return JSON. Successful responses use HTTP `200`; errors return a non-2xx status with a descriptive body.

<Tabs>
  <Tab title="Success">
    ```json theme={null}
    {
      "id": 1,
      "name": "My Project",
      "networkStatus": "MAINNET"
    }
    ```
  </Tab>

  <Tab title="Error">
    ```json theme={null}
    {
      "statusCode": 400,
      "message": "Validation failed",
      "errors": ["name must not be empty"]
    }
    ```
  </Tab>
</Tabs>

## Pagination

Search and aggregation endpoints accept `from` and `size` for cursor-style pagination.

| Parameter | Type    | Default | Description                 |
| --------- | ------- | ------- | --------------------------- |
| `from`    | integer | `0`     | Starting document offset    |
| `size`    | integer | `10`    | Number of results to return |

## Endpoints

<CardGroup cols={2}>
  <Card title="Create Project" icon="folder-plus" href="/api-reference/project-route/create-entity">
    `POST /api/v1/project`
  </Card>

  <Card title="Get Project" icon="folder-open" href="/api-reference/project-route/get-entity-by-id">
    `GET /api/v1/project/{id}`
  </Card>

  <Card title="Create Contract" icon="file-code" href="/api-reference/contract-route/create-entity">
    `POST /api/v1/contract`
  </Card>

  <Card title="Get Contract" icon="file-magnifying-glass" href="/api-reference/contract-route/get-entity-by-id">
    `GET /api/v1/contract/{id}`
  </Card>

  <Card title="Search Alerts" icon="magnifying-glass" href="/api-reference/detector-route/search-alerts">
    `POST /api/v1/detector/alert/search`
  </Card>

  <Card title="Aggregate Alerts" icon="chart-bar" href="/api-reference/detector-route/aggregate-alerts">
    `POST /api/v1/detector/alert/aggregation`
  </Card>
</CardGroup>
