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

# Create webhook

`POST /webhooks`

## Request

- Base URL: `https://queries.test.envia.com`
- URL: `https://queries.test.envia.com/webhooks`
- Auth: HTTP bearer

Creates a new webhook subscription that will send HTTP POST notifications to your specified URL whenever the selected event type occurs (e.g., shipment created, tracking status updated).

**When to use:** Call this endpoint when setting up event-driven integrations, such as notifying your system when a shipment status changes, triggering order fulfillment workflows, or keeping external dashboards in sync with Envia events.

**Prerequisites:**
- Valid JWT token in the Authorization header
- A `type_id` identifying the webhook event type (retrieve available types from `GET /webhook-types`)
- A publicly accessible `url` that can receive HTTP POST requests from Envia servers
- An `active` flag (`1` to enable immediately, `0` to create in disabled state)

**Key behaviors:**
- The `url` must be a valid, publicly reachable HTTPS endpoint; Envia will send JSON payloads via POST to this URL
- Set `active` to `0` to create the webhook in a disabled state for testing before enabling it
- Returns the created webhook object with its assigned `id`, which can be used to update or deactivate it later via `PUT /webhooks/{webhook_id}`
- Multiple webhooks can be registered for the same event type with different URLs

## Request body

- object
  - `type_id` integer, required: Webhook type ID
  - `url` string, uri, required: Webhook URL
  - `active` 0 | 1, required: Active status (0 = inactive, 1 = active)

## Response `200`

Webhook created successfully

- object
  - `meta` string
  - `data` object
    - `id` integer: Created webhook ID
    - `type` string: Webhook type
    - `url` string: Webhook URL
    - `active` integer: Active status

---

[API](https://skmtc.dev/envia/apis/envia-queries-api.md) - [All operations](https://skmtc.dev/envia/apis/envia-queries-api/llms.txt) - [OpenAPI document](https://skmtc.dev/envia/apis/envia-queries-api/revisions/56f601a52f3f?raw)
