---
title: "Create a Webhook"
method: POST
path: "/public/v3/Webhooks"
tags: ["Webhooks"]
---

# Create a Webhook

`POST /public/v3/Webhooks`

Create a webhook for the specified accounts.

## Headers

- `x-tive-account-id` integer, required

## Request body

- WebhookRequest
  - `name` string, required — The unique name of the webhook.
  - `url` string, required — The URL of where webhook data is being sent.
  - `description` string, nullable — A description of what the webhook is being used for.
  - `version` string, nullable — The webhook version. Each version has different data template.
  - `template` string, nullable — The template of data being sent in the webhook. If null, the <a href="https://developers.tive.com/docs/data-structures">default template</a> will be used.
  - `headers` WebhookHeaderRequest[], nullable — Optionally provides the ability to pass along custom data such as a client secret.
    - `key` string, nullable — The name of your custom header.
    - `value` string, nullable — The value of your custom header.
  - `accountIds` integer[], nullable — A list of account IDs associated with the webhook.
  - `httpMethod` string, nullable — The HTTP method used in the webhook request. Values include `POST`, `PUT`, or `PATCH`. Defaults to `POST`.
  - `contentType` string, nullable — The type of content being transmitted in the request. Defaults to `application/json`.
  - `enabled` boolean, required — Determines if the webhook is enabled or not.
  - `applyToAllTrackers` boolean — The webhook will be triggered for every device measurement within the applicable account(s). <em>At least one</em> of the `applyToAll` fields must be set to true.
  - `applyToAllShipments` boolean — Apply the webhook to trigger on all shipment events within the applicable account(s). <em>At least one</em> of the `applyToAll` fields must be set to true.
  - `applyToAllAlertPresets` boolean — Apply the webhook to trigger on all alert preset alerts within the applicable account(s). <em>At least one</em> of the `applyToAll` fields must be set to true.
  - `authentication` WebhookAuthRequest
    - `authType` 1 | 2 | 3
    - `clientId` string, nullable — The Client ID for OAuth2 or OAuth2ResourceOwnerPassword authentication, or the Username for BasicAuth.
    - `clientSecret` string, nullable — The Client Secret for OAuth2 or OAuth2ResourceOwnerPassword authentication, or the Password for BasicAuth.
    - `oAuthTokenEndpointUrl` string, nullable — The OAuth token endpoint URL. Required for OAuth2 and OAuth2ResourceOwnerPassword.
    - `oAuthScope` string, nullable — The OAuth scope. Optional for OAuth2 and OAuth2ResourceOwnerPassword.
    - `oAuthAudience` string, nullable — The OAuth audience. Optional for OAuth2 and OAuth2ResourceOwnerPassword.
    - `resourceOwnerUsername` string, nullable — The resource owner username for OAuth2 Resource Owner Password Credentials grant (RFC 6749 §4.3).
    - `resourceOwnerPassword` string, nullable — The resource owner password for OAuth2 Resource Owner Password Credentials grant (RFC 6749 §4.3).
    - `customBodyParams` string, nullable — Optional JSON object of additional non-sensitive key/value pairs to include in the auth token request body. Example: {"type":"business"}.
    - `customAuthHeaders` string, nullable — Optional JSON object of key/value pairs to include as HTTP headers on the auth token request. Example: {"X-Tenant-Id":"acme"}.
    - `oAuthGrantType` string, nullable — Optional custom grant_type value for OAuth2 token requests. Defaults to 'client_credentials'.
    - `clientCredentialsInHeader` boolean — When true, client_id and client_secret are sent as Authorization: Basic header on the token request instead of in the body.

## Response `201`

The created webhook id

- integer

## Other responses

- `400` — Unable to create the webhook. See response message for details.
- `401` — Unauthorized

---

[API](https://skmtc.net/tive/apis/tive-public-api.md) · [All operations](https://skmtc.net/tive/apis/tive-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tive/tive-public-api/revisions/9a8d869e3cdc/schema)
