Skip to content

Guide

Exports

Write the answer to a query as a CSV or Parquet file, follow it, download it with a key or a short-lived link, and read what the file does and does not carry.

Availability. The export routes are described in the API reference and are not yet available on a released environment. This page states the contract so a client can be written against it. The contract defines CSV and Parquet files. Parquet is refused on an environment until its export database login is set up there, and no environment has that yet (see What is not available).

An export runs a query once, writes the whole answer to a file, and keeps the file for seven days. Use it when a result does not fit one POST /v1/query response (at most 10,000 rows and about 5 MB; see Reading data) or when a person or tool needs a file.

Every route here takes the same bearer API key as POST /v1/query with the query:read scope (Authentication), except the link download, which takes none. The examples use the public API host https://api.signalbraid.com.

  1. POST /v1/query/export plans the export and answers 202 with its status. Nothing is written yet.
  2. GET /v1/exports/{exportId} until state is succeeded (or failed).
  3. GET /v1/exports/{exportId}/file with the key, or POST /v1/exports/{exportId}/links for a link that someone without a key can open.
POST /v1/query/export
Authorization: Bearer <key with query:read>
Content-Type: application/json
Idempotency-Key: weekly-sessions-2026-09-04
{
"query": {
"profile": "ga4.sessions_daily",
"connectionId": "your_connection",
"accounts": ["123456789"],
"metrics": ["sessions"],
"dimensions": ["date"],
"dateRange": { "start": "2026-08-31", "end": "2026-09-04" }
},
"format": "csv",
"csv": { "bom": true }
}

query is the body of POST /v1/query, so the same profiles, fields, filters and rules apply (see Reading data). The workspace is the key’s own and is never in the body. A limit in the query is not applied: the export writes every row. format is csv (the default) or parquet. csv.bom (default false) writes a UTF-8 byte order mark first, which some versions of Excel need to read the file as UTF-8; it belongs to a CSV file, and a parquet request that sends csv is 400 invalid_export_request. Any other field or format is 400 invalid_export_request. Where the export database login is not set up, a parquet request is 503 export_unavailable and nothing is stored.

A query can also name several accounts as sources instead of connectionId and accounts, as on POST /v1/query (GA4 and Search Console profiles), at most 10 pairs for an export (a query takes 25). The file is the answer POST /v1/query gives for those sources: summed by date, or one row per account when you group by account. Every source is checked and pinned when you create the export, all or nothing: one source whose connection is not available is 404 connection_unavailable, and one with an unpublished date is 409 data_incomplete or 409 data_not_ready. If any one source is re-published while the export runs, the export fails with data_superseded, and you can create it again.

The query is validated, authorized and pinned to the published snapshots it reads before the answer. A window that is not fully published is refused exactly as the query route refuses it: 409 data_not_ready or 409 data_incomplete with the missing dates, never a short file. A publication that lands after the call never enters the file; if one moves a pinned day before the file is written, the export ends failed with data_superseded.

The answer is 202 with a Location: /v1/exports/{exportId} header and the status in pending:

{
"exportId": "exp_8d2c41f0a6",
"state": "pending",
"format": "csv",
"requestId": "7b6b8f4e-3d0b-4f64-9a43-2f8f5f1d2a10",
"createdAt": "2026-10-26T09:30:00.000Z",
"expiresAt": null,
"rows": null,
"bytes": null,
"sha256": null,
"errorCode": null,
"fields": ["date", "sessions"],
"freshness": {
"oldestExtractedAt": "2026-09-07T04:20:09.494Z",
"newestExtractedAt": "2026-09-07T04:20:09.494Z",
"stale": false,
"thresholdHours": 2
},
"flags": ["bounded_to_sessions_by_date", "provider_may_revise_recent_data", "not_independently_reconciled"],
"csv": { "bom": true, "formulaNeutralization": "text-columns-single-quote" }
}

The values here are illustrative.

Idempotency-Key is optional: 8–128 characters from A-Za-z0-9._:-. Sent again with the same request, it returns the same export instead of starting another: 202 when that call created it, 200 with the export’s current status, in whatever state it is in, when it already existed. A replay after the export failed, expired or was erased reads that state and does not start a second export; use a new key to run it again. The same key with a different request is 409 idempotency_conflict. A malformed header is 400 invalid_idempotency_key.

