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

# Create a webhook endpoint

`POST /api/v1/customer/webhooks`

## Request

- Base URL: `https://virtualsms.io`
- URL: `https://virtualsms.io/api/v1/customer/webhooks`
- Auth: one of:
  - API key in header `X-API-Key`
  - API key in query parameter `api_key`

The response contains `secret` — the HMAC signing key — and it is the
only time it is ever returned. Store it now.

## Request body

- WebhookCreate
  - `url` string, uri, required: Destination URL. Must be `https://` — plain http, localhost and IP literals are rejected with 400.
  - `description` string, nullable: Free-text label shown in your dashboard.
  - `events` string[], required: Non-empty subset of the supported event types. Duplicates are collapsed.
  - `threshold` number, float, nullable: Balance in USD below which `balance.low` fires. **Required** when `events` contains `balance.low`; must be > 0 and <= 99999.99. Ignored (stored as null) otherwise.

## Response `201`

Created — this response carries the secret

- object
  - `success` boolean
  - `webhook` Webhook
    - `id` string
    - `url` string, uri
    - `description` string, nullable
    - `events` string[]
    - `active` boolean: Set by you. An inactive endpoint receives nothing.
    - `paused` boolean: Set automatically after repeated delivery failures. Un-pause by PATCHing `paused: false`, which also clears the failure counter.
    - `threshold` number, float, nullable
    - `failure_count_consecutive` integer
    - `last_delivered_at` string, date-time, nullable
    - `last_error_at` string, date-time, nullable
    - `last_error_code` string, nullable: HTTP status or transport error recorded on the last failed delivery.
    - `created_at` string, date-time
    - `updated_at` string, date-time
    - `secret` string: HMAC signing secret. Returned **exactly once**, in the 201 response to `POST /api/v1/customer/webhooks`. It is never returned again by any other endpoint — store it when you create the webhook.

## Other responses

- `400`: URL is not https, an event type is unknown, `events` is empty, or `balance.low` was requested without a valid `threshold`.

---

[API](https://skmtc.dev/virtualsms/apis/virtualsms-account-verification-platform-for-developers-and.md) · [All operations](https://skmtc.dev/virtualsms/apis/virtualsms-account-verification-platform-for-developers-and/llms.txt) · [OpenAPI document](https://skmtc.dev/virtualsms/apis/virtualsms-account-verification-platform-for-developers-and/revisions/be89af981be1?raw)
