> ## 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.

# Request tracing

> Set a custom output filename and correlation id on any request with outputFilename and trace.

Every route accepts optional `outputFilename` and `trace` parameters, mapping to the `Gotenberg-Output-Filename` and `Gotenberg-Trace` request headers:

```typescript theme={null}
type OutputOptions = {
  outputFilename?: string; // Custom filename for the resulting file; Gotenberg appends the extension.
  trace?: string; // Custom request id to identify the request in the logs, overriding the generated UUID.
};
```

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

const buffer = await new UrlConverter().convert({
  url: "https://example.com/",
  outputFilename: "my-document",
  trace: "my-correlation-id",
});
```

These apply to Chromium converters and screenshot classes, `LibreOffice.convert()`, and every `PDFEngines` method.

## System routes

The [System](/reference/system) routes accept `trace` too (there's no resulting file, so no `outputFilename`):

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

const health = await System.getHealth("my-correlation-id");
```

## Webhooks

Every route also accepts `webhook` for switching a request to Gotenberg's asynchronous, callback-based mode:

```typescript theme={null}
type WebhookOptions = {
  webhookUrl?: string; // At least one of webhookUrl or webhookErrorUrl is required.
  /** @deprecated Use webhookEventsUrl instead, together with webhookUrl. */
  webhookErrorUrl?: string;
  webhookMethod?: "POST" | "PUT" | "PATCH";
  webhookErrorMethod?: "POST" | "PUT" | "PATCH";
  webhookExtraHttpHeaders?: Record<string, string>;
  webhookEventsUrl?: string;
};
```

At least one of `webhookUrl` or `webhookErrorUrl` is required when `webhook` is set. See [Gotenberg's webhook docs](https://gotenberg.dev/docs/webhook-download) for the async delivery model.