A workspace has at most one export running and three waiting. A create beyond that is 409 export_limit_reached; it is not queued. Creating is also limited to 10 per minute per workspace and downloading to 60 per minute, on every plan; each key has half of that, 5 creations and 30 downloads per minute (see Rate limits).

GET /v1/exports/{exportId} returns the export of the key’s own workspace. A successful read is 200 for every state, failed, expired and erased included, so read state and errorCode. An export of another workspace is the same 404 export_not_found as one that does not exist. Poll with backoff; no completion time is promised.

stateMeaning
pendingPlanned and waiting.
runningThe file is being written.
succeededThe file is ready. rows, bytes, sha256 and expiresAt are set.
failedNo file. errorCode says why.
expiredThe file was removed after its seven days.
erasedThe file was removed because a field it carries was switched off for output, or its organisation was deleted. See Retention and erasure.
FieldMeaning
fieldsThe field ids of the file’s columns, in order. They are the header row.
rowsRows written, header excluded. null until the export succeeds. Equal to the rows the pinned query returns, or the export fails.
bytes, sha256Size and SHA-256 of the file exactly as downloaded, byte order mark included. Compare your copy against them.
expiresAtWhen the file is removed. null until the export succeeds.
freshnessoldestExtractedAt, newestExtractedAt, stale and thresholdHours, taken from the snapshots the export was pinned to. null when the publication carries none. For an export of several sources, one record covers them all: the oldest and newest extraction of any source, stale when any source is stale, and the smallest of their thresholds.
flagsThe query’s limitations, as POST /v1/query reports them, plus stale_source_snapshot when the result is stale. Show them wherever the numbers are shown.
csvThe CSV options in force: bom and formulaNeutralization. null for a Parquet export.
sourceAttributionA YouTube export only: the source of the values, as Reading data describes it for a query result (label, notice, the channel’s links). Show it wherever the numbers are shown. Absent for every other export.

A failed export names one of these in errorCode:

errorCodeMeaningRetry
export_too_largeThe result is larger than the reader can deliver. See What is not available.No. Narrow the window or the filters.
data_supersededA newer publication replaced a pinned day before the file was written.Yes, with a new request.
query_unavailableThe data store was unreachable, or a read ran out of time, on every attempt.Yes, later.
export_unavailableThe file could not be written or recorded.Yes, later.
forbiddenThe key, the workspace or a field lost its authority while the export ran.No.
export_integrity_failedThe file would not have matched the query: a wrong row count, a cell the dialect cannot write faithfully, two reads of an export ordered by a decimal metric that disagreed, or a Parquet file that ended without its footer or whose footer counts other rows.Yes, with a new request; order by a dimension if it repeats.

An export that fails serves no file.

A Parquet export is written by the data store in one statement over the same pinned query, so its rows and values are the ones POST /v1/query answers, in the same order. Each column is named by its field id: a date is a Parquet DATE, an integer dimension or metric a 64-bit integer, a decimal metric a nullable 64-bit float (the number the JSON answer carries; null where the JSON answer is null), and text a UTF-8 string. The file is compressed with zstd. Before the export succeeds, the row count in the file’s footer must equal the rows the query returns; a file that ended early, or carried an error after its first bytes, ends failed with export_integrity_failed. bytes and sha256 are the file’s as downloaded.

GET /v1/exports/{exportId}/file
Authorization: Bearer <key with query:read>

The answer is the file, Content-Type: text/csv; charset=utf-8; header=present, with Content-Disposition: attachment; filename="export-<exportId>.csv" (built by the server, never from the request), and Cache-Control: no-store, X-Content-Type-Options: nosniff and Referrer-Policy: no-referrer. A Parquet export is served as Content-Type: application/vnd.apache.parquet with the filename export-<exportId>.parquet. The file of a YouTube export is named export-youtube-<exportId>.csv (or .parquet) and carries three more headers: SignalBraid-Source: YouTube, SignalBraid-Source-Notice (the notice sentence) and SignalBraid-Source-Link (the channel’s YouTube page). The file itself is unchanged.

  • 409 export_not_ready: the export is queued, running, or failed. Poll its status.
  • 410 export_expired: the file is past its seven days, or was erased, or its connection was changed in one of the ways listed under Retention and erasure. A connection change is answered first, so an export of such a connection that has not finished is 410 too, not 409.
  • 404 export_not_found: no such export in the key’s workspace.

