---
title: "Export an analysis (ideas-json)"
method: GET
path: "/api/agent/analyses/{id}/export"
tags: ["Analyses"]
---

# Export an analysis (ideas-json)

`GET /api/agent/analyses/{id}/export`

## Request

- Base URL: `https://preuve.ai`
- URL: `https://preuve.ai/api/agent/analyses/{id}/export`
- Auth: API key in header `x-preuve-key`

Structured JSON export (schemaVersion 2) for one COMPLETED, export-ready analysis THIS API started. Deep runs include full sections, pivots, citations, and generated module payloads. A report created on the preuve.ai dashboard is not exportable here and answers 403 REPORT_NOT_FROM_AGENT_RUN: the poll resolves it, but the data is served elsewhere. Which way forward depends on the report - Build with AI on its report page where it is available, unlocking or re-running it otherwise - and the refusal text names the right one, so relay that rather than deriving it from the scan depth. Starting a fresh analysis here always works.

## Path parameters

- `id` string, uuid, required

## Query parameters

- `format` 'ideas-json'
- `verbosity` 'full' | 'summary'

## Response `200`

The export payload.

- AnalysisExport: ideas-json export, schemaVersion 2. Deep-only fields are null on free runs. See the Scans and Enrichment guide for the field-by-field contract.
  - `schemaVersion` 2
  - `exportType` 'analysis'
  - `exportedAt` string, date-time
  - `analysis` AnalysisRun
    - `id` string, uuid
    - `reportId` string, uuid, nullable: Null until the report row is attached, which is why a run that failed before dispatch is retryable under the same clientRunId.
    - `clientRunId` string, nullable: The caller-chosen id from create. Null when the analysis is a dashboard-created report resolved by its report id: no run row exists, so there is no clientRunId to replay.
    - `batchId` string, uuid, nullable: The batch this run belongs to, or null for a standalone run.
    - `scanType` 'starter' | 'deep': Your request type. Reliable from creation, even while PROCESSING.
    - `enrichmentMode` 'core' | 'none'
    - `publish` boolean
    - `reportType` 'quick' | 'deep_dive' | 'null', nullable
    - `analysisTier` 'basic' | 'advanced' | 'null', nullable: Derived from the report. Deep runs read "basic" until deep sections land.
    - `status` 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED'
    - `progressStep` string, nullable: Free-text pipeline stage while PROCESSING.
    - `errorCode` string, nullable: Set on a FAILED run. Two internal markers are deliberately rewritten before they leave: an ambiguous dispatch reports TRIGGER_DISPATCH_FAILED and an ambiguous claim refund reports REPORT_CREATE_FAILED.
    - `errorMessage` string, nullable
    - `resetAt` string, date-time: Present only on a batch item refused by the rolling daily cap; absent, not null, on every other run.
    - `pollAfterSeconds` integer: Present only while polling is still useful. Pace by this rather than by a fixed interval.
    - `pollHint` string: Present alongside pollAfterSeconds.
    - `createdAt` string, date-time
    - `updatedAt` string, date-time
    - `readyForExport` boolean: Whether GET /export will serve this analysis now. Always false for a report created on the preuve.ai dashboard, whatever state the report is in, because that export answers 403 REPORT_NOT_FROM_AGENT_RUN. Branch on exportable first.
    - `exportable` boolean: Present, and false, only on a report created on the preuve.ai dashboard. Absent means the ordinary contract applies and readyForExport is the gate. When it is false, no amount of polling or enriching changes it.
    - `exportBlockedCode` 'REPORT_NOT_FROM_AGENT_RUN': Present alongside exportable, naming the refusal.
    - `exportBlockedHint` string: Present alongside exportable. Relayable prose.
    - `enrichment` EnrichmentState: Progress of the core export sections. The four name arrays partition `required`, so a poller decides what to do next by reading them rather than by parsing `status`: anything in processing means keep polling, anything in failed means call enrich again, and missing with nothing processing means enrichment was never started for it.
      - `mode` 'core' | 'none'
      - `status` 'not_required' | 'pending' | 'processing' | 'partial' | 'completed' | 'failed': Rolled up from the arrays below. "partial" means some sections landed and others did not; "not_required" is mode "none", or a report with no required sections.
      - `required` string[]: Every section this report and mode need. The other four arrays partition it.
      - `completed` string[]
      - `missing` string[]: Required, not generated, and not currently being generated.
      - `processing` string[]: Generation is in flight. Keep polling rather than calling enrich again.
      - `failed` string[]: Generation was attempted and failed. Retryable by calling enrich again.
      - `sections` object: Per-section detail, keyed by section name, for every entry in required. Each value carries at least a status matching the array the section is in, plus completedAt on a completed section and whatever the last attempt recorded on a failed one.
    - `modules` object, nullable: Per-module statuses. Deep reports only; null on free runs.
      - `proofOfDemand` ModuleStatus
        - `status` 'not_generated' | 'generating' | 'failed' | 'completed'
      - `founderFit` ModuleStatus
        - `status` 'not_generated' | 'generating' | 'failed' | 'completed'
      - `playbook` ModuleStatus
        - `status` 'not_generated' | 'generating' | 'failed' | 'completed'
      - `trends` ModuleStatus
        - `status` 'not_generated' | 'generating' | 'failed' | 'completed'
      - `community` ModuleStatus
        - `status` 'not_generated' | 'generating' | 'failed' | 'completed'
    - `reportUrl` string, uri, nullable: Null until the report row exists.
    - `shareUrl` string, uri, nullable
  - `verbosity` 'full' | 'summary': The verbosity this payload was built at, echoed back. On "summary", idea.details.omitted names what was dropped.
  - `locked` ExportLocks: Which fields this export left null, and why. Present only when the caller's tier withheld something, and absent entirely when the payload is complete. Read it before concluding a field is absent: a null under one of these paths is locked, not missing and not a failed analysis. It ships to every tier, paid included, and carries no price and no URL. On a batch export there is ONE object for the whole batch, the union of every exported item's withheld fields, deduplicated by path.
    - `reason` string: Why the fields were withheld. "starter_scan" today.
    - `unlockedBy` string: What lifts the lock. "founder_report" today.
    - `fields` object[]: One entry per withheld field.
      - `path` string: Dotted path into the export, e.g. "details.pivots". A path may name several keys of one object with a pipe, e.g. "details.risks[].explanation|mitigation".
      - `label` string: What that path holds, in plain language. Some labels also say the field needs an enrich call once the report is deep.
    - `note` string: One sentence restating that the nulls are a tier boundary rather than missing data.
  - `upsell` ExportUpsell: Purchase context for a locked export or buyable quota refusal. Export upsells are free-owner only; a paid non-regional caller may receive a scan_pack top-up on INSUFFICIENT_TOKENS. Ignore it if you only need the data contract.
    - `offer` 'founder_report' | 'scan_pack': "founder_report" is the $59 one-time tier. "scan_pack" is a top-up for an account that already bought and has no deep credits left.
    - `price` string: Display price text, e.g. "$59 one-time".
    - `guarantee` string: Guarantee text for offer=founder_report. Omitted for scan_pack top-ups; an empty string is never used.
    - `url` string, uri: Purchase or report URL, with attribution query parameters.
    - `locked` string[]: Section names the offer covers. Distinct from the top-level locked object, which names response FIELDS.
    - `note` string: The same facts as one sentence, for a client that relays text.
  - `idea` object
    - `rank` integer
    - `verdict` string
    - `score` number
    - `title` string
    - `risk` string
    - `quote` string
    - `evidence` string
    - `domains` string[]
    - `reportId` string
    - `reportUrl` string
    - `shareUrl` string, nullable
    - `details` object: Summary contract on every tier (including situationBriefing and scores); sections/pivots/communityDemand/founderFit/playbook/proofOfDemand/googleTrends on deep runs. `details.cloneability` is present on every tier but changes shape rather than going null - three fields on starter runs, the full analysis on deep runs. See the Scans and Enrichment guide.

