longrun.
Generate an image from a template

Docs

Templates / Generate an image from a template

Generate an image from a template

Submit an image template render with data for the template’s variables, then retrieve the run for the result.

POSThttps://uselongrun.app/v1/templates/image/{id}/render
Request
curl --request POST "https://uselongrun.app/v1/templates/image/{id}/render" \
  --header "Authorization: Bearer ${API_KEY}"

Request parameters

path
idstringRequired

The template ID to use. Copy it from the template’s API tab. Replace {id} in the URL with that value.

Example
"${TEMPLATE_ID}"
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

dataobjectRequired

Values to insert into the template. Keys must match the variables defined in its Data tab.

Example
{
  "customer_name": "Ada"
}
outputobjectOptional

Where to deliver generated files. Omit this to use the endpoint’s default destination.

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.

optionsobjectOptional

Settings for this request. Use the child fields shown below.

Example
{}

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 →