A large file is sent in parts. Before each part after the first the key is checked again, and so is the export and the connection changes described under Retention and erasure, so revoking the key, erasing the export, deleting the connection, disconnecting a Shopify or Google Ads connection, uninstalling the Shopify app or revoking its access, or pausing a connection set up in SignalBraid ends the transfer with an error rather than a complete file. A stream that ends short of the size in the status is an error, not a complete file: compare bytes and sha256.

A link lets a person or tool without a key fetch one export’s file. It is not an API key: it opens that one file and nothing else.

POST /v1/exports/{exportId}/links
Authorization: Bearer <key with query:read>
Content-Type: application/json
{ "ttlSeconds": 600 }

The body is optional. ttlSeconds is a whole number from 1 to 900 (15 minutes); without it the link lives 10 minutes. It never outlives the file or the key that issued it. Anything else is 400 invalid_export_request. The answer is 201:

{
"linkId": "lnk_41c0d7e9b2",
"exportId": "exp_8d2c41f0a6",
"url": "https://api.signalbraid.com/v1/export-links/kP3x9mQ2vL7nR4tY8wZ1cB6dF0gH5jA2sE9uI3oK7aM",
"expiresAt": "2026-10-26T09:40:41.000Z"
}

The values here are illustrative. The URL holds the secret and is shown once; it cannot be read again. Treat it like a password until it expires: anyone who holds it can fetch the file. The link path, token included, is recorded in the platform’s Workers request logs until log redaction is in place, so keep links short-lived and revoke them (below) when you are done. A link needs a succeeded export (409 export_not_ready otherwise, 410 export_expired for a file that is gone).

GET /v1/export-links/{token} sends the same file with the same headers. There is no Authorization header, and the token is accepted only in the path, never in a query string. Each request is checked against the control plane again, together with the issuing key and the export. A link that is unknown, expired or revoked, whose issuing key was revoked or expired, whose workspace was deleted, or whose export was erased is one and the same 404 link_not_found. A link never outlives its file, so a link to a file past its seven days is also 404 link_not_found. Downloads through a link count against the issuing key’s download allowance, whoever holds the link.

DELETE /v1/exports/{exportId}/links revokes every link of the export at once and answers 204, also when there were none. A revoked link answers 404 link_not_found from the next request on. A download already running has sent its 200 and headers, so it cannot change status: at the next part the stream ends with an error instead of a complete file.

The file is CSV in one fixed dialect. Only the byte order mark can be chosen.

RuleWhat the file does
EncodingUTF-8. A byte order mark is written first only when the request set csv.bom to true.
Record separatorCRLF after every record, the last one included.
Delimiter and quotingA comma. A field containing a comma, a double quote, CR or LF is quoted, and an embedded double quote is doubled.
HeaderOne row of the field ids (date, sessions), never display labels. The same ids are fields in the status.
NULLAn empty, unquoted field. A ratio the query service marks unavailable is NULL, never 0.
Empty string"", so it differs from NULL. In a one-column file a NULL record is a bare CRLF line, so count records with rows, not lines.
Formula neutralizationIn a text column only, a value that starts with =, +, -, @, a tab or a carriage return gets a single quote in front and is always quoted: =SUM(A1) is written "'=SUM(A1)". The value is changed in the file, so a text column that must round-trip exactly needs that prefix removed. Numeric, date and instant columns are never altered: -5 stays -5.
NumbersIntegers and decimals in plain notation, never an exponent. A decimal is the exact string the query service sent, not a rounded float.
Dates and instantsA date is YYYY-MM-DD. An instant is RFC 3339 UTC with a Z.
Row orderThe query’s orderBy, then every requested dimension ascending.

The export fails (export_integrity_failed) rather than write a cell this dialect would have to guess at, such as a value of the wrong type for its column.

A CSV file has nowhere to put freshness or limitations, so the file carries none. Read freshness and flags from the export’s status, and show them wherever the numbers go. Someone who is handed only the file, or only a link, does not see them.

The same holds for the source of a YouTube export: the CSV body has no room for it. It is in the status (sourceAttribution), in the download’s SignalBraid-Source headers (with a link too) and in the filename export-youtube-<exportId>.csv. Keep the source with the file when you pass the file on.