## Other responses

- `400`: The request was rejected before any work started: malformed JSON (INVALID_JSON), an id that is not one of ours (INVALID_ANALYSIS_ID, INVALID_BATCH_ID), an export format we do not serve (UNSUPPORTED_FORMAT), or a field the schema cannot express - an idea too short to analyse, a batch outside 1..5 items (INVALID_BATCH_SIZE), two batch items sharing a clientRunId (DUPLICATE_CLIENT_RUN_ID), an unknown scanType. No paid quota, tokens, or scans were consumed. On the CREATE routes a rate-limit window can still be: those per-account limiters are claimed ahead of schema validation on purpose, so that malformed spam is metered, and retrying unchanged spends another slot. Enrich no longer works that way - since 2026-09-15 its 12/min window is claimed after the body is validated, so a malformed enrich costs nothing. Fix the request either way; retrying it unchanged returns the same answer.
- `401`: Missing x-preuve-key header (MISSING_API_KEY), or a malformed, unknown or revoked key (INVALID_AGENT_KEY - the same envelope for all three, on purpose). Repeated failures are throttled per IP and answer 429.
- `403`: The key lacks export:read (INSUFFICIENT_SCOPE), or the report was created on the preuve.ai dashboard (REPORT_NOT_FROM_AGENT_RUN).
- `404`: Unknown id, or the resource belongs to another account. The code names what was looked up: ANALYSIS_NOT_FOUND on the analysis routes, BATCH_NOT_FOUND on the batch ones. The analysis routes also answer REPORT_DELETED when the run exists but its report was deleted from the dashboard: nothing is left to poll, enrich or export.
- `409`: Not exportable yet (ANALYSIS_NOT_COMPLETE or ENRICHMENT_NOT_COMPLETE).
- `422`: The analysis failed (ANALYSIS_FAILED).
- `500`: Unexpected server error (INTERNAL_ERROR, or TRIGGER_DISPATCH_FAILED when a deep scan could not be handed to the job runner). Never tell the user their quota is safe: on a deep scan the spend can already have happened when the failure hit, and an ambiguous dispatch deliberately keeps the report and its funding because the job may have been accepted before its response was lost. Treat consumption as unknown and retry with backoff. On an operation that takes a clientRunId, retry with the SAME one - that reconciles the original run, whatever state it reached, instead of starting and charging for a second one. On every other operation there is nothing to reconcile: the read or export simply failed, so a plain backed-off retry is the whole recovery.
- `503`: A dependency was unavailable or deliberately paused (SERVICE_DISABLED, LLM_PAUSED, PROFILE_LOOKUP_FAILED, and the fail-closed answer when the rate-limit backend is down). Any authenticated route can answer this one: authentication meters itself through the same fail-closed limiter, so an outage there refuses the request before the handler runs. Retryable, and no paid quota, tokens, or scans were consumed - a pause that lands mid-run refunds the claim it had already made. Back off and try again rather than falling back to a different endpoint.

---

[API](https://skmtc.dev/preuve/apis/preuve-agent-api.md) · [All operations](https://skmtc.dev/preuve/apis/preuve-agent-api/llms.txt) · [OpenAPI document](https://skmtc.dev/preuve/apis/preuve-agent-api/revisions/d58b3d396fa7?raw)
