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

# Create a webhook.

`POST /api/Webhooks`

## Request

- Base URL: `https://api.3dprintlog.com`
- URL: `https://api.3dprintlog.com/api/Webhooks`
- Auth: OAuth 2 (authorization code, authorization URL `https://3dprintlog.auth0.com/authorize`, token URL `https://3dprintlog.auth0.com/oauth/token`)

Returns the signing secret once; it cannot be shown again (rotate it for a new one). The URL
must be http or https on a public address: private, loopback, link-local and reserved
addresses are refused with `code: "blocked_webhook_address"`. Events default to all three.
The Free plan includes one webhook and Pro ten; one more returns 403 with
`code: "webhook_limit"` and the `limit`.

## Request body

- PrintLogApiModelsDTOsWebhookSaveWebhookSubscriptionDto: The body of `POST /api/Webhooks` and `PUT /api/Webhooks/{id}`.
  - `url` string, nullable: An absolute http or https URL on a public address.
  - `description` string, nullable: A label, at most 100 characters.
  - `events` string[], nullable: The events to send; omitted or empty means all of them.
  - `enabled` boolean, nullable: Omitted means on when creating and unchanged when updating.

## Response `201`

The new webhook, with its secret.

- PrintLogApiModelsDTOsWebhookWebhookSubscriptionCreatedDto: A new subscription, or one whose secret was just rotated: the only responses that carry the signing secret. It cannot be shown again; rotate it to get a new one.
  - `id` string, uuid
  - `url` string, nullable
  - `description` string, nullable
  - `events` string[], nullable: `print.started`, `print.finished` and/or `print.failed`.
  - `enabled` boolean
  - `consecutiveFailures` integer: Deliveries in a row that failed after their retries.
  - `lastDeliveryAt` string, date-time, nullable
  - `lastStatusCode` integer, nullable: The HTTP status of the last delivery, or null when no response came back.
  - `lastDeliveryResult` string, nullable: `success`, `http_error`, `timeout`, `connection_failed` or `blocked_address`; null before the first delivery.
  - `autoDisabledAt` string, date-time, nullable: When repeated failures turned it off; turning it back on clears this.
  - `createdDate` string, date-time
  - `updatedDate` string, date-time
  - `secret` string, nullable

## Other responses

- `400`: The URL or events are not valid.
- `401`: Unauthorized
- `403`: Your plan's webhooks are all in use.
- `503`: Webhooks are not configured on this server.

---

[API](https://skmtc.dev/3dprintlog/apis/3d-print-log-api.md) · [All operations](https://skmtc.dev/3dprintlog/apis/3d-print-log-api/llms.txt) · [OpenAPI document](https://skmtc.dev/3dprintlog/apis/3d-print-log-api/revisions/dfc3a4df4e38?raw)
