> For the complete documentation index, see [llms.txt](https://hako.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hako.gitbook.io/docs/integration/getting-starting.md).

# Getting Started

This page is the fastest path to Hako integration. It explains how to get access, where to start in the API, and what the first deposit and withdrawal flow looks like.

## Base URL

```
https://api.hakolabs.app/v1
```

* Swagger / API docs: `https://api.hakolabs.app/v1/docs`
* OpenAPI spec: `https://api.hakolabs.app/v1/openapi.yml`

## Before You Start

* Partner requests are authenticated with `X-API-Key`.
* Action creation is idempotent per partner through `externalId`, so each deposit or withdrawal request should use its own partner-side idempotency key.

## Get API Key

To request API key and start integration, contact Hako here:

* Email: <contact@hakolabs.app>
* Telegram: [@rolaman](https://t.me/rolaman)

## Authentication

Hako uses API key authentication. Expected request header:

```http
X-API-Key: <YOUR_PARTNER_API_KEY>
```

## Integration Path

For a successful integration, use this sequence:

1. Check service availability with `GET /v1/health`.
2. Read available strategies with `GET /v1/strategy` and `GET /v1/strategy/:strategyId`.
3. Request a quote with `POST /v1/quotes/deposit` or `POST /v1/quotes/withdraw`.
4. Create an action with `POST /v1/action/deposit` or `POST /v1/action/withdraw`.
5. For deposits, let the user send the onchain transaction and then call `POST /v1/action/:actionId/report`.
6. For withdrawals, let the user sign the returned typed data and then call `POST /v1/action/:actionId/authorize`.
7. Poll `GET /v1/action/:actionId` until the action reaches a terminal state.

## First Authenticated Request

Example deposit quote request:

```bash
curl -X POST "https://api.hakolabs.app/v1/quotes/deposit" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: <YOUR_PARTNER_API_KEY>" \
  -d '{
    "strategyId": "stable_vault",
    "fromAccount": "0x123...",
    "assetId": "USDC",
    "network": "base",
    "amount": "12.5"
  }'
```

## Flow References

* Deposit Flow - [deposit-flow.md](/docs/integration/deposit-flow.md)
* Withdrawal Flow - [withdrawal-flow.md](/docs/integration/withdrawal-flow.md)

## Integration Example

A reference integration example will live here:

* [Integration Example](https://github.com/hakolabs/hako-integration-example)
