longrun.
URL to PDF

Docs

PDF actions / URL to PDF

URL to PDF

Use URL to PDF to process your inputs. Submit the request, then retrieve the run to get its result.

POSThttps://uselongrun.app/v1/pdf/url-to-pdf
Request
curl --request POST "https://uselongrun.app/v1/pdf/url-to-pdf" \
  --header "Authorization: Bearer ${API_KEY}" \
  --header "Content-Type: application/json" \
  --data '{
  "inputs": {
    "url": "https://example.com"
  }
}'
Accepted · 202
{
  "id": "run_example",
  "status": "queued",
  "outputs": null,
  "error": null,
  "retry_of_run_id": null,
  "created_at": "2026-10-22T10:00:00.000Z",
  "updated_at": "2026-10-22T10:00:00.000Z"
}

The request is accepted, but processing has not finished. Retrieve the run using its ID to get the result.

Completed run · 200
{
  "id": "run_example",
  "status": "completed",
  "outputs": {
    "file": {
      "saved": false,
      "retained": false,
      "id": "file_result",
      "name": "2026-10-22_10-00-03-000.pdf",
      "mime_type": "application/pdf",
      "size": 76800,
      "category": "PDF",
      "storage": "longrun",
      "url": "https://uselongrun.app/v1/files/file_result/content",
      "access": "authenticated",
      "source": "action",
      "created_at": "2026-10-22T10:00:03.000Z",
      "expires_at": "2026-10-23T10:00:03.000Z",
      "expired": false,
      "source_run_id": "run_example",
      "source_name": "Generated file"
    },
    "data": {
      "warnings": []
    }
  },
  "error": null,
  "retry_of_run_id": null,
  "created_at": "2026-10-22T10:00:00.000Z",
  "updated_at": "2026-10-22T10:00:03.000Z"
}

Example result from Get a run after processing completes. File examples use temporary storage; metadata and values will vary with your inputs.

Get the run result

Request parameters

header
Idempotency-KeystringOptional

Scoped to workspace and operation; same key and payload reuses the run during its seven-day retention period. Changed payload returns 409.

Example
"receipt-1042-v1"

Maximum length: 200 characters.

Request body

Send a JSON body with the following inputs. Put processing settings inside options.

Inputs

inputs.urltextRequired

The full HTTPS address of the page to process.

Example
"https://example.com/receipt"

Options

options.formattextOptional

Paper size of the generated PDF.

Example
"A4"

Allowed values: A4 Letter Legal A3 A5

options.landscapebooleanOptional

Set true to make the PDF page wider than it is tall.

Example
true
options.print_backgroundbooleanOptional

Include CSS background colors and images in the PDF.

Example
true
options.scalenumberOptional

Rendering scale multiplier; 1 uses the original scale.

Example
1
options.margin_mmnumberOptional

Space around all four sides of the printed page, in millimetres.

Example
10
options.margin_top_mmnumberOptional

Top margin in millimeters. Overrides the shared margin.

Example
10

Minimum: 0

Maximum: 100

options.margin_right_mmnumberOptional

Right margin in millimeters. Overrides the shared margin.

Example
10

Minimum: 0

Maximum: 100

options.margin_bottom_mmnumberOptional

Bottom margin in millimeters. Overrides the shared margin.

Example
10

Minimum: 0

Maximum: 100

options.margin_left_mmnumberOptional

Left margin in millimeters. Overrides the shared margin.

Example
10

Minimum: 0

Maximum: 100

options.media_typetextOptional

Screen matches browser styling. Print uses the website’s print stylesheet. Defaults to screen.

Example
"print"

Allowed values: screen print

options.single_pagebooleanOptional

Create one long page. Cannot be combined with page ranges or website page size.

Example
true
options.prefer_css_page_sizebooleanOptional

Use the website’s CSS @page dimensions instead of the selected paper size.

Example
true
options.page_rangestextOptional

Pages to include, for example 1-3, 5. Leave unset to include every page.

Example
"1-3,5"
options.wait_for_selectortextOptional

Wait for a matching element to appear, for example #report-ready. Appearance does not guarantee its content is finished.

Example
"#receipt"
options.wait_delay_secondsnumberOptional

Extra delay after readiness checks, in seconds. Defaults to 2. All waits share the conversion time limit.

Example
2

Minimum: 0

Maximum: 20

options.wait_for_expressiontextOptional

Advanced: a JavaScript expression that becomes true when the page is ready, for example window.reportReady === true. Runs inside the page; never include secrets.

Example
"window.receiptReady === true"
options.authobjectOptional

Authentication for the source website. Reference saved secrets instead of putting passwords in the request.

Example
{
  "mode": "none"
}
Show child fields
options.auth.modetextRequired

The authentication method required by the source website.

Example
"none"

Allowed values: none basic bearer custom_headers cookies

options.auth.origintextOptional

The source website origin to which these credentials belong.

Example
"https://example.com"
options.auth.usernameobjectOptional

Reference the saved secret containing the source website username.

Example
{
  "secret_id": "${SECRET_ID}",
  "secret_version_id": "${SECRET_VERSION_ID}"
}
Show child fields
options.auth.username.secret_idtextRequired

ID of a secret saved in Settings → Secrets. Replace the example with your own ID.

Example
"${SECRET_ID}"
options.auth.username.secret_version_idtextRequired

