---
title: "Create a webhook"
method: POST
path: "/api/v1/webhooks"
tags: ["Webhooks"]
---

# Create a webhook

`POST /api/v1/webhooks`

## Request

- Base URL: `https://merchant-api.accruesavings.com`
- URL: `https://merchant-api.accruesavings.com/api/v1/webhooks`
- Auth: none declared. Required headers: `Client-ID`, `Authorization`
- TypeScript: <https://skmtc.dev/byaccrue/apis/accrue-merchant-api/docs/api/v1/webhooks/post.ts> (a function with typed inputs; its response is checked against the schema)

## Headers

- `Client-ID` string, uuid, required: The unique identifier of the client making the request. This header is required to retrieve the client-specific configuration and ensure that the response is tailored to the client's settings and permissions.
- `Authorization` string, uuid, required: Secure secret to access privileged endpoints.

## Request body

- object
  - `data` CreateWebhook, required: Create webhook request
    - `type` 'Webhook', required
    - `attributes` object, required
      - `enabled` boolean, required
      - `name` string, required
      - `url` string: HTTPS endpoint that receives POST requests for subscribed events. If omitted or empty, events are still stored for this webhook (for example, via the webhook events API) but no HTTP delivery is attempted.
      - `topics` string[], required: Array of webhook topics to subscribe to. Use `'*'` to subscribe to all topics. Note: When using `'*'`, all new topics added in the future will automatically be sent to this webhook. You are responsible for handling any new or unknown topic types. The `'*'` wildcard cannot be combined with other topics.

## Response `201`

201 Created

- WebhookResponse
  - `data` Webhook, required
    - `id` string, uuid, required: Unique identifier for the object.
    - `type` 'Webhook', required
    - `attributes` object, required
      - `enabled` boolean, required
      - `name` string, required
      - `url` string, required: HTTPS endpoint for webhook POST delivery. Empty when no URL was configured; events are still recorded for this webhook but no HTTP request is sent.
      - `secret` string, required
      - `topics` string[], required: Array of webhook topics to subscribe to. Use `'*'` to subscribe to all topics. Note: When using `'*'`, all new topics added in the future will automatically be sent to this webhook. You are responsible for handling any new or unknown topic types. The `'*'` wildcard cannot be combined with other topics.
      - `updatedAt` string, date-time, required
      - `createdAt` string, date-time, required

## Other responses

- `400`: Bad Request

---

[API](https://skmtc.dev/byaccrue/apis/accrue-merchant-api.md) - [All operations](https://skmtc.dev/byaccrue/apis/accrue-merchant-api/llms.txt) - [OpenAPI document](https://skmtc.dev/byaccrue/apis/accrue-merchant-api/revisions/3e2d97ef2e6e?raw)
