Documentation Index
Fetch the complete documentation index at: https://docs.uselamina.ai/llms.txt
Use this file to discover all available pages before exploring further.
Why Lamina Uses Async Jobs
Some Lamina apps complete in seconds. Others, especially multi-step image/video pipelines, may take much longer. Because of that,POST /v1/apps/{appId}/runs starts work and returns an execution handle immediately instead of blocking until the final output is ready.
If you are integrating Lamina into a backend, queue system, merchant tool, or content platform, design around the execution lifecycle from the start.
Two Delivery Patterns
Option 1: Webhook (Recommended)
Pass a webhook URL as a query parameter. When the execution completes, we POST the results to your URL.- No polling loop needed
- Results arrive as soon as they’re ready
- Signed with ED25519 for security
- Automatic retries (3 attempts with backoff)
Option 2: Polling
PollGET /v1/runs/{runId} on an interval until status reaches completed or failed.
Use different polling intervals depending on the workflow:
- Short image jobs: every 3-5 seconds
- Heavier multi-step jobs: every 5-10 seconds
- Long-running video jobs: every 10-15 seconds
Recommended Backend Flow
Start the execution
Call
POST /v1/apps/{appId}/runs?webhook=<your_url> and store the returned run ID.What To Persist
For every execution you start, store at least:runIdappId- input payload
- current status
- started timestamp
Failure Handling
If an execution fails:- inspect the top-level
errorMessage - inspect each output’s
error - keep the original inputs for debugging or replay
Webhook Verification
When receiving webhook callbacks, verify the signature to ensure it’s from Lamina:- Fetch the public key from
GET /v1/webhooks/signing-key - Verify the ED25519 signature:
verify(signature, "<timestamp>.<body>", publicKey) - Reject timestamps older than 5 minutes (replay protection)