Skip to content

Guide

Authentication

Bearer API keys created in the app, the two scopes, and what happens when a key is revoked mid-request.

Data routes need a bearer API key. GET /health and the export-link download (GET /v1/export-links/{token}, see Exports) do not:

Authorization: Bearer <YOUR_API_KEY>

Keys are verified with HMAC-SHA-256 against authoritative control-plane records on every request. There is no cached validation and no token exchange, so revocation and expiry apply from the next request.

Owners and admins of an organization create keys in the SignalBraid app, under Settings, on the API access tab. A key belongs to the one workspace that Settings is showing, and carries a name, one or both of the scopes below, and an optional expiry date. Members with any other role cannot see or manage keys.

A key looks like sb_<key id>.<secret>. Send the whole value, case-sensitive.

A query:read key can list its workspace’s connections and their accounts with GET /v1/connections, and read one of them with GET /v1/connections/{connectionId} (see Reading data).

Creating, rotating and revoking a key each need two-step verification set up on your account and a verification from the last 10 minutes. Seeing the list does not.

If your last verification is older than that, the app stops and shows Confirm it is you. Enter the 6-digit code from your authenticator app, or one of your recovery codes; the action you asked for then runs, and nothing changes before that. If two-step verification is not set up yet, the app says so and you cannot manage keys until it is. The app’s own Security tab is where you set it up.

Create API key asks for:

FieldRules
Key name1 to 80 characters. Name it for the thing that will use it.
What the key can doChoose at least one: Read data (query:read) or Run syncs (sync:write). See Scopes.
Expires onOptional. A date after today. The key stops working at the start of that day, UTC. Leave it empty for a key that does not expire.

The key’s value is shown once, in a dialog with a Copy key button. SignalBraid cannot show it again, and the list never carries it. Store it somewhere safe, like any password. If you lose it, rotate the key to get a new value. The same applies if the dialog could not show the value, for example because your session ended while the key was being made: the key exists, and rotating it gives you a value you can see.

Each key is listed with its name, a status of Active, Expired or Revoked, its handle (sb_ and the first eight characters of its ID), its scopes, when it was created and by whom, when it was last used, and its expiry. Dates are UTC. Use the handle to match a key in the list to the one your system holds. A key that was issued outside the app is listed as Unnamed key. The list shows the newest 200 keys.

Last used is updated when a key authenticates, at most once a minute, so it tells you a key is in use, not how often. A key never used shows No use recorded yet.

Rotate is offered on an active key. A new key with the same name, scopes and expiry replaces it. The old key stops working with no overlap, so anything still using it fails until it has the new value. The new value is shown once, as above.

Revoke is offered on an active key. Anything using the key stops working on its next request. This cannot be undone: to use that access again, create a new key. A revoked key stays in the list, marked Revoked.

A key is not tied to the person who created it. Removing a member from the organization does not revoke the keys they created; the app says so when you remove someone. Review the list when people leave, and revoke what should no longer work.

Two scopes exist, and they are genuinely separate — one does not imply the other.

ScopeGrants
query:readPOST /v1/query, GET /v1/metrics/ga4.sessions, GET /v1/connectors, GET /v1/connectors/{connectorId}/schema, GET /v1/usage, GET /v1/connections, GET /v1/connections/{connectionId}, POST /v1/query/ads, POST /v1/query/search-console, GET /v1/datasets, GET /v1/datasets/{datasetId}, POST /v1/datasets/{datasetId}/query, POST /v1/query/export, GET /v1/exports/{exportId}, GET /v1/exports/{exportId}/file, POST /v1/exports/{exportId}/links, DELETE /v1/exports/{exportId}/links, POST /mcp, GET /v1/pilot/schedules/{scheduleId}, GET /v1/ads-sheet/schedules/{scheduleId}, GET /v1/gsc-sheet/schedules/{scheduleId}, GET /v1/shopify-sheet/schedules/{scheduleId}, GET /v1/dataset-sheet/schedules/{scheduleId}
sync:writePOST /v1/syncs, GET /v1/syncs/{runId}, all four POST /v1/pilot/... operations, all five POST /v1/ads-sheet/... operations, all five POST /v1/gsc-sheet/... operations, all five POST /v1/shopify-sheet/... operations, all five POST /v1/dataset-sheet/... operations

