---
title: "Subscribe to webhook"
method: POST
path: "/webhooks"
tags: ["Webhooks"]
---

# Subscribe to webhook

`POST /webhooks`

> ℹ️
>
> Akahu's webhooks are unusual in that they need to be initialised **per user**, requiring a new webhook subscription for each event type you wish to receive for each user.

Register a new webhook subscription for the user, allowing your application to receive events on the following webhook types:

  - `TOKEN`
  - `ACCOUNT`
  - `TRANSACTION`
  - `PAYMENT`
  - `TRANSFER`

> ℹ️
>
> It is a good idea to use the `state` field to store a unique identifier related to your end user, allowing you to determine on an arrival of a webhook event which user of your application needs to be updated or notified.


For more details about webhooks see:
  - [📖 Webhooks reference](/docs/reference-webhooks)
  - [📖 Webhooks events](/reference-webhooks#token)

## Headers

- `X-Akahu-Id` string, required
- `Content-Type` string

## Request body

- object
  - `webhook_type` string — Which types of events you want to receive webhooks for.
  - `state` string — State that will be returned with the webhook payload.

## Response `200`

Successful response.

- object
  - `success` boolean
  - `item_id` string — Newly created Akahu webhook identifer.

## Other responses

- `400` — Your request was malformed or otherwise unacceptable. The `message` key in the response will give more details.
- `401` — You are not authorised to access this content.
- `403` — You are not allowed to access this content.
- `500` — An internal error has prevented us from processing the request. More detail may be supplied in the `message` key.

---

[API](https://skmtc.dev/akahu/apis/akahu-enduring-api.md) · [All operations](https://skmtc.dev/akahu/apis/akahu-enduring-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/akahu/akahu-enduring-api/revisions/b2de9915920d/schema)
