# 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)


---

# Agent Instructions: 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:

```
GET https://hako.gitbook.io/docs/integration/getting-starting.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