ID of a specific saved secret version. Use the version you want this request to read.

Example
"${SECRET_VERSION_ID}"
options.auth.passwordobjectOptional

Reference the saved secret containing the source website password.

Example
{
  "secret_id": "${SECRET_ID}",
  "secret_version_id": "${SECRET_VERSION_ID}"
}
Show child fields
options.auth.password.secret_idtextRequired

ID of a secret saved in Settings → Secrets. Replace the example with your own ID.

Example
"${SECRET_ID}"
options.auth.password.secret_version_idtextRequired

ID of a specific saved secret version. Use the version you want this request to read.

Example
"${SECRET_VERSION_ID}"
options.auth.tokenobjectOptional

Reference the saved secret containing the source website bearer token.

Example
{
  "secret_id": "${SECRET_ID}",
  "secret_version_id": "${SECRET_VERSION_ID}"
}
Show child fields
options.auth.token.secret_idtextRequired

ID of a secret saved in Settings → Secrets. Replace the example with your own ID.

Example
"${SECRET_ID}"
options.auth.token.secret_version_idtextRequired

ID of a specific saved secret version. Use the version you want this request to read.

Example
"${SECRET_VERSION_ID}"
options.auth.headersarray of objectOptional

Authentication headers to send to the source website. Each entry pairs a header name with a saved-secret reference.

Example
[
  {
    "name": "X-API-Key",
    "value": {
      "secret_id": "${SECRET_ID}",
      "secret_version_id": "${SECRET_VERSION_ID}"
    }
  }
]
Show child fields
options.auth.headers[].nametextRequired

HTTP header name required by the source website.

Example
"X-API-Key"
options.auth.headers[].valueobjectRequired

Saved-secret reference containing this header or cookie value. Supply both secret IDs.

Example
{
  "secret_id": "${SECRET_ID}",
  "secret_version_id": "${SECRET_VERSION_ID}"
}
Show child fields
options.auth.headers[].value.secret_idtextRequired

ID of a secret saved in Settings → Secrets. Replace the example with your own ID.

Example
"${SECRET_ID}"
options.auth.headers[].value.secret_version_idtextRequired

ID of a specific saved secret version. Use the version you want this request to read.

Example
"${SECRET_VERSION_ID}"
options.auth.cookiesarray of objectOptional

Cookies required by the source website. Supply their names and saved-secret value references.

Example
[
  {
    "name": "session",
    "value": {
      "secret_id": "${SECRET_ID}",
      "secret_version_id": "${SECRET_VERSION_ID}"
    }
  }
]
Show child fields
options.auth.cookies[].nametextRequired

Name of the source website cookie.

Example
"session"
options.auth.cookies[].valueobjectRequired

Saved-secret reference containing this header or cookie value. Supply both secret IDs.

Example
{
  "secret_id": "${SECRET_ID}",
  "secret_version_id": "${SECRET_VERSION_ID}"
}
Show child fields
options.auth.cookies[].value.secret_idtextRequired

ID of a secret saved in Settings → Secrets. Replace the example with your own ID.

Example
"${SECRET_ID}"
options.auth.cookies[].value.secret_version_idtextRequired

ID of a specific saved secret version. Use the version you want this request to read.

Example
"${SECRET_VERSION_ID}"

Delivery

outputobjectOptional

Choose where the result is delivered. Omit this to use temporary LongRun storage.

Example
{
  "storage": "temporary"
}

Storage guide · Bubble delivery setup

Show child fields
output.storagestringOptional

temporary stores results in LongRun. bubble delivers them to a connected Bubble app. These are the only supported values. A published workflow uses its configured destination unless you override it.

Example
"temporary"

Default: "temporary"

Allowed values: temporary bubble

output.connection_idstringConditionally required

Required when storage is bubble. Copy the connection ID from Settings → Integrations → Bubble. Not used for temporary storage.

Example
"${STORAGE_CONNECTION_ID}"
output.privatebooleanOptional

Only for Bubble delivery. true creates a private file and requires attach_to. false requests a public upload; access still depends on the receiving app configuration.

Example
false

Default: false

output.attach_tostringConditionally required

Required when storage is bubble and private is true. The Bubble Thing ID that owns the file. See the Bubble integration guide for setup.

Example
"${BUBBLE_THING_ID}"
output.file_namestringOptional

Optional output filename, such as receipt.pdf. Omit it to use the generated timestamp-based name. Applies to either destination.

Example
"receipt.pdf"

Maximum length: 255 characters.

webhook_idsarray of stringOptional

IDs of configured webhook endpoints to notify for this run. Omit this to send no webhooks for a direct action.

Example
[
  "${WEBHOOK_ID}"
]

Returns

Returns 202 Accepted with a run ID. Processing continues after the response. Retrieve the run until its status is completed, failed, or cancelled.

Retrieve a run →

Outputs when completed

These fields appear inside outputs on the completed run.

outputs.filePDF file

Generated file metadata. Use its id to retrieve or download the file; check access and expiry metadata before using its URL.

outputs.dataobject

Structured results from this action. Expand the child fields to see the returned values.

Show child fields
outputs.data.warningsarray of text

Limits

Generated files
200 MiB maximum
Processing deadline
90 seconds; processing may stop earlier if a renderer or resource limit is reached
options.auth.headers items
20 maximum
options.auth.cookies items
20 maximum