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

# Create a webhook

`POST /webhooks`

You can configure a webhook via the API to be notified about events that happen in your Terminal49 account. These events can be realted to tracking_requests, shipments and containers. 

This is the recommended way tracking shipments and containers via the API. You should use this instead of polling our the API periodically.

## Request body

- object
  - `data` object, required
    - `attributes` object, required
      - `url` string, uri, required — The URL of the webhook endpoint.
      - `events` string[] — The list of events to enable for this endpoint.
      - `active` boolean, required
      - `headers` object[] — Optional custom headers to pass with each webhook invocation
        - `name` string — The name of the header. (Please note this will be auto-capitalized)
        - `value` string — The value to pass for the header
    - `type` 'webhook', required

## Response `201`

Create a test webhook endpoint

- object
  - `data` Webhook
    - `id` string, uuid, required
    - `type` 'webhook', required
    - `attributes` object
      - `url` string, uri, required — https end point
      - `active` boolean, required — Whether the webhook will be delivered when events are triggered
      - `events` string[], required — The list of events to enabled for this endpoint
      - `secret` string, required — A random token that will sign all delivered webhooks
      - `headers` object[], nullable
        - `name` string
        - `value` string

---

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