Beside each file the export writes a manifest.json: the export id, the file name and content type, the row count, byte count and SHA-256, the number of parts the file is stored in, the CSV options, the columns (id, role and type), the profile and the provenance of the snapshots, and for a YouTube export its sourceAttribution. Most of the same facts are in the status. No route returns the manifest in this version; use the status.

A file lives for seven days from the moment the export is created, not from when the file is written. Then the export reads expired, the file is removed, and the file route answers 410 export_expired. Run the export again for a new file. A link dies with the file, at the latest.

Fields that the profile marks as not aggregate-safe are recorded against each export that reads them, together with the field-policy version in force, so that a purge could find those exports. No such purge of exports can run today: the only governed field an export can hold is Search Console page_daily page, and it has no stream-erasure path. Only organisation deletion is wired: it erases the organisation’s exports. When an export is erased the state reads erased, the file and manifest are deleted, its links stop working, and the file route answers 410 export_expired (through a link the same export is 404 link_not_found).

Some changes to a connection also stop its exports. Once a connection is deleted, the file route answers 410 export_expired for its exports, issuing a link answers 410 export_expired, their links answer 404 link_not_found, and a download already running ends with an error at its next part. Such an export cannot be recovered, and it cannot be run again for a deleted connection. Disconnecting a Shopify or Google Ads connection does the same; a disconnected connection of any other connector keeps its exports downloadable until it is deleted or the files expire. Uninstalling the SignalBraid app from a Shopify store, or revoking its access, also does the same, until the app is installed again. For a connection set up in SignalBraid, pausing it or setting it up again has the same effect only until it is active again. The same holds while a GA4 connection is paused, or while the account an export reads (a Search Console property or an ad account, for example) is paused or cancelled, as can happen when an organization moves to a smaller plan: the export’s file and links are refused, as a query of that connection or account is, until it is active again. When a store’s app is installed again, or a connection or account is active again, the files and links that have not expired work again. Deleting a connection does not yet erase the files themselves; they are removed when they expire after their seven days. An export of several sources depends on every connection it names: a change to any one of them stops it in the same way.

An export is read access to published data, so it does not stop with a pause. A workspace paused for a trial or a subscription can still create exports, poll them and download files and links, until the files expire. Starting a sync is different: that is still 403 workspace_paused (see Errors). A workspace an operator has paused is refused at authentication, like any other request. Exports are refused with 403 forbidden for a workspace that has no entitlement to them.

An MCP client creates and follows the same export through two tools (MCP): create_export takes the query a query tool refused with result_too_large, plus bom and idempotencyKey, and plans it exactly as POST /v1/query/export does; get_export reads its status as GET /v1/exports/{exportId} does. Both answer a result handle: the status object on this page, plus statusUrl, fileUrl and linksUrl for the routes above, never a row. The file is downloaded here, with an API key or a link, not through the tool. Creating an export over MCP needs an MCP connection made with an API key: one made with OAuth is refused forbidden and nothing is created. An export created over MCP is the same export row, counts against the same limit of one running and three waiting, shares the Idempotency-Key space with this route, and writes the same export.requested receipt, with the credential kind mcp. This is implemented and tested in the gateway and not yet deployed.

  • Parquet on any environment today. A Parquet file needs the export database login, which is set up per environment and is set up on none yet. Until it is, a parquet request is 503 export_unavailable and nothing is stored.
  • The published size. The contract for a query export is up to 5,000,000 rows and 2 GiB per file. That size is not delivered today. The reader that feeds the file stops at about 5,000,000 source rows scanned per statement (about half that for a profile that also checks completeness, such as Google Analytics 4 daily data) and at 20 seconds per statement, and a result beyond it ends failed with export_too_large (or query_unavailable when a read runs out of time). Each page the reader fetches is also capped at 5 MiB, so an export of very wide rows can fail export_too_large far below 5,000,000 rows. Smaller windows, fewer dimensions and narrower filters export; do not plan around the published figure.
  • A manifest download. No route returns manifest.json; the status carries most of it.
  • Recurring file exports. Scheduled delivery to a Google Sheet is separate (see Syncing data).

Every code on this page is listed with its status in Errors.