A sync:write key can trigger extraction but cannot read the resulting data. A query:read key can read published data but cannot cause a provider call. Issue the narrower one: a key that only ever reads should not be able to spend provider quota.

Using a key outside its scope returns 403 forbidden, not 401 — the key is valid, the operation is not permitted. A key whose workspace has no plan at all also gets 403 forbidden, for every request, reads included.

POST /v1/exports/{exportId}/links returns a URL that downloads one export’s file without a key (GET /v1/export-links/{token}). A link is not an API key: it reads that one file and nothing else, and it cannot query, list or create anything. It lasts 10 minutes by default and at most 15, and never past the file’s own expiry or the issuing key’s. DELETE /v1/exports/{exportId}/links revokes every link of the export at once, and a link stops working from the next request, or the next part of a running download, after the key that issued it is revoked or expires. Downloads through a link count against the issuing key’s download allowance. Treat the URL as a secret while it lives: anyone holding 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 when done.

The key determines the workspace. On /v1/query the body has no workspace field: a workspaceId in the body is refused as 400 invalid_query, and nothing is read. On /v1/query/ads a body workspaceId must equal the key’s own workspace; a mismatch is 403 forbidden. Neither is ever a cross-tenant read.

Workspace headers are ignored entirely. There is no header, parameter or body field that lets a caller act on a workspace other than its key’s.

The two surfaces differ, which matters when you are reading a status code.

On the /v1 routes, the route match, the method check and the query-delimiter check all run first. GET /v1/query is 405 and POST /v1/query?x=1 is 400, whether or not your key is valid.

On /mcp, the pinned URL, Host and optional Origin are checked first, before the authorization store is touched. A disallowed origin is therefore 403 even when the request also carries a bad key. Authentication follows for requests that reach that private boundary, and the method check comes after it: GET /mcp with no valid key is 401, and 405 only with a valid key.

Worth knowing if you are reasoning about what a leaked key could reach: authorization is checked before the backend read and again before the response is released.

If a key is revoked, expires, or is reassigned to another workspace while a query is in flight, the request returns 401 and the data is discarded. A read that began while the key was valid does not complete just because it started in time. The same recheck applies to sync responses and to MCP tool results.

Pilot requests are authenticated again by the private sync Worker, then rechecked before the gateway releases either a result or a scoped error. Pilot request bodies do not accept workspaceId; the current key supplies it.

An enabled, versioned schedule and active source/destination grants authorize background work. The runtime does not save or replay the configuring API key. Disabling a schedule invalidates unfinished source and export ownership; requests already sent to Google cannot be recalled. See Pilot automation.

If Google returns a valid replacement refresh token immediately before that schedule authority is lost, the broker retains the encrypted replacement under its separate exact credential lease. It still discards the data response and does not start a later Google request for the denied schedule.

If the authorization store cannot be reached, the original REST and MCP routes return 503 auth_unavailable; pilot routes return 503 automation_unavailable. An unreachable key store never results in an unauthenticated read. Retry with backoff.

Authentication failures return fixed messages. unauthorized does not distinguish between a key that never existed, one that expired, and one that was revoked, and error bodies never carry SQL, provider text, ciphertext or reflected header values.

This is deliberate, and it means the API cannot be used to probe which keys or workspaces exist. When debugging, work from the code and your own records rather than expecting the message to narrow it down.

REST bodies must be application/json, at most 4 KiB, unencoded (Content-Encoding other than identity is rejected).

Any URL query delimiter, including a bare ?, is rejected on every /v1 route and on /mcp — keys and query payloads do not belong in the URL. Run and schedule identifiers do appear in documented resource paths. /health is the exception in mechanism rather than spirit: it matches only an exact GET with no query delimiter; a delimiter or another method still matches that deliberately opaque route and returns 404 not_found rather than 400 invalid_query.

Responses are no-store, nosniff and noindex, nofollow, and there is no CORS policy: this is not a browser-callable API.