Exports
An export turns a snapshot into a downloadable artifact — a PDF tearsheet, a slide deck, an audio briefing, an infographic, and so on. Exports are always async: you POST /v1/exports to queue a job, then poll GET /v1/exports/{id} until it completes, then download from the URL the API hands you.
Different artifact types are produced by different providers (some are generated in-process, some involve external AI providers). The API exposes the choice as a (provider, artifact_type) pair on the request body.
[!TIP] The same artifact catalogue is rendered as a gallery in the product’s Studio tab. If you’re not sure which
(provider, artifact_type)pair you want, generate one from the dashboard first and inspect the resulting job — the dashboard surfaces the exact pair it sent.
Lifecycle
Creating an export
curl https://api.regsn.app/v1/exports \
-H "Authorization: Bearer $REGSN_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d "{
\"snapshot_id\": \"$SNAPSHOT_ID\",
\"artifact_type\": \"pdf\",
\"provider\": \"internal-pdf\"
}"{
"export_job_id": "e9c2…",
"status": "pending",
"status_url": "/v1/exports/e9c2…"
}Request body fields:
| Field | Type | Required | Notes |
|---|---|---|---|
snapshot_id | UUID | yes | Must belong to the calling account. |
artifact_type | string | yes | See the matrix below. |
provider | string | yes | Paired with artifact_type. |
options | object | no | Provider-specific options (voice, slide template, etc.). |
[!WARNING] The
(provider, artifact_type)pair must match one of the supported combinations exactly — otherwise you get422 validation_errorwithcode: "unknown". Mistypingprovideris the most common reason for this.
Polling
curl https://api.regsn.app/v1/exports/$EXPORT_JOB_ID \
-H "Authorization: Bearer $REGSN_API_KEY"{
"id": "e9c2…",
"status": "running",
"artifact_type": "pdf",
"provider": "internal-pdf",
"created_at": "2026-05-14T09:18:11Z",
"completed_at": null,
"cost_cents": null,
"error": null,
"download_url": null
}status cycles through pending, running, then a terminal completed or failed. Once completed, download_url is populated and you can fetch the artifact from it (the URL is short-lived; download promptly).
A reasonable poll cadence is 5 seconds. Some artifact types (especially AI-generated video and audio) can take several minutes — design your client accordingly.
Supported artifact types
The full catalog of (provider, artifact_type) pairs is served at runtime by the dashboard; here are the categories. Specifics may change between releases — track the Changelog.
Internal artifacts — fast (≤10 seconds)
provider | artifact_type | Output |
|---|---|---|
internal-pdf | pdf | PDF report |
internal-tearsheet | tearsheet | One-page tearsheet (PNG) |
internal-pptx | slide-deck | PowerPoint deck |
internal-csv | csv | Tabular items + trends |
Gemini / OpenAI — image generation
provider | artifact_type | Output |
|---|---|---|
gemini-infographic | tearsheet-detailed | Detailed tearsheet (PNG) via Gemini |
gemini-infographic | infographic-custom | Custom infographic (PNG) via Gemini |
openai-infographic | tearsheet-detailed | Same artifact via OpenAI gpt-image |
openai-infographic | infographic-custom | Same |
NotebookLM — long-form
Require the NotebookLM sidecar to be configured on your account.
provider | artifact_type | Output |
|---|---|---|
notebooklm | infographic | NLM infographic |
notebooklm | slide-detailed | Detailed deck |
notebooklm | video-explainer | Video explainer |
notebooklm | video | Cinematic video |
notebooklm | audio | Debate-style podcast |
ElevenLabs — audio briefings
provider | artifact_type | Output |
|---|---|---|
elevenlabs-briefing | podcast-briefing | Single-voice executive briefing (MP3) |
elevenlabs-discussion | podcast-discussion | Multi-voice discussion (MP3) |
Google Podcast (gated)
provider | artifact_type | Output |
|---|---|---|
google-podcast | audio | Google Cloud Podcast API (requires access grant) |
Idempotency
Like POST /v1/scans, POST /v1/exports accepts an Idempotency-Key. The semantics are identical: same key + same body returns the cached 202 (with the same export_job_id); same key + different body is 409 idempotency_key_in_use. See Idempotency for the full table.
Both SDKs auto-generate a UUID4 idempotency key per export.
Downloading
The download_url returned on a completed job is short-lived and authenticated by your bearer token. The shape:
/api/export/jobs/{job_id}/downloadHit it with the same Authorization: Bearer … header you use for the rest of the API. The response is the binary artifact with the appropriate Content-Type (e.g. application/pdf, audio/mpeg, image/png).
curl -L -o report.pdf "https://api.regsn.app/api/export/jobs/$JOB_ID/download" \
-H "Authorization: Bearer $REGSN_API_KEY"Error paths
| Status | Code | What it means |
|---|---|---|
| 404 | not_found | The snapshot_id you referenced doesn’t exist or doesn’t belong to your account. |
| 422 | validation_error | Missing field, or unknown (provider, artifact_type) pair. |
| 409 | idempotency_key_in_use | Reused an Idempotency-Key with a different body. |
| 429 | rate_limit_exceeded | 30 exports per hour per key (see Rate limits). |
If a worker fails mid-job, the GET response has status: "failed" and an error string describing what went wrong. Failed jobs do not consume budget.
Code: end-to-end PDF
import { RegSn } from '@regsn/api';
import { writeFile } from 'node:fs/promises';
const client = new RegSn();
// 1. Queue the export.
const job = await client.exports.create({
snapshot_id: process.env.SNAPSHOT_ID,
artifact_type: 'pdf',
provider: 'internal-pdf',
});
// 2. Poll until done.
let status;
do {
await new Promise(r => setTimeout(r, 5000));
status = await client.exports.get(job.export_job_id);
} while (status.status === 'pending' || status.status === 'running');
if (status.status !== 'completed') throw new Error(`export failed: ${status.error}`);
// 3. Download.
const res = await fetch(`https://api.regsn.app${status.download_url}`, {
headers: { Authorization: `Bearer ${process.env.REGSN_API_KEY}` },
});
await writeFile('report.pdf', Buffer.from(await res.arrayBuffer()));See also
- Snapshots — what an export is built from.
- Studio (product) — the dashboard surface that wraps this endpoint.
- Rate limits —
POST /v1/exportsis 30 / hour / key. - Idempotency — retry safety on the create call.