APIAssembly

Generate a work order PDF

POST
/public/v1/assemblies/{id}/pdf

Generate the work order PDF for a single assembly — the same printable production sheet listing its outputs, inputs, and costs that Distru generates in the UI — and download it directly, get a signed link to it, or email it (see format). This is a read-only operation: it neither changes the assembly nor touches inventory or compliance.

The same permissions that govern downloading this PDF in the Distru web app apply to this endpoint; when format is email, the web app's permission for emailing it applies instead (documents the web app cannot email keep the download permission).

format selects how the generated PDF is delivered and has three modes: binary returns the raw PDF bytes as the response body (Content-Type: application/pdf); url returns a JSON envelope {"data": {"url": ..., "expires_datetime": ...}} with a temporary signed download URL; email sends the PDF to the addresses in email_addresses and returns a JSON envelope {"data": {"emailed_to": [...]}}. format is required, but for backward compatibility omitting it defaults to binary.

All PDF download endpoints share a single, combined rate limit for your account: 20 requests per minute and 1000 per day in total across every PDF endpoint (not per endpoint). Requests over the limit return 429 with a Retry-After header, and only successful downloads count toward it.

Authorization

Bearer
headerAuthorizationBearer <token>

API token generated in Distru (Settings → Distru API). Send it on every request as Authorization: Bearer YOUR_API_TOKEN.

Path Parameters

id*string

The ID of the assembly whose work order PDF you want.

Request Body

application/json
  1. body
format*string

How the generated PDF is delivered. One of binary — the raw PDF bytes as the response body (Content-Type: application/pdf); url — a JSON body with a short-lived signed download URL (see the PdfResponse response); or email — emails the PDF to the addresses in email_addresses and returns a JSON body listing who it was emailed to. Required, but omitting it defaults to binary for backward compatibility.

Value in"binary""url""email"
email_addresses?array<string>

Recipient email addresses, used only when format is email (required in that case, ignored otherwise). An entry may hold several comma-separated addresses; spaces, blank entries and repeats are dropped, and emailed_to lists the addresses actually emailed. At least one address is required and every address must be valid, otherwise the request is rejected with a 400. At most 200 addresses may be given, counted after that cleanup.

Response Body

When format is binary (or omitted), the raw PDF file (Content-Type: application/pdf). When format is url, a JSON body with a temporary signed download URL; when format is email, a JSON body listing the addresses the PDF was emailed to (see the PdfResponse schema).

application/pdf,application/json
  1. response

The JSON envelope a PDF endpoint returns for the non-binary formats: format=url returns url + expires_datetime, format=email returns emailed_to.

data?

The response payload; which fields are present depends on the requested format.

Example Request
curl -X POST 'https://app.distru.com/public/v1/assemblies/b2a222a1-fe8b-495a-b1b9-c69b0eebdb63/pdf' \  -H 'Content-Type: application/json' \  -d '{  "format": "url"}'
Example Response
{  "data": {    "expires_datetime": "2026-10-08T10:10:17.789090Z",    "url": "https://example.com/your-file"  }}