> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chromiumly.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Webhooks

> Have Gotenberg upload results to your service instead of answering with them.

Pass `webhook` to have Gotenberg upload the result to your storage or service. Gotenberg answers `204 No Content` right away, so the method resolves to an empty buffer. Once the work is done, it uploads the result to `webhookUrl`, then posts an event to `webhookEventsUrl`.

```typescript theme={null}
type WebhookOptions = {
  webhookUrl: string; // receives the result
  webhookEventsUrl: string; // receives the success or error event
  webhookMethod?: "POST" | "PUT" | "PATCH"; // the method of the upload (default POST)
  webhookExtraHttpHeaders?: Record<string, string>; // sent with the upload and the event
};
```

Both URLs are required. Each must be an absolute `http` or `https` URL Gotenberg can reach.

```typescript theme={null}
import { UrlConverter } from "chromiumly";

await new UrlConverter().convert({
  url: "https://example.com/",
  webhook: {
    webhookUrl: "https://example.com/upload",
    webhookEventsUrl: "https://example.com/events",
    webhookExtraHttpHeaders: { Authorization: "Bearer abc123" },
  },
  trace: "my-request-42",
});
```

Every route takes `webhook` except the `PDF` [read methods](https://docs.chromiumly.dev/pdf/overview.md#read-pdfs) and the [System](https://docs.chromiumly.dev/reference/system.md) routes.

## The upload

The upload carries the result with its `Content-Type`, a `Content-Disposition` that names the file, the request's `Gotenberg-Trace`, and your extra headers.

## The events

A `webhook.success` event follows a delivered upload:

```json theme={null}
{
  "event": "webhook.success",
  "correlationId": "my-request-42",
  "timestamp": "2026-11-01T17:02:51.123456789Z"
}
```

A failed request, or an upload that fails for good, sends `webhook.error` instead, with the status and the message the request would have answered:

```json theme={null}
{
  "event": "webhook.error",
  "correlationId": "my-request-42",
  "timestamp": "2026-11-01T17:02:51.123456789Z",
  "error": { "status": 400, "message": "Invalid form data: …" }
}
```

`correlationId` is the request's `trace`: set it to your own identifier to match events to requests (see [Request tracing](https://docs.chromiumly.dev/advanced/request-tracing.md)).

Gotenberg retries an upload that can't connect, or that answers 429 or a 5xx. For retries, synchronous delivery and destination filters, see [Gotenberg – webhooks](https://gotenberg.dev/docs/webhook-download).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.