/** * GENERATED FILE — DO NOT EDIT. * * Source: https://docs-cdn.narrative.io/api-reference/main/openapi.json * Spec etag: W/"e7456de7840729b7456786b645e0eef2" * * Regenerate with: bun run generate:api-types */ /** * This file was auto-generated by openapi-typescript. * Do not make direct changes to the file. */ export interface paths { "/v2/access-rules/{access_rule_id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get an Access Rule by id (V2) * @description Get an access rule. Authentication is optional: without a token only rules that are visible to * unauthenticated users can be read, always in their shared form. */ get: operations["getAccessRule"]; /** * Update an Access Rule by id (V2) * @description Update an access rule. Only the owning company can update a rule. */ put: operations["updateAccessRule"]; post?: never; /** * Delete an access rule * @description Archives the access rule. Access rule deletion cannot be undone. */ delete: operations["deleteAccessRule"]; options?: never; head?: never; patch?: never; trace?: never; }; "/v2/access-rules/{company_slug}/{access_rule_name}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get an Access Rule by name (V2) * @description Get an access rule by name and company slug. Authentication is optional: without a token only rules that are * visible to unauthenticated users can be read, always in their shared form. */ get: operations["getAccessRuleByName"]; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v2/access-rules": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get all accessible Access Rules (V2) * @description Get all accessible Access Rules. Authentication is optional: without a token only rules that are visible to * unauthenticated users are returned, always in their shared form. * * 'owned_only' and 'shared_only' are flags, they don't require values. * * 'tag', 'dataset_id', and 'company_id' are multi-params. * * Query like 'tag=tag1&tag=tag2&company_id=1&company_id=2' is interpreted as "access rules with tags that comprise 'tag1' or 'tag2' AND belonging to companies with id '1' or '2'. */ get: operations["listAccessRules"]; put?: never; /** * Create a new Access Rule * @description Creates a new access rule based on the provided NQL query. */ post: operations["createAccessRule"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/access-tokens/tokens": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * List System Access Tokens * @description List every System Access Token belonging to your company, including expired ones. The response never contains * the token credentials. * * Requires read access to access_tokens. */ get: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ListAccessTokensResponse"]; }; }; 401: components["responses"]["Unauthorized"]; /** * @description The calling token was issued through the client-credentials grant, which is not tied to a company and so * cannot manage System Access Tokens. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; put?: never; /** * Create a System Access Token * @description Create a System Access Token for your company. * * The response is the only place the credential appears. `access_token` is not stored in retrievable form and no * other endpoint returns it, so if it is lost the token has to be deleted and recreated. * * The new token's expiry is rounded down to whole days, so the `expires_at` you get back can be earlier than the * one you asked for. * * Requires write access to access_tokens. */ post: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["CreateAccessTokenRequest"]; }; }; responses: { /** @description The token was created. This is the only response that contains `access_token`. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["CreatedAccessToken"]; }; }; /** * @description This error is raised when: * - The request cannot be parsed * - `name` is empty or longer than 256 characters * - `expires_at` is less than 1 day or more than 365 days away */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; 401: components["responses"]["Unauthorized"]; /** * @description The calling token was issued through the client-credentials grant, which is not tied to a company and so * cannot manage System Access Tokens. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/access-tokens/tokens/{access_token_id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get a System Access Token by id * @description Retrieve one of your company's System Access Tokens. The response never contains the token credentials. * * Requires read access to access_tokens. */ get: { parameters: { query?: never; header?: never; path: { /** * @description The token's `id`. Anything that is not a UUID does not match the route and returns 404. * @example 546c65d6-e589-4d3c-b1fe-7e61711cc418 */ access_token_id: components["parameters"]["AccessTokenId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["GetAccessTokenResponse"]; }; }; 401: components["responses"]["Unauthorized"]; /** * @description The calling token was issued through the client-credentials grant, which is not tied to a company and so * cannot manage System Access Tokens. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description No token with that id was found. The response has no body. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; /** * Update a System Access Token * @description Change a System Access Token's name, permissions or expiry. Fields you omit are left alone, but the body must * carry at least one of them. * * Updating does not reissue the credential — the existing `access_token` keeps working with the new permissions * and expiry, and is not returned here. * * Requires write access to access_tokens. */ put: { parameters: { query?: never; header?: never; path: { /** * @description The token's `id`. Anything that is not a UUID does not match the route and returns 404. * @example 546c65d6-e589-4d3c-b1fe-7e61711cc418 */ access_token_id: components["parameters"]["AccessTokenId"]; }; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["UpdateAccessTokenRequest"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["AccessTokenMetadata"]; }; }; /** * @description This error is raised when: * - The request cannot be parsed * - `name` is empty or longer than 256 characters * - `expires_at` is less than 1 day or more than 365 days away * - The body sets no fields at all */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; 401: components["responses"]["Unauthorized"]; /** @description No token with that id was found. The response has no body. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; post?: never; /** * Delete a System Access Token * @description Delete a System Access Token. The credential stops working immediately and cannot be recovered. * * Requires write access to access_tokens. */ delete: { parameters: { query?: never; header?: never; path: { /** * @description The token's `id`. Anything that is not a UUID does not match the route and returns 404. * @example 546c65d6-e589-4d3c-b1fe-7e61711cc418 */ access_token_id: components["parameters"]["AccessTokenId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description The token was deleted. The response has no body. */ 200: { headers: { [name: string]: unknown; }; content?: never; }; 401: components["responses"]["Unauthorized"]; /** @description No token with that id was found. The response has no body. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; options?: never; head?: never; patch?: never; trace?: never; }; "/agents/conversations": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * List the calling user's agent conversations * @description Returns a paginated list of conversations created by the bearer-token's user, newest * first (by `created_at`). * * ## Scope: per-user, not per-company * * Results are filtered by **both** `company_id` and `user_id` from the bearer token — * peers in the same company are **not** visible. A caller with no conversations gets * `records: []` with `total_records: 0`, not a 404. * * ## Pagination * * Uses the standard `page` / `per_page` query parameters. Default `per_page` is 50. * `page` must be 1 or more and `per_page` must be a positive integer. A value that isn't * returns a 404 with an empty body, because the route stops matching. * The response envelope carries `prev_page`, `current_page`, `next_page`, * `total_records`, `total_pages`, and the `records` array — same shape every other * paginated Narrative endpoint uses. * * ## Permission * * `agent_conversations` resource with `read` verb. * * ## Example * * ```bash * curl "$API/agents/conversations?page=1&per_page=20" \ * -H "Authorization: Bearer $TOKEN" * ``` */ get: operations["listAgentConversations"]; put?: never; /** * Create an agent conversation * @description Creates a new agent conversation with a pinned `system_prompt` and a `defaults` block * that every subsequent run inherits. The conversation starts at `version: 0` — your * first run's `expected_version` will be `0`. * * ## What this endpoint actually does * * 1. Validates the `defaults` block. Failures here (alias regex, duplicate aliases, * wire-name length, missing required fields) return 400 immediately — the * conversation row is **not** created on validation failure. * 2. Inserts a row in `agent_conversations` with `version = 0`, `company_id` from your * bearer token, and the validated `defaults` serialized as JSONB. * 3. Returns the persisted conversation echo. * * No workflows are started here. The conversation is a long-lived container; the * actual model execution happens later, in `POST /agents/conversations/{id}/runs`. * * ## What you cannot change later * * - **`system_prompt`** — pinned for the conversation's lifetime. If you need a * different system prompt, create a new conversation. * - **`company_id`** / **`user_id`** — derived from the bearer token at creation time; * not exposed in the request body. Both gate every subsequent read endpoint on this * conversation: peers in the same company **cannot** see each other's conversations, * runs, or messages. Cross-user access surfaces as 404 — the API does not * distinguish "doesn't exist" from "owned by another user". * * Everything else in `defaults` (model, max_iterations, tools, etc.) is just a default * — any individual run can override any of those fields via `config_override` on its * `POST .../runs` body. See [Agent Conversations * Reference](https://docs.narrative.io/reference/architecture/agent-conversations#run) * for the override semantics. * * ## Permission * * `agent_conversations` resource with `write` verb. The same permission gates * `POST .../runs`; `read` is required for the GET endpoints. * * ## Example: minimal "hello world" conversation (no tools) * * ```json * { * "name": "hello world", * "system_prompt": "You are a helpful assistant. Answer concisely.", * "defaults": { * "model": "anthropic.claude-opus-4.6", * "data_plane_id": "f79cbdae-4848-47ca-95e8-69588364d185", * "execution_cluster": "shared", * "max_iterations": 10, * "max_tokens": 1024, * "temperature": 0.0, * "output_format_schema": { * "type": "object", * "additionalProperties": false, * "required": ["text"], * "properties": { "text": { "type": "string" } } * } * } * } * ``` * * ## Example: conversation that can search the Narrative docs * * The `mcp_servers` entry registers two tools the model can call server-side. The * platform handles the JSON-RPC calls to `https://docs.narrative.io/mcp` transparently. * * ```json * { * "name": "docs search", * "system_prompt": "Use the available tools to look things up before answering.", * "defaults": { * "model": "anthropic.claude-opus-4.6", * "data_plane_id": "f79cbdae-4848-47ca-95e8-69588364d185", * "execution_cluster": "shared", * "max_iterations": 8, * "max_tokens": 2048, * "temperature": 0.0, * "output_format_schema": { * "type": "object", * "additionalProperties": false, * "required": ["text"], * "properties": { "text": { "type": "string" } } * }, * "mcp_servers": [{ * "alias": "docs", * "url": "https://docs.narrative.io/mcp", * "description": "Narrative docs MCP server" * }] * } * } * ``` * * ## Example: conversation using an external OAuth-connected MCP server * * For an external server that requires user authorization, connect it **first** via `POST * /mcp-connections` (the user consents in a browser; the connection becomes `connected`). * Then reference the returned `connection_id` in the `mcp_servers` entry — the platform * attaches and refreshes that connection's bearer token server-side on every tool call. The * token never appears in the payload or run history. `alias` and `url` are still required; * the `url` should match the server you connected. * * ```json * { * "name": "hugging face tools", * "system_prompt": "Use the available tools to look things up before answering.", * "defaults": { * "model": "anthropic.claude-opus-4.6", * "data_plane_id": "f79cbdae-4848-47ca-95e8-69588364d185", * "execution_cluster": "shared", * "max_iterations": 8, * "max_tokens": 2048, * "temperature": 0.0, * "output_format_schema": { * "type": "object", * "additionalProperties": false, * "required": ["text"], * "properties": { "text": { "type": "string" } } * }, * "mcp_servers": [{ * "alias": "hf", * "url": "https://huggingface.co/mcp", * "description": "Hugging Face MCP server (external, OAuth)", * "connection_id": "b3f1c2a4-5d6e-47f8-9a0b-1c2d3e4f5a6b" * }] * } * } * ``` * * ## Example: conversation with a caller-declared tool (human in the loop) * * Caller-declared `tools[]` entries cause the model's call to **pause** the run with * `status: requires_action`. The caller answers by posting a follow-up run with * `payload.kind: tool_outputs`. These tools have no alias — the model sees the bare * `name`, and the platform routes any dash-free tool call to caller-declared resolution. * * ```json * { * "name": "booking flow", * "system_prompt": "You are a booking assistant.", * "defaults": { * "model": "anthropic.claude-opus-4.6", * "data_plane_id": "f79cbdae-4848-47ca-95e8-69588364d185", * "execution_cluster": "shared", * "max_iterations": 5, * "output_format_schema": { * "type": "object", * "additionalProperties": false, * "required": ["text"], * "properties": { "text": { "type": "string" } } * }, * "tools": [{ * "name": "confirm_booking", * "description": "Ask the user to confirm a proposed booking slot.", * "input_schema": { * "type": "object", * "additionalProperties": false, * "required": ["proposed_slot"], * "properties": { "proposed_slot": { "type": "string" } } * } * }] * } * } * ``` * * ## Common 400 errors * * | `type` URL slug | Cause | * |---|---| * | `/errors/invalid-tool-alias` | MCP alias doesn't match `^[a-zA-Z][a-zA-Z0-9]{0,7}$` | * | `/errors/duplicate-tool-alias` | Same alias appears twice across `mcp_servers` | * | `/errors/invalid-caller-tool-name` | Caller-declared `tools[].name` is empty, contains a dash, or exceeds 64 chars | * | `/errors/duplicate-caller-tool-name` | Same `tools[].name` appears twice | * | `/errors/tool-name-too-long` | Some MCP wire name `{alias}-{tool_name}` > 64 chars | * | `/errors/invalid-mcp-server-url` | An `mcp_servers[].url` is not a public https URL | * | `/errors/reserved-tool-name` | A `tools[].name` takes the name of a platform tool | * | `/errors/unknown-model` | `thinking` is set and `model` is not a model the platform offers | * | `/errors/thinking-not-supported` | `thinking` is set for a model that is not offered thinking | * | `/errors/thinking-setting-not-accepted` | The model does not take this `thinking` setting | * | `/errors/thinking-budget-too-large` | `thinking.budget_tokens` is not smaller than `max_tokens` | * * A body that isn't valid JSON, or doesn't decode (a missing `defaults` field, an unknown * `execution_cluster`), gets a 400 with an `{error, error_description}` body instead. * * See [Agent Conversations error * catalog](https://docs.narrative.io/reference/architecture/agent-conversations/errors/conversation-not-found) * for the full list. */ post: operations["createAgentConversation"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/agents/conversations/{id}": { parameters: { query?: never; header?: never; path: { /** @description The conversation's UUID. */ id: components["schemas"]["ConversationId"]; }; cookie?: never; }; /** * Get an agent conversation * @description Fetches the conversation's metadata plus its current `version`. Use the `version` * immediately before posting a run as `expected_version` — that's how the platform's * compare-and-swap guard knows whether the conversation has advanced since you last * looked. * * ## When to call this * * - Before starting a new run: read `version`, post it as `expected_version`. If you * cache the value across long delays you'll hit * [Version Conflict](https://docs.narrative.io/reference/architecture/agent-conversations/errors/version-conflict) * more often. * - When resuming a `requires_action` run: the conversation's version has advanced * because the assistant turn was persisted on the run row's finalize. Re-read it * before posting `tool_outputs`. * - To inspect a conversation's `defaults` if you've forgotten what was pinned. * * ## What you cannot do here * * There is no `PATCH` / `PUT` for conversations. The `system_prompt` and `defaults` are * immutable at the conversation level. To change behavior, override per-run via * `config_override`, or create a new conversation. * * ## Scope: per-user, not per-company * * Conversations are scoped to the **`(company_id, user_id)`** pair that created them. * Peers in the same company cannot see each other's conversations — the endpoint * returns 404 for "does not exist", "belongs to a different company", and "belongs to * a different user in the same company" alike. This is deliberate: distinguishing them * would leak existence. * * ## Permission * * `agent_conversations` resource with `read` verb. */ get: operations["getAgentConversation"]; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/agents/conversations/{id}/messages": { parameters: { query?: { /** * @description Return messages with `sequence_no > since`. Use the previous response's * `current_version` as the next request's `since` for gap-free incremental reads. * * Default `0` returns the entire conversation from the beginning. A negative or * non-integer value returns a 404 with an empty body, because the route stops matching. */ since?: number; }; header?: never; path: { /** @description The conversation's UUID. */ id: components["schemas"]["ConversationId"]; }; cookie?: never; }; /** * List conversation messages (delta read by version cursor) * @description Returns the messages in this conversation with `sequence_no > since`, plus the * conversation's `current_version` at the moment the response was generated. The * `messages` list is ordered by `sequence_no` ascending and is gap-free — if the * response contains messages with `sequence_no` 3, 4, 5, you have all three. * * ## Polling pattern * * ```text * since = 0 * loop forever: * r = GET /agents/conversations/{id}/messages?since={since} * process r.messages # may be empty * since = r.current_version # use the head, not r.messages.last.sequence_no * wait briefly * ``` * * `current_version` is the conversation's head at the moment the response was generated * — using it as the next request's `since` is the only way to ensure gap-free reads * even when new messages land between the time the response was generated and the time * your client processed it. * * ## When messages get added * * Messages are persisted in a single transaction by the workflow's finalize step (when * a run reaches a terminal state). You won't see partial reads — a run that produces 4 * messages either lands all 4 or none. * * A run's `id` appears in `messages[].run_id`, so you can correlate messages to the * runs that produced them. * * ## What's in `content_blocks` * * Five variants, discriminated by `type`: * * - `text` — plain text. The dominant variant. * - `tool_use` — the model requesting a tool call. Carries `tool_use_id`, the aliased * `name`, and the model's `arguments`. * - `tool_result` — the result of a tool call. Its `content` holds nested content blocks, * and it carries the original `tool_use_id` plus an `is_error` flag. * - `reasoning` / `redacted_reasoning` — the model's working, on a turn that asked for * thinking. * * Blocks the platform produced also carry an `id`. On an assistant turn with an answer, * `final_answer_from` names the blocks the answer came from; render those as the reply. * * The same `tool_use_id` appears on the assistant's `tool_use` block and on the * subsequent `tool` (or `user`, for resume payloads) turn's `tool_result` block — * that's how a UI matches them up. * * ## Permission * * `agent_conversations` resource with `read` verb. * * ## Example: paging from scratch * * ```bash * curl "$API/agents/conversations/{id}/messages?since=0" \ * -H "Authorization: Bearer $TOKEN" * # → { "current_version": 4, "messages": [ <4 entries> ] } * ``` * * Then later: * * ```bash * curl "$API/agents/conversations/{id}/messages?since=4" \ * -H "Authorization: Bearer $TOKEN" * # → { "current_version": 4, "messages": [] } # nothing new * ``` */ get: operations["listAgentConversationMessages"]; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/agents/conversations/{id}/runs": { parameters: { query?: never; header?: never; path: { /** @description The conversation's UUID. */ id: components["schemas"]["ConversationId"]; }; cookie?: never; }; get?: never; put?: never; /** * Start a new run on the conversation * @description Inserts a row in `agent_runs`, kicks off the workflow that drives the agent loop, and * returns immediately. The response has `status: "pending"` — poll * `GET /agents/runs/{id}` to track progress. * * Runs are **asynchronous**. This endpoint does not wait for the model to reply. * Typical end-to-end latency is 3–10 seconds for a single-iteration run, longer for * multi-iteration tool-use loops (60–120 seconds is common for 6–8 iterations against * an MCP server). * * ## Required fields * * - **`client_op_id`** — UUID you generate. Used as the idempotency key, scoped to * `(company_id, user_id, client_op_id)`. Re-sending the same value returns the * original run row unchanged, whichever conversation that run is on. Always generate * a fresh UUID for a fresh logical request; reusing one is only safe if the second * call is a retry of the first. * - **`expected_version`** — the conversation's current version, read from * `GET /agents/conversations/{id}` just before this call. If it doesn't match at * run-creation time, you get a 409 * [Version Conflict](https://docs.narrative.io/reference/architecture/agent-conversations/errors/version-conflict). * Recovery: refetch the conversation, re-read `version`, retry the run with the * fresh value. * - **`payload`** — `kind: "user_message"` to start a fresh user turn, or * `kind: "tool_outputs"` to resume a previously-paused (`requires_action`) run. * * ## Optional fields * * - **`tool_choice`** — bias the model toward (or away from) using tools on iteration 1 * **of this run**. Three values: `auto`, `any`, `specific_tool` (see schema). Applies * only to iteration 1 of this run; iteration 2+ are back on `auto`. To re-force a * specific tool on the next run, set `tool_choice` again on its request body. * - **`config_override`** — sparse override of the conversation's `defaults`. Any field * you set replaces the conversation-level value for this single run. The two list * fields (`mcp_servers`, `tools`) are **wholesale-replaced**, not merged. The * `system_prompt` cannot be overridden. * * ## Run lifecycle (state diagram) * * ```text * pending → running → completed ← model produced a final answer * ↘ requires_action ← model called a caller-declared tool * ↘ failed ← non-recoverable error * ``` * * You stop polling on any of the three terminal states. For `requires_action`, the run * can be **resumed** by posting a new run on the same conversation with * `payload.kind: "tool_outputs"`. For `completed` and `failed`, the run is done. * * ## One active run per conversation * * A conversation runs one turn at a time. While a run is `pending` or `running`, posting * another run on the same conversation returns a 409 * [Run Already In Progress](https://docs.narrative.io/reference/architecture/agent-conversations/errors/run-in-progress). * The `detail` names the active run's id — and, when the run has produced a live turn, * what it is currently doing (for example waiting on a Narrative job). * * Recovery: poll `GET /agents/runs/{active_run_id}` until it reaches a terminal state, * re-read the conversation's `version`, then post your run. A run parked on a long job * can stay non-terminal for a while; `live.messages` on the run response shows what it is * waiting for. * * The three terminal states do **not** block a new run — in particular a * `requires_action` run is done, so the run that resumes it with `tool_outputs` is * accepted as normal. * * Re-posting a `client_op_id` that already has a run **on this conversation** is not * refused: you get that run back, even while a different run is active. The bypass is * per-conversation, while idempotency itself is per-owner — so a `client_op_id` whose * run lives on *another* conversation does not bypass this check, and you get the 409 * while a run here is active. Let the active run finish and re-post; you will then get * the original run back as usual. * * ## Examples * * ### Example 1 — fresh user message, no tools * * ```json * { * "client_op_id": "696b022c-e86d-4b3e-b6d7-ceb7eb1a495e", * "expected_version": 0, * "payload": { "kind": "user_message", "text": "What is 2 + 2?" } * } * ``` * * Returns: * * ```json * { * "id": "82eb9cb7-619e-46bb-ac1c-8a32b0112c1c", * "status": "pending", * "started_at": "2026-05-18T13:21:30.355180Z", * "submitted_inference_job_ids": [], * "pending_tool_calls": [], * "effective_config": { ... }, * ... * } * ``` * * Then poll `GET /agents/runs/{id}` until `status: completed`. Final * `final_text: "4"`. * * ### Example 2 — force a specific tool, override max_iterations * * ```json * { * "client_op_id": "c8aef867-eca6-46f7-8a99-e22dd0ee6062", * "expected_version": 0, * "payload": { "kind": "user_message", "text": "Find me a meeting time for tomorrow afternoon." }, * "tool_choice": { "kind": "specific_tool", "name": "confirm_booking" }, * "config_override": { "max_iterations": 10 } * } * ``` * * The model is forced to call `confirm_booking` on iteration 1. Since `confirm_booking` * is a caller-declared tool (dash-free name, listed in `tools[]`), the run terminates * with `status: requires_action` after one iteration; `pending_tool_calls` contains the * model's proposed arguments. * * To pin an MCP-resolved tool instead, include the `mcp_alias` field: * * ```json * "tool_choice": { "kind": "specific_tool", "mcp_alias": "docs", "name": "search_kb" } * ``` * * ### Example 3 — resume a paused run * * First, refetch the conversation to get the new version (it has advanced because the * paused run's assistant turn was persisted): * * ```bash * curl "$API/agents/conversations/{id}" -H "Authorization: Bearer $TOKEN" * # → { "version": 2, ... } * ``` * * Then post the resume: * * ```json * { * "client_op_id": "7fb6795c-60a2-4cf9-a0db-0cc645279704", * "expected_version": 2, * "payload": { * "kind": "tool_outputs", * "outputs": [{ * "tool_use_id": "tooluse_DWXPKZ50JDGib5GmShyUgJ", * "content": "User confirmed the proposed slot.", * "is_error": false * }] * } * } * ``` * * The model sees the tool result and continues; this run usually terminates * `completed` after one iteration with a contextual final answer. * * ## Idempotency * * Re-sending the same body with the same `client_op_id` returns the original * `agent_runs` row, with a 202 like the first call. Idempotency is on * `(company_id, user_id, client_op_id)`: * * - **Same `client_op_id`, same conversation** → same run row returned, no new * workflow started. * - **Same `client_op_id`, different conversation** → the original run is returned * again, and no run is created on the conversation you posted to. The response * body's `conversation_id` is the one the original run belongs to, so check it if * you reuse ids. * * The conversation checks run first, so a retry only gets the original run back while * `expected_version` still matches. Once that run finishes and its messages land, the * conversation's version moves on and the same retry gets a 409 Version Conflict. Read the * original run with `GET /agents/runs/{id}` instead. * * Use a fresh UUID per logical request, never per retry of an in-flight request. * * ## Common error responses * * | Status | `type` slug | Cause | Recovery | * |---|---|---|---| * | 400 | `/invalid-tool-alias` | `config_override.mcp_servers[]` has a bad alias | Fix the alias | * | 400 | `/tool-name-too-long` | `config_override` introduced a wire name > 64 chars | Shorten alias or tool name | * | 400 | `/unknown-tool-use-id` | `tool_outputs` references an id not on the latest assistant turn | Refetch the prior run's `pending_tool_calls` | * | 400 | `/not-a-client-tool-call` | `tool_outputs` references a server-resolved call | Filter to client-side ids only | * | 400 | `/incomplete-tool-outputs` | Missing or extra `outputs[]` entries | Match the pending set exactly | * | 400 | `/no-assistant-turn` | `tool_outputs` payload on a conversation with no assistant turn yet | Use `user_message` payload instead | * | 400 | `/unknown-tool-choice-name` | `tool_choice.name` is not a declared tool | Fix the name | * | 400 | `/unknown-tool-choice-mcp-alias` | `tool_choice.mcp_alias` is not one of the run's MCP servers | Fix the alias | * | 400 | `/thinking-with-forced-tool-choice` | `specific_tool` or `any` combined with `thinking` | Drop one of them | * | 400 | `/forced-tool-choice-not-supported` | The model can't be forced to call a tool | Use `auto`, or another model | * | 403 | none (`type` is null) | The company is over its credit limit, or has no credit account | Contact your account manager | * | 404 | `/conversation-not-found` | The conversation was not found | Verify the id | * | 409 | `/version-conflict` | `expected_version` mismatch | Refetch the conversation, retry | * | 409 | `/run-in-progress` | Another run on this conversation is `pending` or `running` | Poll the active run named in `detail` until terminal, then retry | * | 500 | `/workflow-start-failed` | Platform couldn't reach the workflow engine | Retry with the same `client_op_id` | * * ## Permission * * `agent_conversations` resource with `write` verb. */ post: operations["createAgentRun"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/agents/conversations/{id}/waitables/{handle}/cancel": { parameters: { query?: never; header?: never; path: { /** @description The conversation's UUID. */ id: components["schemas"]["ConversationId"]; /** * @description The handle to stop waiting on, exactly as `job_monitor` returned it. Opaque — do not * parse or construct one. The pattern is the alphabet handles are drawn from, not their * format: a segment outside it does not match this route and returns 404, the same answer * an unusable handle gets. */ handle: string; }; cookie?: never; }; get?: never; put?: never; /** * Stop waiting on a handle * @description Drops the conversation's claim on a handle. A run parked on that handle wakes, is told the * handle is no longer being waited on, and carries on — it reports back, asks a question, or * does something else. The run finishes normally, so the conversation is free to take its * next turn immediately. * * ## What this does not do * * **It does not cancel the work.** The job behind the handle keeps running exactly as before, * the same way a wait timing out leaves its job alone. Stop the job through its own API if * that is what you want. * * **It does not cancel the run.** The turn completes on its own terms, with the abandoned * wait recorded in the conversation — nothing is discarded. * * The model is told the handle reads `stopped_waiting`, which says what happened to the wait * and claims nothing about the task. * * ## When there is nothing to wake * * The claim is dropped whether or not a run is currently parked on it, and the response says * when. If the run had already moved on, or the wait had already finished, there is simply * nothing to interrupt — and a later `wait_for` on that handle reads the dropped claim rather * than waiting again. * * Idempotent: cancelling the same handle twice returns the same `cancelled_at`. * * ## Permission * * `agent_conversations` resource with `write` verb. */ post: operations["cancelAgentWaitable"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/agents/runs/{id}": { parameters: { query?: never; header?: never; path: { /** @description The run's UUID. */ id: components["schemas"]["RunId"]; }; cookie?: never; }; /** * Get a run's current state * @description Returns the run's current state — status, iterations used so far, token usage, * submitted inference job IDs, the model's final answer (if completed), pending tool * calls (if requires_action), or the error (if failed). * * ## Polling * * Runs are asynchronous. After `POST /agents/conversations/{id}/runs` you poll this * endpoint until you see a terminal status (`completed`, `requires_action`, or * `failed`). A reasonable polling cadence: * * - Start with 2-second polls — most simple runs complete in a single iteration * (5–15 seconds wall-clock). * - Back off to 4–8 seconds for longer-running runs (multi-iteration tool loops). * - Hard-cap at maybe 5 minutes — if a run hasn't terminated by then either something * is wrong (check `submitted_inference_job_ids` in the data plane's `jobs` table) or * the workflow timed out and will land `failed` shortly. * * ## Which fields are populated when * * | `status` | Populated fields | * |---|---| * | `pending` | `id`, `conversation_id`, `client_op_id`, `effective_config`, `started_at` | * | `running` | above + `submitted_inference_job_ids` (one per iteration completed) | * | `completed` | above + `iterations_used`, `usage`, exactly one of `final_text` / `final_structured_output`, `completed_at` | * | `requires_action` | above + `iterations_used`, `usage`, `pending_tool_calls`, `completed_at` | * | `failed` | above + `error`, possibly partial `iterations_used`/`usage`, `completed_at` | * * `effective_config` is **always** populated — it's the fully-merged config used for * this run (conversation defaults + this run's `config_override`). Helpful for * confirming the model saw what you expected. * * ## Run vs. inference iteration * * Each run runs N iterations, where N ≤ `effective_config.max_iterations`. Each * iteration is one inference job submitted to the data plane (one Bedrock or Cortex * API call). `submitted_inference_job_ids` carries the platform's `jobs.id` for each * iteration — use those to drill into the raw model request/response in the data * plane's logs / job table. * * `iterations_used` and `submitted_inference_job_ids.length` match for any terminal * state. * * ## Error structure * * On `status: "failed"` the `error` field carries: * * - `type` — opaque incident code (e.g. `AgentLoopMaxIterationsExceeded`, * `AgentLoopInvalidEffectiveConfig`, `UnknownTool`). Stable across versions, used * for log correlation. * - `message` — human-readable detail. * - `title` and `docs_url` — caller-facing presentation looked up from the platform's * [error catalog](https://docs.narrative.io/reference/architecture/agent-conversations/errors/unexpected). * A `type` the catalog doesn't list (usually because the workflow workers were upgraded * ahead of the API) gets the generic `Unexpected Error` title and docs page; rely on * `type` and `message` in that case. * * Note: this endpoint always returns 200 for a known run — even one with `status: * "failed"`. The HTTP-level error path (RFC 7807) only applies when the call itself * fails (token invalid, run not found, etc.). * * ## Scope: per-user, not per-company * * Runs are scoped to the **`(company_id, user_id)`** pair that created them. Returns * 404 for "run does not exist", "run belongs to a different company", and "run was * created by a different user in the same company" alike — the API does not * distinguish them to avoid leaking existence. * * ## Permission * * `agent_conversations` resource with `read` verb. * * ## Example: completed run * * ```json * { * "id": "82eb9cb7-619e-46bb-ac1c-8a32b0112c1c", * "conversation_id": "bc2505b7-068d-44ed-8055-a6f6ffe54ab1", * "company_id": 1, * "user_id": 407, * "client_op_id": "696b022c-e86d-4b3e-b6d7-ceb7eb1a495e", * "status": "completed", * "tool_choice": null, * "effective_config": { "...": "..." }, * "iterations_used": 1, * "usage": { "prompt_tokens": 169, "completion_tokens": 8, "total_tokens": 177 }, * "submitted_inference_job_ids": ["e94c6eab-019f-4e96-bb47-049fa60e7988"], * "pending_tool_calls": [], * "final_text": "4", * "final_structured_output": null, * "error": null, * "started_at": "2026-05-18T13:21:30.355180Z", * "completed_at": "2026-05-18T13:21:51.983952Z", * "live": { "current_name": "Simple arithmetic", "messages": [] } * } * ``` * * ## Example: completed structured-output run * * ```json * { * "id": "8dda70ab-9f81-4613-a3c9-68b3b584e82d", * "status": "completed", * "iterations_used": 1, * "final_text": null, * "final_structured_output": { * "event": { * "type": "login", * "user_id": "u-123", * "session_duration_seconds": 1800 * } * }, * ... * } * ``` * * ## Example: requires_action run * * ```json * { * "id": "19082f49-0280-4e32-a8b4-7df8dea9dbed", * "status": "requires_action", * "iterations_used": 1, * "pending_tool_calls": [{ * "tool_use_id": "tooluse_DWXPKZ50JDGib5GmShyUgJ", * "name": "confirm_booking", * "arguments": { "proposed_slot": "tomorrow afternoon" } * }], * "final_text": null, * "final_structured_output": null, * ... * } * ``` * * Resume by posting a new run with `payload.kind: "tool_outputs"` carrying the same * `tool_use_id`. * * ## Example: failed run * * ```json * { * "id": "...", * "status": "failed", * "iterations_used": null, * "usage": null, * "final_text": null, * "final_structured_output": null, * "error": { * "type": "AgentLoopMaxIterationsExceeded", * "message": "max iterations exceeded after 5 iterations", * "title": "Max Iterations Exceeded", * "docs_url": "https://docs.narrative.io/reference/architecture/agent-conversations/errors/max-iterations-exceeded" * }, * ... * } * ``` */ get: operations["getAgentRun"]; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/app/commands/delivery": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Delivery Commands * @description Lists delivery commands this app has access to. */ get: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["PaginatedCommands"]; }; }; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/app/commands/delivery/{delivery_id}/files": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Delivery Files * @description Lists delivery files for a particular delivery command. */ get: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for an delivery record. */ delivery_id: components["parameters"]["DeliveryId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["DeliveryFiles"]; }; }; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/app/commands/delivery/{delivery_id}/download/{filename}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Download file * @description Generates a download url for a particular delivery file */ post: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for an delivery record. */ delivery_id: components["parameters"]["DeliveryId"]; /** @description Name of a delivery file. */ filename: components["parameters"]["FileName"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["PaginatedCommands"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/app-invites": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * List app invites * @description Returns all app invites for the authenticated company and app. * * Results are paginated using `page` (1-based, default `1`) and `per_page` * (default `100`) query parameters. Optionally filter results to a specific * installation using `installation_id`. */ get: { parameters: { query?: { /** @description Number of page. Stars from the first (1) page. */ page?: components["parameters"]["PageNumberQueryParam"]; /** @description Number of records to return. */ per_page?: components["parameters"]["PerPageQueryParam"]; /** * @description Filter results to invites belonging to a specific installation. * The installation must be owned by the authenticated caller (matching app and/or company). */ installation_id?: number; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description Successfully retrieved list of app invites. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["AppInvitesResponse"]; }; }; 401: components["responses"]["Unauthorized"]; }; }; put?: never; /** * Create an app invite * @description Creates a new app invite for a company. * * Requires an app client credentials token. The invite is created in `pending` status * and includes a generated invite code. */ post: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["CreateAppInviteRequest"]; }; }; responses: { /** @description Successfully created the app invite. */ 201: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["AppInviteResponse"]; }; }; /** * @description This error is raised when: * - The request body cannot be parsed * - The `base_url` is not a valid URI * - The `display_name` exceeds the maximum length (1024 characters) * - The `invitee_name` exceeds the maximum length (1024 characters) * - A `tags` entry is empty or exceeds the maximum length (128 characters) */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; 401: components["responses"]["Unauthorized"]; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/app-invites/{app_invite_id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get an app invite * @description Returns a specific app invite by its ID. */ get: { parameters: { query?: never; header?: never; path: { /** * @description Unique identifier for an app invite. * @example a1b2c3d4-e5f6-7890-abcd-ef1234567890 */ app_invite_id: components["parameters"]["AppInviteId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description Successfully retrieved the app invite. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["AppInviteResponse"]; }; }; 401: components["responses"]["Unauthorized"]; /** @description The app invite was not found. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; put?: never; post?: never; /** * Archive an app invite * @description Archives an app invite by its ID. * * This is a soft delete that sets the invite status to `archived`. */ delete: { parameters: { query?: never; header?: never; path: { /** * @description Unique identifier for an app invite. * @example a1b2c3d4-e5f6-7890-abcd-ef1234567890 */ app_invite_id: components["parameters"]["AppInviteId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description Successfully archived the app invite. */ 204: { headers: { [name: string]: unknown; }; content?: never; }; 401: components["responses"]["Unauthorized"]; /** @description The app invite was not found. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; options?: never; head?: never; patch?: never; trace?: never; }; "/app-invites/{app_invite_id}/activate": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Activate an app invite * @description Activates an app invite, changing its status from `pending` to `active`. * * Requires an app client credentials token. */ post: { parameters: { query?: never; header?: never; path: { /** * @description Unique identifier for an app invite. * @example a1b2c3d4-e5f6-7890-abcd-ef1234567890 */ app_invite_id: components["parameters"]["AppInviteId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description Successfully activated the app invite. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["AppInviteResponse"]; }; }; 401: components["responses"]["Unauthorized"]; /** @description The app invite was not found. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/app-invites/codes/{code}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get app invite by code * @description Returns a public view of an app invite by its invite code. * * This endpoint does not require authentication and returns a stripped-down response * that omits fields like timestamps and tags from the response. */ get: { parameters: { query?: never; header?: never; path: { /** * @description The invite code used to look up an app invite. * @example abc123def456ghi789jkl012 */ code: components["parameters"]["AppInviteCode"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description Successfully retrieved the app invite. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["AppInvitePublicResponse"]; }; }; /** * @description This error is raised when: * - No app invite exists with the given code */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/apps": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** Lists apps */ get: { parameters: { query?: { /** @description a filter for app categories */ category?: components["parameters"]["AppCategory"]; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": unknown; }; }; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/apps/events": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Publish app event * @description Create a new webhook subscription for the authenticated company. */ post: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["WebhookAppEventBulkRequest"]; }; }; responses: { /** @description Created */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["WebhookAppEventResponse"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/apps/installed/interfaces": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * List installed app interfaces * @description Lists the interfaces of every connector app installed by the caller's company. Each record carries the * `app_id` of the app that owns it. Interfaces are fetched live from each connector's server, so this call * can be slow or fail if a connector is unavailable. * * The optional `tags` query parameter restricts results to interfaces whose metadata tags intersect the * supplied set (case-insensitive, OR semantics). When omitted, every interface is returned. */ get: { parameters: { query?: { /** * @description Restrict results to interfaces whose metadata tags include at least one of the supplied values. * Repeat the parameter to pass multiple tags (e.g. `?tags=audience_delivery`). Matching is * case-insensitive. */ tags?: string[]; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["AppInterfacesResponse"]; }; }; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/apps/{app_id}/interfaces": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * List app interfaces * @description Lists a connector app's interfaces. The app must be installed by the caller's company. Interfaces are * fetched live from the connector's server, so this call can be slow or fail if the connector is * unavailable. * * Each interface carries the JSON Schema of its quick settings (`schema`), used as the `quick_settings` * object when configuring a connection to the interface, and its collaboration policy (`policy`), the * metaschema dataset schemas are validated against. Interface ids match those returned by * `GET /datasets/{dataset_id}/interfaces`. * * The optional `tags` query parameter restricts results to interfaces whose metadata tags intersect the * supplied set (case-insensitive, OR semantics). When omitted, every interface is returned. */ get: { parameters: { query?: { /** * @description Restrict results to interfaces whose metadata tags include at least one of the supplied values. * Repeat the parameter to pass multiple tags (e.g. `?tags=audience_delivery`). Matching is * case-insensitive. */ tags?: string[]; }; header?: never; path: { /** @description the app id */ app_id: components["parameters"]["ApplicationId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["AppInterfacesResponse"]; }; }; /** @description No installed app with this id was found. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/apps/{app_id}/interfaces/{interface_id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get an app interface * @description Returns one of a connector app's interfaces by id. The app must be installed by the caller's company. The * interface is fetched live from the connector's server. */ get: { parameters: { query?: never; header?: never; path: { /** @description the app id */ app_id: components["parameters"]["ApplicationId"]; /** @description Identifier of the interface, as returned by the interface listing endpoints. */ interface_id: string; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["AppInterface"]; }; }; /** @description No installed app with this id was found, or it has no interface with the supplied `interface_id`. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/apps/{app_slug}/profiles": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** Lists profiles */ get: { parameters: { query?: never; header?: never; path: { /** @description unique app name */ app_slug: components["parameters"]["AppSlug"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ProfilesResponse"]; }; }; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/apps/{app_slug}/manifest/profile-store-schema": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** Get Schema */ get: { parameters: { query?: never; header?: never; path: { /** @description unique app name */ app_slug: components["parameters"]["AppSlug"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["GetSchemasResponse"]; }; }; /** @description App or schema not found */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; /** * Put Schema * @description Submitting (create or update) JSON Schema (2019-09 version) for an app. */ put: { parameters: { query?: never; header?: never; path: { /** @description unique app name */ app_slug: components["parameters"]["AppSlug"]; }; cookie?: never; }; requestBody: { content: { "application/json": { [key: string]: unknown; }; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["PostSchemaResponse"]; }; }; }; }; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/apps/{app_slug}/manifest/profile-store-schema/{schema_version_id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** Get Schema */ get: { parameters: { query?: never; header?: never; path: { /** @description unique app name */ app_slug: components["parameters"]["AppSlug"]; /** @description schema version id */ schema_version_id: components["parameters"]["SchemaVersionId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["GetSchemaResponse"]; }; }; /** @description App or schema not found */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/apps/{app_slug}/profile-store/${profile_id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** Get Data instance */ get: { parameters: { query?: never; header?: never; path: { /** @description unique app name */ app_slug: components["parameters"]["AppSlug"]; /** @description the profile id */ profile_id: components["parameters"]["AppProfileIdParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["GetDataResponse"]; }; }; /** @description App, schema or profile not found */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; /** * Post Data instance * @description Submitting (create or update) data for a profile. */ put: { parameters: { query?: never; header?: never; path: { /** @description unique app name */ app_slug: components["parameters"]["AppSlug"]; /** @description the profile id */ profile_id: components["parameters"]["AppProfileIdParam"]; }; cookie?: never; }; requestBody: { content: { "application/json": { [key: string]: unknown; }; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["PutDataResponse"]; }; }; /** @description App, schema or profile not found */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/admin/apps/{app_id}/slug": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; /** * Update a slug * @description Slug can be changed (from NULL) just once. */ put: { parameters: { query?: never; header?: never; path: { /** @description the app id */ app_id: components["parameters"]["ApplicationId"]; }; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["UpdateSlugRequest"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["UpdateSlugResponse"]; }; }; }; }; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/attributes": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get attributes * @description Return all attributes. * * Authentication is optional. Anonymous callers get the shared view of every attribute. With a valid * bearer token, attributes owned by the caller's company are returned as `AttributeOwnedResponse` and * everything else as `AttributeSharedResponse`. A token that is present but invalid is rejected * rather than falling back to the anonymous view. * * When neither `page` nor `per_page` is supplied, every record is returned in a single page. */ get: { parameters: { query?: { /** @description Number of page. Stars from the first (1) page. */ page?: components["parameters"]["PageNumberQueryParam"]; /** @description Number of records to return. */ per_page?: components["parameters"]["PerPageQueryParam"]; /** * @description When `true` (the default), `$ref` type references are resolved and the referenced attribute's type * definition is returned in their place. When `false`, the raw `$ref` node is returned as stored. */ resolve?: components["parameters"]["Resolve"]; /** @description Free-text search term. When provided, attributes are ranked by their relevance to the search term. */ q?: components["parameters"]["AttributeKeywordQueryParam"]; /** * @description Optional minimum relevance score, in the half-open interval `(0, 1]`. By default no threshold is * applied and all matches are returned, ranked by relevance. Supply `min_score` to restrict the * results to attributes scoring at or above the given value; below-threshold attributes are then * excluded from both the results and the `total` count. Can only be supplied together with `q`; * supplying it without `q` returns 400. */ min_score?: components["parameters"]["MinScore"]; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["AttributesResponse"]; }; }; /** @description `min_score` was supplied without `q` or falls outside `(0, 1]`. */ 400: { headers: { [name: string]: unknown; }; content?: never; }; /** @description The bearer token is expired or does not grant read access to attributes. */ 401: { headers: { [name: string]: unknown; }; content?: never; }; /** @description The bearer token could not be parsed or resolved. */ 403: { headers: { [name: string]: unknown; }; content?: never; }; }; }; put?: never; /** * Create an attribute * @description Create a new attribute. */ post: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["AttributeCreateRequest"]; }; }; responses: { /** @description Created */ 201: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["AttributeOwnedResponse"]; }; }; /** @description The request body is malformed or the attribute definition fails validation. */ 400: { headers: { [name: string]: unknown; }; content?: never; }; /** @description The bearer token is expired or does not grant write access to attributes. */ 401: { headers: { [name: string]: unknown; }; content?: never; }; /** * @description No bearer token was sent, the token could not be resolved, or `collaborators` uses a * permission type the company is not allowed to grant. */ 403: { headers: { [name: string]: unknown; }; content?: never; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/attributes/{attribute_name_or_id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get an attribute * @description Authentication is optional. Anonymous callers get the shared view. With a valid bearer token, an * attribute owned by the caller's company is returned as `AttributeOwnedResponse`. A token that is * present but invalid is rejected rather than falling back to the anonymous view. */ get: { parameters: { query?: { /** * @description When `true` (the default), `$ref` type references are resolved and the referenced attribute's type * definition is returned in their place. When `false`, the raw `$ref` node is returned as stored. */ resolve?: components["parameters"]["Resolve"]; }; header?: never; path: { /** @description Either an attribute name or an attribute id */ attribute_name_or_id: components["parameters"]["AttributeNameOrId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["AttributeResponseWithMetadata"]; }; }; /** @description The bearer token is expired or does not grant read access to attributes. */ 401: { headers: { [name: string]: unknown; }; content?: never; }; /** @description The bearer token could not be parsed or resolved. */ 403: { headers: { [name: string]: unknown; }; content?: never; }; /** @description No attribute with the given name or id was found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; /** * Update an attribute * @description Update an attribute. Only the company that owns an attribute may update it. */ put: { parameters: { query?: never; header?: never; path: { /** @description Either an attribute name or an attribute id */ attribute_name_or_id: components["parameters"]["AttributeNameOrId"]; }; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["UpdateAttributeRequest"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["AttributeOwnedResponse"]; }; }; /** @description The request body is malformed or the update fails validation. */ 400: { headers: { [name: string]: unknown; }; content?: never; }; /** @description The bearer token is expired or does not grant write access to attributes. */ 401: { headers: { [name: string]: unknown; }; content?: never; }; /** * @description No bearer token was sent, the token could not be resolved, the caller does not own the * attribute, or `collaborators` uses a permission type the company is not allowed to grant. */ 403: { headers: { [name: string]: unknown; }; content?: never; }; /** @description No attribute with the given name or id was found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; post?: never; /** * Delete an attribute * @description Permanently removes an attribute from the platform. * * Attribute deletion will fail if the given attribute is referenced by another attribute. * * Attribute deletions cannot be undone. */ delete: { parameters: { query?: never; header?: never; path: { /** @description Either an attribute name or an attribute id */ attribute_name_or_id: components["parameters"]["AttributeNameOrId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content?: never; }; /** @description The attribute backs Narrative subscription metadata and cannot be deleted. */ 400: { headers: { [name: string]: unknown; }; content?: never; }; /** @description The bearer token is expired or does not grant write access to attributes. */ 401: { headers: { [name: string]: unknown; }; content?: never; }; /** * @description No bearer token was sent, the token could not be resolved, or the caller does not own the * attribute. */ 403: { headers: { [name: string]: unknown; }; content?: never; }; /** @description No attribute with the given name or id was found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; /** @description The attribute is referenced by another attribute and cannot be deleted. */ 409: { headers: { [name: string]: unknown; }; content?: never; }; }; }; options?: never; head?: never; patch?: never; trace?: never; }; "/attributes/{attribute_name_or_id}/references": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get attribute references. * @description Return the attributes whose type definitions reference the given attribute. * * Authentication is optional. Anonymous callers get the shared view of each referencing attribute; * with a valid bearer token, attributes owned by the caller's company are returned as * `AttributeOwnedResponse`. A token that is present but invalid is rejected rather than falling back * to the anonymous view. */ get: { parameters: { query?: never; header?: never; path: { /** @description Either an attribute name or an attribute id */ attribute_name_or_id: components["parameters"]["AttributeNameOrId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["AttributeReferencesResponse"]; }; }; /** @description The bearer token is expired or does not grant read access to attributes. */ 401: { headers: { [name: string]: unknown; }; content?: never; }; /** @description The bearer token could not be parsed or resolved. */ 403: { headers: { [name: string]: unknown; }; content?: never; }; /** @description No attribute with the given name or id was found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/attributes/{attribute_name_or_id}/derivation-graph": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get the derivation graph around an attribute. * @description Return the part of the derivation graph reachable from the given attribute: the attributes it can be derived * from, the attributes that can be derived from it, the rules connecting them, and the routes out of the * attribute with their total cost and fidelity. Only active rules the caller may use are followed, and an * attribute the caller cannot view is left out along with the rules touching it. * * Authentication is optional. Anonymous callers see rules shared with every company and attributes shared with * every company. A token that is present but invalid is rejected rather than falling back to the anonymous view. */ get: { parameters: { query?: { /** * @description Which way to walk from the attribute. `descendants` follows rules from source to target and reaches what can * be derived from the attribute; `ancestors` follows them from target to source and reaches what the attribute * can be derived from. The default walks both ways. */ direction?: components["parameters"]["DerivationDirection"]; }; header?: never; path: { /** @description Either an attribute name or an attribute id */ attribute_name_or_id: components["parameters"]["AttributeNameOrId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["AttributeDerivationGraphResponse"]; }; }; /** @description `direction` is not one of `descendants`, `ancestors`, `both`. */ 400: { headers: { [name: string]: unknown; }; content?: never; }; /** @description The bearer token is expired or does not grant read access to attributes. */ 401: { headers: { [name: string]: unknown; }; content?: never; }; /** @description The bearer token could not be parsed or resolved. */ 403: { headers: { [name: string]: unknown; }; content?: never; }; /** @description No attribute with the given name or id was found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/oauth/token": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Request or refresh an OAuth token * @description # /oauth/token * # * Requests or refreshes the OAuth Token. */ post: operations["RefreshOAuthToken"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/authentication/b2b/login": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Authenticate a user based on a Stytch session token (B2B version) * @description Authenticate the user based on the Stytch session token, and return the user information, and API Access Token. */ post: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["LoginRequest"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["LoginResponse"]; }; }; /** @description This error is raised when the JSON is malformed or can't be decoded into a valid 'LoginRequest'. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** * @description This error is raised when: * - The stytch token cannot be authenticated */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/authentication/b2b/register": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Register a user based on a Stytch session token (B2B) * @description Register the user based on the Stytch session token and name/company name, and return the the created user id. * The Stych session token can be obtained from a Magic Links or OAuth token thanks to the registration status API. */ post: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["B2bRegisterRequest"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["RegisterResponse"]; }; }; /** @description This error is raised when the JSON is malformed or can't be decoded into a valid 'RegisterRequest'. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** * @description This error is raised when: * - The stytch token cannot be authenticated * - An active user matching the Stytch email cannot be found */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/authentication/b2b/registration-status": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Report whether the user associatd to a Stytch OAuth or Magic Links token has been fully registered on Narrative side (B2B) * @description Report whether the user associatd to a Stytch OAuth or Magic Links token has been fully registered on Narrative side. * Provides a Stytch session token that can be used to access the login and register APIs. */ post: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["B2bRegistrationStatusRequest"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["RegistrationStatusResponse"]; }; }; /** @description This error is raised when the JSON is malformed or can't be decoded into a valid 'RegistrationStatusRequest'. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** * @description This error is raised when: * - The stytch token cannot be authenticated */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/authentication/exchange-token": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Exchange a user token for a token scoped to a different company * @description Exchange the current user access token for a new token scoped to the specified company. * The user can only exchange their token to be scoped to another company to which they belong. */ post: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["ExchangeTokenRequest"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["LoginResponse"]; }; }; /** * @description This error is raised when: * - The token is not a user access token * - The user is not a member of the requested company or the company does not exist */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/authentication/login": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Authenticate a user based on a Stytch session token * @description Authenticate the user based on the Stytch session token, and return the user information, and API Access Token. * The Stych session token can be obtained from a Magic Links or OAuth token thanks to the registration status API. */ post: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["LoginRequest"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["LoginResponse"]; }; }; /** @description This error is raised when the JSON is malformed or can't be decoded into a valid 'LoginRequest'. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** * @description This error is raised when: * - The stytch token cannot be authenticated */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** * @description This error is raised when: * - The stytch email has not been validated or has not been provided by the OAuth provider */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** * @description This error is raised when: * - An active user with the same email already exists * - An inactive user with the same email already exists */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/authentication/register": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Register a user based on a Stytch session token * @description Register the user based on the Stytch session token and name/company name, and return the the created user id. * The Stych session token can be obtained from a Magic Links or OAuth token thanks to the registration status API. */ post: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["RegisterRequest"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["RegisterResponse"]; }; }; /** @description This error is raised when the JSON is malformed or can't be decoded into a valid 'RegisterRequest'. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** * @description This error is raised when: * - The stytch token cannot be authenticated * - An active user matching the Stytch email cannot be found */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** * @description This error is raised when: * - The stytch email has not been validated or has not been provided by the OAuth provider */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/authentication/registration-status": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Report whether the user associatd to a Stytch OAuth or Magic Links token has been fully registered on Narrative side * @description Report whether the user associatd to a Stytch OAuth or Magic Links token has been fully registered on Narrative side. * Provides a Stytch session token that can be used to access the login and register APIs. */ post: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["RegistrationStatusRequest"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["RegistrationStatusResponse"]; }; }; /** @description This error is raised when the JSON is malformed or can't be decoded into a valid 'RegistrationStatusRequest'. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** * @description This error is raised when: * - The stytch token cannot be authenticated */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** * @description This error is raised when: * - The stytch email has not been validated */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** * @description This error is raised when: * - An active user with the same email already exists * - An inactive user with the same email already exists */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/admin/billings/dataset-storage-billing": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get dataset storage billing * @description Get dataset storage billings paginated. */ get: { parameters: { query?: { /** @description Number of records to return. */ per_page?: number; /** @description Number of records to skip (it's usually page_number * per_page). */ offset?: number; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["DatasetStorageBillingViewResponse"]; }; }; /** @description This error is raised when the JSON is malformed */ 400: { headers: { [name: string]: unknown; }; content?: never; }; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/billings/dataset-storage-billing": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get dataset storage billing for company * @description Get dataset storage billings for a company id paginated. * Company id is extracted from token. */ get: { parameters: { query?: { /** @description Number of records to return. */ per_page?: number; /** @description Number of records to skip (it's usually page_number * per_page). */ offset?: number; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["DatasetStorageBillingViewResponse"]; }; }; /** @description This error is raised when the JSON is malformed, or when there are to dataset storage billings for a company */ 400: { headers: { [name: string]: unknown; }; content?: never; }; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/companies/{company_id}/domains": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Lists Company Domains * @description # /companies/{company_id}/domains * * Returns all domains registered by a specific company */ get: { parameters: { query?: never; header?: never; path: { /** * @description The id of an existing company * @example 345 */ company_id: components["parameters"]["CompanyIdPathParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["DomainsResponse"]; }; }; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/admin/companies/logo-upload-url": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Get a presigned URL to upload company logo * @description Sending a file to Narrative is a two step process. * This endpoint allows you to request an `upload_url` which can be used in a `PUT` request to upload the file. * For example, once you have received an `upload_url` you could use it as follows: * * ```bash * curl -v --upload-file logo.png {upload_url} * ``` * * The generated `upload_url` is only valid for 30 minutes after issuance. * * Response also contains `permanent_url`, `expiry`, and `content_type`. * `permanent_url` should be used as long-term reference. * `content_type` should be used as Content-Type header since it is part of URL signature. */ post: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["UploadImageUrlRequest"]; }; }; responses: { /** @description List of companies */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["UploadImageUrlResponse"]; }; }; /** @description Extension error, ensure that you're uploading one of supported formats. */ 400: { headers: { [name: string]: unknown; }; content?: never; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/companies/{company_id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** Get a company */ get: { parameters: { query?: never; header?: never; path: { /** * @description The id of an existing company * @example 345 */ company_id: components["parameters"]["CompanyIdPathParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["PublicCompanyResponse"]; }; }; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/company/{company_id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** Get a company */ get: { parameters: { query?: never; header?: never; path: { /** * @description The id of an existing company * @example 345 */ company_id: components["parameters"]["CompanyIdPathParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["CompanyResponse"]; }; }; }; }; /** * Update a company * @description Update the company. * Please note that "slug" could be changed only once (from null to some value). * Lack of slug (in the request) considered as change to null and passes validation if current value is null too. * Status can be changed from pending to active but not in the opposite direction. */ put: { parameters: { query?: never; header?: never; path: { /** * @description The id of an existing company * @example 345 */ company_id: components["parameters"]["CompanyIdPathParam"]; }; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["CompanyUpdateRequest"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["CompanyResponse"]; }; }; }; }; post?: never; /** Delete (archive) a company */ delete: { parameters: { query?: never; header?: never; path: { /** * @description The id of an existing company * @example 345 */ company_id: components["parameters"]["CompanyIdPathParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content?: never; }; }; }; options?: never; head?: never; patch?: never; trace?: never; }; "/company/{company_id}/data-planes/{data_plane_id}/default-compute-pool": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; post?: never; /** * Clear the company's default compute pool for a data plane * @description Clears the company-level default compute pool for the given data plane. After this call, jobs whose pool is * resolved through the company-level default (level 3 of the resolution chain) on `data_plane_id` will fall through * to the data-plane default (level 4). * * Idempotent: clearing when no default is set is a no-op and still returns `204 No Content`. */ delete: operations["clearCompanyDefaultComputePool"]; options?: never; head?: never; patch?: never; trace?: never; }; "/company/{company_id}/data-planes/{data_plane_id}/default-compute-pool/{compute_pool_id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; /** * Set the company's default compute pool for a data plane * @description Sets the company-level default compute pool for the given data plane. This is level 3 of the compute-pool * resolution chain — when a job doesn't pin a pool explicitly (level 1) and the dataset has no default (level 2), * this default is used before falling through to the data-plane default (level 4). * * The pool must be active, owned by the company or shared with it via `using` collaborators, and live on * `data_plane_id`. Validation mirrors the rule applied to dataset-level defaults. * * Replaces any existing default for `data_plane_id`. Other per-data-plane entries on the company are preserved. */ put: operations["setCompanyDefaultComputePool"]; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/users/{user_id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; /** Update a user */ put: { parameters: { query?: never; header?: never; path: { /** @description The user id */ user_id: components["schemas"]["UserId"]; }; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["UserUpdateRequest"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["UserUpdateResponse"]; }; }; }; }; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/company-info/whoami": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Returns the company and user associated with the token * @description Returns the company and user associated with the token. */ get: { parameters: { query?: { /** @description Whether to include the token's user id on the response. */ with_user_id?: boolean; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description Returns the company and user associated with the token. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["WhoAmIResponse"]; }; }; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/company-info/{company_id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get marketing details on a company * @description Returns the marketing detailed information on a company. */ get: { parameters: { query?: never; header?: never; path: { /** * @description The id of an existing company * @example 345 */ company_id: components["parameters"]["CompanyIdPathParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description Returns the marketing detail of a specific company. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ExternalCompanyInfo"]; }; }; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/data-planes/{data_plane_id}/compute-pools": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * List compute pools * @description Retrieve the active compute pools on the data plane that are accessible to the authenticated company. Archived pools are never listed. At most one pool in the response has a non-null `default_source` — that is the pool the company's jobs run on when they don't name one themselves. */ get: operations["listComputePools"]; put?: never; /** * Create a compute pool * @description Create a new compute pool owned by the authenticated company. The caller must own the data plane or be allowed to manage compute pools on it. */ post: operations["createComputePool"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/data-planes/{data_plane_id}/compute-pools/{compute_pool_id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get a compute pool by ID * @description Retrieve a specific compute pool accessible to the authenticated company. */ get: operations["getComputePool"]; /** * Update a compute pool * @description Update an existing compute pool owned by the authenticated company. A field that is omitted or null is left unchanged. */ put: operations["updateComputePool"]; post?: never; /** * Archive a compute pool * @description Archive the specified compute pool owned by the authenticated company. Archiving a pool that is already archived succeeds and changes nothing. */ delete: operations["deleteComputePool"]; options?: never; head?: never; patch?: never; trace?: never; }; "/v2/connections": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * List connections * @description Lists the calling company's connections, optionally filtered by app, connection type, dataset, model, or profile. */ get: { parameters: { query?: { /** @description Only return connections to this app. */ app_id?: components["parameters"]["AppId"]; /** @description Only return connections of this type. */ connection_type?: components["parameters"]["ConnectionType"]; /** @description Only return connections from this dataset. */ dataset_id?: components["parameters"]["ConnectionDatasetIdParam"]; /** @description Only return connections from this model. */ model_id?: components["parameters"]["ModelId"]; /** @description Only return connections created against this app profile. */ profile_id?: components["parameters"]["ProfileIdParam"]; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["PaginatedConnections"]; }; }; }; }; put?: never; /** * Create a connection * @description Creates a connection routing a dataset's or model's data to a connector app. The connector is selected by the profile: the profile belongs to an installation, and the installation identifies the app. For dataset connections the connector validates the dataset's schema against its interfaces at create time and rejects incompatible datasets. */ post: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["CreateConnectionRequest"]; }; }; responses: { /** @description Created */ 201: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Connection"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v2/connections/{connection_id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** Get a connection */ get: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a connection. */ connection_id: components["parameters"]["ConnectionId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Connection"]; }; }; }; }; put?: never; post?: never; /** * Archive a connection * @description Archives the connection. The connection is not deleted; its status becomes `archived`. */ delete: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a connection. */ connection_id: components["parameters"]["ConnectionId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content?: never; }; }; }; options?: never; head?: never; patch?: never; trace?: never; }; "/data-planes": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * List data planes * @description Retrieve all active data planes accessible to the authenticated company: the data planes it owns, plus any on which it is a collaborator (a participant or a compute-pool manager). Data planes the company does not own are returned as the shared response variant, which omits owner-only details such as the account identifier. Narrative's own data plane is always in the list. */ get: operations["listDataPlanes"]; put?: never; /** * Create a data plane * @description Create a new data plane owned by the authenticated company. */ post: operations["createDataPlane"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/data-planes/{data_plane_id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get a data plane by ID * @description Retrieve a specific data plane the authenticated company owns or collaborates on (as a participant or a compute-pool manager). Data planes the company does not own are returned as the shared response variant, which omits owner-only details such as the account identifier. */ get: operations["getDataPlane"]; put?: never; post?: never; /** * Archive a data plane * @description Archive the specified data plane. Only the owning company can archive a data plane. */ delete: operations["deleteDataPlane"]; options?: never; head?: never; patch?: never; trace?: never; }; "/data-planes/{data_plane_id}/heartbeat": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Data plane heartbeat * @description Send a heartbeat to update the last active timestamp of the data plane. The request needs both a bearer token for the owning company and the data plane secret header. */ post: operations["sendDataPlaneHeartbeat"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/data-planes/{data_plane_id}/health-check": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Trigger a health check * @description Enqueue a health check job for the specified data plane. Optionally target a specific compute pool. Returns the created job. Only the owning company can trigger a health check. A body that cannot be decoded, including one whose `compute_pool_id` is not a UUID, is ignored rather than rejected. */ post: operations["triggerDataPlaneHealthCheck"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/data-planes/{data_plane_id}/collaborators": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; /** * Replace the collaborators on a data plane * @description Overwrites the entire `collaborators` object on the data plane, setting both `participants` (who may * use the data plane) and `manage_compute_pools` (which companies may create / edit / archive compute * pools on it). Mirrors the whole-object PUT pattern used by attributes. * * The granular per-company `PUT/DELETE /data-planes/{data_plane_id}/collaborators/{collaborator_company_id}` * endpoints continue to work for incremental mutation of `participants`; this endpoint is the only way * to set `manage_compute_pools`. */ put: operations["setDataPlaneCollaborators"]; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/data-planes/{data_plane_id}/collaborators/{collaborator_company_id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; /** * Add a collaborator to a data plane * @description Grants the specified company access to the given data plane. */ put: operations["addDataPlaneCollaborator"]; post?: never; /** * Remove a collaborator from a data plane * @description Revokes the specified company's access to the given data plane. */ delete: operations["removeDataPlaneCollaborator"]; options?: never; head?: never; patch?: never; trace?: never; }; "/data-planes/{data_plane_id}/default-compute-pool/{compute_pool_id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; /** * Set the default compute pool for a data plane * @description Sets the specified compute pool as the default for this data plane. * The compute pool must exist, be active, belong to the same company, and be associated with this data plane. */ put: operations["setDataPlaneDefaultComputePool"]; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/data-planes/{data_plane_id}/default-compute-pool": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; post?: never; /** * Clear the default compute pool for a data plane * @description Removes the default compute pool setting from this data plane. */ delete: operations["clearDataPlaneDefaultComputePool"]; options?: never; head?: never; patch?: never; trace?: never; }; "/datasets/{dataset_id}/retention-policy/preview": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Preview snapshot expirations * @description Preview snapshot expirations given a retention policy. */ post: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["SnapshotRetentionPolicy"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["SnapshotExpirationsResponse"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/datasets/{dataset_id}/retention-policy": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; /** * Upsert retention policies for a dataset * @description Accepts either a legacy payload (snapshot-only) or the unified v1 policy object. The response is the dataset, whose `retention_policy` is always in the unified v1 shape whichever form the request took. * **Row TTL clock default:** If `row_ttl.enabled=true` and `row_ttl.clock` is omitted, the server will default to the configured Rosetta Stone attribute (nio_last_modified) **if that mapping exists**; otherwise it returns HTTP 400. */ put: operations["putRetentionPolicy"]; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/datasets/{dataset_id}/snapshots/{snapshot_id}/files-added": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Files added * @description Lists files added by a snapshot */ get: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; /** @description Unique identifier for a snapshot. */ snapshot_id: components["parameters"]["SnapshotId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description Ok */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["FilesAdded"]; }; }; /** @description The dataset or the snapshot was not found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/datasets/{dataset_id}/find-snapshots": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Find snapshots * @description Lists snapshots and associated files */ get: { parameters: { query?: { /** @description Number of records to return. */ per_page?: components["parameters"]["PerPageQueryParam"]; /** @description Number of records to skip (it's usually page_number * per_page). */ offset?: components["parameters"]["Offset"]; /** * @description ISO-8601 timestamp that will be inclusively used as minimal timestamp of a snapshot. * @example 2021-06-24T00:54:40 */ "timestamp.gte"?: components["parameters"]["FromTimestamp"]; /** * @description ISO-8601 timestamp that will be exclusively used as maximal timestamp of a snapshot. * @example 2021-06-24T00:54:40 */ "timestamp.lt"?: components["parameters"]["UntilTimestamp"]; /** * @description ISO-8601 timestamp that will be inclusively used as maximal timestamp of a snapshot. * @example 2021-06-24T00:54:40 */ "timestamp.lte"?: components["parameters"]["ToTimestamp"]; /** * @description Snapshot Id that will be inclusively used as the beginning of snapshot search range. That snapshot should exist. * @example 12345989746723134 */ from_snapshot_id?: components["parameters"]["FromSnapshot"]; /** * @description Snapshot Id that will be exclusively used as the end of snapshot search range. That snapshot should exist. * @example 12345989746723134 */ until_snapshot_id?: components["parameters"]["UntilSnapshot"]; /** * @description Snapshot Id that will be inclusively used as the end of snapshot search range. That snapshot should exist. * @example 12345989746723134 */ to_snapshot_id?: components["parameters"]["ToSnapshot"]; }; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description Ok */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["DetailedSnapshotListResponse"]; }; }; /** @description Inappropriately specified range(s) or non-existing snapshot. */ 400: { headers: { [name: string]: unknown; }; content?: never; }; /** @description The dataset or the snapshot was not found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/datasets/{dataset_id}/find-files": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Find files * @description Lists snapshots and associated files */ get: { parameters: { query?: { /** @description Number of records to return. */ per_page?: components["parameters"]["PerPageQueryParam"]; /** @description Number of records to skip (it's usually page_number * per_page). */ offset?: components["parameters"]["Offset"]; /** * @description ISO-8601 timestamp that will be inclusively used as minimal timestamp of a snapshot. * @example 2021-06-24T00:54:40 */ "timestamp.gte"?: components["parameters"]["FromTimestamp"]; /** * @description ISO-8601 timestamp that will be exclusively used as maximal timestamp of a snapshot. * @example 2021-06-24T00:54:40 */ "timestamp.lt"?: components["parameters"]["UntilTimestamp"]; /** * @description Snapshot Id that will be inclusively used as the beginning of snapshot search range. That snapshot should exist. * @example 12345989746723134 */ from_snapshot_id?: components["parameters"]["FromSnapshot"]; }; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description Ok */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["DatasetFileListResponse"]; }; }; /** @description Specified snapshot doesn't exist. */ 400: { headers: { [name: string]: unknown; }; content?: never; }; /** @description The dataset was not found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/datasets/{dataset_id}/snapshots/{snapshot_id}/files-added/{file_id}/download": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Issue file download url * @description Retrieve the download URL for a file */ post: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; /** @description Unique identifier for a snapshot. */ snapshot_id: components["parameters"]["SnapshotId"]; /** @description Unique identifier for a file. */ file_id: components["parameters"]["FileId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description Ok */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["DownloadUrl"]; }; }; /** @description The snapshot is too old to download. The error code is `snapshot-too-old`. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description The dataset, the snapshot, or the file was not found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; /** @description File is expired according to its policy and can not be downloaded. */ 451: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["FileExpired"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/datasets/{dataset_id}/refresh-schedule": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; /** * Update the materialized view refresh configuration * @description Creates new request for request derivation */ put: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["UpdateMaterializedViewRefreshRequest"]; }; }; responses: { /** @description The dataset, with its updated refresh schedule under `materialized_view_config`. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["DatasetResponse"]; }; }; }; }; /** * Create a refresh schedule for an existing materialized view * @description Creates new request for request derivation */ post: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["CreateMaterializedViewRefreshRequest"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content?: never; }; }; }; /** Archive the materialized view refresh configuration */ delete: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content?: never; }; }; }; options?: never; head?: never; patch?: never; trace?: never; }; "/datasets/{dataset_id}/refresh-materialized-view": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** Run a materialized view refresh now */ post: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["TriggerMaterializedViewRefresh"]; }; }; responses: { /** * @description The refresh job. It has the same shape as the job `POST /nql/run` returns for a * `CREATE MATERIALIZED VIEW` statement. */ 201: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["CreateMaterialiedViewRunResponse"]; }; }; /** * @description A refresh job is already pending or running for this dataset. The error_description * identifies the conflicting job id. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/datasets/{dataset_id}/sample": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Sample a dataset * @description Get a sample of rows from a dataset as JSON. Returns a redacted sample by default, masking every * column specified by the dataset's redaction. Pass `redacted=false` to get the unredacted sample instead. * A dataset with no stored redaction returns the unredacted sample either way. */ get: { parameters: { query?: { /** @description The number of rows to sample from the dataset. */ size?: components["parameters"]["SampleSize"]; /** * @description Defaults to true: returns a redacted sample, masking every column specified by the dataset's * redaction. Set to false to get the unredacted sample. A dataset with no stored redaction * returns the unredacted sample either way. */ redacted?: components["parameters"]["Redacted"]; }; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** @description A list of rows from the dataset encoded as JSON objects. */ records?: Record[]; }; }; }; /** * @description Raised when * - `size` doesn't lie in the interval `(0, 1000]` * - `redacted` isn't a valid boolean * - The dataset is not active * - No sample is available for the dataset yet (request one via `POST /datasets/{dataset_id}/request-sample` first) */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description Authentication token is malformed, invalid or insufficient permissions */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description The token is not bound to a company. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description The dataset was not found. No body. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; /** * Upload a sample * @description Stores the request body as the dataset's sample, replacing any sample already there. The body is * taken as-is: any JSON document is accepted and nothing checks it against the dataset schema. * * Narrative produces samples itself through `POST /datasets/{dataset_id}/request-sample`; this * endpoint is for callers that already hold sample rows. */ put: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody: { content: { "application/json": unknown; }; }; responses: { /** @description The sample is stored. No body. */ 200: { headers: { [name: string]: unknown; }; content?: never; }; /** @description The body is not valid JSON. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description The token is not bound to a company. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description The dataset was not found. No body. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; post?: never; /** * Delete a sample * @description Deletes a sample of rows from a dataset. */ delete: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content?: never; }; /** @description Authentication token is malformed, invalid or insufficient permissions */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description The token is not bound to a company. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description The dataset was not found. No body. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; options?: never; head?: never; patch?: never; trace?: never; }; "/datasets/{dataset_id}/admin/sample": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Sample a dataset (Admin) * @description Get a sample of rows from a dataset as JSON. */ get: { parameters: { query?: { /** @description The number of rows to sample from the dataset. */ size?: components["parameters"]["SampleSize"]; }; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** @description A list of rows from the dataset encoded as JSON objects. */ records?: Record[]; }; }; }; /** * @description Raised when * - `size` doesn't lie in the interval `(0, 1000]` * - The dataset is not active * - No sample is available for the dataset yet (request one via `POST /datasets/{dataset_id}/request-sample` first) */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/datasets/{dataset_id}/request-sample": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Request Dataset Sample * @description Request a dataset sample job with pre-compiled SQL (for non-Narrative Data Planes only) * * A body that cannot be decoded as `RequestSampleRequest` is treated as an empty body rather than * refused: a `compute_pool_id` that is not a UUID is ignored and the dataset's default compute pool is * used. */ post: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; /** @description Optional configuration for the sample job */ requestBody?: { content: { "application/json": components["schemas"]["RequestSampleRequest"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["RequestSampleResponse"]; }; }; /** @description The `compute_pool_id` names a compute pool this dataset cannot run on. No job is created. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description The token belongs to no company or no user. No job is created. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description No dataset with this id was found. No job is created. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v2/datasets/{dataset_id}/request-sample": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Sample a dataset and redact the sample * @description Samples the dataset, then has Narrative's privacy model mark which columns of that sample hold * personal data and how each should be masked. Both steps run as one workflow. * * The response is that workflow and the id of its run. Check the run with * `GET /workflows/{workflow_id}/runs`; when it completes, read the model's decisions with * `GET /datasets/{dataset_id}/redaction` and the masked rows with * `GET /datasets/{dataset_id}/sample/redacted`. If the run fails, no redaction is stored and * `GET /datasets/{dataset_id}/redaction` answers 404, as it does for any dataset without one. A run * that samples successfully and then fails to redact keeps the sample. * * Each call creates its own workflow. * * A body that cannot be decoded as `RequestSampleRequest` is treated as an empty body rather than * refused: a `compute_pool_id` that is not a UUID is ignored and the dataset's default compute pool is * used. * * `POST /datasets/{dataset_id}/request-sample` samples without redacting and returns a job instead. * Two differences beyond the redaction step: this endpoint refuses a company over its credit limit * with a 403, and an invalid sample query fails the run rather than this request. */ post: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; /** @description Optional settings for the sample step */ requestBody?: { content: { "application/json": components["schemas"]["RequestSampleRequest"]; }; }; responses: { /** @description The created workflow, and the id of the run started for it. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["CreateWorkflowResponse"]; }; }; /** @description The `compute_pool_id` names a compute pool this dataset cannot run on. No workflow is created. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description Authentication token is malformed, invalid or insufficient permissions */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** * @description The company is over its credit limit, or the token belongs to no company or no user. No * workflow is created. * * Over the credit limit answers with a problem document titled `Company Credit Limit Exceeded`; * the other two answer with an `invalid_request` error. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"] | components["schemas"]["Response"]; }; }; /** @description No dataset with this id was found. No workflow is created. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/datasets/{dataset_id}/redaction": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get a dataset's sample redaction * @description Return the stored redaction for a dataset's sample: which columns hold personal data, and how * each is masked. Apply it with `GET /datasets/{dataset_id}/sample/redacted`. * * A redaction gets here one of two ways: you upload one with `PUT /datasets/{dataset_id}/redaction`, * or Narrative's privacy model writes one. `POST /v2/datasets/{dataset_id}/request-sample` asks the * model for one in a single call, and the `GenerateSampleRedaction` workflow task asks for the same * thing as a step in a workflow of your own. `model_version` tells an uploaded redaction from a * generated one. */ get: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["SampleRedaction"]; }; }; /** @description Authentication token is malformed, invalid or insufficient permissions */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description Raised when the token used to authenticate the request is not associated with a company. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** * @description The dataset was not found, or it has no redaction stored. Upload one via * `PUT /datasets/{dataset_id}/redaction`, or ask the privacy model for one via * `POST /v2/datasets/{dataset_id}/request-sample`. * * A workflow run that failed also looks like this, because nothing records the failure against * the dataset. Check the workflow run if a redaction you asked for never appeared. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; /** * @description Raised when the stored redaction can't be read: an unrecognised `masking_strategy`, a * `category` that isn't one of the nine supported categories, or `columns` or `written_by` that * don't decode at all. What this endpoint returns is always what was written. * * `GET /datasets/{dataset_id}/sample/redacted` answers 500 for the same redaction, rather than * serving rows masked by a strategy nobody chose. * * The body is an RFC 7807 problem document. `title` is `Stored Redaction Unreadable`, `status` * is `500`, `instance` is `/redaction`, and `detail` is always * `The dataset's stored redaction could not be read. Provide the log_id for support.` `type`, * `debug`, and `app` are null. * * Which column failed to read, and why, goes to the server logs rather than the body. Support * can find that log line by `log_id`, so quote it when you report the failure. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Response"]; }; }; }; }; /** * Upload a dataset's sample redaction * @description Store the redaction for a dataset's sample, replacing whatever was there before. Uploading also * brings back a redaction that was previously deleted. * * Two kinds of caller may upload: a customer with write access on datasets, or Narrative with admin * access on datasets. A customer's dataset is resolved inside their own company. Narrative's is * resolved by id alone, with no company scoping, which is what lets Narrative write a redaction for * a customer's dataset. * * The stored redaction records who wrote it from your access token, so a `written_by` field in the * request body is ignored. * * `model_version` names the privacy model that produced a redaction, and only Narrative may set it. * A customer sending it is refused with a 400 rather than dropped, so reading back a redaction * Narrative generated and sending it straight here needs `model_version` removed first. An upload * that leaves the field out clears a stored value, so a redaction you edit stops claiming a model * produced it. */ put: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["UploadRedactionRequest"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content?: never; }; /** * @description Raised when a column's `masking_strategy` isn't one of the seven supported strategies, when * `keep_last_digits` asks to keep a number of digits outside 1 to 4, when a column's `category` * isn't one of the nine supported categories, when `columns` exceeds its `maxItems`, when * `model_version` is blank or longer than 128 characters, or when `model_version` is sent by a * caller who may not set it. * * `error_description` points at the offending column by its position in `columns`. An * unrecognised `type` is reported with the value that was sent and every type that is accepted: * * ``` * DecodingFailure at .columns[0].masking_strategy: unexpected type 'keep_emial_domain'. expected one of keep_email_domain, keep_initials, keep_last_digits, keep_network_prefix, keep_two_decimal_places, keep_year, mask_everything * ``` * * A recognised `type` with an unusable body is reported at the field that was wrong, so a * `keep_last_digits` asking for too many digits fails at `count`: * * ``` * DecodingFailure at .columns[0].masking_strategy.count: 999 digits must be at most 4 * ``` * * An unrecognised `category` is reported the same way, at the column's own `category`, with * every category that is accepted: * * ``` * DecodingFailure at .columns[0].category: unexpected category 'national_id'. expected one of account_number, other, private_address, private_date, private_email, private_person, private_phone, private_url, secret * ``` * * Too many columns is reported at the document root rather than at a column, because the array * as a whole is what was refused: * * ``` * DecodingFailure at : a redaction must name at most 20480 columns, not 20481 * ``` * * A `model_version` that is blank, or whitespace only, or longer than 128 characters is reported * at its own field: * * ``` * DecodingFailure at .model_version: a model version must be at most 128 characters * ``` * * A `model_version` you may not set is refused after the body has decoded, so a value that is * both forbidden and unusable fails as the decode failure above rather than here. This is the one * 400 on this endpoint that isn't a decode failure: `error` is `invalid_request`, where every * case above is a `bad_payload`. * * ``` * only Narrative may set a redaction's model version: remove model_version from the request body * ``` */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** * @description Raised when the token is malformed or invalid, or when it carries neither write access on * datasets nor admin access on datasets. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** * @description Raised when the token used to authenticate the request is not associated with a company. A * token with admin access on datasets is never asked for one, since the dataset is resolved by * id. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description The dataset was not found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; post?: never; /** * Delete a dataset's sample redaction * @description Delete the stored redaction for a dataset's sample. `GET /datasets/{dataset_id}/redaction` then * reports it as missing, and `GET /datasets/{dataset_id}/sample/redacted` stops returning rows * until a new redaction is stored. Deleting when there is no redaction succeeds and does nothing. */ delete: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content?: never; }; /** @description Authentication token is malformed, invalid or insufficient permissions */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description Raised when the token used to authenticate the request is not associated with a company. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description The dataset was not found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; options?: never; head?: never; patch?: never; trace?: never; }; "/datasets/{dataset_id}/sample/redacted": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Sample a dataset with its redaction applied * @description Get a sample of rows from a dataset with the dataset's stored redaction applied: every column the * redaction names is masked with that column's strategy, and every other column comes back * untouched. * * A stored `masking_strategy` or `category` this API can't read fails the request with a 500. * `GET /datasets/{dataset_id}/redaction` answers 500 for the same redaction. * * Masking a number or a boolean returns the text it renders as, so a masked numeric column comes * back as a JSON string. Redacted rows do not match the dataset's declared schema for those * columns. */ get: { parameters: { query?: { /** @description The number of rows to sample from the dataset. */ size?: components["parameters"]["SampleSize"]; }; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** @description A list of masked rows from the dataset encoded as JSON objects. */ records?: Record[]; }; }; }; /** * @description Raised when * - `size` doesn't lie in the interval `(0, 1000]` * - The dataset is not active * - No sample is available for the dataset yet * - No redaction is stored for the dataset yet * * For the last two, `error_description` names which piece is missing. * `POST /v2/datasets/{dataset_id}/request-sample` supplies both in one call: it samples the * dataset and then has Narrative's privacy model write the redaction. * `POST /datasets/{dataset_id}/request-sample` samples without redacting, and * `PUT /datasets/{dataset_id}/redaction` stores a redaction you wrote yourself. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description Authentication token is malformed, invalid or insufficient permissions */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description Raised when the token used to authenticate the request is not associated with a company. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description The dataset was not found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; /** * @description Raised when the stored redaction can't be read: `columns` isn't a JSON array, an entry names * no `path`, names a `masking_strategy` or `category` this API doesn't recognise, or * `written_by` doesn't decode. Only values this API writes reach the column, so anything * unreadable is a defect rather than a state a caller can cause. * * The body is an RFC 7807 problem document. `title` is `Stored Redaction Unreadable`, `status` * is `500`, `instance` is `/sample/redacted`, and `detail` is always * `The dataset's stored redaction could not be read. Provide the log_id for support.` `type`, * `debug`, and `app` are null. * * Which column failed to read, and why, goes to the server logs rather than the body. Support * can find that log line by `log_id`, so quote it when you report the failure. * * A redaction you uploaded through `PUT /datasets/{dataset_id}/redaction` can't reach this * state: that endpoint answers 400 for any `columns` value it can't read, and it fills in * `written_by` itself. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Response"]; }; }; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/datasets/{dataset_id}/sample/mappings": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Sampled Mappings * @description Returns sampled dataset after attribute mapping for a given `mapping_id` * * This endpoint should be used when mapping exist. * * A response is a list of JSON objects, where every object will have an `input` field, that represents the original key/value pairs from the dataset, and the `output` filed that will contain mapped fields where the key will be `attribute name`, and value will be JSON object of key/value pairs. */ get: { parameters: { query?: { /** @description The number of rows to sample from the dataset. */ size?: number; }; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: number; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": Record[]; }; }; /** @description Raised when no sample is available for the dataset yet (request one via `POST /datasets/{dataset_id}/request-sample` first) */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Response"]; }; }; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/datasets/{dataset_id}/statistics-configuration": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get Statistics Configuration * @description Retrieve the current statistics configuration for a dataset. */ get: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["StatisticsConfigurationResponse"]; }; }; /** @description The dataset or its statistics configuration was not found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; /** * Put Statistics Configuration * @description Create or update the statistics configuration for a dataset. Replaces any existing configuration. */ put: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["DatasetStatisticsConfiguration"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["StatisticsConfigurationResponse"]; }; }; }; }; post?: never; /** * Disable Statistics Configuration * @description Disable the statistics configuration. Statistics will no longer be computed. */ delete: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description The configuration is disabled. No body. */ 204: { headers: { [name: string]: unknown; }; content?: never; }; /** @description The dataset or its statistics configuration was not found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; options?: never; head?: never; patch?: never; trace?: never; }; "/datasets": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get datasets * @description Return the active and pending datasets belonging to the authenticated company, one page at a time. * * Without `page` and `per_page` every dataset comes back in a single page. With either one the list is * paged, `per_page` defaulting to 100. * * A `data_plane_id`, `page` or `per_page` value that does not parse makes the request answer 404 with no * body rather than 400. A `tag` value that is not a valid tag is not an error: the request is served as if * no `tag` had been sent at all. */ get: { parameters: { query?: { /** @description Number of page. Starts from the first (1) page. */ page?: components["parameters"]["DatasetPageNumberParam"]; /** @description Number of records to return. */ per_page?: components["parameters"]["PerPageQueryParam"]; /** @description Free-text keyword query matched against dataset name. */ q?: components["parameters"]["DatasetKeywordQueryParam"]; /** @description Narrow results to datasets on this data plane. */ data_plane_id?: components["parameters"]["DatasetDataPlaneIdParam"]; /** @description Filter to datasets carrying this tag. When supplied multiple times, only datasets carrying every supplied tag are returned (all-of semantics). */ tag?: components["parameters"]["DatasetTagParam"]; /** * @description Return only the dataset's mappings with one of these sources; the datasets themselves are not filtered. * Repeat the parameter to name several; omitted, every stored mapping is returned. Naming `derived` adds the * derived mappings the dataset's stored mappings imply, whatever their own source: each is computed on the * request by applying a derivation rule to a stored mapping, has no `id` because nothing is stored, and carries * a `provenance` saying how it was produced. */ mapping_source?: components["parameters"]["DatasetMappingSourceParam"]; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["DatasetsResponse"]; }; }; /** @description The `data_plane_id`, `page` or `per_page` parameter could not be parsed. No body. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; put?: never; /** * Create a dataset * @description Create or register a new dataset. * * Newly created datasets are in the `pending` status and require activation. * * To register an empty dataset in Snowflake Dataplane: * * If the request has `data_plane_id` defined but `external_id` is not provided, it will create an empty dataset with the specified schema in `pending` state. * * To trigger creation of such dataset in Snowflake Dataplane, it should call `PUT datasets//activate`. */ post: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["DatasetCreateRequest"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["DatasetResponse"]; }; }; /** * @description This error is raised when the JSON is malformed or can't be decoded into a valid 'DatasetCreateRequest'. * Invariants that must be satisfied when decoding the request: * - The dataset name should be defined * - The schema must be properly defined * - The partition key should be a valid pointer to an existing property of one of the following types: boolean, long, string, timestamptz */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/datasets/{dataset_id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** Get a dataset */ get: { parameters: { query?: { /** * @description Return only the dataset's mappings with one of these sources; the datasets themselves are not filtered. * Repeat the parameter to name several; omitted, every stored mapping is returned. Naming `derived` adds the * derived mappings the dataset's stored mappings imply, whatever their own source: each is computed on the * request by applying a derivation rule to a stored mapping, has no `id` because nothing is stored, and carries * a `provenance` saying how it was produced. */ mapping_source?: components["parameters"]["DatasetMappingSourceParam"]; }; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["DatasetResponse"]; }; }; /** @description The dataset was not found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; /** * Update a dataset * @description Update a pending or active dataset. * * All fields can be updated on a pending dataset. * Schema property metadata (`sensitive`, `required`, `unsellable`) and enumeration (append-only), `description`, `display_name` * can be updated on an active dataset. * * Archived datasets cannot be updated. */ put: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["DatasetUpdateRequest"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["DatasetResponse"]; }; }; /** * @description This error is raised when the JSON is malformed or can't be decoded into a valid 'DatasetUpdateRequest'. * Invariants that must be satisfied when decoding the request: * - The schema (if presented) must be properly defined * - The partition key (if presented) should be a valid pointer to an existing property of one of the following types: boolean, long, string, timestamptz * * This error can also be raised when: * - Requesting to update an activated dataset and some immutable field is changed * - Requesting to update an archived dataset * - The update request does not contain any changes * - Downgrading a sensitive field back into a regular field */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; post?: never; /** * Delete a dataset * @description Permanently removes a dataset from the platform. * * Dataset deletion cannot be undone. */ delete: { parameters: { query?: never; header?: { "X-Narrative-Retention-Days"?: string; }; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content?: never; }; /** @description This error is raised when the X-Narrative-Retention-Days header is malformed or can't be decoded into a valid number between 1 and 30. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; options?: never; head?: never; patch?: never; trace?: never; }; "/datasets/{dataset_id}/activate": { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; get?: never; /** * Activate a dataset * @description Activates a dataset. * * This locks in the schema and allows Narrative to begin ingesting data. */ put: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description The dataset, now active. */ 201: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["DatasetResponse"]; }; }; /** @description The dataset is already active, or it lives on a data plane that datasets cannot be activated on. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description The dataset was not found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; /** * Activate a dataset * @deprecated * @description Activates a dataset. * * This locks in the schema and allows Narrative to begin ingesting data. */ post: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description The dataset, now active. */ 201: { headers: { Warning?: string; [name: string]: unknown; }; content: { "application/json": components["schemas"]["DatasetResponse"]; }; }; /** @description The dataset is already active, or it lives on a data plane that datasets cannot be activated on. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description The dataset was not found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/datasets/{dataset_id}/truncate": { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; get?: never; put?: never; /** * Truncate a dataset * @description Truncates a dataset. * * Removes all rows from the dataset but leaves the dataset intact. The rows are removed by a job, which * is returned. */ post: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description The job that truncates the dataset. */ 201: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["JobResponse"]; }; }; /** * @description This error is raised when: * - The dataset is not active * - The dataset is not managed by Narrative (i.e. created from a table/view reference in Snowflake. Not supported to avoid requesting TRUNCATE privilege when getting a reference) */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description The dataset was not found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/datasets/{dataset_id}/admin": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get admin info for a dataset * @description Get a dataset including information about the backing [Iceberg table](http://iceberg.apache.org/). */ get: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["DatasetAdminResponse"]; }; }; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/datasets/{dataset_id}/admin/partition-spec": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Update a dataset's partition spec * @description Update the partition specification of the [Iceberg table](http://iceberg.apache.org/) backing the dataset. * * See: * - [What is partitioning?](http://iceberg.apache.org/partitioning/) * - [Iceberg Specification: Partitioning](http://iceberg.apache.org/spec/#partitioning) */ post: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["UpdatePartitionSpecRequest"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["DatasetAdminResponse"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/datasets/{dataset_id}/stats": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get dataset statistics * @description Return summary statistics for all ingestion snapshots for a given dataset. * For datasets with "incremental" updates, each snapshot defines a new incremental upload of data. * For datasets with "overwrite" updates, each snapshot overwrites the previous data. * `all_records` query parameter is here because of backward compatibility. * By default API is paginated, so if you don't provide both `per_page` and `offset` parameters, you will get only the latest summary. */ get: { parameters: { query?: { /** * @description If true will return 100 records. If false, only returns the most recent record. * Pagination api with `per_page` and `offset` parameters should be used instead of this one. */ all_records?: components["parameters"]["AllRecords"]; /** @description Number of records to return. */ per_page?: components["parameters"]["PerPageQueryParam"]; /** @description Number of records to skip (it's usually page_number * per_page). */ offset?: components["parameters"]["Offset"]; }; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["DatasetSummariesResponse"]; }; }; /** @description The dataset was not found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/datasets/{dataset_id}/column-stats": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get detailed statistics * @description Get statistics for each column. */ get: { parameters: { query?: { /** @description The maximum number of bins to return for the histograms. */ histogram_bin_limit?: components["parameters"]["HistogramBinLimit"]; }; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["GetColumnStatsResponse"]; }; }; /** * @description If the dataset does not exist or if the stats have not been added for the dataset * (in the case of a Non-Narrative data planes) */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; /** * Create or Update detailed statistics * @description Create or Update detailed statistics. Detailed statistics are collected for datasets belonging to the Narrative Data Plane, but * uploading these stats is necessary for non-Narrative data planes, since Narrative does not have access to the data to compute these statistics. */ put: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["UpsertColumnStatsRequest"]; }; }; responses: { /** @description OK */ 201: { headers: { [name: string]: unknown; }; content?: never; }; /** * @description This error is raised when: * - The request cannot be parsed * - Stats are missing for some columns * - Stats are provided for columns not specified in the dataset schema */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description If the dataset does not exist */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/datasets/{dataset_id}/column-stats/recalculate": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Submit recalculation * @description Recalculates the dataset's column statistics. * * Which path the request takes depends on the dataset: * * - A dataset with a statistics configuration (see `PUT /datasets/{dataset_id}/statistics-configuration`) * is recalculated by a job. The body is ignored, and the response carries the job id in * `recalculation_id` with `snapshots` empty and the timestamps null. * - A dataset on the Narrative data plane with no statistics configuration is recalculated over a snapshot * range. The body is read here, and is required: send `{}` to recalculate from the first snapshot. * The response lists the snapshots in the range, or has every field empty when nothing needs * recalculating. * - A dataset on any other data plane with no statistics configuration is recalculated by a job from its * metrics configuration (see `PUT /datasets/{dataset_id}/stats-config`). The body is ignored. * * A job is only started for an API key bound to a user. */ post: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; /** * @description Read only for a dataset on the Narrative data plane that has no statistics configuration, where it is * required. */ requestBody?: { content: { "application/json": { /** @description Id of the first snapshot to recalculate from, as a decimal string. */ from_snapshot?: string; }; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["RecalculationResponse"]; }; }; /** * @description A recalculation is already planned for the dataset, the body was required and is missing or * malformed, or the statistics configuration compiles to no statistics. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"] | components["schemas"]["Response"]; }; }; /** @description The API key is not bound to a user, so no job can be started for it. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description The dataset was not found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/datasets/{dataset_id}/column-stats/{snapshot_id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get detailed statistics for a snapshot * @description Get statistics for each column as they were at one snapshot of the dataset. Same shape as * `GET /datasets/{dataset_id}/column-stats`, which describes the current state. */ get: { parameters: { query?: { /** @description The maximum number of bins to return for the histograms. */ histogram_bin_limit?: components["parameters"]["HistogramBinLimit"]; }; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; /** @description Unique identifier for a snapshot. */ snapshot_id: components["parameters"]["SnapshotId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["GetColumnStatsResponse"]; }; }; /** @description The dataset was not found, or no statistics were computed for that snapshot. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/datasets/{dataset_id}/combine": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Combine snapshot metrics * @description Merges the metrics computed for two or more snapshots into one set of per-column statistics, as if * they had been computed over the snapshots together. Pass `snapshot_id` once per snapshot. */ get: { parameters: { query: { /** @description A snapshot whose metrics to include. Repeat the parameter for each snapshot. */ snapshot_id: number[]; }; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description The combined per-column statistics. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["AllColumnsStatistics"]; }; }; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/datasets/{dataset_id}/upload": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Ingest a file * @description After uploading a file to Narrative via the `upload` API, you can then have the file can then be ingested into a dataset. * * Related guides: * - [How do I create a dataset?](https://kb.narrative.io/how-do-i-create-a-dataset): see the section titled **Upload Files for Ingestion**. */ post: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["FileIngestionRequest"]; }; }; responses: { /** @description The file is queued for ingestion. No body. */ 200: { headers: { [name: string]: unknown; }; content?: never; }; /** * @description The body could not be decoded as `FileIngestionRequest`, the dataset is not active, or * `source_file` names a file that was never uploaded. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description The dataset was not found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/datasets/{dataset_id}/upload/token": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Issue an ingestion token * @description Issues a token that lets a file be uploaded straight into this dataset without the caller's API key. * The token is a signed JWT naming the company and the dataset, and it expires two days after it is * issued. */ post: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["IngestionTokenResponse"]; }; }; /** @description The dataset is not active. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description The dataset was not found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/datasets/{dataset_id}/metrics": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Metrics * @description Lists metrics for a dataset, `per_page` snapshots at a time (5 by default). `previous` in the response * is the `until_snapshot_id` to send for the next page, or null on the last one. */ get: { parameters: { query?: { /** @description Number of records to return. */ per_page?: components["parameters"]["PerPageQueryParam"]; /** * @description Snapshot Id that will be exclusively used as the end of snapshot search range. That snapshot should exist. * @example 12345989746723134 */ until_snapshot_id?: components["parameters"]["UntilSnapshot"]; /** @description The maximum number of bins to return for the histograms. */ histogram_bin_limit?: components["parameters"]["HistogramBinLimit"]; }; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description Ok */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["DatasetStatistics"]; }; }; /** @description The dataset or its metrics were not found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/datasets/{dataset_id}/snapshots/{snapshot_id}/column-stats": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Metrics * @description Metrics for a snapshot */ get: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; /** @description Unique identifier for a snapshot. */ snapshot_id: components["parameters"]["SnapshotId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description Ok */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["AllColumnsStatistics"]; }; }; /** @description The snapshot or its metrics were not found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/datasets/{dataset_id}/stats-config": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get Metrics Configuration * @description Get the latest version of the configuration. */ get: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description Ok */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["GetMetricConfigResponse"]; }; }; /** @description The dataset or its statistics configuration was not found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; /** * Put Metrics Configuration * @description Put new version of configuration. */ put: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["PutMetricConfigRequest"]; }; }; responses: { /** @description The stored configuration version. */ 201: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["PutMetricConfigResponse"]; }; }; /** * @description The body could not be decoded, or a column listed under `value_histogram` is missing from both * `approx_count_distinct` and `count_distinct`, or a column is listed under both of those. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description The dataset was not found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; post?: never; /** * Disable configuration * @description Disable configuration, metrics won't be calculated */ delete: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description The id of the disabled configuration stream, as a bare JSON string. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["MetricConfigStreamId"]; }; }; /** @description The dataset or its statistics configuration was not found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; options?: never; head?: never; patch?: never; trace?: never; }; "/datasets/{dataset_id}/derive-stats-config": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; /** * Derive the configuration * @description Asks Narrative to derive a metrics configuration for the dataset from its schema. The request is queued * and answered with no body; read the result later with `GET /datasets/{dataset_id}/stats-config`. */ put: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description The derivation request was queued. No body. */ 201: { headers: { [name: string]: unknown; }; content?: never; }; /** @description The dataset already has a configuration, or a derivation request for it is already queued. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description The dataset was not found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/datasets/{dataset_id}/enable-stats-config": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Enable configuration * @description Enable configuration if it exists */ post: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description The id of the enabled configuration stream, as a bare JSON string. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["MetricConfigStreamId"]; }; }; /** @description The dataset or its statistics configuration was not found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/datasets/{dataset_id}/interfaces": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * List connector interfaces compatible with a dataset * @description Evaluates the dataset's schema against every connector interface exposed by apps installed for * the caller's company, and reports which interfaces accept the schema and which reject it. * * Each installed app may expose one or more interfaces, each with its own JSON-Schema-based * policy. An interface with no policy accepts any dataset schema. * * The optional `tags` query parameter restricts evaluation to interfaces whose metadata tags * intersect the supplied set (case-insensitive, OR semantics). When omitted, every interface is * evaluated. */ get: { parameters: { query?: { /** * @description Restrict evaluation to interfaces whose metadata tags include at least one of the supplied * values. Repeat the parameter to pass multiple tags (e.g. `?tags=audience_delivery`). * Matching is case-insensitive. */ tags?: string[]; }; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["CompatibleDatasetInterfacesResponse"]; }; }; /** @description The caller is not permitted to access the requested dataset. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description No active dataset exists for the supplied `dataset_id`. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/derivations": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get derivation rules * @description Return the derivation rules usable by your company — the ones it owns plus the ones shared with it through * collaborators — optionally filtered by source or target attribute. */ get: { parameters: { query?: { /** @description Only return rules reading from these attributes. Repeat the parameter to pass several ids. */ source_attribute_id?: number[]; /** @description Only return rules producing these attributes. Repeat the parameter to pass several ids. */ target_attribute_id?: number[]; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["DerivationsResponse"]; }; }; }; }; put?: never; /** * Create a derivation rule * @description Create a new derivation rule. Requires an `admin` grant on `attribute_derivations`, and the rule is owned by * your own company. A user token whose user is a Narrative global admin is accepted without the grant; an app * token always needs it. * * The rule's transformation is validated before the rule can exist: the source and target attributes must exist and * be viewable — and the target must additionally grant your company `map`, since the rule produces values for it — * every expression must parse and type-check against the source attribute's shape, the result must match the target * attribute's declared type, every function must resolve. Each failure returns a 400 with a descriptive message. * * A rule that closes a cycle in the derivation graph is created anyway; the cycle comes back as a warning on the * response. */ post: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["DerivationCreateRequest"]; }; }; responses: { /** @description Created */ 201: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["DerivationResponse"]; }; }; /** @description The rule is invalid — see the error message for the specific validation failure. */ 400: { headers: { [name: string]: unknown; }; content?: never; }; /** * @description The caller is not an admin, the rule's company or collaborators are not allowed, or the target attribute does * not grant the caller's company `map`. */ 403: { headers: { [name: string]: unknown; }; content?: never; }; /** * @description Another of the company's rules already uses the same name, or already covers the same source and target * attributes. */ 409: { headers: { [name: string]: unknown; }; content?: never; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/derivations/{derivation_id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get a derivation rule * @description Return a single derivation rule. Only rules usable by your company — the ones it owns plus the ones shared with * it through collaborators — can be fetched; anything else is a 404. */ get: { parameters: { query?: never; header?: never; path: { /** @description Id of the derivation rule. */ derivation_id: components["parameters"]["DerivationId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["DerivationResponse"]; }; }; /** @description No derivation rule with that id was found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; put?: never; post?: never; /** * Delete a derivation rule * @description Permanently remove a derivation rule. Requires an `admin` grant on `attribute_derivations`, and only the company * that owns a rule can delete it. Deletions cannot be undone; to take a rule out of use while keeping it, set * `active` to `false` instead. */ delete: { parameters: { query?: never; header?: never; path: { /** @description Id of the derivation rule. */ derivation_id: components["parameters"]["DerivationId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content?: never; }; /** @description The caller is not an admin or does not own the rule. */ 403: { headers: { [name: string]: unknown; }; content?: never; }; /** @description No derivation rule with that id. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; options?: never; head?: never; /** * Update a derivation rule * @description Update some fields of a derivation rule. Requires an `admin` grant on `attribute_derivations`, and only the * company that owns a rule can change it. Only the fields present in the request change; a changed transformation * runs the same validation as a creation. Set `fidelity_note` to `null` to clear it. A rule's source and target * attributes cannot be changed — create a new rule instead. */ patch: { parameters: { query?: never; header?: never; path: { /** @description Id of the derivation rule. */ derivation_id: components["parameters"]["DerivationId"]; }; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["DerivationUpdateRequest"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["DerivationResponse"]; }; }; /** @description The update is invalid — see the error message for the specific validation failure. */ 400: { headers: { [name: string]: unknown; }; content?: never; }; /** @description The caller is not an admin or does not own the rule. */ 403: { headers: { [name: string]: unknown; }; content?: never; }; /** @description No derivation rule with that id. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; /** @description The new name is already taken by another of the company's rules. */ 409: { headers: { [name: string]: unknown; }; content?: never; }; }; }; trace?: never; }; "/encryption-materials": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * List encryption materials * @description List encryption materials */ get: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ListResponse"]; }; }; /** * @description This error is raised when: * - The token used to authenticate the request is not associated with a company */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; put?: never; /** * Create an encryption material * @description Create an encryption material */ post: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["request"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["response"]; }; }; /** * @description This error is raised when: * - The request cannot be parsed * - The provided name is invalid * - The provided permissions are invalid * - The provided expiration date is invalid */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** * @description This error is raised when: * - The token used to authenticate the request is not associated with a company */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/encryption-materials/{encryption_material_id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; post?: never; /** Archive a connection */ delete: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for an encryption material */ encryption_material_id: components["parameters"]["EncryptionMaterialId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content?: never; }; }; }; options?: never; head?: never; patch?: never; trace?: never; }; "/installations": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * List installations * @description Returns a paginated list of installations. * * With a company-scoped token (e.g. a user token), lists the installations of the * authenticated company, optionally filtered by app category using the `app_category` * query parameter. * * With an app client-credentials token, lists the installations of the authenticated * app across all companies, optionally narrowed to a single company using the * `company_id` query parameter. Use this to look up the installation id for a company * before creating an installation-scoped access token. * * Results are paginated using `page` (1-based, default `1`) and `per_page` * (default `100`) query parameters. */ get: { parameters: { query?: { /** @description Filter installations by app category. Can be specified multiple times to filter by multiple categories. */ app_category?: components["parameters"]["InstallationAppCategoryParam"]; /** * @description Filter installations by company. Only meaningful with an app client-credentials token; with a * company-scoped token the value must match the authenticated company. * @example 456 */ company_id?: components["parameters"]["InstallationsCompanyIdFilter"]; /** @description Number of page. Stars from the first (1) page. */ page?: components["parameters"]["PageNumberQueryParam"]; /** @description Number of records to return. */ per_page?: components["parameters"]["PerPageQueryParam"]; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description Successfully retrieved list of installations. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["InstallationsResponse"]; }; }; /** * @description This error is raised when: * - The `app_category` parameter contains an invalid value */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; 401: components["responses"]["Unauthorized"]; /** @description The `company_id` query parameter does not match the authenticated company. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; put?: never; /** * Create an installation * @description Creates a new installation for an app. * * The installation associates an app with the authenticated company using a specific tier from the app's manifest. * The tier determines which permissions are granted to the installation. */ post: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["CreateInstallationRequest"]; }; }; responses: { /** @description Successfully created the installation. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Installation"]; }; }; /** * @description This error is raised when: * - The request body cannot be parsed * - The specified `app_id` does not exist * - The specified `tier_id` is not valid for the app */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; 401: components["responses"]["Unauthorized"]; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/installations/whoami": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get current installation info * @description Returns information about the installation associated with the current authentication token. * * This endpoint is useful for apps to identify which installation they are operating under. * The token must be associated with an installation (e.g., an app token). */ get: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description Successfully retrieved installation information. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["InstallationInfo"]; }; }; 401: components["responses"]["Unauthorized"]; /** * @description This error is raised when: * - The token is not associated with an installation */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/installations/{installation_id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get an installation * @description Returns a single installation by its ID. * * With a company-scoped token (e.g. a user token), the installation must belong to the * authenticated company. * * With an app client-credentials token, the installation must belong to the authenticated app. */ get: { parameters: { query?: never; header?: never; path: { /** * @description The unique identifier for the installation. * @example 12345 */ installation_id: components["parameters"]["InstallationIdParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description Successfully retrieved the installation. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Installation"]; }; }; 401: components["responses"]["Unauthorized"]; /** @description The installation was not found. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; put?: never; post?: never; /** * Delete an installation * @description Deletes an installation by its ID. * * The installation must belong to the authenticated company. An installation cannot be deleted * if it has active profiles associated with it. Remove all profiles before uninstalling the app. */ delete: { parameters: { query?: never; header?: never; path: { /** * @description The unique identifier for the installation. * @example 12345 */ installation_id: components["parameters"]["InstallationIdParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description Successfully deleted the installation. */ 200: { headers: { [name: string]: unknown; }; content?: never; }; /** * @description This error is raised when: * - The installation has active profiles associated with it. Remove profiles before uninstalling. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; 401: components["responses"]["Unauthorized"]; /** @description The installation was not found. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; options?: never; head?: never; patch?: never; trace?: never; }; "/installations/{installation_id}/token": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Create an installation-scoped access token * @description Returns a Narrative API access token scoped to the given installation, carrying the * permissions granted to the application at installation. * * With a user-bound bearer token, the access token is created on behalf of the * authenticated user for an installation belonging to the user's company. The token is * used with an application (e.g., the S3 connector) to allow the application to call * Narrative's API on the user's behalf. * * With an app client-credentials bearer token (obtained via `POST /oauth/token` with * `grant_type=client_credentials`), the access token is created by the application itself * for one of its own installations, allowing the application to act on behalf of a * company that has installed it. Use `GET /installations` with the app token to discover * installation ids. */ post: { parameters: { query?: never; header?: never; path: { /** * @description The unique identifier for the installation. * @example 12345 */ installation_id: components["parameters"]["InstallationIdParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description Successfully created an installation-scoped access token. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["AccessToken"]; }; }; 401: components["responses"]["Unauthorized"]; /** @description The installation was not found. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/jobs": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get jobs * @description Returns a list of jobs associated with the specified company, including job ID, job type, timestamp information, and results. * * It returns a maximum of 500 jobs at a time to manage response size. */ get: operations["listJobs"]; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/jobs/{job_id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get a job * @description This endpoint retrieves all details associated with a specific job ID from the jobs table. */ get: operations["getJob"]; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/jobs/{job_id}/run": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Run a job * @description Starts a job by assigning it an executor and moving it to `running`. Applies to jobs in the `pending`, * `scheduled` or `failed` state; it is a no-op for a job in any other state (`running`, `pending_cancellation`, * `completed`, `cancelled`). Idempotent. The response is the job as it stands after the call. * * Requires write access to jobs. */ post: operations["runJob"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/jobs/{job_id}/schedule": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Schedule a job * @description Records which executor has claimed a `pending` job and moves it to `scheduled`. It is a no-op for a job in * any other state. Idempotent. The response is the job as it stands after the call. * * `run` accepts a `scheduled` job, so an executor can claim a job here before it has the capacity to start it. * * Requires write access to jobs. */ post: operations["scheduleJob"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/jobs/{job_id}/complete": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Complete a job * @description Marks a job as `completed` along with its result. The result shape is selected by the `type` field in the body * and must match the job's type. It is a no-op for a job already in a terminal state (`completed`, `cancelled`, * `failed`); a `pending_cancellation` job can still be completed if it finishes before the cancellation is processed. * * Requires write access to jobs. */ post: operations["completeJob"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/jobs/{job_id}/fail": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Fail a job * @description Marks a job as `failed` with a message and optional diagnostic value. It is a no-op for a job already in a * terminal state (`completed`, `cancelled`, `failed`); a `pending_cancellation` job can still be failed if it fails * before the cancellation is processed. * * Requires write access to jobs. */ post: operations["failJob"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/jobs/{job_id}/request-cancellation": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Request cancellation of a job * @description Requests cancellation of a `pending`, `scheduled` or `running` job, moving it to `pending_cancellation` so * the data plane can stop the work. It is a no-op for a job already in a terminal state (`completed`, * `cancelled`, `failed`) or already in `pending_cancellation`. * * Cancellation is only supported on the Narrative data plane for `health_check`, `model_inference_run`, * `model_training_run` and `models_deliver_model` jobs, and on Snowflake data planes for any job. Any other * combination is rejected with a 400, whatever state the job is in. Use `cancel` to finalize a job once it has * reached `pending_cancellation`. * * The response is the job as it was before the call, so a job that was just moved still reads its previous * state here. Fetch it again for the updated state. * * Requires write access to jobs. */ post: operations["requestJobCancellation"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/jobs/{job_id}/cancel": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Cancel a job * @description Finalizes cancellation of a job, moving it from `pending_cancellation` to `cancelled`. It is a no-op for a job * already in a terminal state (`completed`, `cancelled`, `failed`); any other state (`pending`, `scheduled`, * `running`) is rejected with a 400. Use `request-cancellation` first to move a job into `pending_cancellation`. * * The response is the job as it was before the call, so a job that was just cancelled still reads * `pending_cancellation` here. Fetch it again for the updated state. * * Requires write access to jobs. */ post: operations["cancelJob"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/jobs/{job_id}/reschedule": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Reschedule a job * @description Puts a job back on the queue: resets it to `pending` and clears its executor so the operator re-dispatches it * onto a fresh cluster. This is typically used when a job's cluster terminated with its step still in flight. * * By default this is a no-op for jobs already in a terminal state (`completed`, `cancelled`, `failed`). Supply a * body with `force: true` to reschedule a terminal job anyway (e.g. to re-run one that already finished). The body * is optional — an empty body keeps the default behavior. So does a body that fails to parse: it is treated as * empty rather than rejected. * * The response's `outcome` reports whether the job was actually `rescheduled` or `skipped_terminal` (left untouched * because it was terminal and `force` was not set). * * Requires write access to jobs. */ post: operations["rescheduleJob"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/mappings": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get mappings * @description Return the `active` mappings owned by the caller's company. Optionally filter by attribute, dataset, * source and/or the dataset field the mapping depends on. `source=derived` adds the derived mappings those * mappings imply, each with a `provenance` and no `id`; the attribute, dataset and field filters apply to * them too. */ get: { parameters: { query?: { /** * @description Return only mappings with one of these sources. Repeat the parameter to name several; omitted, every stored * mapping is returned. Naming `derived` adds the derived mappings the stored mappings imply, whatever their own * source: each is computed on the request by applying a derivation rule to a stored mapping, has no `id` because * nothing is stored, and carries a `provenance` saying how it was produced. */ source?: components["parameters"]["Source"]; /** * @description Return only mappings whose expression reads this dataset field. Name a top-level column (`email`) to match * every mapping that reads it or anything nested under it, or a dotted path (`address.postal_code`) to match * only mappings that read that nested field. Repeat the parameter to match any of several. Matching uses the * dependencies computed when a mapping was saved, so with `source=derived` a derived mapping matches through * the expression it was built from. Requires `dataset_id`; a request with `depends_on_dataset_field` and no * `dataset_id` is rejected. */ depends_on_dataset_field?: components["parameters"]["DependsOnDatasetField"]; /** @description Attribute identifier. Repeat the parameter to retrieve mappings for multiple attributes. */ attribute_id?: number[]; /** @description Dataset identifier. Repeat the parameter to retrieve mappings for multiple datasets. */ dataset_id?: number[]; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["MappingsResponse"]; }; }; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/mappings/{mapping_id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get mapping * @description Return a specific mapping based on its id. * * Derived mappings (`source: derived` in list responses) are computed per request and have no id, so neither * this endpoint nor the mutation endpoints can reach them. */ get: { parameters: { query?: never; header?: never; path: { /** * @description Unique identifier for a mapping. * @example ea9dddd2-e3ee-40b5-b03e-c3cd37c8a6f0 */ mapping_id: components["parameters"]["MappingId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description Ok */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["MappingResponse"]; }; }; /** @description Mapping not found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; /** * Update a mapping * @description Update the definition of a mapping between an attribute and a dataset. * * Note: the attribute and dataset with which a mapping is associated cannot be updated. */ put: { parameters: { query?: { /** * @description Skip validation of the mapping expressions against the query engine. Structural validation of the * request still runs. The flag is enabled by being present; any value is ignored. */ skip_validation?: components["parameters"]["SkipValidation"]; }; header?: never; path: { /** * @description Unique identifier for a mapping. * @example ea9dddd2-e3ee-40b5-b03e-c3cd37c8a6f0 */ mapping_id: components["parameters"]["MappingId"]; }; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["MappingUpdateRequest"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["MappingResponse"]; }; }; }; }; post?: never; /** * Delete a mapping * @description Mapping deletion cannot be undone. * * If the mapping is still being used then this request fails. * * Both owners (users belonging to the company the mapping belongs to) and admins can delete a mapping. */ delete: { parameters: { query?: never; header?: never; path: { /** * @description Unique identifier for a mapping. * @example ea9dddd2-e3ee-40b5-b03e-c3cd37c8a6f0 */ mapping_id: components["parameters"]["MappingId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description No Content */ 204: { headers: { [name: string]: unknown; }; content?: never; }; }; }; options?: never; head?: never; patch?: never; trace?: never; }; "/mappings/{mapping_id}/accept": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Accept a mapping * @description Accept a proposed mapping, i.e. move it from a `status` of `pending` or `rejected` to `active`. * * Fails with a conflict if an active `global` mapping already exists for the same attribute and * dataset. * * Both owners (users belonging to the company the mapping belongs to) and admins can accept a mapping. */ post: { parameters: { query?: never; header?: never; path: { /** * @description Unique identifier for a mapping. * @example ea9dddd2-e3ee-40b5-b03e-c3cd37c8a6f0 */ mapping_id: components["parameters"]["MappingId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["MappingResponse"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/mappings/companies/{company_id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get mappings for a company * @description Return the mappings owned by a specific company based on its id, in every status (including * `archived` and `rejected`). Optionally filter by attribute, dataset, source and/or the dataset field the * mapping depends on. `source=derived` adds the derived mappings the company's `active` mappings imply, each * with a `provenance` and no `id`; the attribute, dataset and field filters apply to them too. */ get: { parameters: { query?: { /** * @description Return only mappings with one of these sources. Repeat the parameter to name several; omitted, every stored * mapping is returned. Naming `derived` adds the derived mappings the stored mappings imply, whatever their own * source: each is computed on the request by applying a derivation rule to a stored mapping, has no `id` because * nothing is stored, and carries a `provenance` saying how it was produced. */ source?: components["parameters"]["Source"]; /** * @description Return only mappings whose expression reads this dataset field. Name a top-level column (`email`) to match * every mapping that reads it or anything nested under it, or a dotted path (`address.postal_code`) to match * only mappings that read that nested field. Repeat the parameter to match any of several. Matching uses the * dependencies computed when a mapping was saved, so with `source=derived` a derived mapping matches through * the expression it was built from. Requires `dataset_id`; a request with `depends_on_dataset_field` and no * `dataset_id` is rejected. */ depends_on_dataset_field?: components["parameters"]["DependsOnDatasetField"]; /** @description Attribute identifier. Repeat the parameter to retrieve mappings for multiple attributes. */ attribute_id?: number[]; /** @description Dataset identifier. Repeat the parameter to retrieve mappings for multiple datasets. */ dataset_id?: number[]; }; header?: never; path: { /** * @description The id of an existing company * @example 345 */ company_id: components["parameters"]["CompanyIdPathParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description Ok */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["MappingsResponse"]; }; }; }; }; put?: never; /** * Create a mapping * @description Create a mapping between an attribute and one of the company's datasets. The created mapping is * owned by the company and has `global` scope. * * The response also lists, under `derived_mappings`, the derived mappings the new mapping unlocks: the rows * `GET /mappings?source=derived` would return for it, in the same shape. * * Supports mapping types: `cached_mapping`, `object_mapping`, and `value_mapping`. */ post: { parameters: { query?: { /** * @description Skip validation of the mapping expressions against the query engine. Structural validation of the * request still runs. The flag is enabled by being present; any value is ignored. */ skip_validation?: components["parameters"]["SkipValidation"]; }; header?: never; path: { /** * @description The id of an existing company * @example 345 */ company_id: components["parameters"]["CompanyIdPathParam"]; }; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["MappingCreateRequest"]; }; }; responses: { /** @description Ok */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["MappingCreateResponse"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/mappings/{mapping_id}/sample": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get mapping preview * @description Returns sampled dataset after attribute mapping for a given `mapping_id` * * This endpoint should be used when mapping exist. * * A response is a list of JSON objects, where every object will have an `input` field, that represents the original key/value pairs from the dataset, and the `output` filed that will contain mapped fields where the key will be `attribute name`, and value will be JSON object of key/value pairs. */ get: { parameters: { query?: { /** @description The number of rows to sample from the dataset. Defaults to 100 when omitted. */ size?: number; }; header?: never; path: { /** * @description Unique identifier for a mapping. * @example ea9dddd2-e3ee-40b5-b03e-c3cd37c8a6f0 */ mapping_id: string; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["MappingPreviewResponse"]; }; }; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/mappings/test": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Test Mapping * @description Returns sampled dataset after attribute mapping for a given mapping. * * This endpoint should be used when mapping does not exist. * * A response is a list of JSON objects, where every object will have an `input` field, that represents the original key/value pairs from the dataset, and the `output` filed that will contain mapped fields where the key will be `attribute name`, and value will be JSON object of key/value pairs. * * A `cached_mapping` is resolved as a join at query time and has no per-row preview, so its response is always an empty list of records. */ post: { parameters: { query?: { /** @description The number of rows to sample from the dataset. Defaults to 100 when omitted. */ size?: number; }; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["MappingCreateRequest"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["MappingPreviewResponse"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/mcp-connections": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * List the calling user's external MCP connections * @description Returns the caller's external MCP connections with their status. This is the status view — no * client secret and no access/refresh tokens are ever returned. * * ## Scope: per-user, not per-company * * Results are filtered by **both** `company_id` and `user_id` from the bearer token — peers in * the same company are **not** visible. Not paginated; the empty state is `connections: []`. * * ## Permission * * `agent_conversations` resource with `read` verb. * * ## Example * * ```bash * curl "$API/mcp-connections" \ * -H "Authorization: Bearer $TOKEN" * ``` */ get: operations["listMcpConnections"]; put?: never; /** * Begin connecting an external MCP server * @description Starts the OAuth connection flow for an external (non-Narrative) MCP server and returns the * URL the user must visit to grant access. * * ## What this endpoint actually does * * 1. Discovers the server's OAuth protected-resource + authorization-server metadata. * 2. Verifies the authorization server supports the `S256` PKCE method (400 otherwise). * 3. Dynamically registers a client with the authorization server (RFC 7591). Servers that don't * advertise a registration endpoint return 400 — they can't be connected this way. * 4. Persists a `pending` connection (one row per `company_id` + `user_id` + `url`; re-connecting * the same server replaces the previous row) and builds the authorization URL with PKCE and a * one-time `state`. * * No tokens exist yet. The user opens `authorization_url` and consents. The authorization server * redirects their browser to `GET /mcp-connections/callback`, which stores the authorization code * and forwards the browser to the Narrative app. The app then calls * `POST /mcp-connections/complete`, which exchanges the code and flips the connection to * `connected`. The connection stays `pending` until that final call succeeds. * * Once `connected`, reference the connection by `connection_id` from an agent run's * `mcp_servers[].connection_id` to have the platform attach the (server-side, auto-refreshed) * bearer to that server's tool calls. * * ## Permission * * `agent_conversations` resource with `write` verb. * * ## Example * * ```json * { * "url": "https://huggingface.co/mcp", * "alias": "hf" * } * ``` * * ## Common 400 errors * * | Cause | Detail | * |---|---| * | Invalid server URL | `url` is not an absolute `http(s)` URL | * | Invalid alias | `alias` is not 1-8 letters or digits starting with a letter | * | Unsupported PKCE method | the authorization server advertises PKCE methods but not `S256` | * | Dynamic client registration unsupported | the server advertises no registration endpoint | * | External MCP OAuth error | discovery / registration against the external server failed | */ post: operations["createMcpConnection"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/mcp-connections/callback": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * OAuth redirect target that receives the authorization code * @description The OAuth redirect URI. The external authorization server sends the user's **browser** here * after they consent, so the request carries **no Narrative bearer token**. * * This endpoint does **not** complete the connection. It stores the `code` against its flow * server-side and then redirects the browser (`303`) to the Narrative app, which finishes the job * by calling `POST /mcp-connections/complete` with the signed-in user's own credentials. * * You never call this directly — it's the `redirect_uri` the browser is sent to. * * ## Why it can't complete the connection * * Because it is public, anyone could reach it. If the callback also exchanged the code, someone * could start a flow of their own, get another user to open the resulting consent URL, and end up * with **that** user's access token stored on their own connection. Splitting the flow removes * that: the `state` only lets you deposit a code, and exchanging one requires an authenticated * request from the user the flow belongs to. * * The stored `code` is useless on its own — the exchange also needs the flow's PKCE * `code_verifier`, which never leaves the server — and it is never included in the redirect URL. * * ## Redirect parameters * * The `Location` always points at the app's callback page, with: * * | Parameter | When | * |---|---| * | `state` | Whenever the incoming `state` was well-formed. The app posts it back to complete the connection. | * | `error` | Only on failure, see below. Absent means the code was stored and the app should complete. | * * ### `error` values * * | Value | Meaning | * |---|---| * | `access_denied` | The user declined at the authorization server (RFC 6749 §4.1.2.1). | * | `invalid_request`, `unauthorized_client`, `unsupported_response_type`, `invalid_scope`, `server_error`, `temporarily_unavailable` | Other authorization-server failures, per RFC 6749 §4.1.2.1. An unrecognized code is reported as `server_error` rather than echoed. | * | `invalid_state` | The `state` was malformed. | * | `unknown_state` | No authorization flow matches the `state` — it expired, or was already used. | * | `invalid_callback` | Neither `code` nor `error` was present, or `state` was missing. | * * ## Authentication * * Public (no bearer). A `state` alone cannot produce a token — see above. */ get: operations["mcpConnectionCallback"]; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/mcp-connections/complete": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Finish connecting an external MCP server * @description Completes a connection started by `POST /mcp-connections`, after the user has consented and the * authorization server has redirected their browser through `GET /mcp-connections/callback`. * * The Narrative app calls this from its callback page, so normally you don't call it yourself. It * is part of the public API because the connection flow can also be driven by an integration that * handles the redirect itself. * * ## What this endpoint actually does * * 1. Looks up the authorization flow by `state` (400 if unknown or expired). * 2. Checks the connection behind that flow belongs to the calling user (404 otherwise). * 3. Exchanges the stored authorization code at the server's token endpoint, with the flow's PKCE * `code_verifier` and the resource indicator. * 4. Validates the new token with a `tools/list` call against the MCP server. * 5. Stores the encrypted tokens, flips the connection to `connected`, and consumes the flow. * * Returns the connection's status view, the same shape as `GET /mcp-connections/{id}`. * * ## Only the user who started the flow can complete it * * The `state` is not enough. This endpoint requires a bearer token, and the connection must belong * to that token's `company_id` **and** `user_id`. A connection owned by someone else returns 404 — * identical to a nonexistent one, so ids can't be probed across users. That is what stops a `state` * from being used to capture another user's access token, and it is why the public callback only * stores the code instead of exchanging it. * * A failed exchange leaves the flow in place so it can be retried; a failed `tools/list` validation * consumes it, since the token has already been issued. * * ## Permission * * `agent_conversations` resource with `write` verb. * * ## Example * * ```bash * curl -X POST "$API/mcp-connections/complete" \ * -H "Authorization: Bearer $TOKEN" \ * -H "Content-Type: application/json" \ * -d '{"state": "Yk8fQ2Zsb3dTdGF0ZQ"}' * ``` * * ## Common errors * * | Status | Cause | * |---|---| * | 400 | `state` is malformed, unknown, or expired | * | 400 | the callback has not delivered the authorization code yet | * | 400 | the token exchange with the authorization server failed | * | 400 | the new token failed the `tools/list` validation against the MCP server | * | 404 | the connection does not exist, or belongs to another user | */ post: operations["completeMcpConnection"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/mcp-connections/{id}": { parameters: { query?: never; header?: never; path: { /** @description The connection id returned by `POST /mcp-connections`. */ id: string; }; cookie?: never; }; /** * Get one of the calling user's MCP connections * @description Returns a single connection's status view. Credential-free — no client secret or tokens. * * ## Scope: per-user, not per-company * * Only resolves connections owned by the bearer token's `company_id` **and** `user_id`. A connection * that exists but belongs to someone else returns 404, identical to a nonexistent id (so ids can't be * probed across users). * * ## Permission * * `agent_conversations` resource with `read` verb. */ get: operations["getMcpConnection"]; put?: never; post?: never; /** * Delete one of the calling user's MCP connections * @description Removes a connection and its stored (encrypted) tokens. Any in-flight authorization flow state for * the connection is removed too (cascade). Idempotent from the caller's view: deleting an already-gone * connection returns 404. * * After deletion, agent runs that reference this `connection_id` can no longer resolve a token for that * server — the tool call will fail auth. Re-connect via `POST /mcp-connections` to restore access. * * ## Scope: per-user, not per-company * * Only deletes connections owned by the bearer token's `company_id` **and** `user_id`. A not-owned id * returns 404 without revealing that it exists. * * ## Permission * * `agent_conversations` resource with `write` verb. */ delete: operations["deleteMcpConnection"]; options?: never; head?: never; patch?: never; trace?: never; }; "/model-inference/run": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Run model inference * @description Create a job to perform an LLM call. Supported on both AWS and Snowflake data planes. */ post: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["RunRequest"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ModelInferenceRunResponse"]; }; }; /** @description This error is raised when the JSON is malformed or can't be decoded into a valid 'RunResponse'. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/model-training/train-classifier": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Train a classifier * @description Create a job that trains a text classifier on a dataset. Only supported for datasets on Snowflake data planes. * * The training data is referenced by `dataset_id`; the backing table is resolved server-side. Every column * reference in the request (`label_column`, `id_column`, and each feature's `field_path`) is validated against the * dataset's schema before the job is created. */ post: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { /** * @example { * "dataset_id": 123, * "feature_inputs": [ * { * "feature_type": "text", * "field_path": "description", * "name": "description_text" * }, * { * "feature_type": "categorical", * "field_path": "data['merchant']", * "field_type": "string", * "name": "merchant" * } * ], * "label_column": "category", * "model_name": "product_category_classifier" * } */ "application/json": components["schemas"]["TrainClassifierRequest"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["TrainClassifierResponse"]; }; }; /** * @description This error is raised when the JSON is malformed, when a name is not a valid identifier, when a column * reference does not exist in the dataset's schema, or when the dataset is not materialized on a Snowflake * data plane. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** * @description This error is raised when the dataset is accessible to the caller (e.g. through data-plane collaboration) * but is not owned by the caller's company. Only the dataset's owner can train classifiers on it. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description The dataset was not found. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/models": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get models * @description Returns a paginated list of models accessible to the authenticated company. * * Models can be filtered by repository type and sorted by creation date. */ get: { parameters: { query?: { /** @description Page number. Starts from the first (1) page. */ page?: components["parameters"]["PageNumberParam"]; /** @description Number of records to return per page. */ per_page?: components["parameters"]["PerPageParam"]; /** @description Filter models by repository type. Can be specified multiple times to filter by multiple types. */ repository_type?: components["parameters"]["RepositoryType"]; /** @description Sort order for results. */ order_by?: components["parameters"]["OrderBy"]; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ModelsPaginatedResponse"]; }; }; /** @description Unauthorized */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/models/{model_id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get a model * @description Returns a single model by its ID. */ get: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a model. */ model_id: components["parameters"]["ModelIdParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ModelResponse"]; }; }; /** @description Unauthorized */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description Model not found */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; /** * Update a model * @description Updates an existing model. * * Only the fields provided in the request body will be updated. */ put: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a model. */ model_id: components["parameters"]["ModelIdParam"]; }; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["UpdateModelRequest"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ModelResponse"]; }; }; /** @description This error is raised when the JSON is malformed or can't be decoded into a valid update request. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description Unauthorized */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description Model not found */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; post?: never; /** Archive a model */ delete: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a model. */ model_id: components["parameters"]["ModelIdParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ModelResponse"]; }; }; /** @description Unauthorized */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description Model not found */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; options?: never; head?: never; patch?: never; trace?: never; }; "/nql/validate": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Validate an NQL statement * @description Parse and validate an NQL statement without running it. The statement is parsed with the SQL dialect of * the given data plane and checked against the datasets, access rules and views the token's company can * see. A valid statement returns its AST (see the `Ast` schema). An invalid one returns an RFC 7807 * problem whose `title` and `detail` say what is wrong, with the status code `/nql/run` and * `/v1/nql/execute` return for the same problem. * * Requires a token with read access to subscriptions. `POST /nql/parse` does the same check for any * token, or for no token at all. */ post: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["ValidateRequest"]; }; }; responses: { /** * @description The statement is valid. The body is its AST, or an empty object for a `MERGE` statement, which has * no AST representation. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ValidateResponse"]; }; }; /** * @description The statement did not parse, references a table or column the company cannot see, or the request * body did not decode. A body that does not decode returns the `error` / `error_description` shape * with `error` set to `bad_payload`; everything else is the RFC 7807 problem shape. * visit https://docs.narrative.io/guides/nql/troubleshooting for more details */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Response"] | components["schemas"]["Error"]; }; }; /** * @description The statement is a `CREATE MATERIALIZED VIEW` whose name is already taken by a table or materialized * view of the company. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Response"]; }; }; /** * @description Unprocessable Entity — the query parsed but is semantically invalid, for example a materialized * view output column whose type is not supported (such as DECIMAL), or a query that produces no * output columns. * visit https://docs.narrative.io/guides/nql/troubleshooting for more details */ 422: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Response"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/nql/parse": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Parse an NQL statement * @description The same check as `POST /nql/validate`, open to any token and to callers with no token at all, so a * query editor can report problems as the user types. The response and error shapes are those of * `/nql/validate`. * * With a bearer token the statement is checked against the datasets, access rules and views of the * token's company, exactly as `/nql/validate` does, and the token needs no particular permission. * * Without a token there is no company context. The statement is still parsed with the dialect of the * given data plane and type-checked, but it can only resolve tables that need no company, such as * `narrative.rosetta_stone`, and statements that write data (`CREATE MATERIALIZED VIEW`, `INSERT`, * `UPDATE`, `DELETE`, `MERGE`) are rejected with a 400 titled * `Cannot validate certain queries when unauthentified`. */ post: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["ValidateRequest"]; }; }; responses: { /** * @description The statement is valid. The body is its AST, or an empty object for a `MERGE` statement, which has * no AST representation. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ValidateResponse"]; }; }; /** * @description The statement did not parse, references a table or column the caller cannot see, needs a company * but no token was sent, or the request body did not decode. A body that does not decode returns * the `error` / `error_description` shape with `error` set to `bad_payload`; everything else is the * RFC 7807 problem shape. * visit https://docs.narrative.io/guides/nql/troubleshooting for more details */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Response"] | components["schemas"]["Error"]; }; }; /** * @description The statement is a `CREATE MATERIALIZED VIEW` whose name is already taken by a table or materialized * view of the token's company. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Response"]; }; }; /** * @description Unprocessable Entity — the query parsed but is semantically invalid, for example a materialized * view output column whose type is not supported (such as DECIMAL), or a query that produces no * output columns. * visit https://docs.narrative.io/guides/nql/troubleshooting for more details */ 422: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Response"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/nql/run": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Run a NQL Query * @deprecated * @description **Deprecated. Use `POST /v1/nql/execute` instead** — it returns a workflow and run id rather than a job. * `/nql/run` continues to work; removal will be announced separately. * See https://docs.narrative.io/reference/deprecations/nql-run * * The run endpoint in the NQL API allows users to execute their NQL queries. * This endpoint processes the query and performs the specified operations * within the specified data plane. Depending on the NQL provided, the run * endpoint can create materialized views or generate forecasts. */ post: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { /** * @example { * "nql": "CREATE MATERIALIZED VIEW \"dataset_name\" AS SELECT \"company_data\".\"1\".x AS xx, \"company_data\".\"1\".y AS yy, \"company_data\".\"1\".z AS zz, \"company_data\".\"1\".x + \"company_data\".\"1\".y + \"company_data\".\"1\".z AS xyz_sum FROM \"company_data\".\"1\"" * } */ "application/json": { nql: components["schemas"]["NQL"]; data_plane_id?: components["schemas"]["DataPlaneId"]; compute_pool_id?: components["schemas"]["ComputePoolId"]; create_as_view?: components["schemas"]["CreateAsView"]; }; }; }; responses: { /** @description Created */ 201: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["NqlRunResponse"]; }; }; /** * @description Bad Request * visit https://docs.narrative.io/guides/nql/troubleshooting for more details */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Response"]; }; }; /** * @description Either the company has no usage credit for the data plane the statement runs on, or the * statement would create a table or materialized view under a name that is already taken. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Response"]; }; }; /** * @description Unprocessable Entity — the query parsed but is semantically invalid, for example a materialized * view output column whose type is not supported (such as DECIMAL), or a query that produces no * output columns. * visit https://docs.narrative.io/guides/nql/troubleshooting for more details */ 422: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Response"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/nql/execute": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Execute an NQL statement * @description The execute endpoint in the NQL API allows users to execute their NQL queries. * This endpoint processes the query and performs the specified operations * within the specified data plane. The query runs as a workflow, and the * response carries the ID of that workflow run. Follow the run through the workflows * endpoints; `GET /nql/{job_id}` only serves forecast jobs started by `POST /nql/run`. * * Supported statements: `INSERT`, `UPDATE`, `DELETE`, `EXPLAIN`, and `CREATE MATERIALIZED VIEW`. * Set `create_as_view` to create a view rather than a materialized table; it applies only to * `CREATE MATERIALIZED VIEW` and is ignored for other statements. */ post: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { /** * @example { * "nql": "INSERT INTO \"company_data\".\"1\" (\"id\") VALUES (1)" * } */ "application/json": components["schemas"]["ExecuteRequest"]; }; }; responses: { /** @description The created workflow and the id of the run started for it. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["CreateWorkflowResponseWithRunId"]; }; }; /** * @description The statement did not parse, references a table or column the company cannot see, is a plain * `SELECT` or a `MERGE` (neither can be executed here), names a compute pool that is not usable on * the data plane, or the request body did not decode. A body that does not decode returns the * `error` / `error_description` shape with `error` set to `bad_payload`, and a rejected compute pool * returns it with `error` set to `invalid_request`; everything else is the RFC 7807 problem shape. * visit https://docs.narrative.io/guides/nql/troubleshooting for more details */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Response"] | components["schemas"]["Error"]; }; }; /** * @description Either the company has no usage credit for the data plane the statement runs on, or the * statement would create a table or materialized view under a name that is already taken. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Response"]; }; }; /** * @description Unprocessable Entity — the query parsed but is semantically invalid, for example a materialized * view output column whose type is not supported (such as DECIMAL), or a query that produces no * output columns. * visit https://docs.narrative.io/guides/nql/troubleshooting for more details */ 422: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Response"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/nql/{job_id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get a forecast job * @description Poll a forecast job started by `POST /nql/run` with an `EXPLAIN` statement. `result` is null until * the job reaches `completed` or `failed`, then carries either the forecast or the failure message. * * Only forecast jobs are served here. Statements run through `POST /v1/nql/execute` are workflow runs; * follow those through the workflows endpoints. */ get: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a job. */ job_id: components["parameters"]["JobId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ForecastRunResponse"]; }; }; /** @description No forecast job with this id was found. The body is empty. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/admin/permissions": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Create a permission * @description Create a new permission */ post: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["CreatePermissionRequest"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content?: never; }; /** @description This error is raised when the JSON is malformed. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description This error is raised when permission already exists. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/installations/{installation_id}/profiles": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** Returns app profiles */ get: { parameters: { query?: never; header?: never; path: { /** @description The installation ID */ installation_id: components["parameters"]["InstallationId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["AppProfilesResponse"]; }; }; }; }; put?: never; /** * Creates an app profile * @description The profile will be assigned a unique identifier upon creation. New profiles are "disabled" and should be activated after creation. */ post: { parameters: { query?: never; header?: never; path: { /** @description The installation ID */ installation_id: components["parameters"]["InstallationId"]; }; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["AppProfileRequest"]; }; }; responses: { /** @description The created profile */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["AppProfileResponse"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/installations/{installation_id}/profiles/{app_profile_id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** Returns profile with {profile_id} */ get: { parameters: { query?: never; header?: never; path: { /** @description The profile ID */ app_profile_id: components["parameters"]["InstallationProfileIdParam"]; /** @description The installation ID */ installation_id: components["parameters"]["InstallationId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["AppProfileResponse"]; }; }; }; }; /** Updates an existing app profile */ put: { parameters: { query?: never; header?: never; path: { /** @description The profile ID */ app_profile_id: components["parameters"]["InstallationProfileIdParam"]; /** @description The installation ID */ installation_id: components["parameters"]["InstallationId"]; }; cookie?: never; }; /** @description Profile creation payload */ requestBody: { content: { "application/json": components["schemas"]["AppProfileUpdateRequest"]; }; }; responses: { /** @description The updated app profile */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["AppProfileResponse"]; }; }; }; }; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/installations/{installation_id}/profiles/{app_profile_id}/enable": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Enables a profile * @description Only profiles that are enabled will be considered when delivering subscriptions. */ post: { parameters: { query?: never; header?: never; path: { /** @description The profile ID */ app_profile_id: components["parameters"]["InstallationProfileIdParam"]; /** @description The installation ID */ installation_id: components["parameters"]["InstallationId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description The updated app profile */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["AppProfileResponse"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/installations/{installation_id}/profiles/{app_profile_id}/disable": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Disables a profile * @description Only profiles that are enabled will be considered when delivering subscriptions. */ post: { parameters: { query?: never; header?: never; path: { /** @description The profile ID */ app_profile_id: components["parameters"]["InstallationProfileIdParam"]; /** @description The installation ID */ installation_id: components["parameters"]["InstallationId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description The updated app profile */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["AppProfileResponse"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/installations/{installation_id}/profiles/{app_profile_id}/archive": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Archives a profile * @description Archiving prevents using the profile again in the future. */ post: { parameters: { query?: never; header?: never; path: { /** @description The profile ID */ app_profile_id: components["parameters"]["InstallationProfileIdParam"]; /** @description The installation ID */ installation_id: components["parameters"]["InstallationId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description The updated app profile */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["AppProfileResponse"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v2/queries/{query_id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get a query by id * @description Get a query. */ get: { parameters: { query?: never; header?: never; path: { /** @description Query identifier. */ query_id: components["parameters"]["QueryId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["QueriesResponse"]; }; }; }; }; /** * Updates a query * @description Updates a query */ put: { parameters: { query?: never; header?: never; path: { /** @description Query identifier. */ query_id: components["parameters"]["QueryId"]; }; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["UpdateQueryRequest"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["QueriesResponse"]; }; }; }; }; post?: never; /** * Deletes a query * @description Deletes a query */ delete: { parameters: { query?: never; header?: never; path: { /** @description Query identifier. */ query_id: components["parameters"]["QueryId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content?: never; }; }; }; options?: never; head?: never; patch?: never; trace?: never; }; "/v2/queries": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get accessible queries * @description Get all accessible queries. */ get: { parameters: { query?: { /** @description If `true` returns only queries that are owned by the requestor. If `false` returns only queries that have been shared with the requestor. If not provided returns both. */ is_owned?: components["parameters"]["IsOwnedParam"]; /** @description Filters queries that are tagged with `tag`. Can appear multiple times, in which case they're OR-d together */ tag?: components["parameters"]["QueryTagParam"]; /** @description Number of page. Stars from the first (1) page. */ page?: components["parameters"]["PageNumberQueryParam"]; /** @description Number of records to return. */ per_page?: components["parameters"]["PerPageQueryParam"]; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["QueriesPaginatedResponse"]; }; }; }; }; put?: never; /** * Create a query * @description Any number of properties can be updated on the same request. * If a property is not sent on the payload, the value won't be updated. */ post: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["CreateQueryRequest"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["QueriesResponse"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/resources/buckets": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get buckets * @description Return the AWS S3 buckets assigned to the authenticated company. */ get: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["CompanyBucketsResponse"]; }; }; }; }; put?: never; /** * Create bucket * @description Create an AWS S3 bucket inside Narrative's AWS account assigned to the authenticated company. * * The created bucket is uniquely accessible by the authenticated company and can be used to facilitate the automation of tasks like ingestion of data into a dataset. * * Pay attention, that bucket-owner-full-control ACL is strictly required for "bucket_policy" type of access. */ post: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["CompanyBucketRequest"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["CompanyBucketResponse"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/resources/update-access": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Update access type * @description Update access type to the bucket. * Pay attention, that bucket-owner-full-control ACL is strictly required for "bucket_policy" type of access. * Also, bucket should be whitelisted for mutation. All buckets created by creation endpoint are mutable by default. * Buckets created before 2023 could be immutable in case of customized policies. * You can call 'Get buckets' endpoint to check `is_access_mutable` property in response. */ post: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["UpdateBucketAccessTypeRequest"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["CompanyBucketResponse"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v2/inference": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** Infer the dataset schema of a file passed by multipart file. */ post: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "multipart/form-data": components["schemas"]["MultipartFile"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { schema?: components["schemas"]["DatasetSchema"]; }; }; }; /** @description Bad request. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": { /** @description Error code. */ error: string; /** @description Human-friendly error message. */ error_description: string; }; }; }; /** @description Internal error. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": { /** @description Error code. */ error: string; /** @description Human-friendly error message. */ error_description: string; }; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/uploads/{upload_path}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Upload a file * @description Sending a file to Narrative is a two step process. This endpoint allows you to request an `upload_url` which can be used in a `PUT` request to upload the file. * * For example, once you have received an `upload_url` you could use it as follows: * * ```bash * curl -v --upload-file my-file.csv {upload_url} * ``` * * The generated `upload_url` is only valid for 30 minutes after issuance. */ post: { parameters: { query?: never; header?: never; path: { /** * @description A slash-separated path where the uploaded file should be stored * @example /lists/idlist.csv */ upload_path: components["parameters"]["UploadPath"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description The upload url */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["UploadUrl"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/usage": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Create a usage event * @description Create a usage event to charge a customer for their use of a product. */ post: operations["createUsage"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v2/views/{view_id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get a view by id * @description Get a view. */ get: { parameters: { query?: never; header?: never; path: { /** @description View identifier. */ view_id: components["parameters"]["ViewId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ViewsResponse"]; }; }; }; }; /** * Updates a view * @description Updates a view */ put: { parameters: { query?: never; header?: never; path: { /** @description View identifier. */ view_id: components["parameters"]["ViewId"]; }; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["UpdateViewRequest"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ViewsResponse"]; }; }; }; }; post?: never; /** * Archives a view * @description Archives a view */ delete: { parameters: { query?: never; header?: never; path: { /** @description View identifier. */ view_id: components["parameters"]["ViewId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content?: never; }; }; }; options?: never; head?: never; patch?: never; trace?: never; }; "/v2/views": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get accessible views * @description Get all accessible views. */ get: { parameters: { query?: { /** @description If `true` returns only views that are owned by the requestor. If `false` returns only views that have been shared with the requestor. If not provided returns both. */ is_owned?: components["parameters"]["ViewIsOwnedParam"]; /** @description Filters views that are tagged with `tag`. Can appear multiple times, in which case they're OR-d together */ tag?: components["parameters"]["ViewTagParam"]; /** @description Number of page. Stars from the first (1) page. */ page?: components["parameters"]["PageNumberQueryParam"]; /** @description Number of records to return. */ per_page?: components["parameters"]["PerPageQueryParam"]; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ViewsPaginatedResponse"]; }; }; }; }; put?: never; /** * Create a view * @description Any number of properties can be updated on the same request. * If a property is not sent on the payload, the value won't be updated. */ post: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["CreateViewRequest"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ViewsResponse"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/webhooks": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * List webhook subscriptions * @description List your company's active webhook subscriptions. Archived subscriptions are not returned. * * Requires read access to webhooks. */ get: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["WebhookSubscriptionsResponse"]; }; }; 401: components["responses"]["Unauthorized"]; /** @description The token is not scoped to a company. */ 403: { headers: { [name: string]: unknown; }; content?: never; }; }; }; put?: never; /** * Create a webhook subscription * @description Create a webhook subscription for your company. The response includes a `secret`; store it, because it is what * lets you verify that a later callback really came from Narrative. * * Requires write access to webhooks. */ post: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["CreateWebhookSubscriptionRequest"]; }; }; responses: { /** @description The subscription was created. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["WebhookSubscriptionResponse"]; }; }; /** @description The body could not be decoded — an unknown `type`, a missing `url`, or an empty filter array. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; 401: components["responses"]["Unauthorized"]; /** @description The token is not scoped to a company. */ 403: { headers: { [name: string]: unknown; }; content?: never; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/webhooks/{webhook_subscription_id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get a webhook subscription by ID * @description Retrieve one of your company's active webhook subscriptions. * * Requires read access to webhooks. */ get: { parameters: { query?: never; header?: never; path: { /** * @description The subscription's `id`. Anything that is not a UUID does not match the route and returns 404. * @example 3fa85f64-5717-4562-b3fc-2c963f66afa6 */ webhook_subscription_id: components["parameters"]["WebhookSubscriptionId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["WebhookSubscriptionResponse"]; }; }; 401: components["responses"]["Unauthorized"]; /** @description The token is not scoped to a company. */ 403: { headers: { [name: string]: unknown; }; content?: never; }; /** @description No active subscription with that id was found. The response has no body. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; put?: never; post?: never; /** * Archive a webhook subscription * @description Archive a webhook subscription. Archiving is one-way and stops delivery; there is no un-archive. The * subscription disappears from the read endpoints immediately, so archiving the same id twice returns 404 the * second time. * * Requires write access to webhooks. */ delete: { parameters: { query?: never; header?: never; path: { /** * @description The subscription's `id`. Anything that is not a UUID does not match the route and returns 404. * @example 3fa85f64-5717-4562-b3fc-2c963f66afa6 */ webhook_subscription_id: components["parameters"]["WebhookSubscriptionId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description The subscription was archived. The body is an empty JSON object. */ 200: { headers: { [name: string]: unknown; }; content: { /** @example {} */ "application/json": Record; }; }; 401: components["responses"]["Unauthorized"]; /** @description The token is not scoped to a company. */ 403: { headers: { [name: string]: unknown; }; content?: never; }; /** @description No active subscription with that id was found. The response has no body. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; options?: never; head?: never; patch?: never; trace?: never; }; "/whoami": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** Get a current user */ get: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["WhoamiResponse"]; }; }; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/workflows": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * List workflows * @description List all active workflows for the authenticated company. */ get: { parameters: { query?: { /** @description Number of records to return. */ per_page?: components["parameters"]["PerPageQueryParam"]; /** @description Number of page. Stars from the first (1) page. */ page?: components["parameters"]["PageNumberQueryParam"]; /** * @description Narrow results to workflows on this data plane. * @example f79cbdae-4848-47ca-95e8-69588364d185 */ data_plane_id?: components["parameters"]["WorkflowDataPlaneIdParam"]; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description A paginated list of workflows. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ListWorkflowsResponse"]; }; }; }; }; put?: never; /** * Create a workflow * @description Create a new workflow from a YAML specification. The specification is parsed and validated * before the workflow is persisted. * * Optionally, the workflow can be scheduled and/or triggered immediately upon creation * using the `trigger_immediately` and `schedule_immediately` request fields. */ post: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["CreateWorkflowRequest"]; }; }; responses: { /** @description The created workflow. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["CreateWorkflowResponse"]; }; }; /** * @description The specification could not be parsed, the workflow name it declares is already taken or * reserved, or the request body was not valid JSON. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Response"] | components["schemas"]["Error"]; }; }; /** * @description The company has no usage credit for the workflow's data plane. Only returned when * `trigger_immediately` or `schedule_immediately` is set; the workflow is still created * before the credit check runs. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Response"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/workflows/{workflow_id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get a workflow * @description Retrieve a workflow by its ID. Only workflows owned by the authenticated company are accessible. */ get: { parameters: { query?: never; header?: never; path: { /** * @description Unique identifier for a workflow. * @example a1b2c3d4-e5f6-7890-abcd-ef1234567890 */ workflow_id: components["parameters"]["WorkflowId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description The workflow. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["WorkflowResponse"]; }; }; /** @description Workflow not found. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Response"]; }; }; }; }; put?: never; post?: never; /** * Archive a workflow * @description Archive a workflow. This terminates any active schedule and running execution, * then marks the workflow as archived in the database. */ delete: { parameters: { query?: never; header?: never; path: { /** * @description Unique identifier for a workflow. * @example a1b2c3d4-e5f6-7890-abcd-ef1234567890 */ workflow_id: components["parameters"]["WorkflowId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description Workflow successfully archived. */ 204: { headers: { [name: string]: unknown; }; content?: never; }; /** @description Workflow not found. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Response"]; }; }; }; }; options?: never; head?: never; patch?: never; trace?: never; }; "/workflows/{workflow_id}/trigger": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Trigger a workflow * @description Trigger an immediate execution of a workflow. Returns the run ID of the new execution. */ post: { parameters: { query?: never; header?: never; path: { /** * @description Unique identifier for a workflow. * @example a1b2c3d4-e5f6-7890-abcd-ef1234567890 */ workflow_id: components["parameters"]["WorkflowId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description The workflow was triggered successfully. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["TriggerWorkflowResponse"]; }; }; /** @description Workflow not found. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Response"]; }; }; /** @description The company has no usage credit for the workflow's data plane. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Response"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/workflows/{workflow_id}/schedule": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Schedule a workflow * @description Create a schedule for a workflow based on the cron expression defined in its specification. * The workflow specification must contain a `schedule` section. * * Optionally, the workflow can also be triggered immediately by setting `trigger_immediately` to true. * The request body must be a JSON object; send `{}` when there is nothing to set. */ post: { parameters: { query?: never; header?: never; path: { /** * @description Unique identifier for a workflow. * @example a1b2c3d4-e5f6-7890-abcd-ef1234567890 */ workflow_id: components["parameters"]["WorkflowId"]; }; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["ScheduleWorkflowRequest"]; }; }; responses: { /** @description The workflow was scheduled successfully. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ScheduleWorkflowResponse"]; }; }; /** * @description The workflow was not found, its specification declares no schedule, it is already * scheduled, or the request body was not valid JSON. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Response"] | components["schemas"]["Error"]; }; }; /** * @description The company has no usage credit for the workflow's data plane. Scheduling checks credit * whether or not `trigger_immediately` is set. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Response"]; }; }; }; }; /** * Remove a workflow schedule * @description Delete the schedule for a workflow. This stops future scheduled executions from being * created but does not cancel any currently running workflow execution. * * Returns an error if the workflow does not have an active schedule. */ delete: { parameters: { query?: never; header?: never; path: { /** * @description Unique identifier for a workflow. * @example a1b2c3d4-e5f6-7890-abcd-ef1234567890 */ workflow_id: components["parameters"]["WorkflowId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description The workflow schedule was removed successfully. */ 204: { headers: { [name: string]: unknown; }; content?: never; }; /** @description Workflow not found or workflow is not scheduled. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Response"]; }; }; }; }; options?: never; head?: never; patch?: never; trace?: never; }; "/workflows/{workflow_id}/cancel": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Cancel a workflow execution * @description Request cancellation of the currently running execution of a workflow. */ post: { parameters: { query?: never; header?: never; path: { /** * @description Unique identifier for a workflow. * @example a1b2c3d4-e5f6-7890-abcd-ef1234567890 */ workflow_id: components["parameters"]["WorkflowId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description Cancellation request was sent successfully. */ 204: { headers: { [name: string]: unknown; }; content?: never; }; /** @description Workflow not found or no running execution. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Response"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/workflows/{workflow_id}/runs": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * List workflow runs * @description List execution runs for a workflow. Returns a paginated list of runs with their status, * start time, and close time. * * Results are ordered by start time descending (most recent first). */ get: { parameters: { query?: { /** * @description The maximum number of runs to return per page. Defaults to 10. * @example 10 */ per_page?: components["parameters"]["PageSize"]; /** * @description Opaque token from a previous response to retrieve the next page of results. * @example eyJsYXN0UnVuSWQiOiJhYmMxMjMifQ== */ page_token?: components["parameters"]["PageToken"]; }; header?: never; path: { /** * @description Unique identifier for a workflow. * @example a1b2c3d4-e5f6-7890-abcd-ef1234567890 */ workflow_id: components["parameters"]["WorkflowId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description A paginated list of workflow runs. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ListRunsResponse"]; }; }; /** @description Workflow not found. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Response"]; }; }; }; }; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/workflows/{workflow_id}/runs/{run_id}/cancel": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Cancel a specific workflow run * @description Request cancellation of a specific workflow execution identified by its run ID. * This is the recommended method for cancelling workflow executions, as it guarantees * that only the intended execution is cancelled. Unlike cancelling by workflow ID alone, * this avoids a race condition where: * 1. A request to cancel the last execution is sent. * 2. The last execution completes before the server processes the cancellation. * 3. A new workflow execution starts. * 4. The server processes the cancellation request and cancels the new execution instead of the intended one. */ post: { parameters: { query?: never; header?: never; path: { /** * @description Unique identifier for a workflow. * @example a1b2c3d4-e5f6-7890-abcd-ef1234567890 */ workflow_id: components["parameters"]["WorkflowId"]; /** * @description Unique identifier for a workflow execution run. * @example b7e3f1a2-4c5d-6e7f-8a9b-0c1d2e3f4a5b */ run_id: components["parameters"]["RunIdParam"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description Cancellation request was sent successfully. */ 204: { headers: { [name: string]: unknown; }; content?: never; }; /** @description Workflow not found or workflow run not found. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Response"]; }; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; } export interface webhooks { webhookDelivery: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Event delivery * @description This is the request **Narrative sends to you** — the endpoint you registered as a subscription's `url`. It is * described here so you can generate a handler for it; it is not something you call. * * Every delivery is a POST with `Content-Type: application/json` and an `X-Narrative-Secret` header carrying the * subscription's `secret`. Compare that header against the `secret` you stored when you created the subscription * and reject anything that does not match. * * Return any 2xx. Narrative treats everything else — including a connection failure — as a failed attempt and * retries with exponential backoff until the event's attempt budget runs out, so make your handler idempotent on * the envelope's `id`. */ post: operations["webhookDelivery"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; } export interface components { schemas: { AccessToken: { /** * @description The access token * @example xxxxxxxxxxx */ access_token: string; /** * @description The TTL of the `access_token` in seconds * @example 3600 */ access_token_expires_in: number; /** * @description The refresh token * @example yyyyyyyyyyy */ refresh_token: string; /** * @description The TTL of the `refresh_token` in seconds * @example 14400 */ refresh_token_expires_in: number; }; /** * @description The resource a permission applies to. `schema_template` is also accepted on input as a legacy alias for * `schema_preset`, but responses always use `schema_preset`. * @enum {string} */ PermissionResource: "access_tokens" | "agent_conversations" | "api_info" | "app_events" | "app_invites" | "app_profiles" | "apps" | "attribute_derivations" | "attributes" | "billings" | "charges" | "commands_subscriptions_delivery" | "company_info" | "compute_pools" | "connections" | "contracts" | "data_plane_logs" | "data_planes" | "data_streams" | "datasets" | "deliveries" | "destinations" | "encryption_materials" | "events_subscriptions_transaction" | "forecasts" | "inference" | "installations" | "internal_reports" | "jobs" | "lists" | "mappings" | "model_inference" | "model_training" | "models" | "nql" | "payment_methods" | "persistent_permissions" | "products" | "profile_store_data" | "profile_store_schema" | "queries" | "resources" | "schema_preset" | "subscriptions" | "uploads" | "usage" | "users" | "views" | "webhooks" | "workflows"; /** * @description One grant: a level of access to one resource. A token carries a list of these, and an endpoint checks for the * exact pair it needs — `read`/`datasets` does not imply `write`/`datasets`, and neither implies anything about * another resource. * @example { * "resource": "datasets", * "access": "read" * } */ Permission: { /** * @description The level of access. * @enum {string} */ access: "read" | "write"; resource: components["schemas"]["PermissionResource"]; }; /** * Format: date-time * @description When the token expires, RFC 3339. Expiry is stored with day granularity, so this is the requested expiry * rounded down to a whole number of days from when the token was created — ask for 36 hours and you get 24. * @example 2023-10-31T11:19:13.400498Z */ ExpiresAt: string; /** * @description Everything about a System Access Token except the credential itself. The credential is returned once, by * `POST /access-tokens/tokens`, and never again. * @example { * "id": "546c65d6-e589-4d3c-b1fe-7e61711cc418", * "name": "My Token", * "permissions": [ * { * "access": "read", * "resource": "datasets" * }, * { * "access": "write", * "resource": "datasets" * }, * { * "access": "read", * "resource": "subscriptions" * }, * { * "access": "write", * "resource": "subscriptions" * } * ], * "expires_at": "2023-10-31T11:19:13.400498Z" * } */ AccessTokenMetadata: { /** * Format: uuid * @description The id of the token. */ id: string; /** @description The name of the token. */ name: string; /** @description The permissions granted to the token. */ permissions: components["schemas"]["Permission"][]; expires_at: components["schemas"]["ExpiresAt"]; }; /** * @description Every System Access Token belonging to the caller's company, in one unpaginated array. Expired tokens are * included; compare `expires_at` yourself if you only want live ones. * @example { * "records": [ * { * "id": "546c65d6-e589-4d3c-b1fe-7e61711cc418", * "name": "My Read/Write Token", * "permissions": [ * { * "access": "read", * "resource": "datasets" * }, * { * "access": "write", * "resource": "datasets" * }, * { * "access": "read", * "resource": "subscriptions" * }, * { * "access": "write", * "resource": "subscriptions" * } * ], * "expires_at": "2023-10-31T11:19:13.400498Z" * }, * { * "id": "2fb4df74-5318-4ecf-9f23-a8e1066689ba", * "name": "My Read-Only Token", * "permissions": [ * { * "access": "read", * "resource": "datasets" * }, * { * "access": "read", * "resource": "subscriptions" * } * ], * "expires_at": "2023-11-30T11:19:13.400498Z" * } * ] * } */ ListAccessTokensResponse: { records: components["schemas"]["AccessTokenMetadata"][]; }; Error: { /** @example Unauthorized */ error: string; /** @example You are not authorized to use this endpoint. */ error_description: string; }; /** * @description When the token should expire. Accepts either an RFC 3339 timestamp or a bare `YYYY-MM-DD` date, which is read * as midnight UTC. * * The gap between now and this value must be at least 1 and at most 365 whole days — a value less than 24 hours * out rounds down to 0 days and is rejected. Omit it to get the maximum, 365 days. * @example 2023-10-31T11:19:13.400498Z * @example 2023-10-31 */ RequestedExpiresAt: string; /** * @example { * "summary": "Read/write on two resources, expiring on a given date", * "value": { * "name": "My Token", * "permissions": [ * { * "access": "read", * "resource": "datasets" * }, * { * "access": "write", * "resource": "datasets" * }, * { * "access": "read", * "resource": "subscriptions" * }, * { * "access": "write", * "resource": "subscriptions" * } * ], * "expires_at": "2023-10-31T11:19:13.400498Z" * } * } * @example { * "summary": "Read-only, expiring at midnight UTC on a given day", * "value": { * "name": "CI read-only", * "permissions": [ * { * "access": "read", * "resource": "datasets" * }, * { * "access": "read", * "resource": "jobs" * } * ], * "expires_at": "2023-10-31" * } * } * @example { * "summary": "Name only — default permissions, expires in 365 days", * "value": { * "name": "My Token" * } * } */ CreateAccessTokenRequest: { /** @description The name of the token. */ name: string; /** * @description The permissions to grant. Omit this to get the default set — read and write on the resources a platform * user normally works with. */ permissions?: components["schemas"]["Permission"][] | null; expires_at?: components["schemas"]["RequestedExpiresAt"]; }; /** * @description A newly created System Access Token. This is the only response that carries `access_token` — store it now, * because no later call returns it and there is no way to recover it. * @example { * "id": "546c65d6-e589-4d3c-b1fe-7e61711cc418", * "name": "My Token", * "permissions": [ * { * "access": "read", * "resource": "datasets" * }, * { * "access": "write", * "resource": "datasets" * }, * { * "access": "read", * "resource": "subscriptions" * }, * { * "access": "write", * "resource": "subscriptions" * } * ], * "expires_at": "2023-10-31T11:19:13.400498Z", * "access_token": "ldg8uuGibVJNHI9s+dcdIQ==" * } */ CreatedAccessToken: { /** * Format: uuid * @description The id of the token. */ id: string; /** @description The name of the token. */ name: string; /** @description The permissions granted to the token. */ permissions: components["schemas"]["Permission"][]; expires_at: components["schemas"]["ExpiresAt"]; /** @description The credential, base64-encoded. Send it as `Authorization: Bearer `. */ access_token: string; }; /** * @example { * "record": { * "id": "546c65d6-e589-4d3c-b1fe-7e61711cc418", * "name": "My Token", * "permissions": [ * { * "access": "read", * "resource": "datasets" * }, * { * "access": "write", * "resource": "datasets" * }, * { * "access": "read", * "resource": "subscriptions" * }, * { * "access": "write", * "resource": "subscriptions" * } * ], * "expires_at": "2023-10-31T11:19:13.400498Z" * } * } */ GetAccessTokenResponse: { record: components["schemas"]["AccessTokenMetadata"]; }; /** * @description Every field is optional, but at least one must be present — an empty body is a 400. Fields you omit are left * alone. * @example { * "summary": "Rename only", * "value": { * "name": "My Token" * } * } * @example { * "summary": "Replace the permission set and push the expiry out", * "value": { * "permissions": [ * { * "access": "read", * "resource": "datasets" * }, * { * "access": "write", * "resource": "datasets" * }, * { * "access": "read", * "resource": "subscriptions" * }, * { * "access": "write", * "resource": "subscriptions" * } * ], * "expires_at": "2023-10-31T11:19:13.400498Z" * } * } */ UpdateAccessTokenRequest: { /** @description The new name of the token. */ name?: string | null; /** @description The permissions to grant, replacing the current set. */ permissions?: components["schemas"]["Permission"][] | null; expires_at?: components["schemas"]["RequestedExpiresAt"]; }; /** * @description It should be unique. * Also should not intersect with Dataset names. * Must be <= 256 characters and consist of only alphanumeric characters and underscores. */ AccessRuleName: string; /** @description Unique identifier for the access rule. */ AccessRuleId: number; /** * Format: int64 * @description The id of an existing company * @example 345 */ AccessRuleCompanyId: number; /** @description Name of the company that owns this rule. */ AccessRuleCompanyName: string; /** @description Optional. Unique slug assigned to company. */ AccessRuleCompanySlug: string; /** * Format: uuid * @description The data plane the access rule belongs to. A rule can only be queried from this data plane. */ AccessRuleDataPlaneId: string; /** @description Optional. Display Name must be non-empty and less than 1000 chars. */ AccessRuleDisplayName: string; /** @description A human-friendly description of the access rule. */ AccessRuleDescription: string; /** @description Optional. Image url must be < 1000 characters, start from https://, ends with one of: jpg, apng, jpeg, jfif, pjpeg, webp, pjp, svg, avif, png, gif, bmp, tiff */ AccessRuleImage: string; /** * @description Current status of the access rule. Deleting a rule archives it. * @enum {string} */ AccessRuleStatus: "archived" | "active"; /** @description Optional. `_nio_access_rule` will be added even if not presented. Access Rule tag must be non-empty and less than 256 chars. */ AccessRuleTags: string[]; /** @description NQL query of access rule. */ AccessRuleNQL: string; /** * @description Schema describing a structure of View (Access Rule). When the rule exposes mapped attributes, they are * described under `properties._rosetta_stone`. */ AccessRuleSchema: { [key: string]: unknown; }; /** @description This resource is accessible by anyone. */ All: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "All"; }; /** @description This resource is private to the owning company. */ None: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "None"; }; /** @description This resource is visible to non-authenticated users. */ Anonymous: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "Anonymous"; }; /** @description This resource is accessible by all companies specified in `company_ids`. */ Inclusion: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "Inclusion"; /** @description The companies to which the constraint applies. */ company_ids: number[]; }; /** @description This resource is accessible by all companies _except_ those specified in `company_ids`. */ Exclusion: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "Exclusion"; /** @description The companies to which the constraint applies. */ company_ids: number[]; }; /** @description Describes who can view a resource */ View: components["schemas"]["All"] | components["schemas"]["None"] | components["schemas"]["Anonymous"] | components["schemas"]["Inclusion"] | components["schemas"]["Exclusion"]; /** @description Describes who can query a resource */ Query: components["schemas"]["All"] | components["schemas"]["None"] | components["schemas"]["Inclusion"] | components["schemas"]["Exclusion"]; /** @description Describes who can view or query a resource */ Collaborators: { view: components["schemas"]["View"]; query: components["schemas"]["Query"]; }; /** * Format: double * @description How much to charge for a row which matches this access rule. * Cost per mille (CPM), more commonly called “cost per thousand,” is how much a buyer pays for 1,000 records. */ AccessRulePriceCpmUsd: number; /** @description All datasets that were used to form the data. */ AccessRuleDatasetIds: number[]; /** @description When the access rule was created and last updated, and by whom. Only the owning company sees the user ids. */ AccessRuleFullMetadata: { /** * @description When the access rule was created. An ISO-8601 local date-time in UTC, without an offset. * @example 2023-12-14T21:36:51.847901 */ created_at: string; /** * Format: int64 * @description Id of the user who created the access rule, or null when that was not recorded. */ created_by?: number | null; /** * @description When the access rule was last updated. An ISO-8601 local date-time in UTC, without an offset. * @example 2023-12-14T21:36:51.847901 */ updated_at: string; /** * Format: int64 * @description Id of the user who last updated the access rule, or null when that was not recorded. */ updated_by?: number | null; }; /** * @description Indicates the ownership of the access rule. * @enum {string} */ AccessRuleOwnedType: "owned"; AccessRuleMapping: { /** * Format: int64 * @description The id of the mapped attribute. */ attribute_id: number; /** @description The name of the mapped attribute. */ attribute_name: string; /** * @description Dot-separated paths of attribute properties exposed by the access rule. * Empty for scalar attributes. */ properties: string[]; }; /** * @description Attributes that are mapped to columns referenced by this access rule. For each mapped * attribute, `properties` lists the attribute property paths that are exposed by the rule. */ AccessRuleMappings: components["schemas"]["AccessRuleMapping"][]; /** * @example { * "name": "access_rule_ebc86610_0907_4374_8fc9_be360f0ff8d0", * "id": 1, * "company_id": 1, * "company_name": "company", * "company_slug": "company_slug_60a4e678_1d56_48a7_8b8b_4e1d689b11a6", * "data_plane_id": "f79cbdae-4848-47ca-95e8-69588364d185", * "display_name": "display name", * "description": "description", * "image": "https://narrative.test/1.png", * "status": "active", * "tags": [ * "_nio_access_rule" * ], * "nql": "select company_data.\"1\".columnA from company_data.\"1\" WHERE columnA = columnB", * "schema": { * "type": "object", * "properties": { * "columnA": { * "display_name": "columnA", * "type": "string" * } * }, * "required": [ * "columnA" * ] * }, * "collaborators": { * "query": { * "type": "inclusion", * "company_ids": [ * 789 * ] * }, * "view": { * "type": "all" * } * }, * "price_cpm_usd": 1000.054, * "metadata": { * "created_at": "2023-12-14T21:36:51.847901", * "created_by": 42, * "updated_at": "2023-12-14T21:36:51.847901", * "updated_by": null * }, * "dataset_ids": [ * 42 * ], * "type": "owned", * "is_owned": true, * "mappings": [ * { * "attribute_id": 42, * "attribute_name": "id", * "properties": [ * "id.type", * "id.value" * ] * } * ] * } */ OwnedAccessRuleV2Response: { name?: components["schemas"]["AccessRuleName"] | null; id: components["schemas"]["AccessRuleId"]; company_id: components["schemas"]["AccessRuleCompanyId"]; company_name: components["schemas"]["AccessRuleCompanyName"]; company_slug?: components["schemas"]["AccessRuleCompanySlug"] | null; data_plane_id: components["schemas"]["AccessRuleDataPlaneId"]; display_name?: components["schemas"]["AccessRuleDisplayName"] | null; description?: components["schemas"]["AccessRuleDescription"] | null; image?: components["schemas"]["AccessRuleImage"] | null; /** * @description Status of the access rule. Archived rules are never returned by the read endpoints, so this is * `active` everywhere except the response to the update that archives the rule. */ status: components["schemas"]["AccessRuleStatus"]; tags: components["schemas"]["AccessRuleTags"]; nql?: components["schemas"]["AccessRuleNQL"] | null; schema?: components["schemas"]["AccessRuleSchema"] | null; collaborators: components["schemas"]["Collaborators"]; price_cpm_usd: components["schemas"]["AccessRulePriceCpmUsd"]; dataset_ids: components["schemas"]["AccessRuleDatasetIds"]; metadata: components["schemas"]["AccessRuleFullMetadata"]; /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "owned"; /** * @description Always `true` for an owned rule. * @enum {boolean} */ is_owned: true; mappings: components["schemas"]["AccessRuleMappings"]; }; /** @description When the access rule was created and last updated. */ AccessRuleMetadata: { /** * @description When the access rule was created. An ISO-8601 local date-time in UTC, without an offset. * @example 2023-12-14T21:36:51.847901 */ created_at: string; /** * @description When the access rule was last updated. An ISO-8601 local date-time in UTC, without an offset. * @example 2023-12-14T21:36:51.847901 */ updated_at: string; }; /** * @description Indicates the ownership of the access rule. * @enum {string} */ AccessRuleSharedType: "explicit_share" | "implicit_share"; /** * @example { * "name": "name", * "id": 2, * "company_id": 42, * "company_name": "company name", * "company_slug": "sompany_slug", * "data_plane_id": "f79cbdae-4848-47ca-95e8-69588364d185", * "display_name": "access rule", * "description": "description", * "image": "https://google.com/1.jpg", * "tags": [ * "tag" * ], * "schema": { * "type": "object", * "properties": { * "id": { * "order": 1, * "display_name": "id of field", * "type": "string" * } * }, * "required": [ * "id" * ] * }, * "price_cpm_usd": 42.123, * "metadata": { * "created_at": "2007-12-03T10:15:30", * "updated_at": "2008-12-03T10:15:30" * }, * "is_owned": false, * "type": "explicit_share", * "mappings": [ * { * "attribute_id": 42, * "attribute_name": "id", * "properties": [ * "id.type", * "id.value" * ] * } * ] * } */ SharedAccessRuleV2Response: { name?: components["schemas"]["AccessRuleName"] | null; id: components["schemas"]["AccessRuleId"]; company_id: components["schemas"]["AccessRuleCompanyId"]; company_name: components["schemas"]["AccessRuleCompanyName"]; company_slug?: components["schemas"]["AccessRuleCompanySlug"] | null; data_plane_id: components["schemas"]["AccessRuleDataPlaneId"]; display_name?: components["schemas"]["AccessRuleDisplayName"] | null; description?: components["schemas"]["AccessRuleDescription"] | null; image?: components["schemas"]["AccessRuleImage"] | null; tags: components["schemas"]["AccessRuleTags"]; schema?: components["schemas"]["AccessRuleSchema"] | null; price_cpm_usd: components["schemas"]["AccessRulePriceCpmUsd"]; metadata: components["schemas"]["AccessRuleMetadata"]; /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "explicit_share" | "implicit_share"; /** * @description Always `false` for a shared rule. * @enum {boolean} */ is_owned: false; mappings: components["schemas"]["AccessRuleMappings"]; }; /** * @description An access rule as seen by the caller. The owning company gets the full rule (`type` is `owned`); everyone * else, including unauthenticated callers, gets the reduced shared form. */ AccessRuleV2Response: components["schemas"]["OwnedAccessRuleV2Response"] | components["schemas"]["SharedAccessRuleV2Response"]; /** * @description `display_name`, `description` and `image` are replaced on every update: leaving one out, or sending null, * clears it. The other fields are left unchanged when omitted. * @example { * "display_name": "Updated Access Rule", * "description": "This is an updated description for the access rule.", * "image": "https://example.com/updated_image.png", * "status": "active", * "tags": [ * "updated_tag1", * "updated_tag2" * ], * "collaborators": { * "query": { * "type": "inclusion", * "company_ids": [ * 789 * ] * }, * "view": { * "type": "all" * } * } * } */ AccessRuleUpdateRequest: { /** * @description Names a rule that has no name yet. A rule that already has a name cannot be renamed; sending a different * name is a 409. */ name?: components["schemas"]["AccessRuleName"]; display_name?: components["schemas"]["AccessRuleDisplayName"] | null; description?: components["schemas"]["AccessRuleDescription"] | null; /** @description Replaces the rule's tags. `_nio_access_rule` is added if missing. An empty list leaves the tags unchanged. */ tags?: components["schemas"]["AccessRuleTags"]; collaborators?: components["schemas"]["Collaborators"]; image?: components["schemas"]["AccessRuleImage"] | null; status?: components["schemas"]["AccessRuleStatus"]; price_cpm_usd?: components["schemas"]["AccessRulePriceCpmUsd"]; }; /** * @description An RFC 7807 problem. `title` names the kind of error and `detail` explains this occurrence; * https://docs.narrative.io/guides/nql/troubleshooting walks through the NQL titles. * @example { * "type": null, * "title": "Failed to Parse Query", * "status": 400, * "detail": "Invalid query format.", * "instance": "/nql/validate", * "log_id": "c06fea02-0950-45c6-aaff-07ab07c0d04c", * "debug": null * } */ Response: { /** * Format: uri * @description A URL naming the class of error. */ type?: string | null; /** @description a summary of the error */ title: string; /** @description http status code */ status: number; /** @description a longer description of the error */ detail: string; /** @description path of the query */ instance: string; /** * Format: uuid * @description an internal logging id, Narrative can use to help debug a problem. */ log_id: string; /** * @description Extra detail shaped by the error, for example the column and type name of an unsupported-type * error. Null when the error has nothing to add. Most errors only include it for admin tokens. */ debug?: { [key: string]: unknown; } | null; }; /** * Format: int64 * @description The number of the previous page, or null on the first page. Can also refer to the latest existing * page if a page beyond the last one was requested. * @example 1 */ PrevPage: number | null; /** * Format: int64 * @description The number of requested page. * @example 1 */ CurrentPage: number; /** * Format: int64 * @description The number of the next page, or null on the last page. * @example 42 */ NextPage: number | null; /** * Format: int64 * @description Total amount of accessible Access Rules * @example 15000 */ TotalRecords: number; /** * Format: int64 * @description Total amount of pages. * @example 10 */ TotalPages: number; /** * @example { * "prev_page": null, * "current_page": 1, * "next_page": null, * "total_records": 2, * "total_pages": 1, * "records": [ * { * "name": "name", * "id": 2, * "company_id": 42, * "company_name": "company name", * "company_slug": "company_slug", * "data_plane_id": "f79cbdae-4848-47ca-95e8-69588364d185", * "display_name": "access rule", * "description": "description", * "image": "https://google.com/1.jpg", * "tags": [ * "tag" * ], * "schema": { * "type": "object", * "properties": { * "id": { * "order": 1, * "display_name": "id of field", * "type": "string" * } * }, * "required": [ * "id" * ] * }, * "price_cpm_usd": 42, * "metadata": { * "created_at": "2007-12-03T10:15:30", * "updated_at": "2008-12-03T10:15:30" * }, * "is_owned": false, * "type": "explicit_share", * "mappings": [ * { * "attribute_id": 42, * "attribute_name": "id", * "properties": [ * "id.type", * "id.value" * ] * } * ] * }, * { * "name": "access_rule_ebc86610_0907_4374_8fc9_be360f0ff8d0", * "id": 1, * "company_id": 1, * "company_name": "company", * "company_slug": "company_slug_60a4e678_1d56_48a7_8b8b_4e1d689b11a6", * "data_plane_id": "f79cbdae-4848-47ca-95e8-69588364d185", * "display_name": "display name", * "description": "description", * "image": "https://narrative.test/1.png", * "status": "active", * "tags": [ * "_nio_access_rule" * ], * "nql": "select company_data.\"1\".columnA from company_data.\"1\" WHERE columnA = columnB", * "schema": { * "type": "object", * "properties": { * "columnA": { * "display_name": "columnA", * "type": "string" * } * }, * "required": [ * "columnA" * ] * }, * "collaborators": { * "query": { * "type": "inclusion", * "company_ids": [ * 789 * ] * }, * "view": { * "type": "all" * } * }, * "price_cpm_usd": 1000, * "metadata": { * "created_at": "2023-12-14T21:36:51.847901", * "created_by": 42, * "updated_at": "2023-12-14T21:36:51.847901", * "updated_by": null * }, * "dataset_ids": [ * 42 * ], * "is_owned": true, * "type": "owned", * "mappings": [ * { * "attribute_id": 42, * "attribute_name": "id", * "properties": [ * "id.type", * "id.value" * ] * } * ] * } * ] * } */ AccessRulesV2PaginatedResponse: { records: components["schemas"]["AccessRuleV2Response"][]; prev_page?: components["schemas"]["PrevPage"]; current_page: components["schemas"]["CurrentPage"]; next_page?: components["schemas"]["NextPage"]; total_records: components["schemas"]["TotalRecords"]; total_pages: components["schemas"]["TotalPages"]; }; /** * @example { * "name": "example_access_rule", * "display_name": "Example Access Rule", * "description": "This is an example access rule.", * "image": "https://example.com/image.png", * "tags": [ * "tag1", * "tag2" * ], * "nql": "SELECT tar.\"maid\" FROM company_data.\"11370\" tar", * "collaborators": { * "query": { * "type": "inclusion", * "company_ids": [ * 789 * ] * }, * "view": { * "type": "all" * } * }, * "price_cpm_usd": 10 * } */ AccessRuleCreateRequest: { name: components["schemas"]["AccessRuleName"]; nql: components["schemas"]["AccessRuleNQL"]; display_name?: components["schemas"]["AccessRuleDisplayName"]; description?: components["schemas"]["AccessRuleDescription"]; tags?: components["schemas"]["AccessRuleTags"]; collaborators: components["schemas"]["Collaborators"]; price_cpm_usd: components["schemas"]["AccessRulePriceCpmUsd"]; image?: components["schemas"]["AccessRuleImage"]; }; /** Format: uuid */ UUID: string; /** * @description It should be unique. * Must be <= 256 characters and consist of only alphanumeric characters and underscores. */ QueryName: string; /** @description Optional. Display Name must be non-empty and less than 1000 chars. */ DisplayName: string; /** @description A human-friendly description of the query. */ QueryDescription: string; /** @description Optional. Each tag must be less than 256 chars. */ Tags: string[]; /** * Format: int64 * @description The id of an existing company * @example 345 */ CompanyId: number; /** @description Name of the company. */ CompanyName: string; /** @description Unique slug assigned to company. */ CompanySlug: string; /** @description Information about the owner of the query */ Owner: { company_id: components["schemas"]["CompanyId"]; company_name: components["schemas"]["CompanyName"]; company_slug?: components["schemas"]["CompanySlug"]; }; /** @description Whether the requestor owns the query. */ IsOwned: boolean; /** * Format: int64 * @description The id of an existing user * @example 20 */ UserId: number; /** @description Metadata about when and by whom a query was created/updated */ Metadata: { created_by_user_id: components["schemas"]["UserId"]; /** @description ISO-8601 timestamp indicating when the query was created. */ created_at: string; updated_by_user_id: components["schemas"]["UserId"]; /** @description ISO-8601 timestamp indicating when the query was last updated. */ updated_at: string; }; /** @description The AST representing the query. */ AST: Record; /** * @example { * "name": "query1", * "id": "7409b999-2a9a-40cd-89dc-8430d85e0391", * "display_name": "Query One", * "owner": { * "company_id": 456, * "company_name": "ExampleCorp", * "company_slug": "examplecorp" * }, * "tags": [ * "tag1", * "tag2" * ], * "collaborators": { * "query": { * "type": "inclusion", * "company_ids": [ * 789 * ] * }, * "view": { * "type": "all" * } * }, * "is_owned": true, * "metadata": { * "created_at": "2024-04-12T19:57:05.012908", * "created_by_user_id": 321, * "updated_at": "2024-04-12T20:03:48.031825", * "updated_by_user_id": 321 * }, * "ast": { * "type": "select", * "nql": "SELECT age FROM narrative.rosetta_stone", * "budget": null, * "columns": [ * { * "type": "table", * "nql": "age", * "db": null, * "schema": null, * "table": "age" * } * ], * "from": { * "type": "table", * "nql": "narrative.rosetta_stone", * "db": null, * "schema": "narrative", * "table": "rosetta_stone" * }, * "group_by": [], * "having": null, * "is_distinct": false, * "limit": null, * "order_by": [], * "qualify": null, * "where": null, * "windows": [], * "with": [] * } * } */ OwnedQueryResponse: { id: components["schemas"]["UUID"]; name: components["schemas"]["QueryName"]; display_name?: components["schemas"]["DisplayName"]; description?: components["schemas"]["QueryDescription"]; tags?: components["schemas"]["Tags"]; collaborators: components["schemas"]["Collaborators"]; owner: components["schemas"]["Owner"]; is_owned?: components["schemas"]["IsOwned"]; metadata: components["schemas"]["Metadata"]; ast: components["schemas"]["AST"]; }; /** * @example { * "name": "query1", * "id": "7409b999-2a9a-40cd-89dc-8430d85e0391", * "display_name": "Query One", * "owner": { * "company_id": 456, * "company_name": "ExampleCorp", * "company_slug": "examplecorp" * }, * "tags": [ * "tag1", * "tag2" * ], * "is_owned": false, * "ast": { * "type": "select", * "nql": "SELECT age FROM narrative.rosetta_stone", * "budget": null, * "columns": [ * { * "type": "table", * "nql": "age", * "db": null, * "schema": null, * "table": "age" * } * ], * "from": { * "type": "table", * "nql": "narrative.rosetta_stone", * "db": null, * "schema": "narrative", * "table": "rosetta_stone" * }, * "group_by": [], * "having": null, * "is_distinct": false, * "limit": null, * "order_by": [], * "qualify": null, * "where": null, * "windows": [], * "with": [] * } * } */ SharedQueryResponse: { id: components["schemas"]["UUID"]; name: components["schemas"]["QueryName"]; display_name?: components["schemas"]["DisplayName"]; description?: components["schemas"]["QueryDescription"]; tags?: components["schemas"]["Tags"]; owner: components["schemas"]["Owner"]; is_owned?: components["schemas"]["IsOwned"]; ast: components["schemas"]["AST"]; }; QueriesResponse: components["schemas"]["OwnedQueryResponse"] | components["schemas"]["SharedQueryResponse"]; /** * @example { * "name": "updated name", * "tags": [ * "tag3" * ] * } */ UpdateQueryRequest: { name?: components["schemas"]["QueryName"]; display_name?: components["schemas"]["DisplayName"]; description?: components["schemas"]["QueryDescription"]; tags?: components["schemas"]["Tags"]; collaborators?: components["schemas"]["Collaborators"]; ast?: components["schemas"]["AST"]; }; /** * @example { * "prev_page": null, * "current_page": 1, * "next_page": null, * "total_records": 1, * "total_pages": 1, * "records": [ * { * "name": "query1", * "id": "7409b999-2a9a-40cd-89dc-8430d85e0391", * "display_name": "Query One", * "owner": { * "company_id": 456, * "company_name": "ExampleCorp", * "company_slug": "examplecorp" * }, * "tags": [ * "tag1", * "tag2" * ], * "collaborators": { * "query": { * "type": "inclusion", * "company_ids": [ * 789 * ] * }, * "view": { * "type": "all" * } * }, * "is_owned": true, * "metadata": { * "created_at": "2024-04-12T19:57:05.012908", * "created_by_user_id": 321, * "updated_at": "2024-04-12T20:03:48.031825", * "updated_by_user_id": 321 * }, * "ast": { * "type": "select", * "nql": "SELECT age FROM narrative.rosetta_stone", * "budget": null, * "columns": [ * { * "type": "table", * "nql": "age", * "db": null, * "schema": null, * "table": "age" * } * ], * "from": { * "type": "table", * "nql": "narrative.rosetta_stone", * "db": null, * "schema": "narrative", * "table": "rosetta_stone" * }, * "group_by": [], * "having": null, * "is_distinct": false, * "limit": null, * "order_by": [], * "qualify": null, * "where": null, * "windows": [], * "with": [] * } * } * ] * } */ QueriesPaginatedResponse: { records: components["schemas"]["QueriesResponse"][]; prev_page?: components["schemas"]["PrevPage"]; current_page?: components["schemas"]["CurrentPage"]; next_page?: components["schemas"]["NextPage"]; total_records?: components["schemas"]["TotalRecords"]; total_pages?: components["schemas"]["TotalPages"]; }; /** * @example { * "name": "query1", * "display_name": "Query One", * "tags": [ * "tag1", * "tag2" * ], * "collaborators": { * "query": { * "type": "inclusion", * "company_ids": [ * 789 * ] * }, * "view": { * "type": "all" * } * }, * "ast": { * "type": "select", * "nql": "SELECT age FROM narrative.rosetta_stone", * "budget": null, * "columns": [ * { * "type": "table", * "nql": "age", * "db": null, * "schema": null, * "table": "age" * } * ], * "from": { * "type": "table", * "nql": "narrative.rosetta_stone", * "db": null, * "schema": "narrative", * "table": "rosetta_stone" * }, * "group_by": [], * "having": null, * "is_distinct": false, * "limit": null, * "order_by": [], * "qualify": null, * "where": null, * "windows": [], * "with": [] * } * } */ CreateQueryRequest: { name: components["schemas"]["QueryName"]; display_name?: components["schemas"]["DisplayName"]; description?: components["schemas"]["QueryDescription"]; tags?: components["schemas"]["Tags"]; collaborators: components["schemas"]["Collaborators"]; ast: components["schemas"]["AST"]; }; /** Format: uuid */ ViewId: string; /** * @description It should be unique. * Must be <= 256 characters and consist of only alphanumeric characters and underscores. */ ViewName: string; /** @description Information about the owner of the view */ ViewOwner: { company_id: components["schemas"]["CompanyId"]; company_name: components["schemas"]["CompanyName"]; company_slug?: components["schemas"]["CompanySlug"]; }; /** @description Whether the requestor owns the view. */ ViewIsOwned: boolean; /** @description Metadata about when and by whom a view was created/updated */ ViewMetadata: { created_by_user_id: components["schemas"]["UserId"]; /** @description ISO-8601 timestamp indicating when the view was created. */ created_at: string; updated_by_user_id: components["schemas"]["UserId"]; /** @description ISO-8601 timestamp indicating when the view was last updated. */ updated_at: string; }; /** @description NQL schema for the view. */ Schema: { [key: string]: unknown; }; /** * @example { * "name": "view1", * "id": "7409b999-2a9a-40cd-89dc-8430d85e0391", * "display_name": "Query One", * "owner": { * "company_id": 456, * "company_name": "ExampleCorp", * "company_slug": "examplecorp" * }, * "tags": [ * "tag1", * "tag2" * ], * "collaborators": { * "query": { * "type": "inclusion", * "company_ids": [ * 789 * ] * }, * "view": { * "type": "all" * } * }, * "is_owned": true, * "metadata": { * "created_at": "2024-04-12T19:57:05.012908", * "created_by_user_id": 321, * "updated_at": "2024-04-12T20:03:48.031825", * "updated_by_user_id": 321 * }, * "nql": "SELECT age FROM narrative.rosetta_stone", * "schema": { * "type": "object", * "properties": { * "age": { * "display_name": "age", * "type": "double" * } * }, * "required": [ * "id" * ] * } * } */ OwnedViewResponse: { id: components["schemas"]["ViewId"]; name: components["schemas"]["ViewName"]; display_name?: components["schemas"]["DisplayName"]; tags?: components["schemas"]["Tags"]; collaborators: components["schemas"]["Collaborators"]; owner: components["schemas"]["ViewOwner"]; is_owned?: components["schemas"]["ViewIsOwned"]; metadata: components["schemas"]["ViewMetadata"]; nql: string; schema?: components["schemas"]["Schema"]; }; /** * @example { * "name": "view1", * "id": "7409b999-2a9a-40cd-89dc-8430d85e0391", * "display_name": "View One", * "owner": { * "company_id": 456, * "company_name": "ExampleCorp", * "company_slug": "examplecorp" * }, * "tags": [ * "tag1", * "tag2" * ], * "is_owned": false, * "nql": "SELECT age FROM narrative.rosetta_stone", * "schema": { * "type": "object", * "properties": { * "age": { * "display_name": "age", * "type": "double" * } * }, * "required": [ * "id" * ] * } * } */ SharedViewResponse: { id: components["schemas"]["ViewId"]; name: components["schemas"]["ViewName"]; display_name?: components["schemas"]["DisplayName"]; tags?: components["schemas"]["Tags"]; owner: components["schemas"]["ViewOwner"]; is_owned?: components["schemas"]["ViewIsOwned"]; nql: string; schema?: components["schemas"]["Schema"]; }; ViewsResponse: components["schemas"]["OwnedViewResponse"] | components["schemas"]["SharedViewResponse"]; /** * @example { * "name": "updated name", * "tags": [ * "tag3" * ] * } */ UpdateViewRequest: { name?: components["schemas"]["ViewName"]; display_name?: components["schemas"]["DisplayName"]; tags?: components["schemas"]["Tags"]; collaborators?: components["schemas"]["Collaborators"]; nql?: string; }; /** * @example { * "prev_page": null, * "current_page": 1, * "next_page": null, * "total_records": 1, * "total_pages": 1, * "records": [ * { * "name": "view1", * "id": "7409b999-2a9a-40cd-89dc-8430d85e0391", * "display_name": "View One", * "owner": { * "company_id": 456, * "company_name": "ExampleCorp", * "company_slug": "examplecorp" * }, * "tags": [ * "tag1", * "tag2" * ], * "collaborators": { * "query": { * "type": "inclusion", * "company_ids": [ * 789 * ] * }, * "view": { * "type": "all" * } * }, * "is_owned": true, * "metadata": { * "created_at": "2024-04-12T19:57:05.012908", * "created_by_user_id": 321, * "updated_at": "2024-04-12T20:03:48.031825", * "updated_by_user_id": 321 * }, * "nql": "SELECT age FROM narrative.rosetta_stone", * "schema": { * "type": "object", * "properties": { * "age": { * "display_name": "age", * "type": "double" * } * }, * "required": [ * "id" * ] * } * } * ] * } */ ViewsPaginatedResponse: { records: components["schemas"]["ViewsResponse"][]; prev_page?: components["schemas"]["PrevPage"]; current_page?: components["schemas"]["CurrentPage"]; next_page?: components["schemas"]["NextPage"]; total_records?: components["schemas"]["TotalRecords"]; total_pages?: components["schemas"]["TotalPages"]; }; /** * @example { * "name": "view 1", * "display_name": "View One", * "tags": [ * "tag1", * "tag2" * ], * "collaborators": { * "query": { * "type": "inclusion", * "company_ids": [ * 789 * ] * }, * "view": { * "type": "all" * } * }, * "nql": "SELECT age FROM narrative.rosetta_stone" * } */ CreateViewRequest: { name: components["schemas"]["ViewName"]; display_name?: components["schemas"]["DisplayName"]; tags?: components["schemas"]["Tags"]; collaborators: components["schemas"]["Collaborators"]; nql: string; }; /** * Format: uuid * @description UUID identifying a conversation. Returned from `POST /agents/conversations` and used * in every other agent endpoint that operates on this conversation. * @example bc2505b7-068d-44ed-8055-a6f6ffe54ab1 */ ConversationId: string; /** * @description Whether the model should reason before answering, and how hard. Models differ in which form they * accept — one takes an effort level, another a token budget, some both — so a setting is only valid * against the model it is sent to. A setting the model cannot honour is rejected with * [Thinking Setting Not Accepted](https://docs.narrative.io/reference/architecture/agent-conversations/errors/thinking-setting-not-accepted) * rather than quietly downgraded. * * Reasoning comes back as `reasoning` content blocks on the assistant turn. Some models return a * signature with no readable text — the block is there, the words are not. * @example { * "type": "effort", * "level": "high" * } */ ThinkingSetting: ("disabled" | "off") | { /** @enum {string} */ type: "effort"; /** @enum {string} */ level: "low" | "medium" | "high"; } | { /** @enum {string} */ type: "budget"; /** * @description Tokens the model may spend thinking. The floor of 1024 is the provider's. Must be smaller * than `max_tokens` — thinking is spent from the same output budget as the answer, so a * budget that fills it leaves nothing to answer with * ([Thinking Budget Too Large](https://docs.narrative.io/reference/architecture/agent-conversations/errors/thinking-budget-too-large)). */ budget_tokens: number; }; /** * @description A 1–8 character namespace prefix for an MCP server's tools. The platform stitches * `{alias}-{tool_name}` into the wire name the model sees, so the alias is how every * MCP-resolved tool call gets routed back to the right server at execution time. * * **Rules:** * - Must match the regex `^[a-zA-Z][a-zA-Z0-9]{0,7}$` — 1–8 characters total, starts * with an ASCII letter, contains only ASCII letters and digits. * - **No underscores**, **no dashes**, **no other punctuation**. Dashes are reserved as * the alias↔name separator. * - Must be **unique across `mcp_servers`** within a single conversation. The platform * validates this on `POST /agents/conversations`. * * Caller-declared tools (in `tools[]`) have no alias — the model sees their bare `name` * on the wire. The dash in MCP wire names is the routing discriminator: a dash-prefixed * name comes from an MCP server; a dash-free name is caller-declared and triggers * `requires_action`. * * See the [Invalid Tool Alias](https://docs.narrative.io/reference/architecture/agent-conversations/errors/invalid-tool-alias) * and [Duplicate Tool Alias](https://docs.narrative.io/reference/architecture/agent-conversations/errors/duplicate-tool-alias) * error pages for the exact validation behavior. * @example docs */ ToolAlias: string; /** * @description A Model Context Protocol (MCP) server the platform will call **on your behalf** during * a run. The platform discovers the server's tool catalog at run start via the JSON-RPC * `tools/list` method — you do **not** declare individual tools here. When the model * emits a call to `{alias}-{tool_name}`, the platform makes the `tools/call` request, * parses the response, persists the tool result, and feeds it back into the next * inference round, all inside the same run. * * The server must implement [Model Context Protocol](https://modelcontextprotocol.io/) * over HTTP with JSON-RPC 2.0 (both `tools/list` and `tools/call`). * * **Authentication.** Public servers and Narrative-owned MCPs need no auth field. For an * external server that requires user authorization, first connect it via * `POST /mcp-connections` (OAuth) and pass the resulting id as `connection_id` here — the * platform attaches and refreshes that connection's bearer token server-side at call time. * The token never appears in the payload or run history. If you submit a server with no * `connection_id` but it actually requires authorization, run-start discovery gets a `401` * and the run fails with * [MCP Discovery Failed](https://docs.narrative.io/reference/architecture/agent-conversations/errors/mcp-discovery-failed) * telling you to connect it — and naming your existing connection for that URL if you have one. * * **Discovery happens per run.** Each new run re-fetches `tools/list` — there is no * catalog caching between runs. If a server adds, removes, or changes a tool, the next * run picks it up automatically. * * **Error handling:** transient transport errors (5xx, network) during discovery are * surfaced as * [MCP Discovery Failed](https://docs.narrative.io/reference/architecture/agent-conversations/errors/mcp-discovery-failed). * `tools/call` errors follow the same classification as before: * [MCP error pages](https://docs.narrative.io/reference/architecture/agent-conversations/errors/mcp-unknown-tool). */ McpServerConfig: { alias: components["schemas"]["ToolAlias"]; /** * Format: uri * @description Fully-qualified **https** URL to the MCP server's JSON-RPC endpoint, validated when the * conversation or run is created: a non-https or malformed URL is rejected up front with * [Invalid MCP Server URL](https://docs.narrative.io/reference/architecture/agent-conversations/errors/invalid-mcp-server-url). * The endpoint must be publicly reachable — URLs that resolve to loopback, private, or * link-local addresses are refused. * @example https://docs.narrative.io/mcp */ url: string; /** * @description Optional free-form description, exposed in the assembled tool catalog the model sees. Null or * absent means none; a response always carries the key. * @example Public Mintlify-hosted Narrative docs MCP server */ description?: string | null; /** * Format: uuid * @description Reference to a registered external-MCP OAuth connection (from `POST /mcp-connections`). * Set this for an external server that requires user authorization: the platform resolves * and refreshes that connection's bearer token server-side at call time — never in the * payload or run history. Omit (or send null) for public servers or Narrative-owned MCPs. The connection * must belong to the calling user and be in `connected` status. Optional; defaults to none. * @example b3f1c2a4-5d6e-47f8-9a0b-1c2d3e4f5a6b */ connection_id?: string | null; }; /** * @description A single tool definition. Mirrors the relevant fields from the underlying inference * contract (Bedrock/Cortex). * * **For MCP tools (discovered at run start from `mcp_servers[]` entries):** the model sees the bare * `name` prefixed with the parent server's `alias` and a dash (so a tool `search` on a server with * `alias: "docs"` becomes `docs-search` on the wire). The wire-name length cap is * `len(alias) + 1 + len(name) ≤ 64` (Bedrock). * * **For caller-declared tools (declared under top-level `tools[]`):** the model sees the * bare `name` directly. The name must **not contain a dash** — the dash is reserved as * the MCP alias separator and is the routing discriminator at call time. See * [Invalid Caller-Declared Tool Name](https://docs.narrative.io/reference/architecture/agent-conversations/errors/invalid-caller-tool-name). * * **`input_schema` constraints:** must be a subset of JSON Schema Draft 2020-12. Features * like `oneOf`, `anyOf`, `allOf`, `not`, `$ref`, `$defs`, `if/then/else`, `pattern`, and * `format` are **not supported** — the platform forwards the schema to the model * provider, which rejects unsupported features. See * [JSON Schema Reference](https://docs.narrative.io/reference/model-inference/json-schema-reference) * for the supported subset. * * **Wire-name length:** total wire name (whether bare or `{alias}-{name}`) must be * ≤ 64 characters (Bedrock limit). See * [Tool Wire Name Too Long](https://docs.narrative.io/reference/architecture/agent-conversations/errors/tool-name-too-long). */ ToolSpec: { /** * @description The tool's bare name. For MCP tools the model sees `{parent_alias}-{name}`; for * caller-declared tools the model sees `name` directly. Caller-declared names must * not contain a dash. * @example search_narrative_i_o_knowledge_base */ name: string; /** * @description Human-readable description the model uses to decide when to call this tool. * Keep it focused — vague descriptions cause the model to call the tool when it * shouldn't, or skip it when it should. * @example Search the Narrative.io documentation knowledge base. */ description: string; /** * @description JSON Schema describing the tool's input arguments. The model produces an arguments * object matching this schema for every call. Use `additionalProperties: false` and * `required` aggressively — tighter schemas reduce model mistakes. * @example { * "type": "object", * "additionalProperties": false, * "required": [ * "query" * ], * "properties": { * "query": { * "type": "string" * } * } * } */ input_schema: Record; /** * @description Whether to enforce the input schema strictly. Defaults to `true`. Leave it true * for production — turning it off lets the model send arguments that don't validate, * which is almost never what you want. * @default true */ strict: boolean; }; /** * @description The configuration applied to every run on this conversation by default. Each field * can be overridden per-run via `config_override` on the `POST .../runs` body, **except * `system_prompt`** which is fixed at conversation creation time. * * For `mcp_servers` and `tools`, overrides **replace the whole list**, not individual * entries. There is no per-server or per-tool merge — set the complete catalog you want * for that run. * * In a request only `model`, `data_plane_id` and `execution_cluster` are required. A response * (`defaults`, `effective_config`) always carries every key, with `null` for an optional field * that has no value. */ ConversationDefaults: { /** * @description The language model identifier. The platform exposes a fixed set; check the * [Model Inference reference](https://docs.narrative.io/reference/model-inference) * for current supported values. * @example anthropic.claude-opus-4.6 */ model: string; /** * Format: uuid * @description UUID of the data plane (compute environment) that hosts the inference job * executor. Each company has at least one data plane. Get it from your platform * admin or `GET /data-planes`. * @example f79cbdae-4848-47ca-95e8-69588364d185 */ data_plane_id: string; /** * @description Which job-executor pool dispatches the inference call to AWS Bedrock or Snowflake * Cortex. The executor doesn't run the model itself — that happens in the external * service — it only routes the HTTP request. * * **Use `shared` for almost every case.** `dedicated` is only relevant if your * company runs a dedicated executor pool for isolation reasons. * @example shared * @enum {string} */ execution_cluster: "shared" | "dedicated"; /** * Format: uuid * @description Optional compute pool override. Only relevant for `execution_cluster: dedicated` * — pinpoints a specific compute pool inside that cluster. */ compute_pool_id?: string | null; /** * @description Maximum number of inference rounds the workflow may perform before failing with * [Max Iterations Exceeded](https://docs.narrative.io/reference/architecture/agent-conversations/errors/max-iterations-exceeded). * Each iteration is one inference job (one Bedrock/Cortex call), and every tool call * the model makes spends one — including `job_monitor` and `wait_for`, so waiting on * a job it started costs three rounds before the answer. Multi-step research flows * often need 8–15; a one-shot question needs 1–2. * @default 10 * @example 8 */ max_iterations: number; /** * @description Cap on the model's reply length **per iteration** (does not include the prompt). Omitting * the field gives 2048; an explicit `null` leaves it unset for the run. * Bedrock-side enforced. If the model hits this limit mid-JSON, the response will * fail to validate against `output_format_schema` — * [Schema Decode Failed](https://docs.narrative.io/reference/architecture/agent-conversations/errors/schema-decode-failed). * @default 2048 * @example 2048 */ max_tokens: number | null; /** * @description Sampling temperature. Omitting the field gives `0.0`; an explicit `null` leaves it unset * for the run. `0.0` is deterministic-ish (best for structured / factual * answers); higher values introduce randomness (helpful for brainstorming). * @default 0 * @example 0 */ temperature: number | null; /** * @description Omit (or send null) to get the model's own behaviour. Cannot be combined with a run's * `tool_choice` of `specific_tool` or `any` — a forced tool stops the model reasoning, so the * combination is refused * ([Thinking With Forced Tool Choice](https://docs.narrative.io/reference/architecture/agent-conversations/errors/thinking-with-forced-tool-choice)). * A model that is not offered thinking rejects the field outright * ([Thinking Not Supported](https://docs.narrative.io/reference/architecture/agent-conversations/errors/thinking-not-supported)). */ thinking?: components["schemas"]["ThinkingSetting"] | null; /** * @description JSON Schema describing the final answer's structure. When it is set the run is in * structured mode: the answer comes back verbatim in `final_structured_output`. When it is * null the answer comes back as plain text in `final_text`. * * **Supports a subset of Draft 2020-12** — the same subset Bedrock structured * output accepts. Not supported: `oneOf`, `anyOf`, `allOf`, `not`, `$ref`, * `$defs`, `if/then/else`, `pattern`, `format`. Supported: `type`, `properties`, * `required`, `enum`, `additionalProperties: false`, `minimum`/`maximum` on * numbers, `minLength`/`maxLength` on strings, `minItems`/`maxItems` on arrays. * * See * [JSON Schema Reference](https://docs.narrative.io/reference/model-inference/json-schema-reference) * for the canonical supported-feature list. * @example { * "type": "object", * "additionalProperties": false, * "required": [ * "text" * ], * "properties": { * "text": { * "type": "string" * } * } * } */ output_format_schema?: Record | null; /** * @description List of MCP servers and their tools the model can call server-side. Each * server's tools appear to the model with the `{alias}-` prefix. Empty list means * "no MCP tools." Wholesale-replaced when overridden in `config_override`. * @default [] */ mcp_servers: components["schemas"]["McpServerConfig"][]; /** * @description List of caller-declared tools. When the model calls one of these, the run pauses * at `requires_action` and the platform expects you to start a follow-up run with * `payload.kind: tool_outputs`. Caller-declared tool `name`s have no alias prefix * and must not contain a dash. Wholesale-replaced when overridden in * `config_override`. * @default [] */ tools: components["schemas"]["ToolSpec"][]; }; /** * @description Monotonic per-conversation counter, bumped by 1 (or more) every time a successful run * appends messages. Two roles: * * 1. **Delta cursor** for `GET .../messages?since=N` — fetch only messages with * `sequence_no > N`. * 2. **Compare-and-swap token** for `POST .../runs` — set `expected_version` to the * conversation's current head; if it doesn't match at run-creation time, you get a * [Version Conflict](https://docs.narrative.io/reference/architecture/agent-conversations/errors/version-conflict) * (HTTP 409). * * Always start a new run cycle by reading the current `version` from * `GET /agents/conversations/{id}` rather than caching a value from earlier. * @example 4 */ ConversationVersion: number; /** * @description The conversation row as the API returns it. The same shape comes back from * `POST /agents/conversations` (201 Created) and `GET /agents/conversations/{id}` (200 OK). * * A conversation may also carry platform-written tags — recording, for instance, the workflow * whose task created it. They are reserved (the `_nio_` prefix), are not settable, and are not * returned here. */ ConversationResponse: { id: components["schemas"]["ConversationId"]; /** * @description Company ID derived from the bearer token. Pinned for the conversation's lifetime. * @example 1 */ company_id: number; /** * @description User ID derived from the bearer token. Pinned for the conversation's lifetime and * gates every subsequent read endpoint — only the originating user can fetch the * conversation, its messages, or its runs. Peers in the same company see 404. * @example 407 */ user_id: number; name?: string | null; system_prompt?: string | null; defaults: components["schemas"]["ConversationDefaults"]; version: components["schemas"]["ConversationVersion"]; /** * Format: date-time * @example 2026-05-18T13:21:30.355180Z */ created_at: string; /** * Format: date-time * @example 2026-05-18T13:21:51.983952Z */ updated_at: string; }; /** * @description Returned by `GET /agents/conversations`. Page envelope wrapping the caller's * conversations, newest first. Same shape every other paginated Narrative endpoint * uses. */ ListConversationsResponse: { prev_page?: components["schemas"]["PrevPage"]; current_page: components["schemas"]["CurrentPage"]; next_page?: components["schemas"]["NextPage"]; total_records: components["schemas"]["TotalRecords"]; total_pages: components["schemas"]["TotalPages"]; /** @description Page of conversations, ordered by `created_at` descending. */ records: components["schemas"]["ConversationResponse"][]; }; /** * @description Create an empty conversation with a pinned `system_prompt` and a `defaults` block * that every subsequent run inherits (and may sparsely override via `config_override`). * * The `system_prompt` is **permanently fixed**. Everything in `defaults` is, well, a * default — runs can replace any individual field. */ CreateConversationRequest: { /** * @description Optional human-readable label for your own use (logs, dashboards). The model * never sees this. Leave it out (or null) and the platform names the conversation * from its first user message. * @example rate-limiting q&a */ name?: string | null; /** * @description "Stage direction" prepended to every run as a `system`-role message. Cannot be * overridden per-run — if you need different system prompts, create separate * conversations. Leaving it empty is allowed but rarely useful; even one line * ("You are a helpful assistant. Answer concisely.") shapes model behavior. * @example You are an AI assistant that answers questions about the Narrative Data Marketplace. Use the available tools to look things up before answering. */ system_prompt?: string | null; defaults: components["schemas"]["ConversationDefaults"]; }; /** * @description RFC 7807 Problem Details. Returned with `Content-Type: application/json` for every * 4xx/5xx response on `/agents/*`. * * **Field semantics:** * * - `type` — stable URL to the docs page describing this error class. Treat it as the * machine-readable identifier; the same URL is referenced by `RunError.docs_url` on * failed runs. Optional on 500 errors that don't map to a documented class. * - `title` — short human-readable summary. * - `status` — HTTP status code echoed in the body (so clients that read only the body * can still dispatch on status). * - `detail` — request-specific detail. Includes which alias was malformed, which * `tool_use_id` was missing, etc. * - `instance` — always `null` on `/agents` responses. * - `log_id` — UUID correlated with server logs. Always include this when reporting an * issue to support. * - `debug` — always `null` on `/agents` responses. * * Every key is always present. `type` is `null` on the one error with no docs page: the 403 * returned when the company's credit limit is exceeded. * * Not every error on these endpoints uses this shape. A request body that isn't valid JSON, or * doesn't decode, gets a 400 with the plain `{error, error_description}` body instead. So does a * token with no user attached (403), and a token missing the needed permission (401). * * Common error pages indexed by `type`: * * | HTTP | Common cause | Docs page | * |------|--------------|-----------| * | 400 | Bad request body, validation failure | various — see `type` | * | 404 | Resource not found, or owned by a different company | `/conversation-not-found`, `/agent-run-not-found` | * | 409 | Conversation version moved while you were preparing the run, or another run on it is still in flight | `/version-conflict`, `/run-in-progress` | * | 500 | Internal error (schema drift, workflow start failure) | `/invalid-stored-field`, `/workflow-start-failed` | * @example { * "type": "https://docs.narrative.io/reference/architecture/agent-conversations/errors/invalid-tool-alias", * "title": "Invalid Tool Alias", * "status": 400, * "detail": "invalid tool aliases (must match ^[a-zA-Z][a-zA-Z0-9]{0,7}$): with_underscore", * "instance": null, * "log_id": "1f6e5d4c-3b2a-1098-7654-3210fedcba98", * "debug": null * } */ RFCError: { /** * Format: uri * @example https://docs.narrative.io/reference/architecture/agent-conversations/errors/invalid-tool-alias */ type?: string | null; /** @example Invalid Tool Alias */ title: string; /** @example 400 */ status: number; /** @example invalid tool aliases (must match ^[a-zA-Z][a-zA-Z0-9]{0,7}$): with_underscore */ detail: string; instance?: string | null; /** * Format: uuid * @example 1f6e5d4c-3b2a-1098-7654-3210fedcba98 */ log_id: string; debug?: Record | null; }; /** * @description Who produced this message. * * - `user` — the caller's input. Either a `user_message` payload, or a synthesized * user-role turn carrying `tool_result` blocks when continuing from a * `requires_action` run (Bedrock's chat-completion model requires tool results to * live on a user-role turn). * - `assistant` — the model's output. Either a plain answer (`text` blocks) or a * tool-call request (`tool_use` blocks). * - `tool` — synthesized turn that carries `tool_result` blocks from server-side tool * calls. Conceptually distinct from `user` even though the underlying protocol may * collapse them. * @enum {string} */ MessageRole: "user" | "assistant" | "tool"; /** * @description A single block inside a message. Messages carry an ordered list of blocks. Five * variants discriminated by `type`: * * - `text` — plain text content. The dominant variant for user messages and final * assistant answers. * - `tool_use` — the model requesting a tool call. Carries the call's `tool_use_id` * (used to match it with the subsequent result), the fully-aliased `name`, and the * `arguments` the model produced. * - `tool_result` — the response to a `tool_use`. References the same `tool_use_id` * and carries nested content blocks with the actual result text. `is_error` flags * tool failures so the model can decide how to react. * - `reasoning` — the model's own working, present on an assistant turn when the run * asked for thinking (`defaults.thinking`). It comes **first** in the turn, ahead of * the answer. `text` is optional: some models return their reasoning as words, others * return only a `signature` and keep the words to themselves. * - `redacted_reasoning` — reasoning the provider encrypted rather than returned. Opaque * base64; there is nothing to read, and it exists so a turn can still be replayed * intact. * * The discriminator field is `type`. Use it to dispatch in your client. * * Each block may also carry an **`id`** alongside its own fields (`b__`), the identifier * it was given where it was produced. Blocks a caller sent, and turns stored before ids existed, have * none. `final_answer_from` on the message points at ids, which is how a reader knows which block to * render as the reply — see the note there. * * Reasoning blocks are passed through as the model produced them, `signature` included. * A client that wants to continue a conversation exactly as the model left it can send * them back verbatim; one that only wants to show the answer can drop them. The signature * is meaningful only to the provider — treat it as opaque and don't parse it. */ ContentBlock: { /** * @description The id this block was produced under, when we produced it. Absent on blocks a caller sent * and on turns stored before ids existed. * @example b_c08cf800_01 */ id?: string; /** @enum {string} */ type: "text"; text: string; } | { /** * @description The id this block was produced under, when we produced it. Absent on blocks a caller sent * and on turns stored before ids existed. * @example b_c08cf800_01 */ id?: string; /** @enum {string} */ type: "tool_use"; /** * @description Server-assigned identifier the model produced when emitting the tool call. * Use this to match a `tool_result` with its `tool_use`, and to fill * `outputs[].tool_use_id` when resuming a `requires_action` run. * @example tooluse_DWXPKZ50JDGib5GmShyUgJ */ tool_use_id: string; /** * @description Fully-aliased tool name (`{alias}-{tool_name}`) — the same string the model * saw in its tool catalog. The alias prefix is how the platform routes the call * back to its definition. * @example docs-search_narrative_i_o_knowledge_base */ name: string; /** * @description Arguments object produced by the model. Must conform to the tool's * `input_schema` — if the model produced something that doesn't validate, the * run terminates with the * [MCP Tool Argument Validation Failed](https://docs.narrative.io/reference/architecture/agent-conversations/errors/mcp-tool-validation) * error for server-side tools, or surfaces in `pending_tool_calls` as-is for * client-side tools. * @example { * "query": "rate limiting" * } */ arguments: Record; } | { /** * @description The id this block was produced under, when we produced it. Absent on blocks a caller sent * and on turns stored before ids existed. * @example b_c08cf800_01 */ id?: string; /** @enum {string} */ type: "tool_result"; /** * @description The `tool_use_id` from the matching `tool_use` block on the prior assistant turn. * @example tooluse_DWXPKZ50JDGib5GmShyUgJ */ tool_use_id: string; /** * @description Nested content blocks carrying the actual result. Almost always a single * `text` block; the platform splits long results into multiple text blocks when * the underlying MCP server returns multiple chunks. */ content: components["schemas"]["ContentBlock"][]; /** * @description Whether the tool call failed. The model decides how to react to errors — * retry, ask the user, fall through to a partial answer, etc. Note that an * MCP server returning a non-2xx response that the platform can still parse * counts as `is_error: false` (the tool *succeeded* in returning a result, even * if that result reports an underlying failure). */ is_error: boolean; } | { /** * @description The id this block was produced under, when we produced it. Absent on blocks a caller sent * and on turns stored before ids existed. * @example b_c08cf800_01 */ id?: string; /** @enum {string} */ type: "reasoning"; /** * @description The model's working, when it returns it as words. Absent when the model reasoned * but withheld the text — the Opus models do this, and `signature` is then the only * evidence the turn reasoned at all. Never assume this field is present. * @example Cleo cannot be Monday, so the only assignment left is… */ text?: string; /** * @description Provider-issued signature over the reasoning. Opaque: not a hash you can verify * or a token you can decode. Send the block back unchanged to continue a turn as * the model left it, or ignore it. * @example CAIS6QMKcAgQEAEYAipATBOWJItj3lNDm2ZmBW70v+WJ5oI6W68N… */ signature: string; } | { /** * @description The id this block was produced under, when we produced it. Absent on blocks a caller sent * and on turns stored before ids existed. * @example b_c08cf800_01 */ id?: string; /** @enum {string} */ type: "redacted_reasoning"; /** * @description Base64 of the encrypted reasoning. Nothing to display. Kept so the turn can be * replayed whole. * @example ZW5jcnlwdGVkLXJlYXNvbmluZy1ieXRlcw== */ data: string; }; /** * @description A single persisted message. Returned by `GET /agents/conversations/{id}/messages`. * * Messages are ordered by `sequence_no` ascending. Use `sequence_no` as a stable cursor * for paging — every successful run inserts one or more messages, and `sequence_no` * increases by the number of messages inserted. */ MessageDto: { /** * Format: uuid * @description Unique identifier for this message row. * @example 7c2863a2-6a85-4c3f-b400-c55370e9b04a */ id: string; /** * @description Monotonic position of this message within its conversation. Also used as the * delta cursor for `GET .../messages?since=N` — pass the highest `sequence_no` you * already have to fetch only newer messages. * @example 2 */ sequence_no: number; role: components["schemas"]["MessageRole"]; /** * @description Ordered list of content blocks making up this message. Most messages have one * block, but assistant tool-call turns may carry multiple `tool_use` blocks (the * model issuing several tool calls in parallel) and `tool` turns may carry * multiple `tool_result` blocks. A turn where the model both reasoned and talked * before answering carries several blocks of different types — see * `final_answer_from` for which one is the reply. */ content_blocks: components["schemas"]["ContentBlock"][]; /** * @description Ids of the blocks in `content_blocks` the run's final answer was taken from — always * text blocks, always present in this message, and empty on a turn that answered nothing * (a tool-call turn, a caller's message, or a turn stored before ids existed). * * **Render the reply from these, not from every text block.** With thinking enabled a model * may narrate its working as ordinary text before answering; that narration is persisted * because it is real output, but it is not the reply. A reader that renders every text block * shows the working and the answer as two messages. * @example [ * "b_c08cf800_02" * ] */ final_answer_from?: string[]; /** * Format: uuid * @description The run that produced this message. Use it to cross-reference with `GET * /agents/runs/{id}` to see which run the message belongs to (useful when multiple * runs span the same conversation). * @example 82eb9cb7-619e-46bb-ac1c-8a32b0112c1c */ run_id: string; /** Format: date-time */ created_at: string; }; /** * @description Returned by `GET /agents/conversations/{id}/messages?since=N`. Carries the * conversation's current head version (`current_version`) plus the requested page of * messages. * * **Polling pattern:** * ``` * since = 0 * loop: * response = GET /agents/conversations/{id}/messages?since={since} * process response.messages * since = response.current_version * sleep or wait for an event * ``` * * The `current_version` is the conversation's head at the moment the response was * generated — using it as the next request's `since` gives gap-free incremental * reads. */ ListMessagesResponse: { current_version: components["schemas"]["ConversationVersion"]; /** * @description Messages with `sequence_no > since`. Empty array means no new messages — the * conversation is at version `current_version` but you've already seen everything. */ messages: components["schemas"]["MessageDto"][]; }; /** * Format: uuid * @description A UUID **you generate** for each `POST .../runs` call. Acts as an idempotency key: * re-sending the same `client_op_id` returns the original run row unchanged. This lets * you retry network blips, request timeouts, etc. without accidentally starting a * second workflow. * * **Scope:** `(company_id, user_id, client_op_id)` is the uniqueness key. One * `client_op_id` means one run for you, on whichever conversation it first landed — * posting it again against a different conversation returns that first run rather than * starting a new one. * @example 696b022c-e86d-4b3e-b6d7-ceb7eb1a495e */ ClientOpId: string; /** * @description A fresh user turn that starts a new conversational round. Use this for the first run * on a conversation, and for follow-up user questions (e.g. after a `completed` run * where you want to continue the conversation). */ UserMessagePayload: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ kind: "user_message"; /** * @description The user's message verbatim. The platform persists it as a `user`-role message * with a single `text` content block. * @example Find me a meeting time for tomorrow afternoon. */ text: string; }; /** * @description A single tool call's result, supplied by the caller when resuming a `requires_action` * run. */ ToolOutput: { /** * @description Must match a `tool_use_id` from the prior run's `pending_tool_calls`. The platform * rejects unknown ids with * [Unknown tool_use_id](https://docs.narrative.io/reference/architecture/agent-conversations/errors/unknown-tool-use-id) * and ids that resolve to server-side tools with * [Not A Client Tool Call](https://docs.narrative.io/reference/architecture/agent-conversations/errors/not-a-client-tool-call). * @example tooluse_DWXPKZ50JDGib5GmShyUgJ */ tool_use_id: string; /** * @description The tool's result, as plain text. Persisted as a single `text` block inside a * `tool_result` ContentBlock. For non-text results (JSON objects, etc.), serialize * them to a string before sending. * @example User confirmed the proposed slot. */ content: string; /** * @description Set to `true` to tell the model the tool call failed (e.g. the user dismissed * the prompt, an external service returned an error you want to surface). The * model decides how to react — typically by retrying with different arguments, or * falling through to a partial answer. * @default false */ is_error: boolean; }; /** * @description A batch of tool outputs resuming a previously-paused (`requires_action`) run. * * **Cross-reference rules** (enforced by the platform; failure to satisfy returns 400): * - Every `outputs[].tool_use_id` must reference a `tool_use` block on the * conversation's latest assistant turn. * - That `tool_use` must be a **caller-declared** call — its `name` is dash-free. * MCP-resolved calls (`{alias}-{name}` shape) already have their results persisted by * the workflow. See * [Not A Client Tool Call](https://docs.narrative.io/reference/architecture/agent-conversations/errors/not-a-client-tool-call). * - Every pending caller-declared call from `pending_tool_calls` must have a matching * output — no missing, no extras. See * [Incomplete Tool Outputs](https://docs.narrative.io/reference/architecture/agent-conversations/errors/incomplete-tool-outputs). */ ToolOutputsPayload: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ kind: "tool_outputs"; outputs: components["schemas"]["ToolOutput"][]; }; /** * @description The run's input. Discriminated by `kind`: * * - `user_message` — fresh user turn. * - `tool_outputs` — resuming a paused run with the tool answers. */ RunPayload: components["schemas"]["UserMessagePayload"] | components["schemas"]["ToolOutputsPayload"]; /** * @description Per-run policy that biases the model toward (or away from) using tools on the **first * iteration** of the run. From iteration 2 onward the model is back on `{"kind": * "auto"}` regardless. * * **Per-run, not per-conversation:** every new run picks its own `tool_choice`. To * re-force a particular tool on every follow-up run (for example, always asking the user * for confirmation), set it on each `POST .../runs` body. * * Three shapes, discriminated by `kind`: */ ToolChoice: { /** @enum {string} */ kind: "auto"; } | { /** @enum {string} */ kind: "any"; } | { /** @enum {string} */ kind: "specific_tool"; /** * @description The bare tool name — never the wire form. For MCP-pinned tools combine with * `mcp_alias`. For caller-declared tools, omit `mcp_alias`. */ name: string; /** * @description The MCP server's alias when pinning a server-side tool. When present, the * platform stitches `{mcp_alias}-{name}` into the wire name the model sees, and * validates that the alias is a registered MCP server with that tool in its * catalog. Omit (or set to `null`) for caller-declared tools. */ mcp_alias?: string | null; }; /** * @description Sparse override applied to a single run. Any field set here replaces the * corresponding `defaults` field for that run only. Fields not set inherit from * `defaults`. * * Two list fields (`mcp_servers`, `tools`) **replace the whole list** when set, not * merge — if you provide them in the override, the conversation defaults' lists are * ignored entirely for that run. * * Every field may also be sent as `null`, which means the same as leaving it out: the run * inherits the conversation's value. A null cannot clear a default. * * `system_prompt` is **not** in this object — it's pinned at conversation creation and * cannot be overridden. */ RunConfigOverride: { /** @example anthropic.claude-opus-4.6 */ model?: string | null; /** Format: uuid */ data_plane_id?: string | null; /** @enum {string|null} */ execution_cluster?: "shared" | "dedicated" | null; /** Format: uuid */ compute_pool_id?: string | null; max_iterations?: number | null; max_tokens?: number | null; temperature?: number | null; thinking?: components["schemas"]["ThinkingSetting"] | null; output_format_schema?: Record | null; mcp_servers?: components["schemas"]["McpServerConfig"][] | null; tools?: components["schemas"]["ToolSpec"][] | null; }; /** * @description Start a new run on the conversation. * * **Required fields:** * - `client_op_id` — your-generated UUID for idempotency. * - `expected_version` — the conversation's current version, read just before this * call. Triggers a 409 [Version Conflict](https://docs.narrative.io/reference/architecture/agent-conversations/errors/version-conflict) * if the version moved. * - `payload` — the run's input. * * **Optional fields:** * - `tool_choice` — biases tool selection on iteration 1 of this run only. * - `config_override` — sparse override of the conversation's `defaults` for this run. */ CreateRunRequest: { client_op_id: components["schemas"]["ClientOpId"]; expected_version: components["schemas"]["ConversationVersion"]; payload: components["schemas"]["RunPayload"]; tool_choice?: components["schemas"]["ToolChoice"] | null; config_override?: components["schemas"]["RunConfigOverride"] | null; }; /** * Format: uuid * @description UUID identifying a single run. Returned by `POST /agents/conversations/{id}/runs` and * used in `GET /agents/runs/{id}` to poll progress. * @example 82eb9cb7-619e-46bb-ac1c-8a32b0112c1c */ RunId: string; /** * @description Where the run is in its lifecycle. Three terminal states (`completed`, * `requires_action`, `failed`) — you stop polling when you see any of them. The two * in-flight states (`pending`, `running`) mean "keep polling." * * - `pending` — run row inserted by the API but the workflow hasn't picked it up yet. * Usually < 1 second; if a run stays here for tens of seconds the workflow workers * may be down. * - `running` — workflow is mid-execution. One "running" you see roughly corresponds to * one inference iteration; you might cycle through this state several times for a * multi-iteration tool-use loop. * - `completed` — model produced a final answer. Exactly one of `final_text` / * `final_structured_output` is populated depending on whether the caller supplied an * `output_format_schema` on the conversation defaults or run override. * - `requires_action` — model called a client-side tool. `pending_tool_calls` is * populated; resume by posting a new run with `payload.kind: tool_outputs`. * - `failed` — non-recoverable error. `error.type`, `error.message`, `error.title`, * `error.docs_url` are populated. See the * [error catalog](https://docs.narrative.io/reference/architecture/agent-conversations/errors/unexpected) * for the per-type meaning. A run that was deliberately **cancelled** also lands here, tagged * with `error.type: AgentLoopCancelled` so it is distinguishable from a genuine failure. * @enum {string} */ RunStatus: "pending" | "running" | "completed" | "requires_action" | "failed"; /** * @description Token usage totals across every inference iteration in this run. Used for billing * and capacity planning. Note that `prompt_tokens` grows with each iteration because * each round re-sends the full conversation history to the model. */ InferenceUsage: { /** @example 14842 */ prompt_tokens: number; /** @example 510 */ completion_tokens: number; /** @example 15352 */ total_tokens: number; }; /** * @description A tool call from the model that's waiting for **you** to answer. Surfaces on * `status: requires_action` runs. Resume by posting a new run with `payload.kind: * tool_outputs` and matching `outputs[].tool_use_id`. */ PendingToolCall: { /** * @description Use this verbatim as `outputs[].tool_use_id` when resuming the run. * @example tooluse_DWXPKZ50JDGib5GmShyUgJ */ tool_use_id: string; /** * @description The wire-form name of the tool the model is calling. For caller-declared tools * this is the bare `name` (dash-free) — the only shape that surfaces here, since * MCP-resolved calls are settled inline by the platform. * @example confirm_booking */ name: string; /** * @description The arguments the model produced. Matches the tool's `input_schema`. * @example { * "proposed_slot": "tomorrow afternoon" * } */ arguments: Record; }; /** * @description Populated on `status: failed` runs. Use `type` for log correlation and * automated dispatch; show `title` and `message` to humans; link to `docs_url` for * actionable explanations. */ RunError: { /** * @description Stable internal incident code (e.g. `AgentLoopMaxIterationsExceeded`, * `AgentLoopInvalidEffectiveConfig`, `UnknownTool`, `AgentLoopCancelled`). * Future-stable — these are the keys log dashboards and support tooling * correlate on. `AgentLoopCancelled` specifically marks a deliberately * cancelled run rather than a genuine error. * @example AgentLoopMaxIterationsExceeded */ type: string; /** * @description Human-readable detail string emitted by the failing component. * @example max iterations exceeded after 5 iterations */ message: string; /** * @description Caller-facing short title looked up from the platform's error catalog. A `type` the * catalog doesn't list (usually because the workflow was upgraded ahead of the API) * gets the catalog's generic `Unexpected Error` entry. * @example Max Iterations Exceeded */ title?: string; /** * Format: uri * @description Link to the docs page explaining this error class — what triggered it and how to * recover. An unrecognized `type` links to the * [Unexpected Error](https://docs.narrative.io/reference/architecture/agent-conversations/errors/unexpected) * page. * @example https://docs.narrative.io/reference/architecture/agent-conversations/errors/max-iterations-exceeded */ docs_url?: string; }; /** * @description One provisional, in-flight turn under [RunLive.messages](#runlive). Same content shape as a * committed `MessageDto`, but carries a run-local `turn_index` instead of a `sequence_no` — these * turns aren't in the committed log yet, so they have no committed position. The `tool_use` / * `tool_result` blocks carry the same `tool_use_id`s that later land in the committed * `content_blocks`, so you can de-dupe the live tail against `GET .../messages` once the run is * terminal. Block `id`s match too, for the turns we produced. */ LiveMessage: { /** * @description Per-run ordering of live turns (assistant tool_use turn, then its tool_result turn, per * iteration). Independent of `sequence_no`; use it only to order `live.messages`. * @example 0 */ turn_index: number; role: components["schemas"]["MessageRole"]; content_blocks: components["schemas"]["ContentBlock"][]; /** * @description Same meaning as on a committed message: the ids of the blocks the answer was taken from. * **Empty while a turn is still streaming** — the answer is resolved when the run finalizes, so * a live turn names it only once it lands. Until then, render tool progress and wait. * @example [] */ final_answer_from?: string[]; }; /** * @description Mutable, "live" view of the run's conversation — state that can change *after* the run * row was written, so any fresh `GET /agents/runs/{id}` reflects the latest value without a * separate conversation or messages poll. Always present on a run response. */ RunLive: { /** * @description The conversation's current display name, or null if it has none yet. The platform * auto-generates a name from the first user message shortly after the first run is * created (an async flow), so a name that was null when the run started can appear on a * later read. A name the caller set explicitly is never overwritten. * @example Tomorrow Afternoon Meeting */ current_name?: string | null; /** * @description The run's produced turns so far, streamed while the run is **non-terminal** so a chat * client can show tool execution live from its existing run poll. **Empty once the run is * terminal** — the same turns are then committed and authoritative via * `GET /agents/conversations/{id}/messages`. De-dupe the live tail against the committed * messages by `tool_use_id`. * * ## Why a run can be quiet * * A run can deliberately pause: the model may wait for a Narrative job it started, or sleep * between checks of work this platform cannot watch. While it waits, this list carries a * `text` block saying so, and it is the only way to tell a waiting run from a stuck one: * * ```json * { "turn_index": 1, "role": "tool", * "content_blocks": [{ "type": "text", "text": "waiting on 2 tasks [wt_9f3c…, wt_1a2b…], giving up at 2026-08-13T14:05:00Z" }] } * ``` * * ```json * { "turn_index": 1, "role": "tool", * "content_blocks": [{ "type": "text", "text": "sleeping for 300s" }] } * ``` * * These are **human-readable strings, not a stable machine contract** — show them, don't * parse them. A waiting run is healthy: keep polling, or wait for it to reach a terminal * state. It can legitimately stay quiet for hours, and posting another run on the * conversation meanwhile gets a 409 that quotes the same line. */ messages: components["schemas"]["LiveMessage"][]; }; /** * @description Run state as returned by `POST /agents/conversations/{id}/runs` (Accepted, 202) and * `GET /agents/runs/{id}` (OK, 200). Which optional fields are populated depends on * `status`: * * - `completed` → `iterations_used`, `usage`, `submitted_inference_job_ids`, and exactly * one of `final_text` / `final_structured_output`. The two are mutually exclusive: text-mode * runs (no `output_format_schema` supplied) populate `final_text`; structured-mode runs * populate `final_structured_output` with the caller-schema-conforming JSON. * - `requires_action` → `pending_tool_calls`, `iterations_used`, `usage`, * `submitted_inference_job_ids`. * - `failed` → `error`, possibly partial `iterations_used`/`usage`/`submitted_inference_job_ids`. * - `pending` / `running` → only the at-creation fields (`id`, `conversation_id`, * `started_at`, etc.) plus `submitted_inference_job_ids` if any iterations have * started. */ RunResponse: { id: components["schemas"]["RunId"]; conversation_id: components["schemas"]["ConversationId"]; /** @example 1 */ company_id: number; /** @example 407 */ user_id: number; client_op_id: components["schemas"]["ClientOpId"]; status: components["schemas"]["RunStatus"]; /** @description The `tool_choice` the run was started with, or null if it had none. */ tool_choice?: components["schemas"]["ToolChoice"] | null; /** * @description The fully-merged config that was used to run this turn — conversation `defaults` * with `config_override` applied. Echoed back so you can see exactly what the model * saw, especially helpful when debugging unexpected behavior caused by overrides. */ effective_config: components["schemas"]["ConversationDefaults"]; /** * @description Number of inference iterations this run completed. Populated on terminal states. * Equal to `submitted_inference_job_ids.length` for the same run. * @example 6 */ iterations_used?: number | null; usage?: components["schemas"]["InferenceUsage"] | null; /** * @description Inference job IDs (one per iteration) for cross-system tracing. Each ID is a row * in the platform's `jobs` table — use it to pull the raw model request/response * if you need to debug a specific iteration. */ submitted_inference_job_ids: string[]; /** * @description Tool calls the run is waiting for the caller to answer. Empty unless `status` is * `requires_action`. */ pending_tool_calls: components["schemas"]["PendingToolCall"][]; /** * @description The model's final answer in plain text. Populated on `status: completed` when the * caller did NOT supply an `output_format_schema` (text mode). Mutually exclusive with * `final_structured_output`. */ final_text?: string | null; /** * @description The model's final answer as a JSON object conforming to the caller's * `output_format_schema`. Populated on `status: completed` when the caller supplied an * `output_format_schema` on the conversation defaults or run override (structured * mode). The shape is the caller's schema verbatim — no top-level `text` field is * required or implied. Mutually exclusive with `final_text`. */ final_structured_output?: unknown; /** @description Populated only on `status: failed`. */ error?: components["schemas"]["RunError"] | null; /** * Format: date-time * @example 2026-05-18T13:21:30.355180Z */ started_at: string; /** * Format: date-time * @description When the run reached a terminal status. Null while in `pending` or `running`. */ completed_at?: string | null; /** * @description The conversation's current, still-mutating state (e.g. its auto-generated name). * Populated on every read, independent of `status`. */ live: components["schemas"]["RunLive"]; }; /** * @description A handle after its claim has been dropped. Nothing here reports how the task behind the * handle is doing: dropping a claim does not touch the task, so its own API is where to look. */ WaitableResponse: { /** * @description The handle, as `job_monitor` returned it. * @example wt_9d06ad7bc3674fe1aa789ec2eda55c3c */ handle: string; /** * @description What sort of task the handle points at. * @enum {string} */ kind: "job"; /** * Format: date-time * @description When the claim was dropped. Set on the first cancel and never moved, so cancelling the * same handle again reports the original moment. * @example 2026-08-17T12:31:07Z */ cancelled_at?: string | null; }; /** * @description Status view of one connection. Deliberately credential-free — the registered client secret and * the encrypted access/refresh tokens are never returned. */ McpConnectionSummary: { /** * Format: uuid * @example b3f1c2a4-5d6e-47f8-9a0b-1c2d3e4f5a6b */ connection_id: string; /** * Format: uri * @description The external MCP server this connection targets. * @example https://huggingface.co/mcp */ server_url: string; /** @example hf */ alias: string; /** * Format: uri * @description The OAuth issuer discovered for the server. * @example https://huggingface.co */ authorization_server: string; /** * @description Lifecycle. `pending` after creation, and while waiting on the user's consent and the * completion call; `connected` once the token exchange succeeds and `tools/list` validates; * `error` for a failed connection. * @example connected * @enum {string} */ status: "pending" | "connected" | "error"; /** * Format: date-time * @description When the current access token expires, if the server issued an expiry. The platform * refreshes it automatically before use when a refresh token is available. * @example 2026-07-12T18:30:00Z */ expires_at?: string | null; /** * Format: date-time * @example 2026-07-12T17:00:00Z */ created_at: string; /** * Format: date-time * @example 2026-07-12T17:02:11Z */ updated_at: string; }; /** * @description Response for `GET /mcp-connections`: the caller's connections. Not paginated. Empty * `connections` when the caller has none. * @example { * "connections": [ * { * "connection_id": "b3f1c2a4-5d6e-47f8-9a0b-1c2d3e4f5a6b", * "server_url": "https://huggingface.co/mcp", * "alias": "hf", * "authorization_server": "https://huggingface.co", * "status": "connected", * "expires_at": "2026-07-12T18:30:00Z", * "created_at": "2026-07-12T17:00:00Z", * "updated_at": "2026-07-12T17:02:11Z" * } * ] * } */ ListMcpConnectionsResponse: { connections: components["schemas"]["McpConnectionSummary"][]; }; /** * @description Body for `POST /mcp-connections`. Names the external MCP server to connect and the alias its * tools will be exposed under inside an agent run. */ CreateMcpConnectionRequest: { /** * Format: uri * @description Absolute `http(s)` URL of the external MCP server. The server must advertise OAuth * protected-resource metadata, an authorization server that supports Dynamic Client * Registration (RFC 7591), and the `S256` PKCE method. Servers that only support * pre-registered clients cannot be connected this way. * @example https://huggingface.co/mcp */ url: string; /** * @description Short routing prefix for this server's tools. 1–8 characters, starting with a letter, * letters and digits only. * * The model sees each of this server's tools as `{alias}-{tool}`, and that whole name is * capped at 64 characters, so a short alias leaves room for a descriptive tool name. No * dashes: the dash is what the platform splits on to route a call back to its server. * @example hf */ alias: string; }; /** * @description Response for `POST /mcp-connections`. The connection is persisted in `pending` status; the * user must visit `authorization_url` in a browser to grant access. On consent the external * authorization server redirects back to `GET /mcp-connections/callback`, which stores the * authorization code and sends the browser to the Narrative app; the app then calls * `POST /mcp-connections/complete` to flip the connection to `connected`. */ McpConnectionCreatedResponse: { /** * Format: uuid * @description Id of the pending connection. Reference it from an agent run once it is `connected`. * @example b3f1c2a4-5d6e-47f8-9a0b-1c2d3e4f5a6b */ connection_id: string; /** * Format: uri * @description The external authorization server's consent URL, with `client_id`, `redirect_uri`, * `state`, the PKCE `code_challenge` (S256), and the `resource` indicator already applied. * Open it in a browser to authorize the connection. * @example https://huggingface.co/oauth/authorize?response_type=code&client_id=...&code_challenge_method=S256&state=... */ authorization_url: string; }; /** * @description Body for `POST /mcp-connections/complete`. The `state` identifies the authorization flow to * finish; the authorization code itself is already held server-side and is never sent by the * client. */ CompleteMcpConnectionRequest: { /** * @description The one-time state issued by `POST /mcp-connections` and forwarded to the app by * `GET /mcp-connections/callback`. Consumed once the connection completes. * @example Yk8fQ2Zsb3dTdGF0ZQ */ state: string; }; /** * @description Summary information about an app. * @example { * "id": 100, * "name": "Test App", * "slug": "test-app" * } */ AppInfo: { /** * Format: int64 * @description The app ID. * @example 100 */ id: number; /** * @description The app name from the manifest. * @example Test App */ name: string; /** * @description The app slug. * @example test-app */ slug?: string | null; }; /** * @description Summary information about a company. * @example { * "id": 42, * "logo": "https://example.com/logo.png", * "name": "Acme Corp" * } */ CompanyInfo: { /** * Format: int64 * @description The company ID. * @example 42 */ id: number; /** * @description URL to the company logo. * @example https://example.com/logo.png */ logo?: string | null; /** * @description The company name. * @example Acme Corp */ name: string; }; /** * @description The lifecycle status of an app invite. * @example pending * @enum {string} */ AppInviteStatus: "pending" | "active" | "archived"; /** * @description An app invite with full details. * @example { * "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", * "activated_at": null, * "app": { * "id": 100, * "name": "Test App", * "slug": "test-app" * }, * "code": "abc123def456ghi789jkl012", * "company": { * "id": 42, * "logo": "https://example.com/logo.png", * "name": "Acme Corp" * }, * "created_at": "2025-01-01T00:00:00Z", * "data": { * "key": "value" * }, * "display_name": "Partner onboarding invite", * "invitee_name": "Jane Smith", * "status": "pending", * "tags": [ * "onboarding", * "partner" * ], * "updated_at": "2025-01-01T00:00:00Z", * "url": "https://example.com/invite?code=abc123def456ghi789jkl012" * } */ AppInviteResponse: { /** * Format: uuid * @description Unique identifier for the app invite. * @example a1b2c3d4-e5f6-7890-abcd-ef1234567890 */ id: string; /** * Format: date-time * @description The timestamp when the invite was activated, or null if not yet activated. * @example 2025-01-15T10:30:00Z */ activated_at?: string | null; app: components["schemas"]["AppInfo"]; /** * @description The 24-character invite code. * @example abc123def456ghi789jkl012 */ code: string; company: components["schemas"]["CompanyInfo"]; /** * Format: date-time * @description The timestamp when the invite was created. * @example 2025-01-01T00:00:00Z */ created_at: string; /** * @description Custom JSON data associated with the invite. * @example { * "key": "value" * } */ data?: Record | null; /** * @description An optional display name for the invite. * @example Partner onboarding invite */ display_name?: string | null; /** * @description An optional name for the invitee. Maximum 1024 characters. * @example Jane Smith */ invitee_name?: string | null; status: components["schemas"]["AppInviteStatus"]; /** * @description A list of tags associated with the invite. Each tag is max 128 characters. * @example [ * "onboarding", * "partner" * ] */ tags?: string[]; /** * Format: date-time * @description The timestamp when the invite was last updated. * @example 2025-01-15T10:30:00Z */ updated_at: string; /** * @description The full invite URL constructed from the base URL and invite code. * @example https://example.com/invite?code=abc123def456ghi789jkl012 */ url: string; }; /** * @description A paginated list of app invites. * @example { * "current_page": 1, * "next_page": null, * "total_records": 1, * "total_pages": 1, * "records": [ * { * "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", * "activated_at": null, * "app": { * "id": 100, * "name": "Test App", * "slug": "test-app" * }, * "code": "abc123def456ghi789jkl012", * "company": { * "id": 42, * "logo": "https://example.com/logo.png", * "name": "Acme Corp" * }, * "created_at": "2025-01-01T00:00:00Z", * "data": null, * "display_name": null, * "invitee_name": null, * "status": "pending", * "tags": [], * "updated_at": "2025-01-01T00:00:00Z", * "url": "https://example.com/invite?code=abc123def456ghi789jkl012" * } * ] * } */ AppInvitesResponse: { prev_page?: components["schemas"]["PrevPage"]; current_page: components["schemas"]["CurrentPage"]; next_page?: components["schemas"]["NextPage"]; total_records: components["schemas"]["TotalRecords"]; total_pages: components["schemas"]["TotalPages"]; records: components["schemas"]["AppInviteResponse"][]; }; /** * @description Request body for creating a new app invite. * @example { * "base_url": "https://example.com/invite", * "installation_id": 42, * "data": { * "key": "value" * }, * "display_name": "Partner onboarding invite", * "invitee_name": "Jane Smith", * "tags": [ * "onboarding" * ] * } */ CreateAppInviteRequest: { /** * @description The base URL for the invite link. Must be a valid URI with a scheme and host. * @example https://example.com/invite */ base_url: string; /** * Format: int64 * @description The ID of the app installation to create the invite for. * @example 42 */ installation_id: number; /** * @description Optional custom JSON data to associate with the invite. * @example { * "key": "value" * } */ data?: Record | null; /** * @description An optional display name for the invite. Maximum 1000 characters. * @example Partner onboarding invite */ display_name?: string | null; /** * @description An optional name for the invitee. Maximum 1024 characters. * @example Jane Smith */ invitee_name?: string | null; /** * @description A list of tags to associate with the invite. Each tag is max 128 characters. * @example [ * "onboarding" * ] */ tags?: string[]; }; /** * @description A stripped-down public view of an app invite, returned for unauthenticated code lookups. * @example { * "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", * "app": { * "id": 100, * "name": "Test App", * "slug": "test-app" * }, * "company": { * "id": 42, * "logo": "https://example.com/logo.png", * "name": "Acme Corp" * }, * "data": { * "key": "value" * }, * "display_name": "Partner onboarding invite", * "invitee_name": "Jane Smith", * "status": "pending", * "url": "https://example.com/invite?code=abc123def456ghi789jkl012" * } */ AppInvitePublicResponse: { /** * Format: uuid * @description Unique identifier for the app invite. * @example a1b2c3d4-e5f6-7890-abcd-ef1234567890 */ id: string; app: components["schemas"]["AppInfo"]; company: components["schemas"]["CompanyInfo"]; /** * @description Custom JSON data associated with the invite. * @example { * "key": "value" * } */ data?: Record | null; /** * @description An optional display name for the invite. * @example Partner onboarding invite */ display_name?: string | null; /** * @description An optional name for the invitee. Maximum 1024 characters. * @example Jane Smith */ invitee_name?: string | null; status: components["schemas"]["AppInviteStatus"]; /** * @description The full invite URL constructed from the base URL and invite code. * @example https://example.com/invite?code=abc123def456ghi789jkl012 */ url: string; }; EventContext: { /** * Format: int64 * @description The company the event concerns. */ company_id: number; /** Format: uuid */ connection_id?: string | null; /** Format: int64 */ dataset_id?: number | null; /** Format: uuid */ profile_id?: string | null; }; EventType: string; IdempotencyKey: string; /** @description Arbitrary JSON payload */ EventPayload: { [key: string]: unknown; }; WebhookAppEvent: { context: components["schemas"]["EventContext"]; /** Format: date-time */ event_timestamp: string; event_type: components["schemas"]["EventType"]; idempotency_key: components["schemas"]["IdempotencyKey"]; payload: components["schemas"]["EventPayload"]; }; WebhookAppEventBulkRequest: { events: components["schemas"]["WebhookAppEvent"][]; }; WebhookEventDetails: { /** Format: uuid */ webhook_event_id: string; /** Format: uuid */ webhook_subscription_id?: string | null; /** @description The submitted idempotency key, prefixed with the webhook subscription id. */ idempotency_key: string; /** @description The submitted event type, prefixed with the app name. */ event_type: string; /** Format: int64 */ company_id?: number | null; event_payload: components["schemas"]["EventPayload"]; }; WebhookAppEventResponse: { /** @description Events accepted and queued for delivery, one entry per matching webhook subscription. */ enqueued: components["schemas"]["WebhookEventDetails"][]; /** @description Events that could not be queued, e.g. because the idempotency key was already used. */ rejected: components["schemas"]["WebhookEventDetails"][]; }; /** * @example { * "id": "audience_export", * "name": "Audience Export", * "app_id": 42, * "metadata": { * "tags": [ * "advertising", * "audience_delivery" * ], * "refresh_schedule": { * "max": "P180D" * } * }, * "schema": { * "type": "object", * "properties": { * "audience_name": { * "title": "Audience Name", * "type": "string" * } * }, * "required": [ * "audience_name" * ] * }, * "policy": { * "type": "object", * "description": "JSON Schema metaschema over dataset schemas" * } * } */ AppInterface: { /** @description Identifier of the interface, unique within the app. The same identifiers are returned by `GET /datasets/{dataset_id}/interfaces`, so results from the two endpoints can be joined. */ id: string; /** @description Human-readable name of the interface. */ name: string; /** @description ID of the installed app that owns this interface. */ app_id: number; /** @description Interface metadata. */ metadata: { /** @description Tags categorizing the interface (e.g. `advertising`, `audience_delivery`). */ tags?: string[]; /** @description How often data delivered through this interface should be refreshed. */ refresh_schedule?: { /** @description Minimum refresh interval, an ISO-8601 duration (e.g. `P1D`). */ min?: string; /** @description Maximum refresh interval, an ISO-8601 duration (e.g. `P180D`). */ max?: string; }; }; /** @description JSON Schema for the interface's quick settings, used as the `quick_settings` object when configuring a connection to this interface. May embed a `uischema` key describing how the platform UI renders the settings form. */ schema: { [key: string]: unknown; }; /** @description The interface's collaboration policy, a JSON Schema metaschema that dataset schemas are validated against (as by `GET /datasets/{dataset_id}/interfaces`). Note this document can be large. Absent when the interface accepts any dataset schema. */ policy?: { [key: string]: unknown; }; }; AppInterfacesResponse: { records: components["schemas"]["AppInterface"][]; }; ProfilesResponse: { records: string[]; }; GetSchemaResponse: { /** * Format: uuid * @description Unique ID of the version. */ version_id?: string; /** * Format: uuid * @description Unique ID of the schema stream. Stream is associated with some particular app. */ stream_id?: string; /** @description Sequential ID of the version. */ version_number?: number; /** @description Persisted JSON Schema (2019-09 version). */ value?: { [key: string]: unknown; }; /** * Format: date-time * @description ISO-8601 timestamp indicating when the schema version was appended. */ created_at?: string; }; GetSchemasResponse: components["schemas"]["GetSchemaResponse"][]; PostSchemaResponse: { /** * Format: uuid * @description Unique ID of the version. */ version_id?: string; /** * Format: uuid * @description Unique ID of the schema stream. Stream is associated with some particular app. */ stream_id?: string; /** @description Sequential ID of the version. */ version_number?: number; /** @description Persisted JSON Schema (2019-09 version). */ value?: { [key: string]: unknown; }; /** * Format: date-time * @description ISO-8601 timestamp indicating when the schema version was appended. */ created_at?: string; }; GetDataResponse: { /** * Format: uuid * @description Unique ID of the data instance. */ id?: string; /** * Format: uuid * @description Unique ID of the schema. */ schema_version_id?: string; /** @description Persisted instance of the data */ value?: { [key: string]: unknown; }; /** * Format: date-time * @description ISO-8601 timestamp indicating when the schema version was appended. */ created_at?: string; }; /** @description saved instance */ DataInstance: { [key: string]: unknown; }; DataMeta: { /** * Format: uuid * @description Unique ID of the data instance. */ id?: string; /** * Format: uuid * @description Unique ID of the schema. */ schema_version_id?: string; }; PutDataResponse: { data?: components["schemas"]["DataInstance"]; meta?: components["schemas"]["DataMeta"]; }; /** @description A description of the type of data the attribute represents, including collection methodology, assumptions, etc. */ AttributeDescription: string; /** @description A public-facing descriptive name for the attribute. */ AttributeDisplayName: string; /** * @description An short identifier for the attribute to be used when it is referenced in validations. * * Attribute names must consist of only alphanumeric characters or underscores and be < 255 characters long. */ AttributeName: string; /** * @description Whether the field is a join key. Join key values identify an entity, so they can be used to join or * sample against other datasets. Omitted when `false`. */ IsJoinKey: boolean; /** * @description A raw Spark SQL expression determining whether a value for the given column is valid or not. * * If more than one validation is specified then _all_ the validation must evaluate to `true` for the column value to be considered valid. * * If `validations` is not specified or empty then all rows will match the access rule. * * E.g. for an attribute with the following definition: * * ``` * { * "name": "unique_id", * "type": "object", * "properties": { * "identifier_value": { * "type": "string" * }, * "identifier_type": { * "type": "string" * }, * "timestamp": { * "type": "timestamptz" * } * }, * "required": [ * "value" * ] * } * ``` * * Valid validations include: * * - Is the ID type lowercased? * * ```sql * "identifier_type": { * "type": "string", * "validations": [ * "lower($this.identifier_type) = $this.identifier_type" * ] * } * ``` * - Was the row collected within the last 90 days? * * ```sql * "timestamp": { * "type": "timestamptz", * "validations": [ * "$this.timestamp > date_sub(current_date(), 90)" * ] * } * ``` */ Validations: string[]; BinaryType: { /** * @description Raw binary values, e.g. geospatial geometries. * @enum {string} */ type: "binary"; /** * @description What the binary values encode. `geometry` values are native geospatial geometries and `wkb` values are * geometries encoded as [well-known binary](https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry#Well-known_binary). * When `format` is absent the values are opaque bytes. * @enum {string} */ format?: "geometry" | "wkb"; is_join_key?: components["schemas"]["IsJoinKey"]; validations?: components["schemas"]["Validations"]; }; BooleanType: { /** * @description True/false values. Input values must be one of `true` or `false`. * @enum {string} */ type: "boolean"; validations?: components["schemas"]["Validations"]; }; DoubleType: { /** * @description 64-bit IEEE 754 floating point values. * @enum {string} */ type: "double"; /** @description An optional set of possible values for the field. */ enum?: number[]; is_join_key?: components["schemas"]["IsJoinKey"]; validations?: components["schemas"]["Validations"]; }; LongType: { /** * @description 64-bit signed integer values. * @enum {string} */ type: "long"; /** @description An optional set of possible values for the field. */ enum?: number[]; is_join_key?: components["schemas"]["IsJoinKey"]; validations?: components["schemas"]["Validations"]; }; AttributeType: components["schemas"]["ArrayType"] | components["schemas"]["BinaryType"] | components["schemas"]["BooleanType"] | components["schemas"]["DoubleType"] | components["schemas"]["LongType"] | components["schemas"]["ObjectType"] | components["schemas"]["RefType"] | components["schemas"]["StringType"] | components["schemas"]["TimestampTzType"] | components["schemas"]["VariantType"]; ObjectProperty: { /** @description A description of the named field. */ description?: string; /** @description A display name of the named field. */ display_name?: string; /** @description The position of the field within the object, starting at 0. */ order?: number; } & components["schemas"]["AttributeType"]; ObjectType: { /** * @description A record consisting of named fields of any type. * @enum {unknown} */ type: "object"; /** * @description A map from field names to field types. * * Field names must consist of only alphanumeric characters or underscores and be < 255 characters long. */ properties: { [key: string]: components["schemas"]["ObjectProperty"]; }; /** @description An optional array of properties whose values are never missing or null. */ required?: string[]; }; RefType: { type?: never; /** * @description A reference which results in the referenced attribute's type being used as the attribute type. * * A `$ref` can be of one of two forms: * * - An integer referencing another attribute's ID. * * - A special string, `$this`, which references the schema of the attribute in which `$this` appears. This form of reference is called a "self-reference". * * **Note**: if `$ref` is specified, then `type` _cannot_ be specified. * * ### Self-Reference Example * * `$this` allows for an attribute to reference its own schema in * * ``` * { * "name": "family_lineage", * "type": "object", * "properties": { * "name": { * "type": "string" * }, * "parent": { * "$ref": "$this" * } * } * } * ``` * Note that Narrative only expands self-references to a max depth of 3 levels. In the example above this means: * * - `family_lineage.parent.parent.parent` is a valid field * - `family_lineage.parent.parent.parent.parent` is an invalid field as it exceeds the max number of self-references */ $ref: number | "$this"; }; StringType: { /** * @description Abitrary-length character sequences encoded with UTF-8. * @enum {string} */ type: "string"; /** @description An optional set of possible values for the field. */ enum?: string[]; is_join_key?: components["schemas"]["IsJoinKey"]; validations?: components["schemas"]["Validations"]; }; TimestampTzType: { /** * @description Timestamp with timezone, stored as microseconds. Input values are expected to be valid [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) strings. * @enum {string} */ type: "timestamptz"; validations?: components["schemas"]["Validations"]; }; VariantType: { /** * @description Semi-structured values that can hold any JSON value. * @enum {string} */ type: "variant"; validations?: components["schemas"]["Validations"]; }; ArrayType: { /** * @description An array with elements of any data type. * @enum {string} */ type: "array"; items: components["schemas"]["BinaryType"] | components["schemas"]["BooleanType"] | components["schemas"]["DoubleType"] | components["schemas"]["LongType"] | components["schemas"]["ObjectType"] | components["schemas"]["RefType"] | components["schemas"]["StringType"] | components["schemas"]["TimestampTzType"] | components["schemas"]["VariantType"]; validations?: components["schemas"]["Validations"]; }; AttributeResponseWithoutExample: { /** @description Unique identifier for the attribute. */ id: number; description?: components["schemas"]["AttributeDescription"]; display_name: components["schemas"]["AttributeDisplayName"]; name: components["schemas"]["AttributeName"]; /** @description List of tags associated with the attribute */ tags: string[]; } & components["schemas"]["AttributeType"]; /** @description Defines which companies can participate in viewing or mapping attributes. */ Participants: { /** @enum {string} */ type: "none"; } | { /** @enum {string} */ type: "inclusion"; company_ids: number[]; } | { /** @enum {string} */ type: "exclusion"; company_ids: number[]; } | { /** @enum {string} */ type: "all"; }; /** * @description An owned attribute response includes additional fields for attributes owned by the requesting company. * @example { * "id": 123456789, * "name": "price", * "description": "The price of an order, product, or a price component. Currency field accepts ISO 4217 currency codes", * "display_name": "Price", * "type": "object", * "properties": { * "value": { * "order": 0, * "display_name": "Value", * "type": "double", * "validations": [ * "$this.value >= 0.0" * ] * }, * "iso_4217_currency": { * "order": 1, * "display_name": "Currency", * "type": "string", * "enum": [ * "USD", * "GBP", * "JPY" * ] * } * }, * "required": [ * "value", * "iso_4217_currency" * ], * "company_id": 12345, * "collaborators": { * "view": { * "type": "inclusion", * "company_ids": [ * 12345, * 67890 * ] * }, * "map": { * "type": "inclusion", * "company_ids": [ * 12345 * ] * } * }, * "tags": [ * "ecommerce", * "transaction" * ] * } */ AttributeOwnedResponse: components["schemas"]["AttributeResponseWithoutExample"] & { /** @description The ID of the company that owns this attribute */ company_id: number; /** @description Defines which companies have access to view and map this attribute */ collaborators: { view?: components["schemas"]["Participants"]; map?: components["schemas"]["Participants"]; }; }; /** * @description A shared attribute response is returned when the requesting company does not own the attribute. * * There is no `type` discriminator to tell the two variants apart: what distinguishes them is that * an owned response carries `company_id` and `collaborators` and a shared one does not. Forbidding * those two here says so explicitly, so a payload resolves to exactly one branch of * `AttributeResponse` instead of matching both. * @example { * "id": 123456789, * "name": "price", * "description": "The price of an order, product, or a price component. Currency field accepts ISO 4217 currency codes", * "display_name": "Price", * "type": "object", * "properties": { * "value": { * "order": 0, * "display_name": "Value", * "type": "double", * "validations": [ * "$this.value >= 0.0" * ] * }, * "iso_4217_currency": { * "order": 1, * "display_name": "Currency", * "type": "string", * "enum": [ * "USD", * "GBP", * "JPY" * ] * } * }, * "required": [ * "value", * "iso_4217_currency" * ], * "tags": [ * "ecommerce", * "transaction" * ] * } */ AttributeSharedResponse: components["schemas"]["AttributeResponseWithoutExample"] & { company_id?: never; collaborators?: never; }; /** * @description An attribute models a standardized data point available for sale on the Narrative marketplace. * * Narrative automatically turns data points from provider datasets into attributes so that buyers can purchase * well-formed, standardized data from any supplier on the marketplace. * * The response will be one of two types: * - AttributeOwnedResponse: When the requesting company owns the attribute (includes company_id and collaborators) * - AttributeSharedResponse: When the requesting company does not own the attribute */ AttributeResponse: components["schemas"]["AttributeOwnedResponse"] | components["schemas"]["AttributeSharedResponse"]; /** * @description One page of attributes. When the request carries no paging parameters, every record is returned in * a single page. * @example { * "prev_page": null, * "current_page": 1, * "next_page": null, * "total_records": 1, * "total_pages": 1, * "records": [ * { * "id": 123456789, * "name": "price", * "description": "The price of an order, product, or a price component. Currency field accepts ISO 4217 currency codes", * "display_name": "Price", * "type": "object", * "properties": { * "value": { * "order": 0, * "display_name": "Value", * "type": "double", * "validations": [ * "$this.value >= 0.0" * ] * }, * "iso_4217_currency": { * "order": 1, * "display_name": "Currency", * "type": "string", * "enum": [ * "USD", * "GBP", * "JPY" * ] * } * }, * "tags": [ * "ecommerce", * "transaction" * ], * "required": [ * "value", * "iso_4217_currency" * ] * } * ] * } */ AttributesResponse: { records: components["schemas"]["AttributeResponse"][]; prev_page?: components["schemas"]["PrevPage"]; current_page: components["schemas"]["CurrentPage"]; next_page?: components["schemas"]["NextPage"]; total_records: components["schemas"]["TotalRecords"]; total_pages: components["schemas"]["TotalPages"]; }; AttributeTypeWithoutRef: components["schemas"]["ArrayType"] | components["schemas"]["BinaryType"] | components["schemas"]["BooleanType"] | components["schemas"]["DoubleType"] | components["schemas"]["LongType"] | components["schemas"]["ObjectType"] | components["schemas"]["StringType"] | components["schemas"]["TimestampTzType"]; /** * @example { * "name": "price", * "description": "The price of an order, product, or a price component. Currency field accepts ISO 4217 currency codes", * "display_name": "Price", * "type": "object", * "properties": { * "value": { * "type": "double", * "validations": [ * "$this.value >= 0.0" * ] * }, * "iso_4217_currency": { * "type": "string", * "enum": [ * "USD", * "GBP", * "JPY" * ] * }, * "tags": { * "type": "array", * "items": { * "type": "string" * } * } * }, * "required": [ * "value", * "iso_4217_currency" * ], * "tags": [ * "ecommerce", * "pricing" * ], * "collaborators": { * "view": { * "type": "inclusion", * "company_ids": [ * 12345, * 67890 * ] * }, * "map": { * "type": "inclusion", * "company_ids": [ * 12345 * ] * } * } * } */ AttributeCreateRequest: { name: components["schemas"]["AttributeName"]; description?: components["schemas"]["AttributeDescription"]; display_name: components["schemas"]["AttributeDisplayName"]; /** @description List of tags to associate with the attribute */ tags: string[]; /** * @description Defines which companies have access to view and map this attribute. The `all` and * `exclusion` permission types are broad grants that only Narrative may use, and `map` * permissions cannot be broader than `view` permissions. */ collaborators: { view?: components["schemas"]["Participants"]; map?: components["schemas"]["Participants"]; }; } & components["schemas"]["AttributeTypeWithoutRef"]; /** * @description A co-occurring attribute, reduced to its shared fields. Unlike `AttributeResponse` it never carries * `company_id` or `collaborators`, regardless of who owns the attribute or who is asking. */ CooccurringAttribute: components["schemas"]["AttributeResponseWithoutExample"] & { company_id?: never; collaborators?: never; }; AttributeCooccurrence: { attribute?: components["schemas"]["CooccurringAttribute"]; /** * @description A number between 0 and 1 representing how often the attribute is mapped to the same datasets as the * returned attribute */ cooccurrence_pct?: number; }; /** @description Some metadata about the attribute being returned */ AttributeMetadata: { /** @description Attributes that are commonly mapped to the same datasets */ attribute_cooccurrence?: components["schemas"]["AttributeCooccurrence"][]; }; /** * @example { * "id": 123456789, * "name": "price", * "description": "The price of an order, product, or a price component. Currency field accepts ISO 4217 currency codes", * "display_name": "Price", * "type": "object", * "properties": { * "value": { * "order": 0, * "display_name": "Value", * "type": "double", * "validations": [ * "$this.value >= 0.0" * ] * }, * "iso_4217_currency": { * "order": 1, * "display_name": "Currency", * "type": "string", * "enum": [ * "USD", * "GBP", * "JPY" * ] * } * }, * "required": [ * "value", * "iso_4217_currency" * ], * "company_id": 12345, * "collaborators": { * "view": { * "type": "inclusion", * "company_ids": [ * 12345, * 67890 * ] * }, * "map": { * "type": "inclusion", * "company_ids": [ * 12345 * ] * } * }, * "tags": [ * "ecommerce", * "transaction" * ], * "metadata": { * "attribute_cooccurrence": [ * { * "attribute": { * "id": 2, * "name": "unique_id", * "display_name": "Unique ID", * "tags": [], * "type": "string" * }, * "cooccurrence_pct": 0.42 * } * ] * } * } */ AttributeOwnedResponseWithMetadata: components["schemas"]["AttributeOwnedResponse"] & { metadata?: components["schemas"]["AttributeMetadata"]; }; /** * @example { * "id": 123456789, * "name": "price", * "description": "The price of an order, product, or a price component. Currency field accepts ISO 4217 currency codes", * "display_name": "Price", * "type": "object", * "properties": { * "value": { * "order": 0, * "display_name": "Value", * "type": "double", * "validations": [ * "$this.value >= 0.0" * ] * }, * "iso_4217_currency": { * "order": 1, * "display_name": "Currency", * "type": "string", * "enum": [ * "USD", * "GBP", * "JPY" * ] * } * }, * "required": [ * "value", * "iso_4217_currency" * ], * "tags": [ * "ecommerce", * "transaction" * ], * "metadata": { * "attribute_cooccurrence": [ * { * "attribute": { * "id": 2, * "name": "unique_id", * "display_name": "Unique ID", * "tags": [], * "type": "string" * }, * "cooccurrence_pct": 0.42 * } * ] * } * } */ AttributeSharedResponseWithMetadata: components["schemas"]["AttributeSharedResponse"] & { metadata?: components["schemas"]["AttributeMetadata"]; }; /** @description An attribute response that includes metadata. Can be either owned or shared based on the requesting company. */ AttributeResponseWithMetadata: components["schemas"]["AttributeOwnedResponseWithMetadata"] | components["schemas"]["AttributeSharedResponseWithMetadata"]; /** * @example { * "name": "price", * "description": "The price of an order, product, or a price component. Currency field accepts ISO 4217 currency codes", * "display_name": "Price", * "type": "object", * "properties": { * "value": { * "type": "double", * "validations": [ * "$this.value >= 0.0" * ] * }, * "iso_4217_currency": { * "type": "string", * "enum": [ * "USD", * "GBP", * "JPY" * ] * } * }, * "required": [ * "value", * "iso_4217_currency" * ], * "collaborators": { * "view": { * "type": "inclusion", * "company_ids": [ * 12345, * 67890 * ] * }, * "map": { * "type": "inclusion", * "company_ids": [ * 12345 * ] * } * } * } */ UpdateAttributeRequest: { name: components["schemas"]["AttributeName"]; description?: components["schemas"]["AttributeDescription"]; display_name: components["schemas"]["AttributeDisplayName"]; /** @description Defines which companies have access to view and map this attribute */ collaborators: { view?: components["schemas"]["Participants"]; map?: components["schemas"]["Participants"]; }; } & components["schemas"]["AttributeTypeWithoutRef"]; /** @description The attributes whose type definitions reference the given attribute. */ AttributeReferencesResponse: { records: components["schemas"]["AttributeResponse"][]; }; /** @description The attribute at one end of an edge. */ AttributeDerivationEdgeEnd: { /** Format: int64 */ id: number; name: components["schemas"]["AttributeName"]; }; /** * Format: int64 * @description Unique identifier of the derivation rule. * @example 42 */ DerivationId: number; /** * @description Name of the derivation rule, unique within the owning company. * @example raw_email_to_sha256 */ DerivationName: string; /** * @description What the rule does, for whoever is deciding whether to accept derived data. * @example Hashes the raw email address with SHA-256. */ DerivationDescription: string; /** * @description Breaks ties when more than one rule reaches the same target attribute — cheapest first. Resolution over multi-step * paths sums the cost of every rule on a path and prefers the cheapest total. * @default 1 */ DerivationCost: number; /** * @description Explains the `lossy` and `imprecise` flags to whoever is deciding whether to accept derived data. * @example Hashing is one-way, so the original address cannot be recovered. */ FidelityNote: string; /** @description The rule on an edge, without its transformation. */ AttributeDerivationEdgeDerivation: { id: components["schemas"]["DerivationId"]; name: components["schemas"]["DerivationName"]; description: components["schemas"]["DerivationDescription"]; cost: components["schemas"]["DerivationCost"]; /** @description The transformation loses information, e.g. hashing. */ lossy: boolean; /** @description The transformation is approximate, e.g. bucketing an age into a range. */ imprecise: boolean; /** * @description Explains the `lossy` and `imprecise` flags to whoever is deciding whether to accept derived data. Omitted * when the rule has no note. */ fidelity_note?: components["schemas"]["FidelityNote"]; }; /** * @description One derivation rule as an edge of the derivation graph: the attribute at each end and the rule connecting them. * Both ends carry their name so no second lookup is needed to tell `raw_email` from `sha256_email`. The full rule, * including its transformation, is available from `GET /derivations/{id}`. * @example { * "source": { * "id": 118, * "name": "raw_email" * }, * "target": { * "id": 76, * "name": "sha256_email" * }, * "derivation": { * "id": 42, * "name": "raw_email_to_sha256", * "description": "Hashes the raw email address with SHA-256.", * "cost": 1, * "lossy": true, * "imprecise": false, * "fidelity_note": "Hashing is one-way, so the original address cannot be recovered." * } * } */ AttributeDerivationEdge: { /** @description The attribute the rule reads from. */ source: components["schemas"]["AttributeDerivationEdgeEnd"]; /** @description The attribute whose value the rule produces. */ target: components["schemas"]["AttributeDerivationEdgeEnd"]; derivation: components["schemas"]["AttributeDerivationEdgeDerivation"]; }; /** @description An attribute the walk reached, including the requested attribute itself. */ AttributeDerivationGraphNode: { /** Format: int64 */ id: number; display_name: components["schemas"]["AttributeDisplayName"]; /** @description Rules between this attribute and the requested one along the shortest route; 0 for the requested attribute. */ distance: number; name: components["schemas"]["AttributeName"]; /** * @description How the attribute relates to the requested one. `descendant`: it can be derived from the requested attribute. * `ancestor`: the requested attribute can be derived from it. `both`: reachable either way, which only a cycle * makes possible. `self`: the requested attribute. * @enum {string} */ relationship: "self" | "descendant" | "ancestor" | "both"; }; /** * @description One rule taken along a path and the attribute it leads to: the rule's target when walking towards descendants, * its source when walking towards ancestors. */ AttributeDerivationPathStep: { /** Format: int64 */ attribute_id: number; attribute_name: components["schemas"]["AttributeName"]; derivation_id: components["schemas"]["DerivationId"]; }; /** * @description One route out of the requested attribute, one rule per step, visiting no attribute twice. Routes are reported * once they cannot be extended, so every shorter route is a prefix of one listed here. */ AttributeDerivationPath: { /** @description Set when any rule on the route is imprecise. */ imprecise: boolean; /** @description Set when any rule on the route is lossy. */ lossy: boolean; /** * @description Which way the route goes from the requested attribute. * @enum {string} */ relationship: "descendant" | "ancestor"; steps: components["schemas"]["AttributeDerivationPathStep"][]; /** @description The sum of the cost of every rule on the route. */ total_cost: number; }; /** * @description The part of the derivation graph reachable from one attribute through active rules the caller may use, over * attributes the caller can view. `nodes` and `edges` are flat lists rather than a nested tree because the graph can * contain cycles (a rule from birthdate to age and one from age to birthdate are both legitimate). A program walks * the adjacency through `edges`; a person reads `paths`. * * The walk goes as far as query resolution can chain rules, which is one rule today, so every path listed is one a * query can use. At most 50 paths are returned, descendants before ancestors. * @example { * "attribute_id": 291, * "attribute_name": "normalized_email", * "direction": "both", * "edges": [ * { * "source": { * "id": 118, * "name": "raw_email" * }, * "target": { * "id": 291, * "name": "normalized_email" * }, * "derivation": { * "id": 1, * "name": "raw_email_to_normalized_email", * "description": "Lower-cases the address and strips dots and plus-tags where the provider ignores them.", * "cost": 1, * "lossy": true, * "imprecise": false, * "fidelity_note": "Normalization cannot be undone." * } * }, * { * "source": { * "id": 291, * "name": "normalized_email" * }, * "target": { * "id": 76, * "name": "sha256_hashed_email" * }, * "derivation": { * "id": 2, * "name": "normalized_email_to_sha256_hashed_email", * "description": "Hashes the normalized address with SHA-256.", * "cost": 1, * "lossy": true, * "imprecise": false * } * } * ], * "nodes": [ * { * "id": 291, * "display_name": "Normalized Email", * "distance": 0, * "name": "normalized_email", * "relationship": "self" * }, * { * "id": 76, * "display_name": "SHA-256 Hashed Email", * "distance": 1, * "name": "sha256_hashed_email", * "relationship": "descendant" * }, * { * "id": 118, * "display_name": "Raw Email", * "distance": 1, * "name": "raw_email", * "relationship": "ancestor" * } * ], * "paths": [ * { * "imprecise": false, * "lossy": true, * "relationship": "descendant", * "steps": [ * { * "attribute_id": 76, * "attribute_name": "sha256_hashed_email", * "derivation_id": 2 * } * ], * "total_cost": 1 * }, * { * "imprecise": false, * "lossy": true, * "relationship": "ancestor", * "steps": [ * { * "attribute_id": 118, * "attribute_name": "raw_email", * "derivation_id": 1 * } * ], * "total_cost": 1 * } * ] * } */ AttributeDerivationGraphResponse: { /** Format: int64 */ attribute_id: number; attribute_name: components["schemas"]["AttributeName"]; /** * @description The direction the walk followed, as requested. * @enum {string} */ direction: "descendants" | "ancestors" | "both"; /** @description Every rule connecting two of the nodes, in rule id order. */ edges: components["schemas"]["AttributeDerivationEdge"][]; /** @description The requested attribute first, then the rest by distance and then by id. */ nodes: components["schemas"]["AttributeDerivationGraphNode"][]; paths: components["schemas"]["AttributeDerivationPath"][]; }; /** * @example { * "stytch_session_token": "1rjpyoFiYLucsV-nuoi7dZ_VOkMUkcZLw6rICEYBzAy0" * } */ LoginRequest: { /** @description The Stytch session token */ stytch_session_token: string; }; /** * @example { * "user": { * "id": 10, * "name": "First Last", * "role": "partner_admin", * "company_id": 100, * "company_name": "ACME Corp" * }, * "api_token": { * "access_token": "OI2Sfun5GnOS9zk0irkc3w==", * "access_token_expires_in": 1000, * "refresh_token": "yZYCdZrvHvlnEQw9/C640Q", * "refresh_token_expires_in": 10000 * } * } */ LoginResponse: { user: { id: number; /** @enum {string} */ role?: "global_admin" | "partner_admin" | "partner_user"; name: string; company_id: number; company_name: string; email: string; }; api_token: components["schemas"]["AccessToken"]; }; /** * @example { * "stytch_session_token": "1rjpyoFiYLucsV-nuoi7dZ_VOkMUkcZLw6rICEYBzAy0", * "name": "First Last", * "company_name": "ACME Corp" * } */ B2bRegisterRequest: { /** @description The Stytch session token */ stytch_session_token: string; /** @description The name of the user */ name?: string; /** @description The name of the company */ company_name: string; }; /** * @example { * "user_id": 100 * } */ RegisterResponse: { user_id?: number; }; /** * @example { * "stytch_token": "cykuz7f22h7rx5SPomBZUB359jj6GA-4NUBkuZDiduun", * "session_duration_minutes": 5 * } */ B2bRegistrationStatusRequest: { stytch_token: string; /** @description The duration in minutes of the Stytch session to create */ session_duration_minutes?: number; }; /** * @example { * "status": "complete", * "email": "first.last@example.com", * "stytch_session_token": "10hLht9FCo9cBp3I69uY5KjYMmy5VqmZjAVEz1CKZjsa", * "stytch_session_jwt": "eyJhbGciOiJSUzI1NiIsImtpZCI6Imp3ay10ZXN0LTk1YjU2OGZhLTk1NWUtNGQ2OC04NDljLTM5MDA0MmEwZTlmOCIsInR5cCI6IkpXVCJ9.eyJhdWQiOlsicHJvamVjdC10ZXN0LWQ1Y2E2MjhlLWFmMzctNDhmZC1hZTliLWIzMmUwY2Y5NmEyYyJdLCJleHAiOjE2ODUxMjkwNTAsImh0dHBzOi8vc3R5dGNoLmNvbS9zZXNzaW9uIjp7ImlkIjoic2Vzc2lvbi10ZXN0LTRlNTg4ZDQ3LTJlZjctNDZhNy1iMGQxLTQxOGJhMmZjNTljMiIsInN0YXJ0ZWRfYXQiOiIyMDIzLTA1LTI2VDE5OjE0OjU1WiIsImxhc3RfYWNjZXNzZWRfYXQiOiIyMDIzLTA1LTI2VDE5OjE5OjEwWiIsImV4cGlyZXNfYXQiOiIyMDIzLTA1LTI2VDIwOjE0OjU1WiIsImF0dHJpYnV0ZXMiOnsidXNlcl9hZ2VudCI6IiIsImlwX2FkZHJlc3MiOiIifSwiYXV0aGVudGljYXRpb25fZmFjdG9ycyI6W3sidHlwZSI6Im9hdXRoIiwiZGVsaXZlcnlfbWV0aG9kIjoib2F1dGhfZ2l0aHViIiwibGFzdF9hdXRoZW50aWNhdGVkX2F0IjoiMjAyMy0wNS0yNlQxOToxNDo1NVoiLCJnaXRodWJfb2F1dGhfZmFjdG9yIjp7ImlkIjoib2F1dGgtdXNlci10ZXN0LTdlY2M5YjUxLTU0YzUtNDg2MS04NjI2LTQyM2Q0Y2ZiYjQxMiIsInByb3ZpZGVyX3N1YmplY3QiOiIxNDIzMjkifX1dfSwiaWF0IjoxNjg1MTI4NzUwLCJpc3MiOiJzdHl0Y2guY29tL3Byb2plY3QtdGVzdC1kNWNhNjI4ZS1hZjM3LTQ4ZmQtYWU5Yi1iMzJlMGNmOTZhMmMiLCJuYmYiOjE2ODUxMjg3NTAsInN1YiI6InVzZXItdGVzdC03ZDYzYmMwNS05YzlmLTRmMTktODhhYS1iMmQwODk3ZGNiN2YifQ.OthwVlyy7Eu0g8h9K3tG2KzZBiOi3hykP-BpdTjrR4tZUXwqPyYPs8BmiaPRQOd17zyUNLxjGH4q5sfU6F0z4BXQXd3U8hWdRYRmUNVFPvLhFWva5FNP5ZYRD8XX_cjYTWV0E41Zd_W3YvFK5hCYs7cwYyR0mMw2XRzTYX1CjTfHOtNmPW-uLwhvHqAroLa2vM7PoyFlS0Xs2j0Dje01WI0eqJYgSVTwB5ZMTWttJKqXjFPaLQ-7XkJxHtmpXTxCoO-U38kDba26cyhTQrXBoHV2c8KMtrBWS3L3_kN-gw96FzcJ0C2W8HxhZJrI_GIZ4OLxFy3jxXvjDcsjMX940w" * } */ RegistrationStatusResponse: { /** @enum {string} */ status: "complete" | "pending"; email?: string; stytch_session_token: string; stytch_session_jwt: string; }; /** * @example { * "company_id": 123 * } */ ExchangeTokenRequest: { /** @description The ID of the company to exchange the token for */ company_id: number; }; /** * @example { * "stytch_session_token": "1rjpyoFiYLucsV-nuoi7dZ_VOkMUkcZLw6rICEYBzAy0", * "name": "First Last", * "company_name": "ACME Corp" * } */ RegisterRequest: { /** @description The Stytch session token */ stytch_session_token: string; /** @description The name of the user */ name?: string; /** @description The name of the company */ company_name: string; }; MagicLinksToken: { /** @enum {string} */ token_type?: "magiclinks"; token?: string; }; OAuthToken: { /** @enum {string} */ token_type?: "magiclinks"; token?: string; }; /** @description The Stytch Magic Links or OAuth token */ StytchToken: components["schemas"]["MagicLinksToken"] | components["schemas"]["OAuthToken"]; /** * @example { * "stytch_token": { * "token_type": "magiclinks", * "token": "cykuz7f22h7rx5SPomBZUB359jj6GA-4NUBkuZDiduun" * }, * "session_duration_minutes": 5 * } */ RegistrationStatusRequest: { stytch_token: components["schemas"]["StytchToken"]; /** @description The duration in minutes of the Stytch session to create */ session_duration_minutes?: number; }; AppRef: { /** Format: int64 */ id?: number; name?: string; }; ProfileRef: { id?: components["schemas"]["UUID"]; name?: string; }; /** @enum {string} */ ConnectionStatus: "active" | "archived"; /** * @example { * "type": "connections_dataset", * "id": "21691f26-f308-4e98-896c-579db27da04b", * "app": { * "id": 500, * "name": "S3 Connector" * }, * "created_at": "2026-07-14T00:00:00Z", * "dataset_id": 42, * "installation_id": 9000, * "quick_settings": { * "bucket_suffix": "/my-subscription", * "number_of_files": "5" * }, * "profile_id": "d555f07f-f140-40d2-91af-e6aa54f7488b", * "profile": { * "id": "d555f07f-f140-40d2-91af-e6aa54f7488b", * "name": "Production" * }, * "status": "active" * } */ DatasetConnection: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "connections_dataset"; id?: components["schemas"]["UUID"]; app?: components["schemas"]["AppRef"]; /** Format: date-time */ created_at?: string; /** Format: int64 */ dataset_id?: number; /** Format: int64 */ installation_id?: number; quick_settings?: Record; profile_id?: components["schemas"]["UUID"]; profile?: components["schemas"]["ProfileRef"]; status?: components["schemas"]["ConnectionStatus"]; }; /** * @example { * "type": "connections_model", * "id": "31691f26-f308-4e98-896c-579db27da04c", * "app": { * "id": 501, * "name": "Model Connector" * }, * "created_at": "2026-07-14T00:00:00Z", * "model_id": 7, * "installation_id": 9001, * "profile_id": "d555f07f-f140-40d2-91af-e6aa54f7488b", * "profile": { * "id": "d555f07f-f140-40d2-91af-e6aa54f7488b", * "name": "Production" * }, * "status": "active" * } */ ModelConnection: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "connections_model"; id?: components["schemas"]["UUID"]; app?: components["schemas"]["AppRef"]; /** Format: date-time */ created_at?: string; /** Format: int64 */ model_id?: number; /** Format: int64 */ installation_id?: number; quick_settings?: Record; profile_id?: components["schemas"]["UUID"]; profile?: components["schemas"]["ProfileRef"]; status?: components["schemas"]["ConnectionStatus"]; }; Connection: components["schemas"]["DatasetConnection"] | components["schemas"]["ModelConnection"]; PaginatedConnections: { records?: components["schemas"]["Connection"][]; }; /** * @example { * "type": "connections_dataset", * "dataset_id": 42, * "profile_id": "d555f07f-f140-40d2-91af-e6aa54f7488b", * "quick_settings": { * "bucket_suffix": "/my-subscription", * "number_of_files": "5" * } * } */ CreateDatasetConnectionRequest: { /** * @description Discriminator. Must be `connections_dataset`. (enum property replaced by openapi-typescript) * @enum {string} */ type: "connections_dataset"; /** * Format: int64 * @description The dataset whose data is routed to the connector. */ dataset_id: number; profile_id: components["schemas"]["UUID"]; /** @description Optional connector-specific settings, validated by the connector. */ quick_settings?: Record; }; /** * @example { * "type": "connections_model", * "model_id": 7, * "profile_id": "d555f07f-f140-40d2-91af-e6aa54f7488b" * } */ CreateModelConnectionRequest: { /** * @description Discriminator. Must be `connections_model`. (enum property replaced by openapi-typescript) * @enum {string} */ type: "connections_model"; /** * Format: int64 * @description The model connected to the connector. */ model_id: number; profile_id: components["schemas"]["UUID"]; /** @description Optional connector-specific settings, validated by the connector. */ quick_settings?: Record; }; CreateConnectionRequest: components["schemas"]["CreateDatasetConnectionRequest"] | components["schemas"]["CreateModelConnectionRequest"]; /** * @description The source of the mapping. * * `company` - Company private mapping * * `admin` - Admin created/promoted mapping * * `system` - System (Automated/ML) mappings * * `lineage` - Lineage-derived mappings (editable without admin) * * `rosetta_stone` - Rosetta Stone mappings (editable without admin) * * `derived` - Computed on the request from a stored mapping and a derivation rule. Not stored, so it has * no `id`; listed only when asked for by source * @enum {string} */ MappingSource: "company" | "admin" | "system" | "lineage" | "rosetta_stone" | "derived"; /** @description Unique identifier for the dataset. */ DatasetId: number; AwsRegion: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "region_aws"; /** @description AWS region identifier, e.g. `us-east-1`. */ id: string; }; AwsPlatform: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "platform_aws"; /** @description The 12-digit AWS account ID of the account hosting the data plane. */ account_id: string; region: components["schemas"]["AwsRegion"]; }; AzureRegion: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "region_azure"; /** @description Azure region identifier, e.g. `uaenorth`. */ id: string; }; GcpRegion: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "region_gcp"; /** @description GCP region identifier, e.g. `us-east4`. */ id: string; }; Region: components["schemas"]["AwsRegion"] | components["schemas"]["AzureRegion"] | components["schemas"]["GcpRegion"]; SnowflakePlatform: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "platform_snowflake"; account_locator: string; account_name: string; organization_name: string; region?: components["schemas"]["Region"] | null; }; Platform: components["schemas"]["AwsPlatform"] | components["schemas"]["SnowflakePlatform"]; ParticipantsAll: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "all"; }; ParticipantsNone: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "none"; }; DataPlaneParticipantsInclusion: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "inclusion"; company_ids: components["schemas"]["CompanyId"][]; }; DataPlaneParticipantsExclusion: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "exclusion"; company_ids: components["schemas"]["CompanyId"][]; }; DataPlaneParticipants: components["schemas"]["ParticipantsAll"] | components["schemas"]["ParticipantsNone"] | components["schemas"]["DataPlaneParticipantsInclusion"] | components["schemas"]["DataPlaneParticipantsExclusion"]; DataPlaneCollaborators: { participants: components["schemas"]["DataPlaneParticipants"]; manage_compute_pools: components["schemas"]["DataPlaneParticipants"]; }; SnowflakeWarehouse: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "snowflake_warehouse"; /** @description Snowflake warehouse name. Must start with a letter or underscore and contain only alphanumeric characters, underscores, and dollar signs. */ name: string; /** Format: uuid */ alias: string; }; AwsEmrExternalId: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "aws_emr"; }; ExternalId: components["schemas"]["SnowflakeWarehouse"] | components["schemas"]["AwsEmrExternalId"]; SnowflakeWarehouseProvider: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "snowflake_warehouse"; /** @description The name of the Snowflake warehouse to use. */ warehouse_name?: string | null; /** @enum {string|null} */ size?: "x_small" | "small" | "medium" | "large" | "x_large" | "2x_large" | "3x_large" | "4x_large" | "5x_large" | "6x_large" | null; /** @enum {string|null} */ warehouse_type?: "standard" | "snowpark_optimized" | null; /** @description Auto-suspend time in seconds. */ auto_suspend?: number | null; auto_resume?: boolean | null; min_cluster_count?: number | null; max_cluster_count?: number | null; /** @enum {string|null} */ scaling_policy?: "standard" | "economy" | null; max_concurrency_level?: number | null; statement_queued_timeout_in_seconds?: number | null; statement_timeout_in_seconds?: number | null; enable_query_acceleration?: boolean | null; query_acceleration_max_scale_factor?: number | null; resource_constraint?: string | null; comment?: string | null; }; AwsEmrProvider: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "aws_emr"; /** * @description EMR cluster auto-termination idle timeout, in seconds. Tri-state semantics (applied on both create and update — omitting this field on an update resets it to the default, it does not preserve the prior value): * * - omitted / `null`: the pool is set to the default of 15 minutes (900 seconds). * - `-1`: idle-termination disabled — EMR's `AutoTerminationPolicy` is not set on the cluster * and the operator-side idle reaper skips the idle check too. The cluster runs until it is * explicitly terminated or recycled. * * - `60` ≤ n ≤ `604800` (7 days): set EMR's `AutoTerminationPolicy` to that value, and use the * same value in the operator-side idle reaper. */ idle_timeout_seconds?: number | null; /** * @description Maximum time, in seconds, that a single job's EMR step may stay in `RUNNING` before the operator cancels the step and fails the job. Omitted / `null` means the pool is set to the default of 4 hours (14400 seconds), on both create and update (omitting it on an update resets it to the default rather than preserving the prior value). When set explicitly, must be between 60 seconds and 7 days. * * The shared Narrative compute pool is configured with a 1-hour timeout and is intended for small jobs. Pools the user provisions for themselves can set their own (longer) limit. */ job_execution_timeout_seconds?: number | null; /** * @description Compute pool size. Names mirror Snowflake's warehouse sizes and target the equivalent Snowflake warehouse's *memory* budget — a workload that fits in a Snowflake warehouse of size N gets equivalent RAM on the EMR cluster of size N. vCPU counts will not match Snowflake's because EMR runs on memory-optimized instances (r7g/r7gd/r6g, 8 GiB/vCPU), so the same memory budget delivers fewer vCPUs than Snowflake. * * Target worker (core+task) memory at max scale: x_small (~32 GiB, ~4 vCPU; min size — overshoots Snowflake's 16 GiB), small (~32 GiB, ~4 vCPU), medium (~64 GiB, ~8 vCPU), large (~128 GiB, ~16 vCPU), x_large (~256 GiB, ~32 vCPU), 2x_large (~512 GiB, ~64 vCPU), 3x_large (~1 TiB, ~128 vCPU), 4x_large (~2 TiB, ~256 vCPU), 5x_large (~4 TiB, ~512 vCPU), 6x_large (~8 TiB, ~1024 vCPU). * * Each size has a `*_storage` variant (e.g. `medium_storage`) with the same memory budget, but running on `rXgd` instances with local NVMe SSD storage. Use these for shuffle-/scratch-heavy jobs that would otherwise spill to EBS and fail with "No space left on device". * @enum {string} */ size: "x_small" | "small" | "medium" | "large" | "x_large" | "2x_large" | "3x_large" | "4x_large" | "5x_large" | "6x_large" | "x_small_storage" | "small_storage" | "medium_storage" | "large_storage" | "x_large_storage" | "2x_large_storage" | "3x_large_storage" | "4x_large_storage" | "5x_large_storage" | "6x_large_storage"; }; Provider: components["schemas"]["SnowflakeWarehouseProvider"] | components["schemas"]["AwsEmrProvider"]; ParticipantsInclusion: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "inclusion"; company_ids: components["schemas"]["CompanyId"][]; }; ParticipantsExclusion: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "exclusion"; company_ids: components["schemas"]["CompanyId"][]; }; ComputePoolParticipants: components["schemas"]["ParticipantsAll"] | components["schemas"]["ParticipantsNone"] | components["schemas"]["ParticipantsInclusion"] | components["schemas"]["ParticipantsExclusion"]; ComputePoolCollaborators: { /** @description Companies that can use this compute pool for jobs. Use participants automatically have view access. */ use: components["schemas"]["ComputePoolParticipants"]; }; /** * @description Where the authenticated company's default compute pool for a data plane comes from. `company` is the company's own default for the data plane (`PUT /company/{company_id}/data-planes/{data_plane_id}/default-compute-pool/{compute_pool_id}`) and takes precedence; `data_plane` is the default set by the data plane's owner (`PUT /data-planes/{data_plane_id}/default-compute-pool/{compute_pool_id}`). * @enum {string} */ ComputePoolDefaultSource: "company" | "data_plane"; ComputePoolOwnedResponse: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "owned"; /** Format: uuid */ id: string; company_id: components["schemas"]["CompanyId"]; /** Format: uuid */ data_plane_id: string; external_id: components["schemas"]["ExternalId"]; name: string; display_name: string; description?: string | null; /** @enum {string} */ status: "active" | "archived"; /** Format: date-time */ created_at: string; /** * Format: date-time * @description Null until the pool has been updated at least once. */ updated_at?: string | null; tags: string[]; provider: components["schemas"]["Provider"]; collaborators: components["schemas"]["ComputePoolCollaborators"]; /** @description Set when this pool is the compute pool the authenticated company's jobs run on when they don't name one themselves, and says which level made it the default. `null` on every other pool. Exactly one active pool per data plane can carry a non-null value. */ default_source: components["schemas"]["ComputePoolDefaultSource"] | null; }; ComputePoolSharedResponse: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "shared"; /** Format: uuid */ id: string; company_id: components["schemas"]["CompanyId"]; /** Format: uuid */ data_plane_id: string; external_id: components["schemas"]["ExternalId"]; name: string; display_name: string; description?: string | null; /** @enum {string} */ status: "active" | "archived"; /** Format: date-time */ created_at: string; /** * Format: date-time * @description Null until the pool has been updated at least once. */ updated_at?: string | null; tags: string[]; provider: components["schemas"]["Provider"]; /** @description Set when this pool is the compute pool the authenticated company's jobs run on when they don't name one themselves, and says which level made it the default. `null` on every other pool. Exactly one active pool per data plane can carry a non-null value. */ default_source: components["schemas"]["ComputePoolDefaultSource"] | null; }; ComputePoolResponse: components["schemas"]["ComputePoolOwnedResponse"] | components["schemas"]["ComputePoolSharedResponse"]; DataPlaneOwnedResponse: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "owned"; /** Format: uuid */ id: string; company_id: components["schemas"]["CompanyId"]; /** Format: date-time */ created_at: string; description?: string | null; display_name: string; external_id: string; platform: components["schemas"]["Platform"]; /** @enum {string} */ status: "active" | "archived"; /** Format: date-time */ last_heartbeat_at?: string | null; tags?: string[] | null; /** Format: date-time */ updated_at: string; collaborators: components["schemas"]["DataPlaneCollaborators"]; /** Format: uuid */ default_compute_pool_id?: string | null; compute_pools: components["schemas"]["ComputePoolResponse"][]; }; AwsSharedResponse: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "platform_shared_aws"; region: components["schemas"]["AwsRegion"]; }; SnowflakeSharedResponse: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "platform_shared_snowflake"; region?: components["schemas"]["Region"] | null; }; PlatformSharedResponse: components["schemas"]["AwsSharedResponse"] | components["schemas"]["SnowflakeSharedResponse"]; DataPlaneSharedResponse: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "shared"; /** Format: uuid */ id: string; company_id: components["schemas"]["CompanyId"]; /** Format: date-time */ created_at: string; description?: string | null; display_name: string; platform: components["schemas"]["PlatformSharedResponse"]; /** @enum {string} */ status: "active" | "archived"; /** Format: date-time */ last_heartbeat_at?: string | null; tags?: string[] | null; /** Format: date-time */ updated_at: string; /** Format: uuid */ default_compute_pool_id?: string | null; compute_pools: components["schemas"]["ComputePoolResponse"][]; }; DataPlaneResponse: components["schemas"]["DataPlaneOwnedResponse"] | components["schemas"]["DataPlaneSharedResponse"]; /** * Format: uuid * @description Unique identifier for a mapping. * @example ea9dddd2-e3ee-40b5-b03e-c3cd37c8a6f0 */ MappingId: string; /** * @description A raw SQL expression which produces a value from the source dataset for the target primitive attribute type. * * E.g. for a source dataset with the following type definition: * * ``` * { * "type": "object", * "properties": { * "firstName": { * "type": "string" * }, * "lastName": { * "type": "string" * } * }, * "required": [ * "lastName" * ] * } * ``` * * * Valid expressions include: * * - Lower casing the first name: * * ```sql * lower(firstName) * ``` * * - Constructing a "full name" from the first and last name: * * ```sql * concat_ws(' ', coalesce(firstName, ''), lastName) * ``` * * - Taking the first initial of the first name if is not null: * * ```sql * case when firstName is not null and char_length(firstName) > 0 then substr(firstName, 1) else null end * ``` */ MappingExpression: string; /** * @description A string indicating which property of the target attribute the expression is producing a value for. * * E.g. for an attribute with the following type definition; * * ``` * { * "type": "object", * "properties": { * "latitude": { * "type": "double" * }, * "longitude": { * "type": "double" * }, * "location_accuracy": { * "type": "object", * "properties": { * "horizontal": { * "type": "double" * }, * "vertical": { * "type": "double" * } * } * } * }, * "required": [ * "latitude", * "longitude" * ] * } * ``` * * The possible paths are: * * - `latitude` * - `longitude` * - `location_accuracy.horizontal` * - `location_accuracy.vertical` */ MappingPath: string; /** * @description Describes the dataset fields that a mapping expression depends on. * @example { * "properties": [] * } */ MappingExpressionDependencies: { /** * @description List of dataset field references that the mapping expression uses. * @example [ * "firstName", * "lastName" * ] */ properties?: string[]; }; ObjectMapping: { /** * @description A mapping from a dataset to an attribute with a type of `object`. * @enum {string} */ type: "object_mapping"; /** * @description `property_mappings` define how a value for each property of the target attribute is constructed from a row of the source dataset. * * A mapping must be provided for each of the target attribute's _required_ properties. */ property_mappings: { expression: components["schemas"]["MappingExpression"]; path: components["schemas"]["MappingPath"]; dependencies?: components["schemas"]["MappingExpressionDependencies"]; }[]; }; ValueMapping: { /** * @description A mapping from a dataset to an attribute with a primitive type, i.e. one of `array`, `boolean`, `double`, `long`, `string`, or `timestamptz`. * @enum {string} */ type: "value_mapping"; expression: components["schemas"]["MappingExpression"]; dependencies?: components["schemas"]["MappingExpressionDependencies"]; }; /** @description Read shape for cached mappings. See `RawCachedMapping` for create/update requests and the surrounding constraints. */ CachedMapping: { /** @enum {string} */ type: "cached_mapping"; cache_dataset_id: number; input_expressions: components["schemas"]["MappingExpression"][]; dependencies?: components["schemas"]["MappingExpressionDependencies"]; }; MappingDefinition: components["schemas"]["ObjectMapping"] | components["schemas"]["ValueMapping"] | components["schemas"]["CachedMapping"]; /** * @description The status of the mapping. * * `active` - Active mappings can be used * * `archived` - Archived/Deleted mappings - mapping no longer in use * * `pending` - Pending mappings need to be accepted before they can be used * * `rejected` - Proposed mappings the owner turned down. Can still be accepted later * @enum {string} */ MappingStatus: "active" | "archived" | "pending" | "rejected"; /** * @description The scope of the mapping. * * `global` - Mappings available to all * * `private` - Company private mappings * @enum {string} */ MappingScope: "global" | "private"; /** * @description How a derived mapping was produced. * @example { * "source_mapping_id": "ea9dddd2-e3ee-40b5-b03e-c3cd37c8a6f0", * "source_attribute_id": 291, * "derivation_path": [ * 42 * ], * "lossy": true, * "imprecise": false * } */ MappingProvenance: { source_mapping_id: components["schemas"]["MappingId"] & unknown; /** @description The attribute of the source mapping. */ source_attribute_id: number; /** * @description The derivation rules applied, in order, from the source attribute to this mapping's attribute. One * element today; longer once derivations chain. */ derivation_path: number[]; /** @description True when any rule on the path is lossy (the source value cannot be recovered). */ lossy: boolean; /** @description True when any rule on the path is imprecise (the value may differ from ground truth). */ imprecise: boolean; }; /** * @description Free-form labels on the mapping. Null and an empty array both mean no tags; `nio:`-prefixed tags * are reserved for Narrative. * @example [ * "nio:rosetta" * ] */ MappingTags: string[] | null; /** * @example { * "id": "ea9dddd2-e3ee-40b5-b03e-c3cd37c8a7f0", * "attribute_id": 1, * "created_at": "2021-12-10T00:00:00Z", * "dataset_id": 3, * "mapping": { * "type": "object_mapping", * "property_mappings": [ * { * "path": "foo", * "expression": "upper(`US Kennel ID`)", * "dependencies": { * "properties": [ * "US Kennel ID" * ] * } * }, * { * "path": "bar.baz.qux", * "expression": "weight * 10000", * "dependencies": { * "properties": [ * "weight" * ] * } * } * ] * }, * "status": "active", * "updated_at": "2021-12-10T00:00:01Z", * "created_by": 1, * "updated_by": 1, * "company_id": 100, * "scope": "global", * "source": "admin", * "derived_from": "ea9dddd2-e3ee-40b5-b03e-c3cd37c8a6f0" * } */ MappingResponse: { id?: components["schemas"]["MappingId"] & unknown; /** @description The target attribute's ID. */ attribute_id: number; /** * @description ISO-8601 timestamp indicating when the mapping was created. * @example 2021-08-26T21:06:07.710357Z */ created_at: string; /** @description The source dataset's ID. */ dataset_id: number; mapping: components["schemas"]["MappingDefinition"]; status: components["schemas"]["MappingStatus"]; /** * @description ISO-8601 timestamp indicating when the mapping was last updated. * @example 2021-08-26T21:06:07.710357Z */ updated_at: string; created_by: components["schemas"]["UserId"] & unknown; updated_by: components["schemas"]["UserId"] & unknown; /** @description The company that owns the mapping. Null for platform-wide mappings. */ company_id?: components["schemas"]["CompanyId"] | null; scope: components["schemas"]["MappingScope"]; source: components["schemas"]["MappingSource"]; provenance?: components["schemas"]["MappingProvenance"] & unknown; tags?: components["schemas"]["MappingTags"]; /** * @description The stored mapping this one was copied from when it was authored (lineage). Unrelated to derivation rules; * see `provenance` for those. Null when the mapping was authored directly. */ derived_from?: components["schemas"]["MappingId"] | null; }; /** @description The Dataset's name. Should be unique, contain only alpanum chars and underscores. Max length is 256. */ DatasetName: string; /** @description The Dataset's name to display at UI. */ DatasetDisplayName: string; /** @description A description of the data contained with the dataset. */ DatasetDescription: string | null; RowClock: { /** @enum {string} */ kind: "event_time"; /** @description Rosetta Stone attribute name for timestamp evaluation. */ attribute?: string; }; /** @description Row-level deletion policy. Action is always HARD_DELETE. Clock must be EVENT_TIME. If `clock` is omitted, server uses configured Rosetta Stone attribute (defaults to nio_last_modified); if mapping doesn't exist, returns HTTP 400. */ RowTTLType: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ kind: "row_ttl"; clock?: components["schemas"]["RowClock"]; }; TableClock: { /** @enum {string} */ kind: "created_at" | "max_event_time"; /** @description Rosetta Stone attribute name evaluated when kind is max_event_time. */ attribute?: string; }; /** @description Drop the dataset object when the table age exceeds the interval. Action is always DROP_TABLE. */ TableTTLType: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ kind: "table_ttl"; clock?: components["schemas"]["TableClock"]; }; /** * @example { * "type": "expire_everything" * } */ ExpireEverything: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "expire_everything"; }; /** * @example { * "type": "retain_everything" * } */ RetainEverything: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "retain_everything"; }; /** * @example { * "type": "snapshot_age", * "operator": ">", * "period": "P30D" * } */ SnapshotAge: { /** @enum {string} */ type?: "snapshot_age"; /** @enum {string} */ operator?: ">" | "<" | ">=" | "<="; /** @description An ISO 8601 period format */ period?: string; }; ExpireWhen: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "expire_when"; expression?: components["schemas"]["SnapshotAge"]; }; RetainWhen: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "retain_when"; expression?: components["schemas"]["SnapshotAge"]; }; /** * @description Keep a fixed number of the most recent snapshots. * @example { * "type": "retain_snapshots", * "snapshots_to_retain": 5 * } */ RetainSnapshots: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "retain_snapshots"; snapshots_to_retain: number; }; /** @description Iceberg only: delete snapshots older than the interval. */ SnapshotTTLType: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ kind: "snapshot_ttl"; snapshot_retention_policy?: components["schemas"]["ExpireEverything"] | components["schemas"]["RetainEverything"] | components["schemas"]["ExpireWhen"] | components["schemas"]["RetainWhen"] | components["schemas"]["RetainSnapshots"]; }; /** @description One retention rule. `type` says what is deleted and by which clock; `enabled` and `interval` are siblings of it, not part of it. */ RetentionPolicy: { type: components["schemas"]["RowTTLType"] | components["schemas"]["TableTTLType"] | components["schemas"]["SnapshotTTLType"]; /** @default false */ enabled: boolean; /** @description ISO-8601 duration, e.g., P30D, PT12H. */ interval?: string; }; RefreshSchedule: { /** @description cron expression */ schedule?: string; /** * @description Timezone for schedule execution * @default UTC */ schedule_zone_id: string; /** * @description The status * @enum {unknown} */ status?: "active" | "pending" | "archived"; }; /** * @description A dataset's retention policies, plus the schedule they are enforced on. This is the shape every dataset response carries; legacy snapshot-only payloads are accepted on write and returned in this form. * @example { * "policies": [ * { * "type": { * "kind": "table_ttl", * "clock": { * "kind": "created_at" * } * }, * "enabled": true, * "interval": "P1D" * } * ], * "schedule_config": { * "schedule": "@hourly", * "schedule_zone_id": "UTC", * "status": "active" * } * } */ UnifiedV1Response: { policies: components["schemas"]["RetentionPolicy"][]; schedule_config?: components["schemas"]["RefreshSchedule"]; }; FlatFileConfig: { /** * @description Describes input files where each row is a set of fields separated by some delimiter. Common examples include comma-separated (CSV) and tab-separated (TSV) files. Files can be compressed using gzip or bzip2 as long as they include the appropriate suffix to indicate what kind of compression has been applied. E.g. bzip2 files must end in ".bz2" and gzipped files must end in ".gz". * @enum {string} */ type: "flat"; /** @description Whether or not files include a header. */ header: boolean; /** @description Character separating values within a row in a file. */ delimiter: string; /** @description Character used for escaping quoted values where the separator can be part of the value. */ quote: string; /** @description Character used for escaping quotes inside an already quoted value. */ escape: string; }; JsonFileConfig: { /** * @description Describes input files in the [JSON Lines](https://jsonlines.org/) file format. * @enum {string} */ type: "json"; }; ParquetFileConfig: { /** * @description Describes input files in the [Parquet](https://parquet.apache.org/) file format. * @enum {string} */ type: "parquet"; }; /** @description Defines the input file format. Files provided to Narrative for ingestion into a Dataset must match the file configuration. */ FileConfig: components["schemas"]["FlatFileConfig"] | components["schemas"]["JsonFileConfig"] | components["schemas"]["ParquetFileConfig"]; /** * @description An optional RFC-6901 JSON pointer to a Dataset field to indicate that the field is "primary" -- i.e. it is of particular interest to buyers. Narrative uses this information to optimize buyer experience when purchasing your Dataset. * The primary key, if specified, must refer to a _required_ field that has a type of `boolean`, `long`, `string`, or `timestamptz`. */ PrimaryField: string; /** * @description An optional RFC-6901 JSON pointer to the Dataset field the stored data is partitioned by. * The partition key, if specified, must refer to a field that has a type of `boolean`, `long`, `string`, or `timestamptz`. The pointer may descend through nested object fields, e.g. `/event/timestamp`. */ PartitionKey: string; DatasetType: components["schemas"]["ArrayType-2"] | components["schemas"]["DatasetBooleanType"] | components["schemas"]["DatasetDoubleType"] | components["schemas"]["DatasetLongType"] | components["schemas"]["DatasetObjectType"] | components["schemas"]["DatasetStringType"] | components["schemas"]["TimestampTzType-2"]; /** * @description A raw Spark SQL expression determining whether a value for the given column is valid or not. * * If more than one validation is specified then _all_ the validation must evaluate to `true` for the column value to be considered valid. * * If `validations` is not specified or empty then all rows will match the access rule. * * E.g. for a dataset with the following type definition: * * ``` * { * "type": "object", * "properties": { * "idValue": { * "type": "string" * }, * "idType": { * "type": "string", * "enum": [ * "idfa", * "adid" * ] * }, * "timestamp": { * "type": "timestamptz" * } * }, * "required": [ * "idValue" * ] * } * ``` * * Valid constraints include: * * - Is the ID type IDFA? * * ```sql * idType = 'idfa' * ``` * - Is the ID type non-null? * * ```sql * idType is not null * ``` * - Was the row collected within the last 90 days? * * ```sql * timestamp > date_sub(current_date(), 90) * ``` */ "Validations-2": string[]; "ArrayType-2": { /** * @description An array with elements of any data type. * @enum {string} */ type: "array"; items: components["schemas"]["DatasetType"]; validations?: components["schemas"]["Validations-2"]; }; DatasetBooleanType: { /** * @description True/false values. Input values must be one of `true` or `false`. * @enum {string} */ type: "boolean"; validations?: components["schemas"]["Validations-2"]; }; DatasetDoubleType: { /** * @description 64-bit IEEE 754 floating point values. * @enum {string} */ type: "double"; /** @description An optional set of possible values for the field. */ enum?: number[]; validations?: components["schemas"]["Validations-2"]; }; DatasetLongType: { /** * @description 64-bit signed integer values. * @enum {string} */ type: "long"; /** @description An optional set of possible values for the field. */ enum?: number[]; validations?: components["schemas"]["Validations-2"]; }; DatasetObjectType: { /** * @description A record consisting of named fields of any type. * @enum {unknown} */ type: "object"; /** * @description A map from field names to field types. * * Field names must consist of only alphanumeric characters or underscores and be < 255 characters long. */ properties: { [key: string]: components["schemas"]["DatasetObjectProperty"]; }; /** @description An optional array of properties whose values are never missing or null. */ required?: string[]; /** @description An optional array of properties that cannot be sold to buyers. */ unsellable?: string[]; /** @description An optional array of properties that are sensitive. Data in sensitive fields are redacted when showed to Narrative users via the UI or API but can still be bought and sold. */ sensitive?: string[]; }; DatasetStringType: { /** * @description Abitrary-length character sequences encoded with UTF-8. * @enum {string} */ type: "string"; /** @description An optional set of possible values for the field. */ enum?: string[]; validations?: components["schemas"]["Validations-2"]; }; "TimestampTzType-2": { /** * @description Timestamp with timezone, stored as microseconds. Input values are expected to be valid [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) strings. * @enum {string} */ type: "timestamptz"; validations?: components["schemas"]["Validations-2"]; }; DatasetObjectProperty: { /** * @description The zero-based position of the field among its siblings. Responses always carry it. For a `flat` file * type it is the column's position in the input file, so a request should set it rather than rely on the * order of the keys in `properties`. */ order?: number; /** @description A name that will be represent at User Interface. */ display_name?: string; /** @description An optional estimate of how many distinct values of the field will be provided to Narrative. Narrative uses this information to optimizer buyer experience. */ approximate_cardinality?: number; /** @description A description of the named field. */ description?: string; } & components["schemas"]["DatasetType"]; /** * @description Schema describing a dataset's input file type and the kind of data the file contains. * Note: when the file type is "flat" then the order of the properties describing the must be given in the order they appear in the input file. */ DatasetSchema: { file_config: components["schemas"]["FileConfig"]; primary?: components["schemas"]["PrimaryField"]; partition_key?: components["schemas"]["PartitionKey"]; } & components["schemas"]["DatasetObjectType"]; /** * @description The dataset status. * * - `active` means that data can be added to the dataset but the schema is locked in place * - `pending` means the dataset has been created, but the schema can still be altered and no data can be added to the dataset * - `archived` means the dataset has been retired and can no longer be read from or written to * @enum {string} */ DatasetStatus: "active" | "pending" | "archived"; /** @description Tags that describe the dataset. */ DatasetTags: string[]; /** * @description How Narrative will treat new data uploaded for the dataset. * - `append` means data will be added to the dataset, this is what to choose if you incrementally update your dataset over time. * - `overwrite` means that all existing data will be overwritten with new data. * @enum {string} */ DatasetWriteMode: "append" | "overwrite"; /** @description The total estimated number of files across this dataset snapshot and all unexpired snapshots that precede it. */ EstTotalDatasetStoredFiles: number; /** @description The total estimated number of records across this dataset snapshot and all unexpired snapshots that precede it. */ EstTotalDatasetStoredRecords: number; /** @description The total estimated storage size in bytes used by this dataset snapshot and all unexpired snapshots that precede it. */ EstTotalDatasetStoredBytes: number; /** @description The number of files in this dataset snapshot. */ ActiveDatasetStoredFiles: number; /** @description The number of records in this dataset snapshot. */ ActiveDatasetStoredRecords: number; /** @description The total storage size in bytes used by this dataset snapshot. */ ActiveDatasetStoredBytes: number; /** @description The number of files added when generating this snapshot. */ SnapshotAddedFiles: number; /** @description The number of records added when generating this snapshot. */ SnapshotAddedRecords: number; /** @description The number of records deleted when generating this snapshot. */ SnapshotDeletedRecords: number; /** @description The amount of storage in bytes added when generating this snapshot. */ SnapshotAddedBytes: number; /** @description The number of files deleted when generating this snapshot. */ SnapshotDeletedFiles: number; /** @description The number of delete tracking files added when generating this snapshot. */ SnapshotAddedDeleteFiles: number; /** @description The number of delete tracking files removed when generating this snapshot. */ SnapshotRemovedDeleteFiles: number; /** @description The amount of storage in bytes removed when generating this snapshot. */ SnapshotRemovedBytes: number; DatasetResponseStats: { est_total_dataset_stored_files: components["schemas"]["EstTotalDatasetStoredFiles"]; est_total_dataset_stored_records: components["schemas"]["EstTotalDatasetStoredRecords"]; est_total_dataset_stored_bytes: components["schemas"]["EstTotalDatasetStoredBytes"]; active_dataset_stored_files: components["schemas"]["ActiveDatasetStoredFiles"]; active_dataset_stored_records: components["schemas"]["ActiveDatasetStoredRecords"]; active_dataset_stored_bytes: components["schemas"]["ActiveDatasetStoredBytes"]; last_snapshot_added_files: components["schemas"]["SnapshotAddedFiles"]; last_snapshot_added_records: components["schemas"]["SnapshotAddedRecords"]; last_snapshot_deleted_records: components["schemas"]["SnapshotDeletedRecords"]; last_snapshot_added_bytes: components["schemas"]["SnapshotAddedBytes"]; last_snapshot_deleted_files: components["schemas"]["SnapshotDeletedFiles"]; last_snapshot_added_delete_files: components["schemas"]["SnapshotAddedDeleteFiles"]; last_snapshot_removed_delete_files: components["schemas"]["SnapshotRemovedDeleteFiles"]; last_snapshot_removed_bytes: components["schemas"]["SnapshotRemovedBytes"]; }; /** * @description A dataset. * * The encoder drops nulls and empty collections, so an optional field is absent rather than null, * and `tags` and `mappings` are absent rather than `[]` when there are none. `DatasetAdminResponse` * composes this schema with `allOf` but encodes without that step, so on the admin endpoints the * same optional fields arrive as null. Either way they are optional, and both shapes validate. * @example { * "id": 18923, * "company_id": 382, * "created_at": "2021-06-24T00:54:40.029056Z", * "data_plane": { * "type": "owned", * "id": "c0bed5c2-8af8-4f7a-9787-1ffc3def339b", * "company_id": 382, * "created_at": "2021-06-01T00:00:00Z", * "description": "The company's Snowflake account", * "display_name": "Snowflake (us-west-2)", * "external_id": "snowflake-prod", * "platform": { * "type": "platform_snowflake", * "account_locator": "ab12345", * "account_name": "acme", * "organization_name": "acmeorg", * "region": { * "type": "region_aws", * "id": "us-west-2" * } * }, * "status": "active", * "tags": [], * "updated_at": "2021-06-01T00:00:00Z", * "collaborators": { * "participants": { * "type": "all" * }, * "manage_compute_pools": { * "type": "all" * } * }, * "compute_pools": [] * }, * "is_narrative_managed": true, * "retention_policy": { * "policies": [ * { * "type": { * "kind": "snapshot_ttl", * "snapshot_retention_policy": { * "type": "retain_everything" * } * }, * "enabled": true * } * ] * }, * "description": "Mobile identifiers tied to birth information provided as part of app registration.", * "name": "declared_age", * "display_name": "Declared Age", * "schema": { * "file_config": { * "type": "flat", * "delimiter": ",", * "escape": "\"", * "header": true, * "quote": "\"" * }, * "type": "object", * "properties": { * "idValue": { * "display_name": "id value", * "order": 0, * "approximate_cardinality": 100000, * "description": "ID values", * "type": "string" * }, * "idType": { * "display_name": "id type", * "order": 1, * "approximate_cardinality": 1, * "type": "string", * "enum": [ * "md5_email", * "sha256_email" * ] * }, * "eventTimestamp": { * "display_name": "event timestamp", * "order": 2, * "description": "When the observation was collected", * "type": "timestamptz", * "validations": [ * "eventTimestamp < current_timestamp()" * ] * }, * "countryCode": { * "display_name": "country code", * "order": 3, * "approximate_cardinality": 6, * "description": "The country of residence of the individual", * "type": "string" * }, * "age": { * "display_name": "age", * "order": 4, * "approximate_cardinality": 90, * "description": "How old this individual is in years", * "type": "long" * }, * "birthInfo": { * "display_name": "birth info", * "order": 5, * "description": "The year this individual was born", * "type": "double" * } * }, * "required": [ * "idValue", * "idType", * "eventTimestamp", * "countryCode", * "age" * ], * "primary": "/age" * }, * "status": "active", * "tags": [ * "age", * "demo", * "demographic", * "demographics" * ], * "updated_at": "2021-06-24T00:54:40.029056Z", * "write_mode": "append", * "subscription_id": "123e4567-e89b-12d3-a456-426614174000", * "last_snapshot_created_at": "2023-06-09T16:51:34.215Z", * "stats": { * "est_total_dataset_stored_files": 10, * "est_total_dataset_stored_records": 500059, * "est_total_dataset_stored_bytes": 4206454, * "active_dataset_stored_files": 10, * "active_dataset_stored_records": 500059, * "active_dataset_stored_bytes": 4206454, * "last_snapshot_added_files": 2, * "last_snapshot_added_records": 499999, * "last_snapshot_deleted_records": 0, * "last_snapshot_added_bytes": 4193500, * "last_snapshot_deleted_files": 0, * "last_snapshot_added_delete_files": 0, * "last_snapshot_removed_delete_files": 0, * "last_snapshot_removed_bytes": 0 * } * } */ DatasetResponse: { id: components["schemas"]["DatasetId"]; /** @description The ID of the company owning the dataset. */ company_id: number; /** @description The data plane the dataset lives on. */ data_plane: components["schemas"]["DataPlaneResponse"]; /** * @description The dataset's identifier in the system it came from. Absent when the dataset did not come from * one. */ external_id?: string | null; /** @description Whether Narrative manages the dataset rather than the owning company. */ is_narrative_managed: boolean; /** @description The mappings from this dataset's fields to attributes. Absent when the dataset has none. */ mappings?: components["schemas"]["MappingResponse"][]; /** @description Compute pool configuration for the dataset. */ compute_pool_config?: { /** * Format: uuid * @description The default compute pool to use for dataset operations. */ default_compute_pool_id?: string; }; /** @description ISO-8601 timestamp indicating when the dataset was created */ created_at: string; name: components["schemas"]["DatasetName"]; display_name: components["schemas"]["DatasetDisplayName"]; description?: components["schemas"]["DatasetDescription"]; retention_policy: components["schemas"]["UnifiedV1Response"]; schema: components["schemas"]["DatasetSchema"]; status: components["schemas"]["DatasetStatus"]; tags?: components["schemas"]["DatasetTags"]; write_mode: components["schemas"]["DatasetWriteMode"]; /** @description Id of a subscription which writes output to the dataset */ subscription_id?: string | null; /** @description ISO-8601 timestamp indicating when the dataset was last updated. */ updated_at: string; /** @description ISO-8601 timestamp indicating when the last snapshot was created. */ last_snapshot_created_at?: string | null; /** @description Materialized-view configuration. Present only for materialized-view datasets. */ materialized_view_config?: { /** @description The NQL query that defines the materialized view. */ nql: string; /** @description The active refresh schedule, if one is set. */ refresh_schedule_config?: { /** @description cron expression the refresh runs on, for example: @hourly, 0 12 * * 1-5 */ schedule: string; /** @description zone id the schedule runs in, for example: EST, GMT+2 */ schedule_zone_id: string; /** @description whether advanced statistics calculation is enabled */ stats_enabled?: boolean; /** * @description active runs on the cron schedule; pending and archived do not run * @enum {string} */ status: "active" | "pending" | "archived"; /** @description ISO-8601 timestamp indicating when the refresh schedule was created. */ created_at?: string; /** @description ISO-8601 timestamp indicating when the refresh schedule was last updated. */ updated_at?: string; }; } | null; stats?: components["schemas"]["DatasetResponseStats"] | null; }; /** * @example { * "prev_page": null, * "current_page": 1, * "next_page": null, * "total_records": 1, * "total_pages": 1, * "records": [ * { * "id": 18923, * "company_id": 382, * "created_at": "2021-06-24T00:54:40.029056Z", * "data_plane": { * "type": "owned", * "id": "c0bed5c2-8af8-4f7a-9787-1ffc3def339b", * "company_id": 382, * "created_at": "2021-06-01T00:00:00Z", * "description": "The company's Snowflake account", * "display_name": "Snowflake (us-west-2)", * "external_id": "snowflake-prod", * "platform": { * "type": "platform_snowflake", * "account_locator": "ab12345", * "account_name": "acme", * "organization_name": "acmeorg", * "region": { * "type": "region_aws", * "id": "us-west-2" * } * }, * "status": "active", * "tags": [], * "updated_at": "2021-06-01T00:00:00Z", * "collaborators": { * "participants": { * "type": "all" * }, * "manage_compute_pools": { * "type": "all" * } * }, * "compute_pools": [] * }, * "display_name": "Declared Age", * "is_narrative_managed": true, * "description": "Mobile identifiers tied to birth information provided as part of app registration.", * "name": "Declared Age", * "retention_policy": { * "policies": [ * { * "type": { * "kind": "snapshot_ttl", * "snapshot_retention_policy": { * "type": "retain_everything" * } * }, * "enabled": true * } * ] * }, * "schema": { * "file_config": { * "type": "flat", * "delimiter": ",", * "escape": "\"", * "header": true, * "quote": "\"" * }, * "type": "object", * "properties": { * "idValue": { * "display_name": "Id Value", * "order": 0, * "approximate_cardinality": 100000, * "description": "ID values", * "type": "string" * }, * "idType": { * "display_name": "Id Type", * "order": 1, * "approximate_cardinality": 1, * "type": "string", * "enum": [ * "md5_email", * "sha256_email" * ] * }, * "eventTimestamp": { * "display_name": "Event TS", * "order": 2, * "description": "When the observation was collected", * "type": "timestamptz", * "validations": [ * "eventTimestamp < current_timestamp()" * ] * }, * "countryCode": { * "display_name": "countryCode", * "order": 3, * "approximate_cardinality": 6, * "description": "The country of residence of the individual", * "type": "string" * }, * "age": { * "display_name": "Age", * "order": 4, * "approximate_cardinality": 90, * "description": "How old this individual is in years", * "type": "long" * }, * "birthInfo": { * "display_name": "birth info", * "order": 5, * "description": "The year this individual was born", * "type": "double" * } * }, * "required": [ * "idValue", * "idType", * "eventTimestamp", * "countryCode", * "age" * ], * "primary": "/age" * }, * "status": "active", * "tags": [ * "age", * "demo", * "demographic", * "demographics" * ], * "updated_at": "2021-06-24T00:54:40.029056Z", * "write_mode": "append", * "subscription_id": "123e4567-e89b-12d3-a456-426614174000" * } * ] * } */ DatasetsResponse: { prev_page?: components["schemas"]["PrevPage"]; current_page: components["schemas"]["CurrentPage"]; next_page?: components["schemas"]["NextPage"]; total_records: components["schemas"]["TotalRecords"]; total_pages: components["schemas"]["TotalPages"]; records: components["schemas"]["DatasetResponse"][]; }; /** @description A flag to enable derivation of the config. */ DeriveMetricsConfig: boolean; /** * @example { * "name": "sample_data", * "display_name": "sample data", * "description": "sample description", * "data_plane_id": "123e4567-e89b-12d3-a456-426614174000", * "external_id": "ext-dataset-001", * "is_narrative_managed": false, * "schema": { * "file_config": { * "type": "flat", * "delimiter": ",", * "escape": "\"", * "header": true, * "quote": "\"" * }, * "type": "object", * "properties": { * "idValue": { * "approximate_cardinality": 100000, * "description": "ID values", * "type": "string" * }, * "idType": { * "approximate_cardinality": 1, * "type": "string", * "enum": [ * "md5_email", * "sha256_email" * ] * }, * "eventTimestamp": { * "description": "When the observation was collected", * "type": "timestamptz", * "validations": [ * "eventTimestamp < current_timestamp()" * ] * }, * "countryCode": { * "approximate_cardinality": 6, * "description": "The country of residence of the individual", * "type": "string" * }, * "age": { * "approximate_cardinality": 90, * "description": "How old this individual is in years", * "type": "long" * }, * "birthInfo": { * "description": "The year this individual was born", * "type": "double" * } * }, * "required": [ * "idValue", * "idType", * "eventTimestamp", * "countryCode", * "age" * ], * "primary": "/age" * }, * "tags": [ * "age", * "demo", * "demographic", * "demographics" * ], * "write_mode": "append", * "derive_metrics_config": true * } */ DatasetCreateRequest: { name: components["schemas"]["DatasetName"]; display_name?: components["schemas"]["DatasetDisplayName"]; description?: components["schemas"]["DatasetDescription"]; /** * Format: uuid * @description Optional data plane identifier, must be provided when registering dataset in external dataplane. */ data_plane_id?: string; /** @description Optional external identifier, must be excluded when registering dataset in external dataplane */ external_id?: string; /** @description Whether the dataset is managed by Narrative */ is_narrative_managed?: boolean; schema: components["schemas"]["DatasetSchema"]; tags?: components["schemas"]["DatasetTags"]; write_mode?: components["schemas"]["DatasetWriteMode"]; derive_metrics_config?: components["schemas"]["DeriveMetricsConfig"]; }; /** * @example { * "description": "Mobile identifiers tied to birth information provided as part of app registration.", * "name": "declared_age", * "display_name": "Declared Age", * "schema": { * "file_config": { * "type": "flat", * "delimiter": ",", * "escape": "\"", * "header": true, * "quote": "\"" * }, * "type": "object", * "properties": { * "idValue": { * "approximate_cardinality": 100000, * "description": "ID values", * "type": "string" * }, * "idType": { * "approximate_cardinality": 1, * "type": "string", * "enum": [ * "md5_email", * "sha256_email" * ] * }, * "eventTimestamp": { * "description": "When the observation was collected", * "type": "timestamptz", * "validations": [ * "eventTimestamp < current_timestamp()" * ] * }, * "countryCode": { * "approximate_cardinality": 6, * "description": "The country of residence of the individual", * "type": "string" * }, * "age": { * "approximate_cardinality": 90, * "description": "How old this individual is in years", * "type": "long" * }, * "birthInfo": { * "description": "The year this individual was born", * "type": "double" * } * }, * "required": [ * "idValue", * "idType", * "eventTimestamp", * "countryCode", * "age" * ], * "primary": "/age" * }, * "tags": [ * "age", * "demo", * "demographic", * "demographics" * ] * } */ DatasetUpdateRequest: { name?: components["schemas"]["DatasetName"]; display_name?: components["schemas"]["DatasetDisplayName"]; description?: components["schemas"]["DatasetDescription"]; schema?: components["schemas"]["DatasetSchema"]; tags?: components["schemas"]["DatasetTags"]; write_mode?: components["schemas"]["DatasetWriteMode"]; }; /** * Format: uuid * @description Unique identifier for the job. */ JobId: string; /** * @example { * "type": "api_user", * "company_id": 1, * "user_id": 1248 * } */ ApiUserRequestSource: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "api_user"; /** * Format: int64 * @description The company the request was made for. */ company_id: number; /** * Format: int64 * @description The user who made the request. */ user_id: number; }; /** * @example { * "type": "process", * "name": "narrative-control-plane" * } */ ProcessRequestSource: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "process"; /** @description The process that enqueued the job, e.g. `narrative-control-plane` or `health-check`. */ name: string; }; /** * @description Who asked for the job. Discriminated by `type`: `api_user` for a job requested through the API on behalf * of a user, `process` for one enqueued by a Narrative process. */ RequestSource: components["schemas"]["ApiUserRequestSource"] | components["schemas"]["ProcessRequestSource"]; /** * @description Where a job is in its lifecycle. * * - `pending` — enqueued and waiting to be picked up. * - `scheduled` — claimed by an executor but not yet started. * - `running` — being executed. * - `pending_cancellation` — cancellation has been requested and the data plane has yet to stop the work. * - `completed`, `cancelled`, `failed` — terminal states. * @enum {string} */ State: "pending" | "scheduled" | "running" | "pending_cancellation" | "completed" | "cancelled" | "failed"; /** * @description The type of the execution cluster to run the job on. * * - `dedicated` runs job on a dedicated cluster. * - `shared` runs job on a shared cluster. * @enum {string} */ ExecutionClusterType: "dedicated" | "shared"; /** * @description The fields every job carries, whatever its type. Each branch of `JobResponse` adds `type`, `input`, and * `result` on top of these. * * Every key listed here is present on every job. The ones typed as nullable are sent as `null` rather than * omitted when they have no value. */ JobBase: { job_id: components["schemas"]["JobId"]; /** * Format: int64 * @description The company the job belongs to. */ company_id: number; /** * Format: uuid * @description The data plane the job runs on. Jobs enqueued without one are reported as running on the Narrative data * plane, `f79cbdae-4848-47ca-95e8-69588364d185`, so this is never null in practice. */ data_plane_id?: string | null; /** * Format: uuid * @description The compute pool associated with the job, if any. */ compute_pool_id?: string | null; request_source: components["schemas"]["RequestSource"]; state: components["schemas"]["State"]; /** * @description Which operator runs the job, e.g. `materialized-view-refresh` or `datasets_execute_select`. Finer-grained * than `type`: several job types can share one operator, and where no such mapping exists the two are equal. */ operator_type: string; /** @description Free-form labels attached to the job. */ tags: string[]; /** @description The internal job executor tied to the job. Null until an executor picks the job up. */ executor?: string | null; execution_cluster: components["schemas"]["ExecutionClusterType"]; /** @description The unique key the job was enqueued under. */ idempotency_key: string; /** * Format: date-time * @description When the job was taken off the queue. Null while it is still queued. */ dequeued_at?: string | null; /** * Format: date-time * @description The timestamp representing when the job was created. */ created_at: string; /** * Format: date-time * @description The timestamp representing when the job was updated. */ updated_at: string; /** * Format: date-time * @description When the job's current attempt started. A job can be retried; each retry is a new attempt, so this advances to the latest one, while `created_at` stays at the original submission. */ attempted_at: string; /** @description Which attempt this is: 1 for the first, increasing by one on each retry. */ attempt_version: number; /** * Format: date-time * @description The timestamp representing when the job finished. Null until the job reaches a terminal state. */ ended_at?: string | null; /** * Format: uuid * @description The id of the workflow that enqueued the job. Null for jobs not enqueued by a workflow. */ workflow_id?: string | null; /** * Format: uuid * @description The id of the workflow run that enqueued the job. Null for jobs not enqueued by a workflow run. */ workflow_run_id?: string | null; }; /** * @description One partition expression applied to the written table. * @example { * "field": "event_timestamp", * "fn": "day", * "args": [] * } */ MaterializeViewJobPartition: { /** @description The column the partition is derived from. */ field: string; /** @description The partition transform, e.g. `day` or `bucket`. */ fn: string; /** @description Arguments to `fn`. Empty for transforms that take none. */ args: string[]; }; /** * @description Which chunk of a batched refresh this job is. * @example { * "batch_id": "0f1e2d3c-4b5a-4968-9788-6a5b4c3d2e1f", * "chunk_sequence": { * "number": 1, * "of": 4 * } * } */ MaterializeViewJobChunkMetadata: { /** * Format: uuid * @description Shared by every chunk of the same refresh. */ batch_id: string; chunk_sequence: { /** @description This chunk's position in the batch, starting at 1. */ number: number; /** @description How many chunks the batch has. */ of: number; }; }; /** * @description The upper bound of the rows a DELTA source contributes to this refresh. * @example { * "dataset_id": 10674, * "upper_bound": "2024-01-28T00:00:00Z" * } */ MaterializeViewJobDeltaDatasetBound: { /** Format: int64 */ dataset_id: number; /** * Format: date-time * @description Inclusive `_nio_last_modified_at` upper bound. Null when the dataset has no data. */ upper_bound?: string | null; }; /** * @description Jobs enqueued today carry every field below, with `null` where a value is unset. Most of the optional fields * were added over the life of this job type, so a row written before a field existed lacks that key. * @example { * "nql": "CREATE MATERIALIZED VIEW \"test_stats\" AS SELECT \"value\" FROM \"company_data\".\"10674\"", * "compiled_select": "SELECT\n `ds_10674`.`value`\nFROM\n narrative.datasets.ds_10674 `ds_10674`", * "create_as_view": null, * "dataset_id": 10736, * "billing_enabled": null, * "stats_enabled": true, * "contains_delta_syntax": null, * "first_run": false, * "merge": true, * "partitions": null, * "snowflake_create_table": null, * "snowflake_insert_statement": null, * "chunk_metadata": null, * "nio_last_modified_at": null, * "delta_dataset_bounds": null, * "write_mode": "append" * } */ MaterializeViewJobInput: { /** @description The `CREATE MATERIALIZED VIEW` statement the view was defined with. */ nql: string; /** @description The SELECT that `nql` compiles to. This is what the operator runs. */ compiled_select: string; /** @description Write a view instead of a table. Null when the job was enqueued without the option. */ create_as_view?: boolean | null; /** * Format: int64 * @description The dataset the refreshed rows are written to. */ dataset_id: number; /** @description Whether the refresh bills for the rows it reads. */ billing_enabled?: boolean | null; /** @description Whether extended dataset statistics are on for the view. Only the V1 stats path reads this. */ stats_enabled?: boolean | null; /** @description Whether `nql` uses DELTA syntax. */ contains_delta_syntax?: boolean | null; /** @description Whether this is the view's first refresh. */ first_run?: boolean | null; /** @description Whether the refresh merges into the target rather than replacing it. */ merge?: boolean | null; /** @description Partition configuration for the write. Null when the view is unpartitioned; never an empty array. */ partitions?: components["schemas"]["MaterializeViewJobPartition"][] | null; /** @description Snowflake `CREATE TABLE` used to support MERGE. Null outside the Snowflake data plane. */ snowflake_create_table?: string | null; /** @description Snowflake INSERT used to support MERGE. Null outside the Snowflake data plane. */ snowflake_insert_statement?: string | null; /** @description Chunking state when the refresh is split across several jobs. Null when it is not. */ chunk_metadata?: components["schemas"]["MaterializeViewJobChunkMetadata"] | null; /** * Format: date-time * @description The `_nio_last_modified_at` watermark the refresh writes. */ nio_last_modified_at?: string | null; /** * @description Bounds for the DELTA sources the refresh reads. Null on jobs enqueued without them, which does not mean * the query has no DELTA. */ delta_dataset_bounds?: components["schemas"]["MaterializeViewJobDeltaDatasetBound"][] | null; /** * @description Whether the refresh appends to the target dataset or overwrites it. Null when unset. * @enum {string|null} */ write_mode?: "append" | "overwrite" | null; }; MaterializeViewJobRowStats: { /** Format: int64 */ affected_rows: number; /** Format: int64 */ inserted_rows: number; /** Format: int64 */ updated_rows: number; /** Format: int64 */ deleted_rows: number; }; /** * @description Written by the completion handler and by the Spark executor alike. `recalculation_id` and `row_stats` were * added after this job type existed, so older completed rows lack them. * @example { * "dataset_id": 10736, * "snapshot_id": 1724919539450264600, * "recalculation_id": "abf9a2ec-426b-4751-bd16-fcb435061925", * "row_stats": null * } */ MaterializeViewJobResult: { /** * Format: int64 * @description The dataset the rows were written to. */ dataset_id: number; /** * Format: int64 * @description The Iceberg snapshot the write produced. The Snowflake data plane passes a numeric snapshot id here * too, so this is always a number; `0` when the value it sent did not parse as one. */ snapshot_id: number; /** * Format: uuid * @description The statistics recalculation this refresh triggered. Only the V1 stats path sets it. */ recalculation_id?: string | null; /** @description Row counts for the write. Null when the operator did not report them. */ row_stats?: components["schemas"]["MaterializeViewJobRowStats"] | null; }; /** * @description Refreshes a materialized view: runs the view's compiled SELECT and writes the rows into the target dataset. * Runs the `materialized-view-refresh` operator. * @example { * "job_id": "2a5b9ad7-dc8f-47bb-8e62-843a38f8054c", * "company_id": 1, * "data_plane_id": "f79cbdae-4848-47ca-95e8-69588364d185", * "compute_pool_id": null, * "request_source": { * "type": "api_user", * "company_id": 1, * "user_id": 407 * }, * "state": "completed", * "type": "materialize-view", * "operator_type": "materialized-view-refresh", * "tags": [], * "input": { * "nql": "CREATE MATERIALIZED VIEW \"test_stats\" AS SELECT \"value\" FROM \"company_data\".\"10674\"", * "compiled_select": "SELECT\n `ds_10674`.`value`\nFROM\n narrative.datasets.ds_10674 `ds_10674`", * "create_as_view": null, * "dataset_id": 10736, * "billing_enabled": null, * "stats_enabled": true, * "contains_delta_syntax": null, * "first_run": false, * "merge": true, * "partitions": null, * "snowflake_create_table": null, * "snowflake_insert_statement": null, * "chunk_metadata": null, * "nio_last_modified_at": null, * "delta_dataset_bounds": null, * "write_mode": "append" * }, * "executor": "job-executor-98e1f48e-bf54-4f11-bbd1-73c445120266", * "execution_cluster": "shared", * "idempotency_key": "10736:29329c64e7b8a4eda86aaabe04872b832ab456b5543d0c259c812525391f158c:669a5f8e4f373c2f907700decde47511aac6470f5698e2b856fb07f09160e5f2", * "result": { * "dataset_id": 10736, * "snapshot_id": 1724919539450264600, * "recalculation_id": "abf9a2ec-426b-4751-bd16-fcb435061925", * "row_stats": null * }, * "dequeued_at": "2023-10-31T11:19:13.400498Z", * "created_at": "2023-10-31T11:19:13.400498Z", * "updated_at": "2023-10-31T11:25:08.327209Z", * "attempted_at": "2023-10-31T11:19:13.400498Z", * "attempt_version": 1, * "ended_at": "2023-10-31T11:25:08.327194Z", * "workflow_id": null, * "workflow_run_id": null * } */ MaterializeViewJobResponse: { /** @enum {string} */ type: "materialize-view"; input: components["schemas"]["MaterializeViewJobInput"]; result: components["schemas"]["MaterializeViewJobResult"] | null; } & (components["schemas"]["JobBase"] & { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "materialize-view"; }); /** * @example { * "nql": "EXPLAIN SELECT narrative.rosetta_stone.\"age\" FROM narrative.rosetta_stone WHERE narrative.rosetta_stone.\"age\" > 50", * "compiled_sql": "SELECT\n `t`.`age`\nFROM\n narrative.datasets.ds_63 `t`\nWHERE\n `t`.`age` > 50" * } */ NqlForecastJobInput: { /** @description The NQL that was forecast. */ nql: string; /** @description The SQL that `nql` compiles to. This is what the operator runs. */ compiled_sql: string; }; /** * @example { * "success": { * "result": { * "Forecast": { * "rows": 1643721216, * "cost": 136130662400000 * } * } * } * } */ NqlForecastJobSuccess: { success: { result: { Forecast: { /** @description How many rows the query would return. */ rows: number; /** @description What those rows would cost, in microcents. */ cost: number; }; }; }; }; /** * @example { * "failure": { * "msg": "query timed out" * } * } */ NqlForecastJobFailure: { failure: { /** @description Why the forecast could not be produced. */ msg: string; }; }; /** * @description The forecast, or the reason it could not be produced. Exactly one of `success` / `failure` is present — * this is a Scala sum type encoded by constructor name, so the absent branch is not sent as null. * * Note the capitalised `Forecast` key inside `success.result`: that inner type is encoded with a different * Circe configuration than the fields around it, which leaves the constructor name as written. */ NqlForecastJobResult: components["schemas"]["NqlForecastJobSuccess"] | components["schemas"]["NqlForecastJobFailure"]; /** * @description Estimates how many rows a query would return and what they would cost, without buying them. Enqueued by * `EXPLAIN`-style NQL. */ NqlForecastJobResponse: { /** @enum {string} */ type: "nql-forecast"; input: components["schemas"]["NqlForecastJobInput"]; result: components["schemas"]["NqlForecastJobResult"] | null; } & (components["schemas"]["JobBase"] & { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "nql-forecast"; }); /** * @example { * "dataset_id": 10736, * "compiled_sql": "SELECT `ds_10674`.`value` FROM narrative.datasets.ds_10674 `ds_10674` LIMIT 100" * } */ DatasetsSampleJobInput: { /** * Format: int64 * @description The dataset being sampled. */ dataset_id: number; /** @description The SELECT that produces the sample. Compiled by the API, run by the operator. */ compiled_sql: string; }; /** * @description How many rows the sample holds. The rows themselves are stored separately, not returned here. * * Two shapes are stored. A job completed with the rows it selected (`datasets_execute_select`), or by the * legacy executor, carries `type` and `row_count`. A job completed with the bare `datasets_sample` marker * stores an empty object, so neither key is guaranteed. * @example { * "type": "datasets_sample", * "row_count": 100 * } * @example {} */ DatasetsSampleJobResult: { /** * @description Repeated inside the result by the encoder that writes it. * @enum {string} */ type?: "datasets_sample"; /** Format: int64 */ row_count?: number; }; /** * @description Reads a sample of rows from a dataset. Runs the `datasets_execute_select` operator, except on the * Narrative data plane without a compute pool, where the operator type stays `datasets_sample`. */ DatasetsSampleJobResponse: { /** @enum {string} */ type: "datasets_sample"; input: components["schemas"]["DatasetsSampleJobInput"]; result: components["schemas"]["DatasetsSampleJobResult"] | null; } & (components["schemas"]["JobBase"] & { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "datasets_sample"; }); /** * @description Pre-compiled SQL. The API compiles the query; the operator just runs it. * @example { * "dataset_id": 10736, * "compiled_sql": "SELECT `ds_10674`.`age` FROM narrative.datasets.ds_10674 `ds_10674`" * } */ DatasetsCalculateColumnStatsJobInputV2: { /** * Format: int64 * @description The dataset the statistics are computed for. */ dataset_id: number; /** @description The SELECT that produces the statistics. */ compiled_sql: string; }; /** * @description Which statistics to collect for one column. The first six are basic statistics, on by default; the rest are * advanced and are turned on by the dataset's metrics configuration. Statistics that make no sense for the * column's type are switched off before the job is enqueued — `mean` on a string column, for instance. */ DatasetsCalculateColumnStatsFlags: { nan_value_count: boolean; null_value_count: boolean; value_count: boolean; lower_bound: boolean; upper_bound: boolean; column_stored_bytes: boolean; approx_count_distinct: boolean; count_distinct: boolean; histogram: boolean; mean: boolean; standard_deviation: boolean; completeness: boolean; observed_types: boolean; }; DatasetsCalculateColumnStatsColumnDetails: { /** * @description The column's type, as the stats job sees it. * @enum {string} */ data_type: "boolean" | "double" | "long" | "string" | "timestamp_tz" | "array" | "object"; enabled_column_stats: components["schemas"]["DatasetsCalculateColumnStatsFlags"]; }; /** * @description Per-column instructions. The operator builds the query from these. `enabled_column_stats` was added after * this shape existed; the oldest rows carry only `dataset_id`. * @example { * "dataset_id": 10736, * "enabled_column_stats": { * "AGE": { * "data_type": "long", * "enabled_column_stats": { * "nan_value_count": false, * "null_value_count": true, * "value_count": true, * "lower_bound": true, * "upper_bound": true, * "column_stored_bytes": true, * "approx_count_distinct": false, * "count_distinct": false, * "histogram": false, * "mean": false, * "standard_deviation": false, * "completeness": false, * "observed_types": false * } * } * } * } */ DatasetsCalculateColumnStatsJobInputV1: { /** * Format: int64 * @description The dataset the statistics are computed for. */ dataset_id: number; /** @description Which statistics to collect, keyed by column name. Null when the job was enqueued without any. */ enabled_column_stats?: { [key: string]: components["schemas"]["DatasetsCalculateColumnStatsColumnDetails"]; } | null; }; /** * @description Either input shape. A payload tells you which one it is: V2 carries `compiled_sql`, V1 does not. `anyOf` * rather than `oneOf` because a V2 payload also satisfies V1's one required key, and a stored row carrying * both — nothing writes one today, but nothing stops one either — should still validate. */ DatasetsCalculateColumnStatsJobInput: components["schemas"]["DatasetsCalculateColumnStatsJobInputV2"] | components["schemas"]["DatasetsCalculateColumnStatsJobInputV1"]; /** * @description A marker that the job finished. The statistics themselves are written to the dataset, not returned here. * A job completed through the API carries only `type`; one completed by the legacy executor also carries * `total_rows` and `column_count`. * @example { * "type": "datasets_calculate_column_stats" * } * @example { * "type": "datasets_calculate_column_stats", * "total_rows": 12000, * "column_count": 4 * } */ DatasetsCalculateColumnStatsJobResult: { /** @enum {string} */ type: "datasets_calculate_column_stats"; /** * Format: int64 * @description How many rows the dataset had when the statistics were computed. */ total_rows?: number; /** @description How many columns statistics were computed for. */ column_count?: number; }; /** * @description Computes per-column statistics for a dataset. * * Two input shapes are in flight. V1 names the columns to collect and which statistics to collect for each; * V2 hands the operator a SELECT the API already compiled. Which one a job carries depends on the path that * enqueued it, so `input` accepts either. */ DatasetsCalculateColumnStatsJobResponse: { /** @enum {string} */ type: "datasets_calculate_column_stats"; input: components["schemas"]["DatasetsCalculateColumnStatsJobInput"]; result: components["schemas"]["DatasetsCalculateColumnStatsJobResult"] | null; } & (components["schemas"]["JobBase"] & { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "datasets_calculate_column_stats"; }); /** * @example { * "dataset_id": 10736, * "nio_last_modified_at": "2024-01-28T00:00:00Z", * "compiled_query": "SELECT `t`.`_nio_access_rule_id` FROM narrative.datasets.ds_10736 `t`", * "refresh_job_id": "2a5b9ad7-dc8f-47bb-8e62-843a38f8054c" * } */ CollectAccessRulesBillingDataJobInput: { /** * Format: int64 * @description The dataset the refresh wrote to. Null on jobs enqueued without one. */ dataset_id?: number | null; /** * Format: date-time * @description The job counts rows whose `_nio_last_modified_at` matches this watermark. */ nio_last_modified_at: string; /** @description The query that counts the rows, compiled by the API so the operator needs no query logic. */ compiled_query: string; /** * Format: uuid * @description The `materialize-view` job whose rows this job bills for. */ refresh_job_id: string; }; CollectAccessRulesBillingDataPrice: { /** * @description ISO 4217 currency code. * @example USD */ currency: string; /** * Format: int64 * @description Price per row, in microcents. */ microcents: number; }; CollectAccessRulesBillingDataSource: { /** * Format: int64 * @description The access rule the rows came from. */ access_rule_id: number; /** * Format: int64 * @description How many rows this access rule contributed. */ rows: number; price_per_row: components["schemas"]["CollectAccessRulesBillingDataPrice"]; }; /** * @description One entry per access rule the refresh read from. A job completed through the API carries `type` as well; * one completed by the Spark executor does not. * @example { * "type": "materialized_views_collect_access_rules_billing_data", * "sources": [ * { * "access_rule_id": 88, * "rows": 1200, * "price_per_row": { * "currency": "USD", * "microcents": 250 * } * } * ] * } */ CollectAccessRulesBillingDataJobResult: { /** * @description Repeated inside the result by the completion handler. * @enum {string} */ type?: "materialized_views_collect_access_rules_billing_data"; sources: components["schemas"]["CollectAccessRulesBillingDataSource"][]; }; /** * @description Counts, per access rule, how many rows a materialized-view refresh pulled and what they cost, so the * refresh can be billed. Enqueued after the refresh it reports on, and points back at it through * `input.refresh_job_id`. */ CollectAccessRulesBillingDataJobResponse: { /** @enum {string} */ type: "materialized_views_collect_access_rules_billing_data"; input: components["schemas"]["CollectAccessRulesBillingDataJobInput"]; result: components["schemas"]["CollectAccessRulesBillingDataJobResult"] | null; } & (components["schemas"]["JobBase"] & { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "materialized_views_collect_access_rules_billing_data"; }); /** * @example { * "app_id": 142, * "connection_id": "0f1e2d3c-4b5a-4968-9788-6a5b4c3d2e1f", * "dataset_id": 10736, * "external_id": "nio_10736", * "snapshot_id": "1724919539450264600", * "maintenance_window_predicate": null * } */ DatasetsDeliverDataJobInput: { /** * Format: int64 * @description The app being delivered to. Null on deliveries not routed through an app installation. */ app_id?: number | null; /** * Format: uuid * @description The connection being delivered to. */ connection_id?: string | null; /** * Format: int64 * @description The dataset being delivered. */ dataset_id: number; /** @description The dataset's external identifier, as the destination knows it. */ external_id: string; /** * @description The snapshot being delivered. A string, not a number — the Snowflake data plane passes a numeric * snapshot id through this field as text. */ snapshot_id?: string | null; /** * @description SQL restricting the delivery to a maintenance window. Null when the delivery covers the whole * snapshot. */ maintenance_window_predicate?: string | null; }; /** * @description Empty. The API records nothing beyond the job reaching `completed` — what was delivered is already in the * input, and the destination's own response is not kept. * @example {} */ DatasetsDeliverDataJobResult: Record; /** * @description Delivers a dataset snapshot out to a connected app. One job per connection, so a dataset delivered to * several destinations produces several of these. */ DatasetsDeliverDataJobResponse: { /** @enum {string} */ type: "datasets_deliver_data"; input: components["schemas"]["DatasetsDeliverDataJobInput"]; result: components["schemas"]["DatasetsDeliverDataJobResult"] | null; } & (components["schemas"]["JobBase"] & { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "datasets_deliver_data"; }); /** @enum {string} */ ModelInferenceRunEffortLevel: "low" | "medium" | "high"; ModelInferenceRunThinkingEffortVocabulary: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "effort"; /** @description The effort levels the model accepts, shallowest first. Never empty. */ levels: components["schemas"]["ModelInferenceRunEffortLevel"][]; default: components["schemas"]["ModelInferenceRunEffortLevel"]; }; ModelInferenceRunThinkingBudgetVocabulary: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "budget"; /** @description The token budget used when a caller asks for budgeted thinking without naming one. */ default: number; }; /** * @description One way of asking a model to think, with the value used when a caller names the vocabulary without a * value. Discriminated by `type`. */ ModelInferenceRunThinkingVocabulary: components["schemas"]["ModelInferenceRunThinkingEffortVocabulary"] | components["schemas"]["ModelInferenceRunThinkingBudgetVocabulary"]; /** * @description What to ask the provider for: no thinking (`"disabled"`), thinking at an effort level, or thinking with a * token budget. * @example disabled * @example { * "type": "effort", * "level": "high" * } * @example { * "type": "budget", * "budget_tokens": 2048 * } */ ModelInferenceRunThinkingSetting: "disabled" | { /** @enum {string} */ type: "effort"; level: components["schemas"]["ModelInferenceRunEffortLevel"]; } | { /** @enum {string} */ type: "budget"; budget_tokens: number; }; /** * @description What a caller may ask this binding for about thinking, and what it is sent when nobody asks. Absent on a * binding that is not offered thinking. * @example { * "vocabularies": [ * { * "type": "effort", * "levels": [ * "low", * "medium", * "high" * ], * "default": "medium" * } * ], * "unasked": "disabled", * "reasoning_text_readable": true * } */ ModelInferenceRunThinkingSupport: { /** @description The ways this binding can be asked to think, preferred one first. Never empty. */ vocabularies: components["schemas"]["ModelInferenceRunThinkingVocabulary"][]; /** @description The setting sent when a caller names none. Omitted for a binding that needs no thinking field at all. */ unasked?: components["schemas"]["ModelInferenceRunThinkingSetting"]; /** @description Whether the reasoning that comes back is readable text, rather than a signature with no words. */ reasoning_text_readable: boolean; /** * @description `false` for a model that always thinks and can't turn thinking off. When a caller asks such a model * for `disabled`, the model is sent low effort instead. Absent means `true`. */ off_allowed?: boolean; }; /** * @description What this provider binding supports. Only `structured_output_mode` is always sent — the rest are omitted * entirely when unset, rather than sent as null. */ ModelInferenceRunCapabilities: { /** * @description How the binding produces structured output. * @enum {string} */ structured_output_mode: "native" | "forced_tool_use" | "prompted_tool_use"; /** @description Present when the binding supports grammar-constrained tool arguments. */ strict_tool_use?: { /** @description How many strict tools one request may declare. */ max_tool_count: number; }; /** @description Which sampling parameters the binding honours. Absent when it accepts none; never an empty array. */ supported_sampling_parameters?: ("temperature" | "top_p")[]; thinking_support?: components["schemas"]["ModelInferenceRunThinkingSupport"]; }; /** @description Where the model runs and what it can do there. Discriminated by `provider`. */ ModelInferenceRunProviderBinding: { /** @enum {string} */ provider: "bedrock" | "snowflake_cortex"; /** @description The provider's own id for the model, e.g. `global.anthropic.claude-sonnet-4-6`. */ model_id: string; capabilities: components["schemas"]["ModelInferenceRunCapabilities"]; }; /** @description The model, narrowed to the one provider binding that fits this job's data plane. */ ModelInferenceRunModel: { /** @description The Narrative model id. */ id: string; binding: components["schemas"]["ModelInferenceRunProviderBinding"]; }; ModelInferenceRunMessage: { /** @enum {string} */ role: "user" | "assistant" | "system"; /** @description The turn's content blocks, in order. */ content: components["schemas"]["ContentBlock"][]; }; /** * @description Sampling settings for the call. Every key is present; the optional ones are null when unset. `thinking` * was added after this job type existed, so older rows lack it. */ ModelInferenceRunConfig: { /** @description JSON Schema the model's structured output must satisfy. */ output_format_schema: Record; max_tokens?: number | null; /** Format: float */ temperature?: number | null; /** Format: float */ top_p?: number | null; stop_sequences?: string[] | null; /** @description Reasoning setting for the call. Null leaves the binding's own default. */ thinking?: components["schemas"]["ModelInferenceRunThinkingSetting"] | null; }; /** @description One tool definition, shaped to map straight onto the provider's tool specification. */ ModelInferenceRunToolSpec: { name: string; description: string; /** @description JSON Schema for the tool's arguments. */ input_schema: Record; /** * @description Opt into grammar-constrained sampling for this tool's arguments. Defaults to true when the field is * absent, which is how payloads written before the field existed decode. * @default true */ strict: boolean; }; /** * @description How the model selects a tool. `auto` lets it decide, `any` forces some tool, `specific_tool` forces the * named one. * @example { * "type": "auto" * } * @example { * "type": "specific_tool", * "name": "nio_emit_structured_output" * } */ ModelInferenceRunToolChoice: { /** @enum {string} */ type: "auto" | "any" | "specific_tool"; /** @description Which tool to call. Present only when `type` is `specific_tool`; must match a `tools[].name`. */ name?: string; }; /** * @description Jobs enqueued today carry every field below. `tools` and `tool_choice` were added after this job type * existed, so older rows lack them. * @example { * "model": { * "id": "claude-sonnet-4", * "binding": { * "provider": "bedrock", * "model_id": "global.anthropic.claude-sonnet-4", * "capabilities": { * "structured_output_mode": "native" * } * } * }, * "messages": [ * { * "role": "user", * "content": [ * { * "type": "text", * "text": "Which city?" * } * ] * } * ], * "inference_config": { * "output_format_schema": { * "type": "object" * }, * "max_tokens": 1024, * "temperature": null, * "top_p": null, * "stop_sequences": null, * "thinking": null * }, * "tools": null, * "tool_choice": null * } */ ModelInferenceRunJobInput: { /** * @description The model to run, narrowed to the one provider binding that fits this job's data plane. Rows written * before the binding travelled with the job carry the bare model id as a string instead. */ model: components["schemas"]["ModelInferenceRunModel"] | string; /** @description The conversation so far, oldest first. */ messages: components["schemas"]["ModelInferenceRunMessage"][]; inference_config: components["schemas"]["ModelInferenceRunConfig"]; /** * @description Tool definitions offered to the model. Null when the job offers no tools, in which case the model only * produces structured output. Never an empty array. */ tools?: components["schemas"]["ModelInferenceRunToolSpec"][] | null; /** @description How the model picks a tool. Only meaningful when `tools` is set; null leaves the provider default. */ tool_choice?: components["schemas"]["ModelInferenceRunToolChoice"] | null; }; ModelInferenceRunUsage: { completion_tokens: number; prompt_tokens: number; total_tokens: number; }; ModelInferenceRunToolCall: { id: string; name: string; /** @description The arguments the model produced for the call. */ arguments: Record; }; ModelInferenceRunProducedBlock: { /** @description The block's identifier, e.g. `b_c08cf800_00`. */ id: string; block: components["schemas"]["ContentBlock"]; }; ModelInferenceRunFailedStructuredOutput: { /** @description Why the output was rejected. */ message: string; /** @description What the model actually produced. */ raw_output: unknown; }; /** * @description The turn the model produced, with its provenance and token usage. Results written today carry every field * below. `tool_calls`, `stop_reason`, `produced_blocks`, `final_answer_from` and `failed_structured_output` * were added after this job type existed, so older rows carry only `structured_output` and `usage`. * @example { * "structured_output": { * "city": "Paris" * }, * "usage": { * "completion_tokens": 907, * "prompt_tokens": 4849, * "total_tokens": 5756 * }, * "tool_calls": [], * "stop_reason": "end_turn", * "produced_blocks": [], * "final_answer_from": [], * "failed_structured_output": null * } */ ModelInferenceRunJobResult: { /** * @description The model's structured answer. Null on a tool-use-only turn, where the model called a tool instead of * answering. */ structured_output: Record | null; usage: components["schemas"]["ModelInferenceRunUsage"]; /** @description Tool calls the model made on this turn. */ tool_calls?: components["schemas"]["ModelInferenceRunToolCall"][]; /** * @description Why the model stopped. Unrecognised provider values are passed through verbatim. * @example end_turn * @example tool_use * @example max_tokens * @example stop_sequence * @example guardrail_intervened * @example content_filtered * @example malformed_model_output */ stop_reason?: string; /** * @description The blocks the model produced, reasoning included, each with the id it was given. Empty on operators * that do not report them — a reader then rebuilds the turn from the other fields. */ produced_blocks?: components["schemas"]["ModelInferenceRunProducedBlock"][]; /** @description Ids of the `produced_blocks` the answer was taken from. */ final_answer_from?: string[]; /** * @description Structured output that did not satisfy `output_format_schema`. The job still succeeds and the raw * output is kept here rather than discarded. */ failed_structured_output?: components["schemas"]["ModelInferenceRunFailedStructuredOutput"] | null; }; /** * @description Runs one inference call against a model on the data plane. The conversation, the model binding, and the * sampling settings all travel in `input`; the model's answer comes back in `result`. */ ModelInferenceRunJobResponse: { /** @enum {string} */ type: "model_inference_run"; input: components["schemas"]["ModelInferenceRunJobInput"]; result: components["schemas"]["ModelInferenceRunJobResult"] | null; } & (components["schemas"]["JobBase"] & { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "model_inference_run"; }); /** * @example { * "external_id": "nio_10736", * "is_narrative_managed": true * } */ DatasetsDeleteTableJobInput: { /** @description The table's external identifier. */ external_id: string; /** * @description Whether Narrative owns the table's storage. A table Narrative does not manage is deregistered rather * than dropped. Added after this job type existed, so older rows lack the key. */ is_narrative_managed?: boolean | null; }; /** * @description Empty. The API records nothing beyond the job reaching `completed`. * @example {} */ DatasetsDeleteTableJobResult: Record; /** @description Drops a dataset's underlying table. */ DatasetsDeleteTableJobResponse: { /** @enum {string} */ type: "datasets_delete_table"; input: components["schemas"]["DatasetsDeleteTableJobInput"]; result: components["schemas"]["DatasetsDeleteTableJobResult"] | null; } & (components["schemas"]["JobBase"] & { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "datasets_delete_table"; }); /** * @example { * "dataset_id": 10736, * "nql": "DELETE FROM \"company_data\".\"10736\" WHERE \"age\" < 18", * "compiled_sql": "DELETE FROM narrative.datasets.ds_10736 WHERE age < 18", * "nio_last_modified_at": null * } */ DatasetsExecuteDmlJobInput: { /** * Format: int64 * @description The dataset the statement runs against. */ dataset_id: number; /** @description The NQL statement as written. */ nql: string; /** @description The SQL that `nql` compiles to. This is what the operator runs. */ compiled_sql: string; /** * Format: date-time * @description The `_nio_last_modified_at` watermark the statement writes. */ nio_last_modified_at?: string | null; }; /** * @description Row counts for the statement. A job completed through the API carries `type` as well; one completed by * the legacy executor does not. * @example { * "type": "datasets_execute_dml", * "affected_rows": 10, * "inserted_rows": 0, * "updated_rows": 0, * "deleted_rows": 10 * } */ DatasetsExecuteDmlJobResult: { /** * @description Repeated inside the result by the completion handler. * @enum {string} */ type?: "datasets_execute_dml"; /** Format: int64 */ affected_rows: number; /** Format: int64 */ inserted_rows: number; /** Format: int64 */ updated_rows: number; /** Format: int64 */ deleted_rows: number; }; /** @description Runs a DML statement — an NQL `DELETE` or `UPDATE` — against a dataset. */ DatasetsExecuteDmlJobResponse: { /** @enum {string} */ type: "datasets_execute_dml"; input: components["schemas"]["DatasetsExecuteDmlJobInput"]; result: components["schemas"]["DatasetsExecuteDmlJobResult"] | null; } & (components["schemas"]["JobBase"] & { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "datasets_execute_dml"; }); /** * @example { * "dataset_id": 10736, * "compiled_sql": "CREATE TABLE narrative.datasets.ds_10736 (age BIGINT)" * } */ DatasetsCreateTableSnowflakeJobInput: { /** @description The dataset the table is created for. */ dataset_id: number; /** @description The `CREATE TABLE` statement, compiled by the API. */ compiled_sql: string; }; IcebergTablePlainColumn: { name: string; data_type: components["schemas"]["DatasetType"]; /** @description Whether the column accepts nulls. */ optional: boolean; }; /** @description A one-off expression, not tied to an attribute. */ MaterializedFieldAdHoc: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "ad_hoc"; data_type: components["schemas"]["AttributeTypeWithoutRef"]; mapping: components["schemas"]["MappingDefinition"]; }; /** * @description An attribute as it appears inside another resource, such as a dataset's materialized fields. Unlike the * responses from the attributes API it always carries `company_id` and `collaborators`, whoever the caller is. */ Attribute: components["schemas"]["AttributeResponseWithoutExample"] & { /** @description The ID of the company that owns this attribute */ company_id: number; /** @description Defines which companies have access to view and map this attribute */ collaborators: { view?: components["schemas"]["Participants"]; map?: components["schemas"]["Participants"]; }; metadata?: components["schemas"]["AttributeMetadata"]; }; /** @description An attribute's value, mapped from this dataset. */ MaterializedFieldAttribute: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "attribute"; attribute: components["schemas"]["Attribute"]; mapping: components["schemas"]["MappingResponse"]; }; /** @description A sample keyed on an attribute's value, so the same entities are sampled consistently. */ MaterializedFieldAttributeSample: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "attribute_sample"; attribute: components["schemas"]["Attribute"]; /** @description Sample rate denominator — 128 means one row in 128. */ denominator: number; fields: string[]; mapping: components["schemas"]["MappingResponse"]; }; /** * @description A uniform random sample of the dataset's rows. * @example { * "type": "uniform_sample", * "denominator": 128 * } */ MaterializedFieldUniformSample: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "uniform_sample"; /** @description Sample rate denominator — 128 means one row in 128. */ denominator: number; }; /** @description An XZ2 spatial index over a geometry expression. */ MaterializedFieldXz2Index: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "xz2_index"; expression: string; }; /** @description When the row was last written. */ MaterializedFieldLastModifiedAt: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "last_modified_at"; }; /** @description Which sources contributed the row. */ MaterializedFieldNioSources: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "nio_sources"; }; /** @description What the field is materialized from. `type` selects the shape. */ MaterializedFieldValue: components["schemas"]["MaterializedFieldAdHoc"] | components["schemas"]["MaterializedFieldAttribute"] | components["schemas"]["MaterializedFieldAttributeSample"] | components["schemas"]["MaterializedFieldUniformSample"] | components["schemas"]["MaterializedFieldXz2Index"] | components["schemas"]["MaterializedFieldLastModifiedAt"] | components["schemas"]["MaterializedFieldNioSources"]; IcebergTableMaterializedColumn: { name: string; data_type: components["schemas"]["DatasetType"]; /** @description Whether the column accepts nulls. */ optional: boolean; description: string; value: components["schemas"]["MaterializedFieldValue"]; }; /** @description A table column. Either a plain column or a materialized field. */ IcebergTableColumn: { plain: components["schemas"]["IcebergTablePlainColumn"]; } | { materialized: components["schemas"]["IcebergTableMaterializedColumn"]; }; IcebergTablePartitionField: { /** @description The column the partition is derived from. */ source_column: string; /** * @description The Iceberg partition transform: `identity`, `year`, `month`, `day`, `hour`, `bucket[]` or * `truncate[]`. */ transform: string; }; /** @description The columns and partitioning of the Iceberg table to create. */ IcebergTableDefinition: { columns: components["schemas"]["IcebergTableColumn"][]; partitions: components["schemas"]["IcebergTablePartitionField"][]; }; /** * @example { * "dataset_id": 10737, * "definition": { * "columns": [ * { * "plain": { * "name": "id", * "data_type": { * "type": "string" * }, * "optional": false * } * }, * { * "materialized": { * "name": "_nio_last_modified_at", * "data_type": { * "type": "timestamptz" * }, * "optional": false, * "description": "Last Modified At", * "value": { * "type": "last_modified_at" * } * } * } * ], * "partitions": [ * { * "source_column": "id", * "transform": "identity" * } * ] * } * } */ DatasetsCreateTableIcebergJobInput: { /** @description The dataset the table is backing. */ dataset_id: number; definition: components["schemas"]["IcebergTableDefinition"]; }; /** @description The input for a create table job. Snowflake gets a compiled `CREATE TABLE` statement, and AWS gets an Iceberg table definition. */ DatasetsCreateTableJobInput: components["schemas"]["DatasetsCreateTableSnowflakeJobInput"] | components["schemas"]["DatasetsCreateTableIcebergJobInput"]; /** * @description Set when the job completes. Always `{"type": "datasets_create_table"}`; the job reports success and nothing else. * Completing the job doesn't activate the dataset. * @example { * "type": "datasets_create_table" * } */ DatasetsCreateTableJobResult: { /** @enum {string} */ type: "datasets_create_table"; }; /** @description Creates a dataset's underlying table. */ DatasetsCreateTableJobResponse: { /** @enum {string} */ type: "datasets_create_table"; input: components["schemas"]["DatasetsCreateTableJobInput"]; result: components["schemas"]["DatasetsCreateTableJobResult"] | null; } & (components["schemas"]["JobBase"] & { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "datasets_create_table"; }); /** * @example { * "dataset_id": 10736 * } */ DatasetsTruncateTableJobInput: { /** @description The dataset being truncated. */ dataset_id: number; }; /** * @description Empty. The API records nothing beyond the job reaching `completed`. * @example {} */ DatasetsTruncateTableJobResult: Record; /** @description Empties a dataset's underlying table, leaving the table itself in place. */ DatasetsTruncateTableJobResponse: { /** @enum {string} */ type: "datasets_truncate_table"; input: components["schemas"]["DatasetsTruncateTableJobInput"]; result: components["schemas"]["DatasetsTruncateTableJobResult"] | null; } & (components["schemas"]["JobBase"] & { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "datasets_truncate_table"; }); /** * @example { * "dataset_id": 10736, * "dataset_external_id": "nio_10736" * } */ DatasetsEnforceTableTtlRetentionPolicyJobInput: { /** * Format: int64 * @description The dataset the policy applies to. */ dataset_id: number; /** @description The dataset's external identifier. Null when the dataset has none. */ dataset_external_id?: string | null; }; /** * @description Empty. The API records nothing beyond the job reaching `completed`. * @example {} */ DatasetsEnforceTableTtlRetentionPolicyJobResult: Record; /** * @description Applies a dataset's table-level TTL retention policy — drops the table once it has outlived the policy. * Runs the `datasets_enforce_table_ttl_retention_policy` operator. */ DatasetsEnforceTableTtlRetentionPolicyJobResponse: { /** @enum {string} */ type: "datasets_enforce_table_ttl_retention_policy"; input: components["schemas"]["DatasetsEnforceTableTtlRetentionPolicyJobInput"]; result: components["schemas"]["DatasetsEnforceTableTtlRetentionPolicyJobResult"] | null; } & (components["schemas"]["JobBase"] & { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "datasets_enforce_table_ttl_retention_policy"; }); /** * @example { * "dataset_id": 10736, * "sql": [ * "DELETE FROM narrative.datasets.ds_10736 WHERE _nio_last_modified_at < 1706400000000" * ] * } */ DatasetsEnforceRowTtlRetentionPolicyJobInput: { /** @description The dataset the policy applies to. */ dataset_id: number; /** @description The delete statements that enforce the policy, run in order. */ sql: string[]; }; /** * @description Empty. The API records nothing beyond the job reaching `completed`. * @example {} */ DatasetsEnforceRowTtlRetentionPolicyJobResult: Record; /** * @description Applies a dataset's row-level TTL retention policy — deletes rows that have outlived it. Runs the * `datasets_enforce_row_ttl_retention_policy` operator. */ DatasetsEnforceRowTtlRetentionPolicyJobResponse: { /** @enum {string} */ type: "datasets_enforce_row_ttl_retention_policy"; input: components["schemas"]["DatasetsEnforceRowTtlRetentionPolicyJobInput"]; result: components["schemas"]["DatasetsEnforceRowTtlRetentionPolicyJobResult"] | null; } & (components["schemas"]["JobBase"] & { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "datasets_enforce_row_ttl_retention_policy"; }); /** * @example { * "compiled_sql": "SELECT COUNT(1) AS affected_rows FROM narrative.datasets.ds_10736", * "dataset_id": 10736 * } */ DatasetsCalculateAffectedRowsJobInput: { /** @description The SELECT that counts the rows, compiled by the API. */ compiled_sql: string; /** * Format: int64 * @description The dataset being counted. */ dataset_id: number; }; DatasetsCalculateAffectedRowsRow: { /** @description One returned row, keyed by column name. */ values: Record; }; /** * @description The operator's raw SELECT output. The count sits at `rows[0].values.affected_rows`; the job carries the * generic select result rather than a count field of its own so that new SELECT-backed job types need no * operator change. A job completed through the API carries `type` as well; one completed by the legacy * executor does not. * @example { * "type": "datasets_execute_select", * "rows": [ * { * "values": { * "affected_rows": 42 * } * } * ] * } */ DatasetsCalculateAffectedRowsJobResult: { /** * @description The operator that produced the result, not the job's own type. * @enum {string} */ type?: "datasets_execute_select"; rows: components["schemas"]["DatasetsCalculateAffectedRowsRow"][]; }; /** * @description Counts how many rows a pending statement would touch. Runs the `datasets_execute_select` operator and the * row it returns is read as the count, which is why the result carries that operator's type rather than this * job's. */ DatasetsCalculateAffectedRowsJobResponse: { /** @enum {string} */ type: "datasets_calculate_affected_rows"; input: components["schemas"]["DatasetsCalculateAffectedRowsJobInput"]; result: components["schemas"]["DatasetsCalculateAffectedRowsJobResult"] | null; } & (components["schemas"]["JobBase"] & { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "datasets_calculate_affected_rows"; }); /** * @description One destination the trained model is delivered to. * @example { * "app_id": 142, * "profile_id": "9c1f0a2e-3d4b-4c5a-8e6f-7a8b9c0d1e2f", * "quick_settings": null * } */ ModelTrainingRunConnection: { /** * Format: int64 * @description The app being delivered to. */ app_id: number; /** * Format: uuid * @description The destination profile within the app. */ profile_id: string; /** @description Connector settings for the destination. Null when the connection needs none. */ quick_settings?: Record | null; }; ModelTrainingRunHuggingFaceRepository: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "hugging_face"; /** @description The Hugging Face organization the model sits under. */ organization: string; }; ModelTrainingRunNarrativeRepository: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "narrative"; /** * Format: int64 * @description The company whose Narrative repository holds the model. */ company_id: number; }; /** @description Where a model lives. Discriminated by `type`. */ ModelTrainingRunRepository: components["schemas"]["ModelTrainingRunHuggingFaceRepository"] | components["schemas"]["ModelTrainingRunNarrativeRepository"]; /** * @description One access rule. `all` and `none` stand alone; `inclusion` and `exclusion` list the companies they apply * to. `anonymous` means no authentication is needed at all. * @example { * "type": "none" * } * @example { * "type": "inclusion", * "company_ids": [ * 1, * 2 * ] * } */ ModelTrainingRunViewCollaboratorRule: { /** @enum {string} */ type: "anonymous" | "all" | "none" | "inclusion" | "exclusion"; /** @description The companies the rule names. Present only for `inclusion` and `exclusion`, and never empty. */ company_ids?: number[]; }; /** * @description One access rule. `all` and `none` stand alone; `inclusion` and `exclusion` list the companies they apply * to. * @example { * "type": "none" * } * @example { * "type": "inclusion", * "company_ids": [ * 1, * 2 * ] * } */ ModelTrainingRunCollaboratorRule: { /** @enum {string} */ type: "all" | "none" | "inclusion" | "exclusion"; /** @description The companies the rule names. Present only for `inclusion` and `exclusion`, and never empty. */ company_ids?: number[]; }; /** @description Who may view, train on, and deploy the trained model. */ ModelTrainingRunCollaborators: { view: components["schemas"]["ModelTrainingRunViewCollaboratorRule"]; train: components["schemas"]["ModelTrainingRunCollaboratorRule"]; deploy: components["schemas"]["ModelTrainingRunCollaboratorRule"]; }; /** @description What the run publishes. */ ModelTrainingRunOutputModel: { name: string; collaborators: components["schemas"]["ModelTrainingRunCollaborators"]; description?: string | null; tags?: string[] | null; license_id?: string | null; }; /** * @example { * "company_id": 1, * "connections": null, * "custom_axolotl_config_override": null, * "dataset_id": 10736, * "instance_type": "ml.g5.12xlarge", * "base_model_id": 57, * "base_model_repository": { * "type": "hugging_face", * "organization": "meta-llama" * }, * "base_model_repo_id": "meta-llama/Llama-3.1-8B", * "trained_model_narrative_repository_model_id": "7d2f1b3c-5e6a-4f8b-9c0d-1e2f3a4b5c6d", * "trained_model_narrative_repo_id": "1/7d2f1b3c-5e6a-4f8b-9c0d-1e2f3a4b5c6d/1", * "trained_model_version": 1, * "trained_model": { * "name": "churn-predictor", * "collaborators": { * "view": { * "type": "none" * }, * "train": { * "type": "none" * }, * "deploy": { * "type": "none" * } * }, * "description": null, * "tags": null, * "license_id": null * } * } */ ModelTrainingRunJobInput: { /** * Format: int64 * @description The company the trained model belongs to. */ company_id: number; /** * @description Destinations the trained model is delivered to once training finishes. Null when there are none; * absent on jobs enqueued before the field existed. */ connections?: components["schemas"]["ModelTrainingRunConnection"][] | null; /** @description Overrides merged into the generated Axolotl training config. Null to use the defaults. */ custom_axolotl_config_override?: Record | null; /** * Format: int64 * @description The dataset the model trains on. */ dataset_id: number; /** @description The instance the training runs on, e.g. `ml.g5.12xlarge`. */ instance_type: string; /** * Format: int64 * @description The base model being fine-tuned. */ base_model_id: number; base_model_repository: components["schemas"]["ModelTrainingRunRepository"]; /** @description The base model's id within its repository, e.g. `meta-llama/Llama-3.1-8B`. */ base_model_repo_id: string; /** * Format: uuid * @description The id the trained model is published under in Narrative's repository. */ trained_model_narrative_repository_model_id: string; /** @description The trained model's full repository path, `//`. */ trained_model_narrative_repo_id: string; /** @description The version this run produces. */ trained_model_version: number; trained_model: components["schemas"]["ModelTrainingRunOutputModel"]; }; /** * @description A job result the spec does not describe a shape for. The server stores `result` as arbitrary JSON and does * not constrain it, so this is any JSON value. Null until the job reaches a terminal state. * @example { * "row_count": 100 * } * @example {} */ JobResult: unknown; /** * @description Fine-tunes a base model on a dataset and publishes the result to a model repository. * * `result` is whatever the training operator posted when it completed the job — the API stores it as sent * rather than reshaping it, so it is free-form here. */ ModelTrainingRunJobResponse: { /** @enum {string} */ type: "model_training_run"; input: components["schemas"]["ModelTrainingRunJobInput"]; result: components["schemas"]["JobResult"]; } & (components["schemas"]["JobBase"] & { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "model_training_run"; }); /** * @example { * "company_id": 1, * "app_id": 142, * "connection_id": "0f1e2d3c-4b5a-4968-9788-6a5b4c3d2e1f", * "profile_id": "9c1f0a2e-3d4b-4c5a-8e6f-7a8b9c0d1e2f", * "model_id": "7d2f1b3c-5e6a-4f8b-9c0d-1e2f3a4b5c6d", * "model_name": "churn-predictor", * "model_version": 1, * "quick_settings": null * } */ ModelsDeliverModelJobInput: { /** * Format: int64 * @description The company that owns the model. */ company_id: number; /** * Format: int64 * @description The app being delivered to. */ app_id: number; /** * Format: uuid * @description The connection being delivered to. */ connection_id: string; /** * Format: uuid * @description The destination profile within the app. */ profile_id: string; /** * Format: uuid * @description The model's id in Narrative's repository. */ model_id: string; model_name: string; model_version: number; /** @description Connector settings for the destination. Null when the connection needs none. */ quick_settings?: Record | null; }; /** * @description Delivers a trained model out to a connected app. Enqueued once training finishes, one job per connection. * * `result` is whatever the delivery operator posted when it completed the job — the API stores it as sent * rather than reshaping it, so it is free-form here. */ ModelsDeliverModelJobResponse: { /** @enum {string} */ type: "models_deliver_model"; input: components["schemas"]["ModelsDeliverModelJobInput"]; result: components["schemas"]["JobResult"]; } & (components["schemas"]["JobBase"] & { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "models_deliver_model"; }); /** * @description A job input the spec does not describe a shape for. The server stores `input` as arbitrary JSON and does * not constrain it, so this is any JSON value. * @example { * "dataset_id": 10736, * "compiled_sql": "SELECT `t`.`age` FROM narrative.datasets.ds_10736 `t`" * } * @example {} */ JobInput: unknown; /** * @description Trains a classifier. * * Both `input` and `result` are free-form. The input is the training config exactly as the caller submitted * it, and the result is whatever the operator posted on completion — neither passes through a typed class in * the marketplace, so there is no fixed shape to document. */ ModelsTrainClassifierJobResponse: { /** @enum {string} */ type: "models_train_classifier"; input: components["schemas"]["JobInput"]; result: components["schemas"]["JobResult"]; } & (components["schemas"]["JobBase"] & { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "models_train_classifier"; }); /** * @description Empty. The job carries no parameters — the data plane it targets is the job's own `data_plane_id`. * @example {} */ HealthCheckJobInput: Record; /** * @description Checks that a data plane is reachable and can run work. Enqueued by * `POST /data-planes/{data_plane_id}/health-check`. */ HealthCheckJobResponse: { /** @enum {string} */ type: "health_check"; input: components["schemas"]["HealthCheckJobInput"]; result: components["schemas"]["JobResult"]; } & (components["schemas"]["JobBase"] & { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "health_check"; }); /** * @description A job of one of the types this spec describes. `type` selects the branch, and each branch gives the typed * `input` and `result` for that kind of job. Every branch also carries the `JobBase` fields. */ DescribedJobResponse: components["schemas"]["MaterializeViewJobResponse"] | components["schemas"]["NqlForecastJobResponse"] | components["schemas"]["DatasetsSampleJobResponse"] | components["schemas"]["DatasetsCalculateColumnStatsJobResponse"] | components["schemas"]["CollectAccessRulesBillingDataJobResponse"] | components["schemas"]["DatasetsDeliverDataJobResponse"] | components["schemas"]["ModelInferenceRunJobResponse"] | components["schemas"]["DatasetsDeleteTableJobResponse"] | components["schemas"]["DatasetsExecuteDmlJobResponse"] | components["schemas"]["DatasetsCreateTableJobResponse"] | components["schemas"]["DatasetsTruncateTableJobResponse"] | components["schemas"]["DatasetsEnforceTableTtlRetentionPolicyJobResponse"] | components["schemas"]["DatasetsEnforceRowTtlRetentionPolicyJobResponse"] | components["schemas"]["DatasetsCalculateAffectedRowsJobResponse"] | components["schemas"]["ModelTrainingRunJobResponse"] | components["schemas"]["ModelsDeliverModelJobResponse"] | components["schemas"]["ModelsTrainClassifierJobResponse"] | components["schemas"]["HealthCheckJobResponse"]; /** * @description A job of a type this spec version does not describe. `input` and `result` stay free-form here. * * This branch is what keeps `JobResponse` open. Job types are free strings on the server, and `input` and * `result` are stored as arbitrary JSON, so a client will meet job types added after it was generated, and * rows written before the current shapes existed. Both land here rather than failing to parse. Read `type` * to find out what you actually have. */ OtherJobResponse: { /** @description Any job type other than the ones `JobResponse` describes a branch for. */ type: string; input: components["schemas"]["JobInput"]; result: components["schemas"]["JobResult"]; } & components["schemas"]["JobBase"]; /** * @description A job. Every job carries the same envelope of fields — see `JobBase` — but `input` and `result` hold * job-type-specific payloads, so the response is a union over `type`: pick the branch whose `type` matches * and you get the typed `input` and `result` for that kind of job. * * The union is open on purpose. Job types are free strings on the server, so a type this spec version does * not describe lands in `OtherJobResponse`, where both fields stay free-form. No branch closes itself to * extra properties, and new job types can appear without a spec change. * * The described types sit together under `DescribedJobResponse`, which has a discriminator on `type`. Any other * `type` is an `OtherJobResponse`. That branch sits outside the discriminator because a mapping can only name * specific values, and a branch with no mapping entry would only match a `type` equal to its schema name. * * `input` and `result` are returned exactly as they were stored when the job was enqueued or completed. The * server never reshapes them, so a field a job type gained after a row was written is absent from that row * rather than null. The typed branches describe what the current code writes; fields that have not always * been written are left out of each branch's `required` list. * * `result` is `null` in every branch until the job reaches a terminal state. */ JobResponse: components["schemas"]["DescribedJobResponse"] | components["schemas"]["OtherJobResponse"]; /** @description A field Narrative materializes into the dataset's table at ingestion. */ MaterializedFieldResponse: { /** Format: uuid */ id: string; /** Format: date-time */ created_at: string; description?: string | null; /** @description Position of the field in the table schema. */ field_id?: number; metadata: Record; name: string; /** * @description - `active` — in the table schema and populated at ingestion * - `deactivated` — no longer populated, but still in the schema so historical queries work * - `archived` — removed from the table schema * @enum {string} */ status: "active" | "deactivated" | "archived"; /** Format: date-time */ updated_at: string; value: components["schemas"]["MaterializedFieldValue"]; }; DatasetAdminResponse: components["schemas"]["DatasetResponse"] & { /** * @description Metadata of Iceberg table backing the given Dataset encoded in spec-compliant JSON. * * See: * - [Table Metadata](http://iceberg.apache.org/spec/#table-metadata) * - [Appendix C: JSON Serialization](http://iceberg.apache.org/spec/#appendix-c-json-serialization) */ table?: Record | null; /** * @description Fields Narrative precomputes and stores in the table alongside the uploaded data — samples, * indexes and mapped attribute values. Absent when the dataset has none. */ materialized_fields?: components["schemas"]["MaterializedFieldResponse"][]; }; PartitionSpecAddField: { /** * @description Discriminator indicating that the field is being added to the partition spec. (enum property replaced by openapi-typescript) * @enum {string} */ type: "add"; /** * @description A string indicating which field in the schema is being used a source for the partition value. * * The field reference must be a _primitive_ type. * * E.g. given a dataset with the following Iceberg table schema: * * ``` * { * "type": "struct", * "schema-id": 0, * "fields": [ * { * "id": 1, * "name": "id", * "required": true, * "type": { * "type": "struct", * "fields": [ * { * "id": 3, * "name": "value", * "required": true, * "type": "string" * }, * { * "id": 4, * "name": "type", * "required": false, * "type": "string" * } * ] * } * }, * { * "id": 2, * "name": "__NARRATIVE_DEFAULT_PARTITION__", * "required": true, * "type": "string" * } * ] * } * ``` * * The possible paths are: * * - `__NARRATIVE_DEFAULT_PARTITION__` * - `id.value` * - `id.type` */ field?: string; /** * @description A function applied to the source field to produce a partition value. * * See: http://iceberg.apache.org/spec/#partition-transforms * * Supported transforms are: * * - `bucket`: bucket transforms must be provided in the form `bucket[N]` where `N` is a positive integer indicating the number of buckets. * - `truncate`: truncation transforms must be provided in the form `truncate[W]` where `W` a positive integer indicating the truncation width. * - `identity` * - `hour` * - `day` * - `month` * - `year` */ transform?: string; }; PartitionSpecRemoveField: { /** * @description Discriminator indicating that the field is being removed from the partition spec. (enum property replaced by openapi-typescript) * @enum {string} */ type: "remove"; /** * @description The _partition spec_ field to be removed. * * E.g. given the following partition spec: * * ``` * { * "spec-id": 1, * "fields": [ * { * "name": "__NARRATIVE_DEFAULT_PARTITION___bucket", * "transform": "bucket[256]", * "source-id": 2, * "field-id": 1000 * }, * { * "name": "id.value_bucket_128", * "transform": "bucket[128]", * "source-id": 3, * "field-id": 1001 * } * ] * } * ``` * * The following are valid values for `field: * * - `__NARRATIVE_DEFAULT_PARTITION___bucket`: passing this as `field` will remove the `bucket[256]` partition derived from the `__NARRATIVE_DEFAULT_PARTITION__` schema field. * - `id.value_bucket_128`: passing this as `field` will remove the `bucket[128]` partition derived from the `id.value` schema field. */ field?: string; }; PartitionSpecUpdate: components["schemas"]["PartitionSpecAddField"] | components["schemas"]["PartitionSpecRemoveField"]; /** * @example { * "updates": [ * { * "type": "add", * "field": "id.value", * "transform": "bucket[128]" * }, * { * "type": "remove", * "field": "__NARRATIVE_DEFAULT_PARTITION___bucket" * } * ] * } */ UpdatePartitionSpecRequest: { updates: components["schemas"]["PartitionSpecUpdate"][]; }; /** @description Backwards-compatible legacy payloads. Interpreted as snapshot-level retention on Iceberg. The dataset returned carries the policy in the unified v1 shape. */ SnapshotRetentionPolicy: components["schemas"]["ExpireEverything"] | components["schemas"]["RetainEverything"] | components["schemas"]["ExpireWhen"] | components["schemas"]["RetainWhen"]; /** * @example { * "snapshots_to_expire": [ * { * "snapshot_id": 8840810861846963000, * "created_at": "2022-01-28T16:25:47.987Z" * }, * { * "snapshot_id": 6511121635994506000, * "created_at": "2022-01-28T16:58:59.264Z" * }, * { * "snapshot_id": 4359653450296158700, * "created_at": "2022-01-28T17:33:25.560Z" * }, * { * "snapshot_id": 7422070807769186000, * "created_at": "2022-01-28T18:58:45.856Z" * } * ] * } */ SnapshotExpirationsResponse: { /** @description A list of the existing snapshots for the dataset */ snapshots_to_expire?: { /** @description The id of the snapshot */ snapshot_id?: number; /** @description ISO-8601 timestamp indicating when the snapshot was created */ created_at?: string; }[]; }; /** * @example { * "policies": [ * { * "type": { * "kind": "table_ttl", * "clock": { * "kind": "created_at" * } * }, * "enabled": true, * "interval": "P1D" * } * ], * "schedule_config": { * "schedule": "@hourly", * "schedule_zone_id": "UTC", * "status": "active" * } * } */ UnifiedV1Request: { policies: components["schemas"]["RetentionPolicy"][]; schedule_config?: components["schemas"]["RefreshSchedule"]; }; /** * @example { * "compute_pool_id": "a81e1460-fbdc-4204-bd76-a9e496bf760d" * } */ RequestSampleRequest: { /** * Format: uuid * @description The compute pool to run the sample job on. * If not specified, defaults to the dataset's configured compute pool, * then to the data plane's default compute pool. */ compute_pool_id?: string; }; /** * @example { * "job_id": "a81e1460-fbdc-4204-bd76-a9e496bf760d" * } */ RequestSampleResponse: { /** * Format: uuid * @description The id of the job that has been enqueued. */ job_id: string; }; /** * Format: uuid * @description Unique identifier for a workflow. * @example a1b2c3d4-e5f6-7890-abcd-ef1234567890 */ WorkflowId: string; /** * @description The name of the workflow, extracted from the specification. * @example my-etl-workflow */ WorkflowName: string; /** * @description The workflow specification in YAML format. * @example document: * dsl: '1.0.0' * namespace: test * name: test-workflow * version: '1.0.0' * do: * - createView: * call: CreateMaterializedViewIfNotExists * with: * nql: "CREATE MATERIALIZED VIEW workflow_output AS SELECT track_id FROM company_data.workflow_input" * - refreshView: * call: RefreshMaterializedView * with: * datasetName: workflow_output * - insertData: * call: ExecuteDml * with: * nql: "INSERT INTO company_data.workflow_input (track_id) VALUES ('test')" */ WorkflowSpecification: string; /** @description Tags that describe the workflow. */ WorkflowTags: string[]; WorkflowResponse: { id: components["schemas"]["WorkflowId"]; name: components["schemas"]["WorkflowName"]; specification: components["schemas"]["WorkflowSpecification"]; /** * Format: uuid * @description The data plane this workflow is associated with. * @example d1e2f3a4-b5c6-7890-abcd-ef1234567890 */ data_plane_id: string; /** * Format: int64 * @description The company that owns this workflow. * @example 100 */ company_id: number; /** * Format: date-time * @description ISO-8601 timestamp of when the workflow was created. * @example 2025-01-15T10:30:00Z */ created_at: string; created_by: components["schemas"]["UserId"] & unknown; /** * Format: date-time * @description ISO-8601 timestamp of when the workflow was last updated. * @example 2025-01-15T10:30:00Z */ updated_at: string; /** * @description The current status of the workflow. * @example active * @enum {string} */ status: "active" | "archived"; /** * Format: date-time * @description ISO-8601 timestamp of when the workflow was archived, or null if active. * @example null */ archived_at?: string | null; tags: components["schemas"]["WorkflowTags"]; }; /** * Format: uuid * @description Workflow execution run ID. * @example b7e3f1a2-4c5d-6e7f-8a9b-0c1d2e3f4a5b */ WorkflowRunId: string; CreateWorkflowResponse: components["schemas"]["WorkflowResponse"] & { /** @description The run ID if the workflow was triggered immediately upon creation. */ run_id?: components["schemas"]["WorkflowRunId"] | null; }; /** * @description The kind of personal data found in a column. Nine values are accepted: * * - `account_number` * - `other` * - `private_address` * - `private_date` * - `private_email` * - `private_person` * - `private_phone` * - `private_url` * - `secret` * * The privacy model produces every one of them except `other`, which is for a redaction you upload * yourself when none of the other eight fit. * * On write, a value outside that list is rejected with a 400 that names the value it refused and * lists all nine that are accepted. * * Both read endpoints answer 500 for a stored `category` this API can't read, rather than * reporting or masking by something nobody wrote. * @example private_email * @enum {string} */ PersonalDataCategory: "account_number" | "other" | "private_address" | "private_date" | "private_email" | "private_person" | "private_phone" | "private_url" | "secret"; /** * @description How a column's value is masked. Seven variants, each a JSON object tagged with `type`: * * - `keep_email_domain`: keeps the domain, plus the local part's first and last two characters * (or just its first character when the local part is two to four characters long, and nothing * at all when it is one character). A value with no `@`, or one that starts with `@` and so has * no local part, is masked completely, domain included: `@example.com` masks to `************`. * - `keep_initials`: replaces each whitespace-separated token with its first letter and three mask * characters, whatever the token's length, so `John Doe` becomes `J*** D***`. * - `keep_network_prefix`: keeps an IPv4 address's `/24` and masks the rest. Anything else, IPv6 * included, is masked completely. * - `keep_two_decimal_places`: rounds a coordinate to two decimal places. A value that isn't a * coordinate is masked completely. * - `keep_year`: returns the first four-digit run in the value and drops the rest, so `1985-03-12` * becomes `1985`. A value with no four-digit run is masked completely. * - `keep_last_digits`: keeps the last `count` digits, masks every other letter and digit, and * leaves separators alone so the value's shape survives. When the value has no other letter or * digit to mask it keeps one digit fewer, so `1234` with `count: 4` masks to `*234`. * - `mask_everything`: keeps nothing. * * On write, an unrecognised `type` is rejected with a 400 and nothing is stored. The 400 names the * column it refused, the value it didn't recognise, and all seven types it accepts. Accepting the * typo and masking some other way instead would be worse than refusing: someone who typed * `keep_emial_domain` would believe the domain was being kept, see fully-masked values, and get * nothing telling them the strategy they asked for wasn't the one in use. * * Both read endpoints answer 500 for a stored `masking_strategy` this API can't read, rather than * naming a strategy nobody wrote or masking by one. That 500 carries a `log_id` and not the column * that failed, so quote it when you report the failure. * @example { * "type": "keep_email_domain" * } */ MaskingStrategy: { /** @enum {string} */ type: "keep_email_domain"; } | { /** @enum {string} */ type: "keep_initials"; } | { /** @enum {string} */ type: "keep_network_prefix"; } | { /** @enum {string} */ type: "keep_two_decimal_places"; } | { /** @enum {string} */ type: "keep_year"; } | { /** @enum {string} */ type: "mask_everything"; } | { /** @enum {string} */ type: "keep_last_digits"; /** @description How many trailing digits survive. PCI practice keeps 4. */ count: number; }; /** * @description One column of the sample, the kind of personal data it holds, and how it is masked. The category * does not constrain the strategy: a redaction you upload can pair any category with any strategy. * @example { * "path": "email_address", * "category": "private_email", * "masking_strategy": { * "type": "keep_email_domain" * } * } */ RedactedColumn: { /** * @description Dot-separated path to the column in the sample, e.g. `email_address` or * `payment.card_number`. A path that doesn't resolve in a row leaves that row untouched, so a * redaction naming a since-renamed column quietly stops masking it. * @example email_address */ path: string; /** * @description Optional on a redaction you upload: send `null` or leave the key out for a column you don't * want to classify. The privacy model sets it on the redactions it writes. Nothing masks by the * category, only by `masking_strategy`, which is why the category may be left out and the * strategy may not. A stored redaction always returns the key, `null` for a column with no * category. */ category?: components["schemas"]["PersonalDataCategory"] | null; masking_strategy: components["schemas"]["MaskingStrategy"]; }; /** * @description Who was authenticated when the redaction was written, taken from the access token rather than * from anything the caller sent. One variant per kind of grant a token can carry, each tagged with * `type`: * * - `user_resource_owner`: a token issued directly to a user of a company. * - `app_installation`: a token issued to an app a company installed. `user_id` is null when the * app issued itself the token rather than acting for a user. * - `app_client_credentials`: a token issued to an app on its own credentials, which carries no * user and no company. * @example { * "type": "user_resource_owner", * "user_id": 4711, * "company_id": 42 * } */ RedactionWriter: { /** @enum {string} */ type: "user_resource_owner"; /** @description The user the access token was issued to. */ user_id: number; /** @description The company that user belongs to. */ company_id: number; } | { /** @enum {string} */ type: "app_installation"; /** @description The user the app was acting for, or null when the app issued itself the token. */ user_id: number | null; /** @description The company that installed the app. */ company_id: number; /** @description The installed app. */ app_id: number; /** @description That app's installation the token was issued against. */ installation_id: number; } | { /** @enum {string} */ type: "app_client_credentials"; /** @description The app the access token was issued to. */ app_id: number; }; /** * @description The stored redaction for one dataset's sample. * @example { * "dataset_id": 1234, * "columns": [ * { * "path": "email_address", * "category": "private_email", * "masking_strategy": { * "type": "keep_email_domain" * } * }, * { * "path": "payment.card_number", * "category": "account_number", * "masking_strategy": { * "type": "keep_last_digits", * "count": 4 * } * } * ], * "written_by": { * "type": "app_installation", * "user_id": null, * "company_id": 42, * "app_id": 8, * "installation_id": 17 * }, * "model_version": "openai/privacy-filter", * "created_at": "2026-07-30T18:04:11Z", * "updated_at": "2026-07-30T18:04:11Z" * } */ SampleRedaction: { /** @description The dataset this redaction belongs to. */ dataset_id: number; /** @description One entry per column that holds personal data. */ columns: components["schemas"]["RedactedColumn"][]; written_by: components["schemas"]["RedactionWriter"]; /** * @description The privacy model that produced the redaction, named by the model repository the worker * loaded. A deployment can point the worker at a different repository, so read the value rather * than expecting a fixed one. * * Null on a redaction you uploaded yourself: `PUT /datasets/{dataset_id}/redaction` refuses this * field from any caller but Narrative, and an upload that leaves it out clears a stored value. */ model_version: string | null; /** * Format: date-time * @description When the dataset's first redaction was written. Survives later uploads. */ created_at: string; /** * Format: date-time * @description When the redaction was last written or deleted. */ updated_at: string; }; /** * @description Body of `PUT /datasets/{dataset_id}/redaction`. The stored redaction's `written_by` comes from * your access token, and `dataset_id`, `created_at` and `updated_at` are ignored. * @example { * "columns": [ * { * "path": "email_address", * "category": "private_email", * "masking_strategy": { * "type": "keep_email_domain" * } * }, * { * "path": "payment.card_number", * "category": "account_number", * "masking_strategy": { * "type": "keep_last_digits", * "count": 4 * } * }, * { * "path": "notes", * "category": null, * "masking_strategy": { * "type": "mask_everything" * } * } * ] * } */ UploadRedactionRequest: { /** * @description One entry per column that holds personal data. An array longer than `maxItems` is rejected with * a 400 and nothing is stored. */ columns: components["schemas"]["RedactedColumn"][]; /** * @description The privacy model that produced these columns. Only Narrative may set it: a caller with admin * access on datasets may send it, and any other caller is refused with a 400. Leaving the field * out clears a value already stored. */ model_version?: string | null; }; /** * @example { * "snapshot_id": 1111111111111111200, * "snapshot_created_at": "2021-06-24T00:54:40.029056Z", * "est_total_dataset_stored_files": 999, * "est_total_dataset_stored_records": 9999, * "est_total_dataset_stored_bytes": 999999, * "active_dataset_stored_files": 999, * "active_dataset_stored_records": 9999, * "active_dataset_stored_bytes": 999999, * "snapshot_added_files": 9, * "snapshot_added_records": 999, * "snapshot_deleted_records": 9, * "snapshot_added_bytes": 9999, * "snapshot_deleted_files": 9, * "snapshot_added_delete_files": 9, * "snapshot_removed_delete_files": 9, * "snapshot_removed_bytes": 9 * } */ DatasetSummaryResponse: { /** @description The ID of a snapshot of the dataset. A new snapshot is generated whenever data is uploaded to the dataset. The most recent snapshot represents the state of the dataset that is used in data shops transactions. */ snapshot_id: number; /** * Format: date-time * @description When the snapshot was created. */ snapshot_created_at: string; est_total_dataset_stored_files: components["schemas"]["EstTotalDatasetStoredFiles"]; est_total_dataset_stored_records: components["schemas"]["EstTotalDatasetStoredRecords"]; est_total_dataset_stored_bytes: components["schemas"]["EstTotalDatasetStoredBytes"]; active_dataset_stored_files: components["schemas"]["ActiveDatasetStoredFiles"]; active_dataset_stored_records: components["schemas"]["ActiveDatasetStoredRecords"]; active_dataset_stored_bytes: components["schemas"]["ActiveDatasetStoredBytes"]; snapshot_added_files: components["schemas"]["SnapshotAddedFiles"]; snapshot_added_records: components["schemas"]["SnapshotAddedRecords"]; snapshot_deleted_records: components["schemas"]["SnapshotDeletedRecords"]; snapshot_added_bytes: components["schemas"]["SnapshotAddedBytes"]; snapshot_deleted_files: components["schemas"]["SnapshotDeletedFiles"]; snapshot_added_delete_files: components["schemas"]["SnapshotAddedDeleteFiles"]; snapshot_removed_delete_files: components["schemas"]["SnapshotRemovedDeleteFiles"]; snapshot_removed_bytes: components["schemas"]["SnapshotRemovedBytes"]; }; /** * @example { * "dataset_id": 1, * "records": [ * { * "snapshot_id": 1111111111111111200, * "snapshot_created_at": "2021-06-24T00:54:40.029056Z", * "est_total_dataset_stored_files": 999, * "est_total_dataset_stored_records": 9999, * "est_total_dataset_stored_bytes": 999999, * "active_dataset_stored_files": 999, * "active_dataset_stored_records": 9999, * "active_dataset_stored_bytes": 999999, * "snapshot_added_files": 9, * "snapshot_added_records": 999, * "snapshot_deleted_records": 9, * "snapshot_added_bytes": 9999, * "snapshot_deleted_files": 9, * "snapshot_added_delete_files": 9, * "snapshot_removed_delete_files": 9, * "snapshot_removed_bytes": 9 * } * ] * } */ DatasetSummariesResponse: { /** @description A valid existing active dataset id */ dataset_id: number; records: components["schemas"]["DatasetSummaryResponse"][]; }; Columns: { columns: string[]; }; /** * @example { * "value_histogram": { * "columns": [ * "firstName", * "secondName", * "firstChars", * "age" * ] * }, * "completeness": { * "columns": [ * "firstName", * "secondName", * "firstChars", * "age" * ] * }, * "approx_count_distinct": { * "columns": [ * "firstChars", * "age" * ] * }, * "count_distinct": { * "columns": [ * "firstName", * "secondName" * ] * }, * "observed_types_histogram": { * "columns": [ * "firstName" * ] * }, * "mean": { * "columns": [ * "age" * ] * }, * "deviation": { * "columns": [ * "age" * ] * } * } */ Configuration: { value_histogram: components["schemas"]["Columns"]; completeness: components["schemas"]["Columns"]; approx_count_distinct: components["schemas"]["Columns"]; count_distinct: components["schemas"]["Columns"]; observed_types_histogram: components["schemas"]["Columns"]; mean: components["schemas"]["Columns"]; deviation: components["schemas"]["Columns"]; }; SnapshotRange: { /** @description The first snapshot from calculation range. */ from_snapshot: string; /** @description The last snapshot from calculation range. */ until_snapshot: string; /** * Format: date-time * @description Timestamp of from_snapshot. */ from_snapshot_timestamp: string; /** * Format: date-time * @description Timestamp of until_snapshot. */ until_snapshot_timestamp: string; }; /** * @example { * "snapshot_range": null, * "configuration": { * "value_histogram": { * "columns": [ * "firstName", * "secondName", * "firstChars", * "age" * ] * }, * "completeness": { * "columns": [ * "firstName", * "secondName", * "firstChars", * "age" * ] * }, * "approx_count_distinct": { * "columns": [ * "firstChars", * "age" * ] * }, * "count_distinct": { * "columns": [ * "firstName", * "secondName" * ] * }, * "observed_types_histogram": { * "columns": [ * "firstName" * ] * }, * "mean": { * "columns": [ * "age" * ] * }, * "deviation": { * "columns": [ * "age" * ] * } * } * } */ AdvancedStatisticsMetadata: { configuration: components["schemas"]["Configuration"]; /** @description The snapshots the statistics were computed over. Null when they were uploaded rather than computed. */ snapshot_range?: components["schemas"]["SnapshotRange"] | null; }; /** * @description Every statistic is null when it is unknown for the column. * @example { * "nan_value_count": 0, * "null_value_count": 0, * "lower_bound": 0.10002140801691319, * "upper_bound": 3.73687073431858, * "value_count": 9876, * "column_store_bytes": 12345 * } */ BasicStatistics: { /** @description The number of not-a-number values in the column. */ nan_value_count?: number | null; /** @description The number of null values in the column. */ null_value_count?: number | null; /** @description The total number of values in the column including null and not-a-number values. */ value_count?: number | null; /** @description Lower bound of values in the column. */ lower_bound?: string | number | (string | number)[] | boolean | Record | null; /** @description Upper bound of values in the column. */ upper_bound?: string | number | (string | number)[] | boolean | Record | null; /** @description The storage size in bytes used by this column. */ column_store_bytes?: number | null; }; DistributionValue: { /** Format: int64 */ absolute?: number; /** Format: double */ ratio?: number; }; Distribution: { values?: { [key: string]: components["schemas"]["DistributionValue"]; }; /** Format: int64 */ number_of_bins?: number; }; /** @description Every statistic is null when it was not computed for the column. */ AdvancedStatistics: { /** Format: int64 */ approx_count_distinct?: number | null; /** Format: int64 */ count_distinct?: number | null; histogram?: components["schemas"]["Distribution"] | null; /** Format: double */ mean?: number | null; /** Format: double */ standard_deviation?: number | null; /** Format: double */ completeness?: number | null; observed_types?: components["schemas"]["Distribution"] | null; }; /** * @example { * "name": "age", * "type": "LONG", * "basic_statistics": { * "nan_value_count": null, * "null_value_count": 0, * "lower_bound": 22, * "upper_bound": 52, * "value_count": 60, * "column_store_bytes": 655 * }, * "advanced_statistics": { * "approx_count_distinct": 13, * "count_distinct": null, * "histogram": { * "values": { * "22": { * "absolute": 3, * "ratio": 0.0667 * }, * "25": { * "absolute": 3, * "ratio": 0.0667 * }, * "28": { * "absolute": 9, * "ratio": 0.2 * }, * "31": { * "absolute": 3, * "ratio": 0.0667 * }, * "32": { * "absolute": 3, * "ratio": 0.0667 * }, * "34": { * "absolute": 3, * "ratio": 0.0667 * }, * "36": { * "absolute": 3, * "ratio": 0.0667 * }, * "39": { * "absolute": 3, * "ratio": 0.0667 * }, * "40": { * "absolute": 3, * "ratio": 0.0667 * }, * "45": { * "absolute": 3, * "ratio": 0.0667 * }, * "47": { * "absolute": 3, * "ratio": 0.0667 * }, * "50": { * "absolute": 3, * "ratio": 0.0667 * }, * "52": { * "absolute": 3, * "ratio": 0.0667 * } * }, * "number_of_bins": 13 * }, * "mean": 35.8, * "standard_deviation": 9.064215354899726, * "completeness": 1, * "observed_types": null * } * } */ SingleColumnSummary: { /** @description The name of the column. */ name: string; /** @description The declared type of data in the column. Can be boolean, int, long, float, double, decimal, date, time, timestamp, timestamptz, string, uuid, fixed, binary, struct, list, and map. */ type: string; basic_statistics: components["schemas"]["BasicStatistics"]; /** @description Null when no advanced statistics were computed for the column. */ advanced_statistics?: components["schemas"]["AdvancedStatistics"] | null; }; GetColumnStatsResponse: { /** @description How the advanced statistics were computed. Null when none were. */ advanced_statistics_metadata?: components["schemas"]["AdvancedStatisticsMetadata"] | null; columns_summary: components["schemas"]["SingleColumnSummary"][]; }; /** * @example { * "records": [ * { * "column_name": "idType", * "approx_count_distinct": 2, * "count_distinct": null, * "histogram": { * "values": { * "adid": { * "absolute": 2, * "ratio": 0.5 * }, * "idfa": { * "absolute": 2, * "ratio": 0.5 * } * }, * "number_of_bins": 2 * }, * "mean": null, * "standard_deviation": null, * "completeness": null, * "observed_types": null * }, * { * "column_name": "idValue", * "approx_count_distinct": 20000, * "count_distinct": null, * "histogram": null, * "mean": null, * "standard_deviation": null, * "completeness": null, * "observed_types": null * } * ] * } */ UpsertColumnStatsRequest: { /** * Format: int64 * @description Total row count the statistics were computed over. Null when the caller does not know it. */ total_rows?: number | null; records?: { column_name: string; /** Format: int64 */ approx_count_distinct?: number | null; /** Format: int64 */ count_distinct?: number | null; histogram?: components["schemas"]["Distribution"] | null; /** Format: double */ mean?: number | null; /** Format: double */ standard_deviation?: number | null; /** Format: double */ completeness?: number | null; observed_types?: components["schemas"]["Distribution"] | null; }[]; }; /** * @example { * "recalculation_id": "a81e1460-fbdc-4204-bd76-a9e496bf760d", * "snapshots": [ * "4396758588236543" * ], * "from_snapshot_timestamp": "2023-06-28T19:47:36.604706Z", * "until_snapshot_timestamp": "2023-06-28T19:47:36.604709Z" * } */ RecalculationResponse: { /** * Format: uuid * @description Unique recalculation id, or the id of the job doing the recalculation. Null when nothing needs recalculating. */ recalculation_id?: string | null; /** @description List of snapshots that should be included into statistics. */ snapshots: string[]; /** * Format: date-time * @description Timestamp of the first snapshot from the range. Null when the recalculation runs as a job. */ from_snapshot_timestamp?: string | null; /** * Format: date-time * @description Timestamp of the last snapshot from the range. Null when the recalculation runs as a job. */ until_snapshot_timestamp?: string | null; }; SingleColumnStatistics: { column_name: string; /** Format: int64 */ approx_count_distinct?: number | null; /** Format: int64 */ count_distinct?: number | null; histogram?: components["schemas"]["Distribution"] | null; /** Format: double */ mean?: number | null; /** Format: double */ standard_deviation?: number | null; /** Format: double */ completeness?: number | null; observed_types?: components["schemas"]["Distribution"] | null; }; /** @description Per-column statistics for a snapshot. */ AllColumnsStatistics: components["schemas"]["SingleColumnStatistics"][]; /** * @example { * "source_file": "/2021-12-01/example.csv" * } */ FileIngestionRequest: { /** * @description The file to be ingested. * * This must be equal to the `upload_path` passed to the `upload` API when the file was submitted to Narrative. */ source_file: string; }; /** * @example { * "token": "eyJhbGciOiJIUzI1NiJ9.eyJjb21wYW55X2lkIjoxLCJkYXRhc2V0X2lkIjoyNjR9.5aQbJ0e6hVfWZQwXk1Qd0yQqf5s4b7t2r3c4d5e6f7g" * } */ IngestionTokenResponse: { /** @description A signed JWT that authorizes uploads into the dataset. Expires two days after issue. */ token: string; }; /** * @example { * "name": "00000-357-27b8ca02-1c02-4761-85e5-5df9694015da-00001.parquet" * } */ FileAdded: { name?: string; }; /** * @example [ * { * "name": "00000-357-27b8ca02-1c02-4761-85e5-5df9694015da-00001.parquet" * }, * { * "name": "00000-357-27b8ca02-1c02-4761-85e5-5df9694015da-00002.parquet" * } * ] */ FilesAdded: components["schemas"]["FileAdded"][]; AddedPaths: { /** @description A list of added files. */ added: string[]; }; /** * @example { * "snapshot_id": 1, * "timestamp": "2023-02-02T14:11:43.324", * "is_downloadable": true, * "files": { * "added": [ * "s3://some-bucket/file1.parquet" * ] * }, * "operation": "append" * } */ AppendSnapshotMetadata: { /** @description Unique identifier for a snapshot. */ snapshot_id: number; /** @description ISO-8601 timestamp of Snapshot */ timestamp: string; files: components["schemas"]["AddedPaths"]; /** @enum {string} */ operation?: "append"; /** @description Whether the files in the snapshot are downloadable. Files older than 30 days are not downloadable. */ is_downloadable: boolean; }; DeletedPaths: { /** @description A list of deleted files. */ deleted: string[]; }; /** * @example { * "snapshot_id": 1, * "timestamp": "2023-02-02T14:11:43.324", * "is_downloadable": true, * "files": { * "deleted": [ * "s3://some-bucket/file1.parquet" * ] * }, * "operation": "delete" * } */ DeleteSnapshotMetadata: { /** @description Unique identifier for a snapshot. */ snapshot_id: number; /** @description ISO-8601 timestamp of Snapshot */ timestamp: string; files: components["schemas"]["DeletedPaths"]; /** @enum {string} */ operation?: "delete"; /** @description Whether the files in the snapshot are downloadable. Files belonging to snapshots that are older than 30 days are not downloadable */ is_downloadable: boolean; }; AddedAndDeletedPaths: { /** @description A list of added files. */ added: string[]; /** @description A list of deleted files. */ deleted: string[]; }; /** * @example { * "snapshot_id": 1, * "timestamp": "2023-02-02T14:11:43.324", * "is_downloadable": true, * "files": { * "added": [ * "s3://some-bucket/file3.parquet" * ], * "deleted": [ * "s3://some-bucket/file4.parquet" * ] * }, * "operation": "overwrite" * } */ RewriteSnapshotMetadata: { /** @description Unique identifier for a snapshot. */ snapshot_id: number; /** @description ISO-8601 timestamp of Snapshot */ timestamp: string; files: components["schemas"]["AddedAndDeletedPaths"]; /** @enum {string} */ operation?: "overwrite"; /** @description Whether the files in the snapshot are downloadable. Files belonging to snapshots that are older than 30 days are not downloadable */ is_downloadable: boolean; }; /** * @example { * "snapshot_id": 1, * "timestamp": "2023-02-02T14:11:43.324", * "is_downloadable": true, * "files": { * "added": [ * "s3://some-bucket/file2.parquet" * ], * "deleted": [ * "s3://some-bucket/file1.parquet" * ] * }, * "operation": "replace" * } */ ReplaceSnapshotMetadata: { /** @description Unique identifier for a snapshot. */ snapshot_id: number; /** @description ISO-8601 timestamp of Snapshot */ timestamp: string; files: components["schemas"]["AddedAndDeletedPaths"]; /** @enum {string} */ operation?: "replace"; /** @description Whether the files in the snapshot are downloadable. Files belonging to snapshots that are older than 30 days are not downloadable */ is_downloadable: boolean; }; SnapshotMetadata: components["schemas"]["AppendSnapshotMetadata"] | components["schemas"]["DeleteSnapshotMetadata"] | components["schemas"]["RewriteSnapshotMetadata"] | components["schemas"]["ReplaceSnapshotMetadata"]; DetailedSnapshotListResponse: { snapshots: components["schemas"]["SnapshotMetadata"][]; /** @description Pagination-related flag that shows if there are more snapshots to query. */ has_next: boolean; /** * Format: int64 * @description The id of the snapshot that could be used as search parameter to get next page, or null on the last page. Unlike 'offset', guarantees no 'floating pages' issues */ next_snapshot?: number | null; }; SnapshotStatistics: { /** @description The dataset snapshot these statistics were computed from. */ snapshot_id: string; metrics: components["schemas"]["AllColumnsStatistics"]; }; DatasetStatistics: { /** * @description Snapshot id to pass as `until_snapshot` to fetch the next page of older snapshots. Null when * there are no further pages. */ previous?: string | null; /** @description Statistics for each snapshot on this page. */ statistics: components["schemas"]["SnapshotStatistics"][]; }; /** * @example { * "value_histogram": { * "columns": [ * "str_value" * ] * }, * "completeness": { * "columns": [ * "n_value" * ] * }, * "approx_count_distinct": { * "columns": [ * "str_value" * ] * }, * "count_distinct": { * "columns": [ * "str_value" * ] * }, * "observed_types_histogram": { * "columns": [ * "str_value" * ] * }, * "mean": { * "columns": [ * "n_value" * ] * }, * "deviation": { * "columns": [ * "n_value" * ] * }, * "version": 1, * "disabled": false * } */ GetMetricConfigResponse: { value_histogram: components["schemas"]["Columns"]; completeness: components["schemas"]["Columns"]; approx_count_distinct: components["schemas"]["Columns"]; count_distinct: components["schemas"]["Columns"]; observed_types_histogram: components["schemas"]["Columns"]; mean: components["schemas"]["Columns"]; deviation: components["schemas"]["Columns"]; /** Format: int32 */ version: number; disabled: boolean; }; PutMetricConfigRequest: { value_histogram: components["schemas"]["Columns"]; completeness: components["schemas"]["Columns"]; approx_count_distinct: components["schemas"]["Columns"]; count_distinct: components["schemas"]["Columns"]; observed_types_histogram: components["schemas"]["Columns"]; mean: components["schemas"]["Columns"]; deviation: components["schemas"]["Columns"]; }; PutMetricConfigResponse: { /** Format: uuid */ stream_id: string; /** Format: uuid */ version_id: string; }; /** * Format: uuid * @description The id of a metrics configuration stream. Sent as a bare JSON string, not wrapped in an object. * @example 0f9c2b7e-2a4d-4c1e-9b7a-3e5f6a7b8c9d */ MetricConfigStreamId: string; /** * @description Identifier for a supported statistic. * @enum {string} */ StatName: "value_count" | "null_value_count" | "nan_value_count" | "lower_bound" | "upper_bound" | "approx_count_distinct" | "count_distinct" | "histogram" | "mean" | "standard_deviation" | "completeness"; /** * @description Statistics to compute. An empty array explicitly disables all stats for this scope. Server filters type-incompatible stats. * * Null and an empty array are different: null means this level says nothing about the stat set and inherits it, `[]` means compute nothing here. The encoder writes null for every slot the config does not use, so a node that selects stats through `self`/`properties`/`items` carries `"enabled_stats": null` rather than omitting the key. */ EnabledStats: components["schemas"]["StatName"][] | null; /** @description Tuning parameters for the histogram statistic. Each property is independently optional and follows per-property inheritance: when a child scope provides histogram options, only the properties it explicitly sets are overridden. Unspecified properties keep the value resolved from the parent level (namespace scope, defaults, or server defaults of max_bins=50 and overflow=none). */ HistogramOptions: { /** * @description Maximum number of bins in the frequency distribution. * @default 50 */ max_bins: number; /** * @description Behavior when cardinality exceeds max_bins. 'none' (default): skip the histogram entirely. 'truncate': keep the top N-1 bins by frequency and roll everything else into an 'Other Values' bin. * @default none * @enum {string} */ overflow: "none" | "truncate"; }; /** * @description Per-stat tuning parameters. Extensible as new stat options are introduced. Null means this level sets no options and inherits them. * * ## Histogram options and enabled_stats interaction * Histogram options (`stat_options.histogram`) require that the `histogram` stat is present in the **resolved** stat set. There are exactly two valid ways to provide histogram options: * 1. **With enabled_stats that includes `histogram`** — the stat set is explicit, and options * tune the histogram directly. * Example: `{ "enabled_stats": ["value_count", "histogram"], "stat_options": { "histogram": { "max_bins": 200 } } }` * * 2. **Without enabled_stats (stat_options only)** — the stat set is inherited from the parent * level (namespace scope → defaults). The parent's stat set **must** include `histogram`; * otherwise the server rejects the request with a validation error. * Example: defaults enable `histogram`. A field provides only * `{ "stat_options": { "histogram": { "max_bins": 500 } } }` — valid because `histogram` * is inherited from defaults. * * Providing histogram options when `enabled_stats` is present but does **not** include `histogram` is always an error — there is no implicit enabling of stats via options. * * ## Per-property inheritance within stat_options * When stat_options is provided without enabled_stats (at scope, field, or nested levels), the stat set is inherited from the parent level and only the specified option properties are overridden. Individual option properties not explicitly set retain their value from the **resolved parent** — not from server defaults. For example, if scope overrides `max_bins` to 200 and a field provides only `overflow: truncate`, the field gets `max_bins: 200` from scope (not the server default of 50) and `overflow: truncate` from its own override. */ StatOptions: { histogram?: components["schemas"]["HistogramOptions"]; } | null; /** @description A stat selection with optional per-stat configuration. At least one of enabled_stats or stat_options must be provided. An empty enabled_stats array explicitly disables all stats for this scope. approx_count_distinct and count_distinct are mutually exclusive — the server rejects any request that includes both in the same enabled_stats array. */ StatConfig: { enabled_stats?: components["schemas"]["EnabledStats"]; stat_options?: components["schemas"]["StatOptions"]; } | { enabled_stats: unknown; } | { stat_options: unknown; }; /** @description Recompute statistics on a cron schedule. Supported on all data planes. */ CronRefresh: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ trigger: "CronRefresh"; /** * @description A standard 5-field cron expression defining the refresh schedule. All times are interpreted in UTC. * * ## Format * * ``` ┌───────────── minute (0–59) │ ┌───────────── hour (0–23) │ │ ┌───────────── day of month (1–31) │ │ │ ┌───────────── month (1–12) │ │ │ │ ┌───────────── day of week (0–7, where 0 and 7 = Sunday) │ │ │ │ │ * * * * * ``` * * ## Supported syntax * * - `*` — every value in the field's range * - `,` — list separator (e.g. `1,15` for the 1st and 15th) * - `-` — range (e.g. `1-5` for Monday through Friday) * - `/` — step (e.g. `*\/15` in the minute field = every 15 minutes) * - `?` — unspecified, allowed in day-of-month and day-of-week * - `L` — last day, allowed in day-of-month (last day of month) and day-of-week (`5L` = last Friday) * - `W` — nearest weekday, allowed in day-of-month (e.g. `15W` = nearest weekday to the 15th) * - `LW` — last weekday of the month, allowed in day-of-month * - `#` — nth occurrence, allowed in day-of-week (e.g. `5#3` = third Friday) * - Nicknames: `@yearly`, `@annually`, `@monthly`, `@weekly`, `@daily`, `@midnight`, `@hourly` * * ## Day-of-week numbering * * Monday = 1 through Saturday = 6, Sunday = 0 or 7. Both `0` and `7` map to Sunday. * * ## Examples * * | Expression | Meaning | |-------------------|----------------------------------------| | `0 0 * * *` | Every day at midnight UTC | | `0 3 * * 1` | Every Monday at 03:00 UTC | | `*\/15 * * * *` | Every 15 minutes | | `0 0 1 * *` | First day of every month at midnight | | `0 6 * * 1-5` | Weekdays at 06:00 UTC | | `0 0 L * ?` | Last day of every month at midnight | | `0 9 ? * 5#1` | First Friday of every month at 09:00 | | `@daily` | Equivalent to `0 0 * * *` | */ cron_expression: string; }; /** @description Recompute statistics whenever dataset data is updated (new snapshot ingested, data modified, etc.). */ OnUpdateRefresh: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ trigger: "OnUpdateRefresh"; }; /** @description Statistics are only computed on demand. No automatic refresh. */ ManualRefresh: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ trigger: "ManualRefresh"; }; /** @description A valid identifier: alphanumeric characters and underscores only, max 256 characters. */ IdentifierPattern: string; /** @description Statistics configuration for a named property of an object node. The property may itself be primitive or non-primitive (recursive). A property must carry at least one configuration field — there is no no-op/inherited variant at the nested level. If a property is listed, it must specify what stats to compute. approx_count_distinct and count_distinct are mutually exclusive — the server rejects any request that includes both in the same enabled_stats array. */ NestedPropertyConfig: { /** @description Name of the child property relative to the parent object node. Must be a valid identifier (alphanumeric and underscores, max 256 chars). */ path: components["schemas"]["IdentifierPattern"]; enabled_stats?: components["schemas"]["EnabledStats"]; stat_options?: components["schemas"]["StatOptions"]; /** @description Statistics for the non-primitive property node itself (the struct/array column). Only `null_value_count` is currently supported — other stats are rejected. Use this to count rows where the entire container value is NULL. */ self?: components["schemas"]["StatConfig"] | null; /** @description Explicit configurations for named child properties of this object property. Only listed children receive stats — unlisted ones are skipped entirely. */ properties?: components["schemas"]["NestedPropertyConfig"][] | null; /** @description Configuration for the array item node of this array property. */ items?: components["schemas"]["NestedNodeConfig"] | null; } & (({ self?: null; properties?: null; items?: null; } | { enabled_stats: unknown; } | { stat_options: unknown; }) | ({ enabled_stats?: null; stat_options?: null; } | { self: unknown; } | { properties: unknown; } | { items: unknown; })); /** * @description Recursive statistics configuration for a nested node. Primitive nodes use flat enabled_stats/stat_options. Non-primitive nodes use self for node-level stats, properties for object children, and items for array elements. approx_count_distinct and count_distinct are mutually exclusive — the server rejects any request that includes both in the same enabled_stats array. * * The two modes are told apart by which slots are non-null, not by which keys are present. The encoder writes all five keys on every node and nulls the ones the mode does not use, so presence alone does not distinguish them. */ NestedNodeConfig: { enabled_stats?: components["schemas"]["EnabledStats"]; stat_options?: components["schemas"]["StatOptions"]; /** @description Statistics for the non-primitive node itself (the struct/array column). Only `null_value_count` is currently supported — other stats are rejected. Use this to count rows where the entire container value is NULL. */ self?: components["schemas"]["StatConfig"] | null; /** @description Explicit configurations for named child properties of an object node. Only properties listed here receive stats — unlisted children are skipped entirely (they do NOT inherit from any parent level). This is by design: stat selection for struct children is opt-in, not opt-out. */ properties?: components["schemas"]["NestedPropertyConfig"][] | null; /** @description Configuration for the array item node. */ items?: components["schemas"]["NestedNodeConfig"] | null; } & (({ self?: null; properties?: null; items?: null; } | { enabled_stats: unknown; } | { stat_options: unknown; }) | ({ enabled_stats?: null; stat_options?: null; } | { self: unknown; } | { properties: unknown; } | { items: unknown; })); /** * @description Common stat configuration shared by dataset and Rosetta Stone field configs. Exactly one of three modes must be used (the server rejects invalid combinations): * * 1. **Primitive field** — provide enabled_stats and/or stat_options at the top level. * Must not include self, properties, or items. * * 2. **Non-primitive field** — provide self, properties, and/or items for nested structure. * Must not include enabled_stats or stat_options at this level; * use self for node-level stat configuration instead. * * 3. **No-op / inherit** — leave all stat fields null or absent. The field inherits its * configuration from the namespace scope or global defaults. * * * This schema deliberately has no `oneOf` over the three modes. Mode 3 is all five slots null, which matches neither of the other two, so a closed union here would reject it. * Closing this schema is left to the two that compose it. `additionalProperties: false` here would only see the properties below, so it would reject the `field_name` and `attribute_name` its siblings contribute; `DatasetFieldConfig` and `RosettaStoneFieldConfig` use `unevaluatedProperties: false`, which sees the whole composition. */ FieldConfigBase: { enabled_stats?: components["schemas"]["EnabledStats"]; stat_options?: components["schemas"]["StatOptions"]; /** @description Statistics for the non-primitive field node itself (the struct/array column). Only `null_value_count` is currently supported — other stats are rejected. Use this to count rows where the entire container value is NULL. */ self?: components["schemas"]["StatConfig"] | null; /** @description Explicit configurations for named child properties of an object field. Only listed children receive stats — unlisted ones are skipped entirely. */ properties?: components["schemas"]["NestedPropertyConfig"][] | null; /** @description Configuration for the array item node. */ items?: components["schemas"]["NestedNodeConfig"] | null; }; DatasetFieldConfig: components["schemas"]["FieldConfigBase"] & { /** @description The column name as defined in the dataset schema. Must be a valid identifier (alphanumeric and underscores, max 256 chars). */ field_name: components["schemas"]["IdentifierPattern"]; }; /** @description Namespace configuration for dataset schema columns. Set scope.enabled_stats to [] to disable stats for all dataset fields. At least one of scope or fields must be non-null. */ DatasetFieldNamespace: { scope?: components["schemas"]["StatConfig"] | null; /** @description Per-field overrides for individual dataset columns. */ fields?: components["schemas"]["DatasetFieldConfig"][] | null; } | { scope: unknown; } | { fields: unknown; }; RosettaStoneFieldConfig: components["schemas"]["FieldConfigBase"] & { /** @description The Rosetta Stone attribute name (e.g. 'hl7_gender', 'unique_identifier'). Must be a valid identifier (alphanumeric and underscores, max 256 chars). */ attribute_name: components["schemas"]["IdentifierPattern"]; }; /** @description Namespace configuration for Rosetta Stone attributes. Set scope.enabled_stats to [] to disable stats for all Rosetta Stone fields. At least one of scope or fields must be non-null. */ RosettaStoneFieldNamespace: { scope?: components["schemas"]["StatConfig"] | null; /** @description Per-field overrides for individual Rosetta Stone attributes. */ fields?: components["schemas"]["RosettaStoneFieldConfig"][] | null; } | { scope: unknown; } | { fields: unknown; }; /** * @description Configuration payload for computing statistics on dataset fields and Rosetta Stone attributes. Supports recursive nesting for arbitrarily deep schemas. * * ## Inheritance chain * defaults → namespace scope → field override → nested node overrides. * * Two distinct inheritance rules apply depending on what is being configured: * * ### 1. Stat set (enabled_stats) — all-or-nothing per level * When a level provides `enabled_stats`, it **completely replaces** the parent's stat set. There is no merging: the child's list is the final set of stats for that scope. Properties not listed in a parent's `properties` array receive **no stats** — they are not inherited from any parent level. * Example: an object field `address` has children `city`, `zip`, and `state`. If the field config lists only `city` in `properties`, then `zip` and `state` get no stats at all, regardless of what defaults or scope say. * * ### 2. Stat options (stat_options) — partial override with per-property inheritance * When a level provides only `stat_options` (without `enabled_stats`), it inherits the stat set from its parent and applies option overrides on top. Individual option properties follow a granular rule: **only explicitly provided option properties are overridden; unspecified properties keep the value resolved from the parent level**. * Example: defaults enable `histogram` with `max_bins: 50, overflow: none`. A namespace scope provides `stat_options: { histogram: { max_bins: 200 } }` without `enabled_stats`. The resolved scope inherits the full stat set from defaults, and the histogram options become `max_bins: 200, overflow: none` — `overflow` was not overridden, so the parent's value (`none`) is preserved. * * ### Chained stat_options overrides across levels * Per-property inheritance applies at every level of the chain, and each level inherits from its **resolved parent** — not from the original defaults. This means overrides accumulate. * Example — scope overrides `max_bins`, field overrides `overflow`: * ```json { * "defaults": { * "enabled_stats": ["value_count", "histogram"], * "stat_options": { "histogram": { "max_bins": 50 } } * }, * "refresh": { "trigger": "manual" }, * "dataset": { * "scope": { * "stat_options": { "histogram": { "max_bins": 200 } } * }, * "fields": [ * { * "field_name": "price", * "stat_options": { "histogram": { "overflow": "truncate" } } * } * ] * } * } ``` * Resolution for `price`: * 1. **defaults** → `histogram(max_bins=50, overflow=none)` * 2. **scope** (stat_options only, inherits defaults) → `histogram(max_bins=200, overflow=none)` — * scope overrides `max_bins` to 200; `overflow` is not specified, so it keeps defaults' `none`. * * 3. **price field** (stat_options only, inherits resolved scope) → `histogram(max_bins=200, overflow=truncate)` — * field overrides `overflow` to `truncate`; `max_bins` is not specified, so it keeps scope's `200` (not * defaults' `50`). * * The key point: `price` gets `max_bins=200` from scope, not `max_bins=50` from defaults. Each level inherits from its immediate resolved parent, not from the root. * The same per-property inheritance applies at nested levels (object properties, array items). A deeply nested node that provides only `stat_options` inherits the stat set and unspecified option properties from the effective parent resolved at the namespace level (defaults + scope). */ DatasetStatisticsConfiguration: { /** @description Global default stat configuration applied to all eligible fields and properties. The server automatically filters stats incompatible with a field's resolved type and node kind. Note: enabled_stats is required for defaults because there is no parent scope to inherit from. Providing only stat_options without enabled_stats is invalid at this level. */ defaults: components["schemas"]["StatConfig"]; /** @description When to recompute statistics. Exactly one trigger type must be specified. */ refresh: components["schemas"]["CronRefresh"] | components["schemas"]["OnUpdateRefresh"] | components["schemas"]["ManualRefresh"]; /** @description Configuration for dataset schema columns. Use 'scope' to override defaults for all dataset fields, or to disable the namespace entirely via enabled_stats: []. Use 'fields' for per-field overrides. Null when the config does not touch this namespace. */ dataset?: components["schemas"]["DatasetFieldNamespace"] | null; /** @description Configuration for Rosetta Stone attributes. Use 'scope' to override defaults for all Rosetta Stone fields, or to disable the namespace entirely via enabled_stats: []. Use 'fields' for per-field overrides. Null when the config does not touch this namespace. */ rosetta_stone?: components["schemas"]["RosettaStoneFieldNamespace"] | null; }; /** @description Full statistics configuration entity with metadata. Returned by both PUT (create/update) and GET endpoints. */ StatisticsConfigurationResponse: { /** * Format: uuid * @description Unique identifier for this configuration version. */ id: string; /** * Format: int64 * @description The dataset this configuration belongs to. */ dataset_id: number; /** * Format: int32 * @description Monotonically increasing version number. */ version: number; /** * Format: date-time * @description Timestamp when this configuration version was created. */ created_at: string; /** * Format: int64 * @description User ID of the user who created this configuration version. */ created_by: number; /** @description The full statistics configuration payload. */ configuration: components["schemas"]["DatasetStatisticsConfiguration"]; }; SnapshotFile: { /** @description Appended file. */ path: string; /** @description Size of a file (in bytes). */ size: number; }; SnapshotFiles: { files: components["schemas"]["SnapshotFile"][]; /** @description Unique identifier for a snapshot. */ snapshot_id: string; /** @description ISO-8601 timestamp of Snapshot */ timestamp: string; /** @description Whether the files in the snapshot are downloadable. Files belonging to snapshots that are older than 30 days are not downloadable */ is_downloadable: boolean; }; DatasetFileListResponse: { files_per_snapshot: components["schemas"]["SnapshotFiles"][]; /** @description Pagination-related flag that shows if there are more snapshots to query. */ has_next: boolean; /** @description The id of the snapshot that could be used as search parameter to get next page. Unlike 'offset', guarantees no 'floating pages' issues. Null on the last page. */ next_snapshot: string | null; }; /** * @example { * "download_url": "https://narrative-datasets-dev.s3.amazonaws.com/datasets/companyId%3D1/datasetId%3D264/data/_nio_sample_128%3Dnull/countryCode_bucket%3D1/00000-357-27b8ba02-1c02-4761-85e5-5df9694015da-00001.parquet?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220627T164615Z&X-Amz-SignedHeaders=host&X-Amz-Expires=21599&X-Amz-Credential=REDACTED&X-Amz-Signature=REDACTED" * } */ DownloadUrl: { /** @description A pre-signed URL the file can be fetched from. It expires. */ download_url: string; }; /** * @example { * "error": "expired", * "error_description": "File has expired" * } */ FileExpired: { /** @enum {string} */ error?: "expired"; error_description?: string; }; ExecutionCluster: { type?: components["schemas"]["ExecutionClusterType"]; }; /** * @example { * "cron": "@hourly", * "cron_zone_id": "EST", * "stats_enabled": false, * "status": "active" * } */ UpdateMaterializedViewRefreshRequest: { /** @description cron expression "for example: @hourly, 0 12 * * 1-5" */ cron?: string; /** @description zone id where the cron should take place "for example: EST, GMT+2" */ cron_zone_id?: string; execution_cluster?: components["schemas"]["ExecutionCluster"]; /** @description if we need to enable advanced statistics calculation */ stats_enabled?: boolean; /** * @description active will be ran on cron schedule, pending and archived won't be run * @enum {string} */ status?: "active" | "pending" | "archived"; /** * Format: uuid * @description The ID of the compute pool to use for scheduled refreshes. The compute pool * must be active, belong to your company, and be associated with the target * data plane. */ compute_pool_id?: string; }; /** * @example { * "cron": "@hourly", * "cron_zone_id": "EST", * "stats_enabled": false, * "status": "active" * } */ CreateMaterializedViewRefreshRequest: { /** @description cron expression "for example: @hourly, 0 12 * * 1-5" */ cron: string; /** @description zone id where the cron should take place "for example: EST, GMT+2" */ cron_zone_id: string; execution_cluster?: components["schemas"]["ExecutionCluster"]; /** @description if we need to enable advanced statistics calculation */ stats_enabled?: boolean; /** * @description active will be ran on cron schedule, pending and archived won't be run * @enum {string} */ status?: "active" | "pending" | "archived"; /** * Format: uuid * @description The ID of the compute pool to use for scheduled refreshes. The compute pool * must be active, belong to your company, and be associated with the target * data plane. */ compute_pool_id?: string; }; /** * @example { * "type": "full", * "execution_cluster": { * "type": "dedicated" * } * } */ TriggerMaterializedViewRefresh: { /** * @description full will skip progress tracking and run the materialized view from scratch, incremental * will use the progress tracking. * @enum {string} */ type: "full" | "incremental"; execution_cluster?: components["schemas"]["ExecutionCluster"]; /** * Format: uuid * @description The ID of the compute pool to use for this refresh. The compute pool must be * active, belong to your company, and be associated with the target data plane. * If not specified, falls back to the compute pool configured on the refresh * schedule (if any). */ compute_pool_id?: string; }; Failure: { message?: string; /** Format: date-time */ timestamp?: string; /** @description useful information to diagnostic a failure such as a Apache Spark stacktrace */ value?: Record; }; RunResponseBase: { id: components["schemas"]["JobId"]; /** @description Company that ran the job. */ company_id: components["schemas"]["CompanyId"]; /** * Format: date-time * @description When the job finished, or null while it is still pending or running. */ completed_at?: string | null; /** * Format: date-time * @description The timestamp representing when the job was created. */ created_at: string; /** @description causes of job failure */ failures: components["schemas"]["Failure"][]; /** @description The unique ID associated with the job. */ idempotency_key: string; request_source: components["schemas"]["RequestSource"]; state: components["schemas"]["State"]; /** * Format: date-time * @description The timestamp representing when the job was updated. */ updated_at: string; }; /** * @description When `true`, a `CREATE MATERIALIZED VIEW` statement creates a view over the query rather than a * materialized table, so reads run the query instead of returning stored rows. Ignored for any other * statement type, and not compatible with `MERGE`, `DELTA`, `CHUNKING_STRATEGY`, or `PARTITIONED_BY`. * @default false * @example false */ CreateAsView: boolean; /** @description A NQL query. */ NQL: string; CreateMaterializedViewInput: { /** @description The SELECT part of the statement, compiled to the data plane's SQL dialect. */ compiled_select: string; create_as_view: components["schemas"]["CreateAsView"]; /** @description The dataset the job fills. */ dataset: components["schemas"]["DatasetResponse"]; nql: components["schemas"]["NQL"]; }; CreateMaterializedViewResult: { /** @constant */ type: "success"; /** @constant */ nql_type: "create_materialized_view"; dataset_id: components["schemas"]["DatasetId"]; /** * Format: int64 * @description The snapshot the job wrote. */ snapshot_id: number; }; RunFailureResult: { /** @constant */ type: "failure"; /** @constant */ nql_type: "failure"; /** @description Why the job failed. */ message: string; }; /** @description A job that builds a materialized view. */ CreateMaterialiedViewRunResponse: components["schemas"]["RunResponseBase"] & { /** @description The dataset being created and the query that fills it. */ input: components["schemas"]["CreateMaterializedViewInput"]; /** * @description The dataset and snapshot the job produced, or the failure that ended it. Null while the job is * pending or running. */ result?: components["schemas"]["CreateMaterializedViewResult"] | components["schemas"]["RunFailureResult"] | null; }; AcceptedInterface: { /** @description ID of the installed app that owns this interface. */ app_id: number; /** @description Identifier of the connector interface accepted by the dataset's schema. */ interface_id: string; }; IncompatibleInterface: { /** @description ID of the installed app that owns this interface. */ app_id: number; /** @description Identifier of the connector interface that rejected the dataset's schema. */ interface_id: string; /** * @description Hierarchical JSON Schema validation output describing why the dataset schema is incompatible * with this interface's policy. The shape mirrors the underlying validator's `OutputUnit` and * is intended for diagnostic display rather than programmatic consumption. */ details: { [key: string]: unknown; }; }; /** * @example { * "dataset_id": 18923, * "accepted": [ * { * "app_id": 42, * "interface_id": "audience_export" * } * ], * "errors": [ * { * "app_id": 99, * "interface_id": "people_match", * "details": { * "valid": false, * "errors": [ * { * "instanceLocation": "$.properties", * "error": "required property 'email' missing" * } * ] * } * } * ] * } */ CompatibleDatasetInterfacesResponse: { /** @description The dataset whose schema was evaluated against installed connector interfaces. */ dataset_id: number; /** @description Connector interfaces whose policy is satisfied by the dataset's schema. */ accepted: components["schemas"]["AcceptedInterface"][]; /** * @description Connector interfaces whose policy was *not* satisfied by the dataset's schema, along with * per-interface details describing which constraints failed. */ errors: components["schemas"]["IncompatibleInterface"][]; }; /** @description Which companies a grant applies to. */ DerivationParticipants: { /** @enum {string} */ type: "none"; } | { /** @enum {string} */ type: "all"; } | { /** @enum {string} */ type: "inclusion"; company_ids: number[]; } | { /** @enum {string} */ type: "exclusion"; company_ids: number[]; }; /** * @description Which companies, besides the one that owns the rule, may have the rule applied to their data. A rule grants a * single thing, so there is one `use` dimension. Only Narrative can share a rule broadly — with `all` companies or * with everyone outside an `exclusion` set. * @example { * "use": { * "type": "none" * } * } */ DerivationCollaborators: { use: components["schemas"]["DerivationParticipants"]; }; /** @description Object mapping definition for create/update requests (without dependencies). */ RawObjectMapping: { /** * @description A mapping from a dataset to an attribute with a type of `object`. * @enum {string} */ type: "object_mapping"; /** * @description `property_mappings` define how a value for each property of the target attribute is constructed from a row of the source dataset. * * A mapping must be provided for each of the target attribute's _required_ properties. */ property_mappings: { expression?: components["schemas"]["MappingExpression"]; path?: components["schemas"]["MappingPath"]; }[]; }; /** @description Value mapping definition for create/update requests (without dependencies). */ RawValueMapping: { /** * @description A mapping from a dataset to an attribute with a primitive type, i.e. one of `array`, `boolean`, `double`, `long`, `string`, or `timestamptz`. * @enum {string} */ type: "value_mapping"; expression: components["schemas"]["MappingExpression"]; }; /** * @description The transformation that produces the target attribute's value from the source attribute's value. Expressions * reference the source attribute's shape through `$source` — for a rule from `raw_email` to `sha256_hashed_email`, * the `value` property maps to `SHA2(NORMALIZE_EMAIL($source.value), 256)`. * * The shape mirrors mapping expressions, except `cached_mapping` is not allowed: a cached mapping reads values out * of a stored dataset, so there would be nothing to substitute a `$source` reference into. * * Expressions may use the current date or time (`CURRENT_DATE`, `CURRENT_TIMESTAMP`, …): the expression runs when a * query resolves the rule, so a rule like birthdate → age in years is correct as of each query that uses it. Enum * constraints and validation expressions on the target attribute do not restrict the transformation, exactly as * they do not restrict a dataset mapping. */ DerivationMapping: components["schemas"]["RawObjectMapping"] | components["schemas"]["RawValueMapping"]; /** * @description A condition worth knowing about that did not stop the rule from being written. Returned on create and update * responses; list and get responses do not compute warnings. */ DerivationWarning: { /** @enum {string} */ type: "cyclic_derivation"; /** * @description The rule closes a cycle in the derivation graph. Lists the attribute ids visited in order, starting from the * rule's source attribute; the closing step back to the first id is implied. Cycle detection is bounded: only * cycles of up to 6 attributes are reported, and at most 10 come back. */ cycle: number[]; }; DerivationResponse: { id: components["schemas"]["DerivationId"]; name: components["schemas"]["DerivationName"]; description: components["schemas"]["DerivationDescription"]; /** Format: int64 */ source_attribute_id: number; /** Format: int64 */ target_attribute_id: number; /** Format: int64 */ company_id: number; collaborators: components["schemas"]["DerivationCollaborators"]; mapping: components["schemas"]["DerivationMapping"]; lossy: boolean; imprecise: boolean; /** * @description Explains the `lossy` and `imprecise` flags to whoever is deciding whether to accept derived data. `null` when * the rule has no note. */ fidelity_note: string | null; cost: components["schemas"]["DerivationCost"]; active: boolean; /** Format: date-time */ created_at: string; /** * Format: int64 * @description Id of the user who created the rule. */ created_by: number; /** Format: date-time */ updated_at: string; /** * Format: int64 * @description Id of the user who last updated the rule. */ updated_by: number; /** @description Populated on create and update responses; empty on reads. */ warnings: components["schemas"]["DerivationWarning"][]; }; DerivationsResponse: { records: components["schemas"]["DerivationResponse"][]; }; /** @description Body of `POST /derivations`. */ DerivationCreateRequest: { name: components["schemas"]["DerivationName"]; description: components["schemas"]["DerivationDescription"]; /** * Format: int64 * @description The attribute the rule reads from through `$source`. */ source_attribute_id: number; /** * Format: int64 * @description The attribute whose value the rule produces. Must differ from `source_attribute_id`. */ target_attribute_id: number; /** * Format: int64 * @description The company that owns the rule. Must be the caller's company. */ company_id: number; mapping: components["schemas"]["DerivationMapping"]; /** @description The transformation loses information, e.g. hashing. */ lossy: boolean; /** @description The transformation is approximate, e.g. bucketing an age into a range. */ imprecise: boolean; collaborators?: components["schemas"]["DerivationCollaborators"]; fidelity_note?: components["schemas"]["FidelityNote"]; cost?: components["schemas"]["DerivationCost"]; /** * @description Inactive rules are never applied. * @default true */ active: boolean; } & { [key: string]: unknown; }; /** * @description Body of `PATCH /derivations/{id}`. Only the fields present in the request change. Setting `fidelity_note` to * `null` clears it; leaving the key out keeps the current value. The source and target attributes of a rule are * immutable — there is no key for them here, and one sent anyway is ignored. */ DerivationUpdateRequest: { name?: components["schemas"]["DerivationName"]; description?: components["schemas"]["DerivationDescription"]; collaborators?: components["schemas"]["DerivationCollaborators"]; mapping?: components["schemas"]["DerivationMapping"]; lossy?: boolean; imprecise?: boolean; fidelity_note?: string | null; cost?: components["schemas"]["DerivationCost"]; active?: boolean; } & { [key: string]: unknown; }; /** * @example { * "id": "tmh-9w", * "company_id": 1, * "key": "42qM49JKw+ssWntvUKez25ku9xxge6P+h/X3bVlZe5M=", * "salt": "eROwh/ni8r6pbjRNXj3cOZJPMK348NG+zpy6mzuLISk=" * } */ EncryptionMaterial: { /** @description The id of the encryption material */ id: string; /** @description the company_id the encryption material belongs to */ company_id: number; /** @description The decrypted encryption key */ key: string; /** @description The encryption salt */ salt: string; }; /** * @example { * "records": [ * { * "id": "tmh-9w", * "company_id": 1, * "key": "42qM49JKw+ssWntvUKez25ku9xxge6P+h/X3bVlZe5M=", * "salt": "eROwh/ni8r6pbjRNXj3cOZJPMK348NG+zpy6mzuLISk=" * }, * { * "id": "U-oztw", * "company_id": 1, * "key": "0gudo94Bsf92/FLjT5uUI8arx2r7N0LB6/bop5RDqR8=", * "salt": "KnF5F+VeG9xIYhFY9XTyeQTPYk6Wba/SEvSDzq0lHNA=" * } * ] * } */ ListResponse: { records: components["schemas"]["EncryptionMaterial"][]; }; /** * @example { * "display_name": "My encryption material", * "description": "Some kind of description", * "tags": [ * "use-case-1" * ] * } */ request: { /** @description The name of the encryption material */ display_name: string; /** @description The description of the encryption material. Optional. */ description?: string; /** @description Each tag must be less than 256 chars. Optional. */ Tags?: string[]; }; /** * @example { * "id": "tmh-9w" * } */ response: { /** @description The id of the encryption material */ id: string; }; MultipartFile: { /** Format: binary */ file?: string; }; /** * @description An installation represents an app that has been installed for a company. * @example { * "id": 12345, * "app_id": 67, * "company_id": 345, * "tier_id": "basic", * "permissions": [ * { * "access": "read", * "resource": "datasets" * }, * { * "access": "write", * "resource": "destinations" * } * ], * "installation_time": "2024-01-15T10:30:00" * } */ Installation: { /** * Format: int64 * @description Unique identifier for the installation. * @example 12345 */ id: number; /** * Format: int64 * @description The ID of the installed app. * @example 67 */ app_id: number; /** * Format: int64 * @description The ID of the company that installed the app. * @example 345 */ company_id: number; /** * @description The tier selected during installation. * @example basic */ tier_id: string; /** @description The permissions granted to this installation. */ permissions: components["schemas"]["Permission"][]; /** * @description When the installation happened, as an ISO 8601 local date-time with no offset or zone — * `2024-01-15T10:30:00`. Read it as UTC. This is deliberately not `format: date-time`, which * means RFC 3339 and would require an offset the server does not send. * @example 2024-01-15T10:30:00 */ installation_time: string; }; /** * @description A paginated list of installations. * @example { * "current_page": 1, * "next_page": null, * "total_records": 1, * "total_pages": 1, * "records": [ * { * "id": 12345, * "app_id": 67, * "company_id": 345, * "tier_id": "basic", * "permissions": [ * { * "access": "read", * "resource": "datasets" * } * ], * "installation_time": "2024-01-15T10:30:00" * } * ] * } */ InstallationsResponse: { prev_page?: components["schemas"]["PrevPage"]; current_page: components["schemas"]["CurrentPage"]; next_page?: components["schemas"]["NextPage"]; total_records: components["schemas"]["TotalRecords"]; total_pages: components["schemas"]["TotalPages"]; records: components["schemas"]["Installation"][]; }; /** * @description Request body for creating a new installation. * @example { * "app_id": 67, * "tier_id": "basic" * } */ CreateInstallationRequest: { /** * Format: int64 * @description The ID of the app to install. * @example 67 */ app_id: number; /** * @description The tier to use for the installation. Must be a valid tier ID from the app's manifest. * @example basic */ tier_id: string; }; /** * @description Information about the current installation context (from token). * @example { * "id": 12345 * } */ InstallationInfo: { /** * Format: int64 * @description The installation ID associated with the current token. * @example 12345 */ id: number; }; /** * @example { * "id": "7bc22af4-fb6e-431e-92bc-e366e4f960ff", * "name": "My profile name", * "description": "My profile description", * "status": "disabled", * "app_id": 12345, * "app_name": "My App", * "tags": [ * "production", * "analytics" * ] * } */ AppProfileResponse: { /** Format: uuid */ id: string; name: string; description?: string | null; /** @enum {string} */ status: "enabled" | "disabled" | "archived"; /** @description The unique identifier of the app */ app_id?: number | null; /** @description The name of the app */ app_name?: string | null; /** @description List of tags associated with the profile */ tags: string[]; }; AppProfilesResponse: { records: components["schemas"]["AppProfileResponse"][]; }; /** * @example { * "name": "My profile name", * "description": "My profile description", * "tags": [ * "production", * "analytics" * ] * } */ AppProfileRequest: { name?: string; description?: string; /** @description Optional list of tags to associate with the profile */ tags?: string[]; }; /** * @example { * "description": "My profile description", * "tags": [ * "staging", * "test" * ] * } */ AppProfileUpdateRequest: { name?: string; description?: string; /** @description Optional list of tags to update on the profile */ tags?: string[]; }; /** * @description A paginated list of jobs. * @example { * "prev_page": null, * "current_page": 1, * "next_page": null, * "total_records": 1, * "total_pages": 1, * "records": [ * { * "job_id": "2a5b9ad7-dc8f-47bb-8e62-843a38f8054c", * "company_id": 1, * "data_plane_id": "f79cbdae-4848-47ca-95e8-69588364d185", * "compute_pool_id": null, * "request_source": { * "type": "api_user", * "company_id": 1, * "user_id": 407 * }, * "state": "completed", * "type": "materialize-view", * "operator_type": "materialized-view-refresh", * "tags": [], * "input": { * "nql": "CREATE MATERIALIZED VIEW \"test_stats\" AS SELECT \"value\" FROM \"company_data\".\"10674\"", * "compiled_select": "SELECT\n `ds_10674`.`value`\nFROM\n narrative.datasets.ds_10674 `ds_10674`", * "create_as_view": null, * "dataset_id": 10736, * "billing_enabled": null, * "stats_enabled": true, * "contains_delta_syntax": null, * "first_run": false, * "merge": true, * "partitions": null, * "snowflake_create_table": null, * "snowflake_insert_statement": null, * "chunk_metadata": null, * "nio_last_modified_at": null, * "delta_dataset_bounds": null, * "write_mode": "append" * }, * "executor": "job-executor-98e1f48e-bf54-4f11-bbd1-73c445120266", * "execution_cluster": "shared", * "idempotency_key": "10736:29329c64e7b8a4eda86aaabe04872b832ab456b5543d0c259c812525391f158c:669a5f8e4f373c2f907700decde47511aac6470f5698e2b856fb07f09160e5f2", * "result": { * "dataset_id": 10736, * "snapshot_id": 1724919539450264600, * "recalculation_id": "abf9a2ec-426b-4751-bd16-fcb435061925", * "row_stats": null * }, * "dequeued_at": "2023-10-31T11:19:13.400498Z", * "created_at": "2023-10-31T11:19:13.400498Z", * "updated_at": "2023-10-31T11:25:08.327209Z", * "attempted_at": "2023-10-31T11:19:13.400498Z", * "attempt_version": 1, * "ended_at": "2023-10-31T11:25:08.327194Z", * "workflow_id": null, * "workflow_run_id": null * } * ] * } */ JobsResponse: { records: components["schemas"]["JobResponse"][]; prev_page?: components["schemas"]["PrevPage"]; current_page: components["schemas"]["CurrentPage"]; next_page?: components["schemas"]["NextPage"]; total_records: components["schemas"]["TotalRecords"]; total_pages: components["schemas"]["TotalPages"]; }; /** * @description Identifier of a job executor. Non-blank, at most 255 characters. * @example job-executor-98e1f48e-bf54-4f11-bbd1-73c445120266 */ ExecutorId: string; /** * @description Assigns an executor to a `pending`, `scheduled` or `failed` job and moves it to `running`. * @example { * "executor": "job-executor-98e1f48e-bf54-4f11-bbd1-73c445120266" * } */ RunJobRequest: { executor: components["schemas"]["ExecutorId"]; }; /** * @description Records which executor has claimed a `pending` job and moves it to `scheduled`. * @example { * "executor": "job-executor-98e1f48e-bf54-4f11-bbd1-73c445120266" * } */ ScheduleJobRequest: { executor: components["schemas"]["ExecutorId"]; }; /** * @description Completes an `nql-forecast` job. `forecast` is accepted as a legacy spelling of the type. * @example { * "type": "nql-forecast", * "cost": 136130662400000, * "rows": 1643721216 * } */ CompleteNqlForecastRequest: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "nql-forecast" | "forecast"; /** * Format: int64 * @description What the forecast rows would cost, in microcents. */ cost: number; /** * Format: int64 * @description How many rows the query would return. */ rows: number; }; /** * @description Completes a `materialize-view` job. * @example { * "type": "refresh_materialized_view", * "snapshot_id": "1724919539450264600", * "row_stats": { * "affected_rows": 10, * "inserted_rows": 10, * "updated_rows": 0, * "deleted_rows": 0 * } * } */ CompleteRefreshMaterializedViewRequest: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "refresh_materialized_view"; /** * @description The snapshot the refresh produced, as a string. The Snowflake data plane passes its numeric snapshot id * through here as text; a value that does not parse as a number is stored as `0`. */ snapshot_id: string; /** @description Row counts for the write. Omit or send null when the operator did not report them. */ row_stats?: components["schemas"]["MaterializeViewJobRowStats"] | null; }; /** * @description Completes a `datasets_execute_dml` job. * @example { * "type": "datasets_execute_dml", * "affected_rows": 10, * "deleted_rows": 10 * } */ CompleteDatasetsExecuteDmlRequest: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "datasets_execute_dml"; /** Format: int64 */ affected_rows: number; /** * Format: int64 * @default 0 */ inserted_rows: number; /** * Format: int64 * @default 0 */ updated_rows: number; /** * Format: int64 * @default 0 */ deleted_rows: number; }; /** * @description Completes a job whose `operator_type` is `datasets_execute_select` with the rows the SELECT returned. For a * `datasets_sample` job the server counts the rows and stores a `datasets_sample` result; for a * `datasets_calculate_affected_rows` job it stores the rows as sent. * @example { * "type": "datasets_execute_select", * "rows": [ * { * "values": { * "affected_rows": 42 * } * } * ] * } */ CompleteDatasetsExecuteSelectRequest: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "datasets_execute_select"; rows: components["schemas"]["DatasetsCalculateAffectedRowsRow"][]; }; /** * @description Completes a `datasets_calculate_column_stats` job. Carries no payload beyond the type. * @example { * "type": "datasets_calculate_column_stats" * } */ CompleteDatasetsCalculateColumnStatsRequest: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "datasets_calculate_column_stats"; }; /** * @description Completes a `datasets_create_table` job. Carries no payload beyond the type. * @example { * "type": "datasets_create_table" * } */ CompleteDatasetsCreateTableRequest: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "datasets_create_table"; }; /** * @description Completes a `datasets_truncate_table` job. Carries no payload beyond the type. * @example { * "type": "datasets_truncate_table" * } */ CompleteDatasetsTruncateTableRequest: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "datasets_truncate_table"; }; /** * @description Completes a `datasets_delete_table` job. Carries no payload beyond the type. * @example { * "type": "datasets_delete_table" * } */ CompleteDatasetsDeleteTableRequest: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "datasets_delete_table"; }; /** * @description Completes a `datasets_deliver_data` job. Carries no payload beyond the type. * @example { * "type": "datasets_deliver_data" * } */ CompleteDatasetsDeliverDataRequest: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "datasets_deliver_data"; }; /** * @description Completes a `datasets_sample` job without a row count; the stored result is an empty object. Kept for * executors that predate compute pools — newer executors complete sample jobs with * `datasets_execute_select` instead. * @example { * "type": "datasets_sample" * } */ CompleteDatasetsSampleRequest: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "datasets_sample"; }; /** * @description Completes a `datasets_enforce_table_ttl_retention_policy` job. Carries no payload beyond the type. * @example { * "type": "datasets_enforce_table_ttl_retention_policy" * } */ CompleteDatasetsEnforceTableTtlRetentionPolicyRequest: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "datasets_enforce_table_ttl_retention_policy"; }; /** * @description Completes a `datasets_enforce_row_ttl_retention_policy` job. Carries no payload beyond the type. * @example { * "type": "datasets_enforce_row_ttl_retention_policy" * } */ CompleteDatasetsEnforceRowTtlRetentionPolicyRequest: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "datasets_enforce_row_ttl_retention_policy"; }; /** * @description Completes a `materialized_views_collect_access_rules_billing_data` job. * @example { * "type": "materialized_views_collect_access_rules_billing_data", * "sources": [ * { * "access_rule_id": 88, * "rows": 1200, * "price_per_row": { * "currency": "USD", * "microcents": 250 * } * } * ] * } */ CompleteCollectAccessRulesBillingDataRequest: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "materialized_views_collect_access_rules_billing_data"; /** @description One entry per access rule the refresh read from. */ sources: components["schemas"]["CollectAccessRulesBillingDataSource"][]; }; /** * @description Completes a `model_inference_run` job with the turn the model produced. Only `usage` is required: an * operator without a tool-use channel (the Snowflake Cortex executor, for instance) posts just * `structured_output` and `usage`, and the server fills in the defaults for the rest. * @example { * "type": "model_inference_run", * "structured_output": { * "city": "Paris" * }, * "usage": { * "completion_tokens": 907, * "prompt_tokens": 4849, * "total_tokens": 5756 * }, * "stop_reason": "end_turn" * } */ CompleteModelInferenceRunRequest: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "model_inference_run"; /** * @description The model's structured answer. Omit or send null on a tool-use-only turn, where the model called a tool * instead of answering. */ structured_output?: Record | null; usage: components["schemas"]["ModelInferenceRunUsage"]; /** * @description Tool calls the model made on this turn. Defaults to none. * @default [] */ tool_calls: components["schemas"]["ModelInferenceRunToolCall"][]; /** * @description Why the model stopped. Any string is accepted; unrecognised provider values are stored verbatim. * Defaults to `end_turn`. * @default end_turn * @example end_turn * @example tool_use * @example max_tokens * @example stop_sequence * @example guardrail_intervened * @example content_filtered * @example malformed_model_output */ stop_reason: string; /** @description Structured output that did not satisfy the requested schema. Omit or send null when the output was valid. */ failed_structured_output?: components["schemas"]["ModelInferenceRunFailedStructuredOutput"] | null; /** * @description The blocks the model produced, reasoning included, each with an id. Defaults to none. * @default [] */ produced_blocks: components["schemas"]["ModelInferenceRunProducedBlock"][]; /** * @description Ids of the `produced_blocks` the answer was taken from. Defaults to none. * @default [] */ final_answer_from: string[]; }; /** * @description Completes a `model_training_run` job. `result` is stored as sent. * @example { * "type": "model_training_run", * "result": { * "artifact_uri": "s3://narrative-models/1/7d2f1b3c/1" * } * } */ CompleteModelTrainingRunRequest: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "model_training_run"; /** @description Whatever the training operator wants recorded. Any JSON value. */ result: unknown; }; /** * @description Completes a `models_deliver_model` job. `result` is stored as sent. * @example { * "type": "models_deliver_model", * "result": { * "delivered_at": "2024-01-28T04:05:00Z" * } * } */ CompleteModelsDeliverModelRequest: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "models_deliver_model"; /** @description Whatever the delivery operator wants recorded. Any JSON value. */ result: unknown; }; /** * @description Completes a `models_train_classifier` job. `result` is stored as sent. * @example { * "type": "models_train_classifier", * "result": { * "accuracy": 0.91 * } * } */ CompleteModelsTrainClassifierRequest: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "models_train_classifier"; /** @description Whatever the training operator wants recorded. Any JSON value. */ result: unknown; }; /** * @description Completes a `health_check` job. `result` is stored as sent. When it parses as a health-check report the * server also acts on it — archiving compute pools whose reference is no longer bound, updating warehouse * details on the ones that are healthy — but a result that does not parse is stored without complaint. * @example { * "type": "health_check", * "result": { * "healthy": true * } * } */ CompleteHealthCheckRequest: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "health_check"; /** @description The data plane's health-check report. Any JSON value. */ result: unknown; }; /** * @description Marks a job as `completed` along with its result. The body is a union discriminated by `type`, which must * match the job's own type — with two exceptions. `datasets_execute_select` completes any job whose * `operator_type` is `datasets_execute_select` (`datasets_sample`, `datasets_calculate_affected_rows`), and * `forecast` is accepted as a legacy spelling of `nql-forecast`. A body whose `type` does not fit the job is * rejected with a 400. * * Fields not listed on a variant are ignored. * @example { * "type": "nql-forecast", * "cost": 136130662400000, * "rows": 1643721216 * } */ CompleteJobRequest: components["schemas"]["CompleteNqlForecastRequest"] | components["schemas"]["CompleteRefreshMaterializedViewRequest"] | components["schemas"]["CompleteDatasetsExecuteDmlRequest"] | components["schemas"]["CompleteDatasetsExecuteSelectRequest"] | components["schemas"]["CompleteDatasetsCalculateColumnStatsRequest"] | components["schemas"]["CompleteDatasetsCreateTableRequest"] | components["schemas"]["CompleteDatasetsTruncateTableRequest"] | components["schemas"]["CompleteDatasetsDeleteTableRequest"] | components["schemas"]["CompleteDatasetsDeliverDataRequest"] | components["schemas"]["CompleteDatasetsSampleRequest"] | components["schemas"]["CompleteDatasetsEnforceTableTtlRetentionPolicyRequest"] | components["schemas"]["CompleteDatasetsEnforceRowTtlRetentionPolicyRequest"] | components["schemas"]["CompleteCollectAccessRulesBillingDataRequest"] | components["schemas"]["CompleteModelInferenceRunRequest"] | components["schemas"]["CompleteModelTrainingRunRequest"] | components["schemas"]["CompleteModelsDeliverModelRequest"] | components["schemas"]["CompleteModelsTrainClassifierRequest"] | components["schemas"]["CompleteHealthCheckRequest"]; /** * @description Marks a job as `failed`. * @example { * "message": "step exited with a non-zero status", * "value": { * "exit_code": 1 * } * } */ FailJobRequest: { /** @description Human-readable description of why the job failed. */ message: string; /** * @description Optional diagnostic information, e.g. an Apache Spark stack trace. Any JSON value; stored as an empty * object when omitted or null. */ value?: unknown; }; /** * @description Optional body for rescheduling a job. May be omitted entirely — an empty body keeps the default behavior, where * rescheduling is a no-op for jobs already in a terminal state (`completed`, `cancelled`, `failed`). * @example { * "force": true * } */ RescheduleJobRequest: { /** * @description When `true`, reschedule the job even if it is in a terminal state, resetting it to `pending` and clearing its * executor so the operator re-dispatches it onto a fresh cluster. Use this to re-run a job that already finished. * When omitted, `null` or `false`, terminal jobs are left untouched. * @default false */ force: boolean | null; }; /** * @description What a reschedule call did. * * - `rescheduled` — the job was put back on the queue (reset to `pending`, executor cleared). * - `skipped_terminal` — the job was left untouched because it was already in a terminal state and `force` was not set. * @enum {string} */ RescheduleOutcome: "rescheduled" | "skipped_terminal"; /** @description Result of rescheduling a job — what happened, plus the job's current state afterwards. */ RescheduleJobResponse: { outcome: components["schemas"]["RescheduleOutcome"]; job: components["schemas"]["JobResponse"]; }; /** @description Lists company's domains */ DomainsResponse: { domains?: string[]; }; /** * @description Unique identifier of an existing company. * @example 7 */ ExternalCompanyId: number; /** * @example { * "company_id": 42, * "slug": "acm", * "name": "ACM", * "long_description": "The Acme Corporation is an ironic name for the fictional corporation, appearing in the Road Runner/Wile E. Coyote animated shorts, where it was used as a running gag.", * "short_description": "American Company that Manufactures Everything", * "contact_email": "info@acm.io", * "data_shop_url": "https://shop.acm.io", * "twitter_link": "https://twitter.com/acm_company", * "linkedin_link": "https://www.linkedin.com/company/acm_company", * "image_url": null, * "visibility": "visible", * "status": "active", * "website": null * } */ PublicCompanyResponse: { company_id?: components["schemas"]["ExternalCompanyId"]; /** @description Unique id for the company */ slug?: string | null; /** @description Name of the company */ name?: string; /** @description A short description of the company */ short_description?: string | null; /** @description The complete description of the company */ long_description?: string | null; /** @description Email contact */ contact_email?: string | null; /** @description The url of the website of the company */ website?: string | null; /** @description The url of the data shop of the company */ data_shop_url?: string | null; /** @description Twitter account */ twitter_link?: string | null; /** @description LinkedIn account */ linkedin_link?: string | null; /** @description The url of the logo of the company */ image_url?: string | null; /** @description The geographical location of the company */ location?: string; /** @description The number of employees */ size?: string; /** @enum {string} */ visibility?: "invisible" | "visible" | "invisible_in_discover"; /** @enum {string} */ status?: "active" | "deleted" | "pending"; }; /** * @description The company behind the request token, and the user when one was asked for. * * Unlike `/whoami`, this endpoint accepts app installation and client-credential tokens, so it is the * way a caller holding one of those resolves its own company. * @example { * "id": 7, * "user_id": 100 * } */ WhoAmIResponse: { id: components["schemas"]["ExternalCompanyId"]; /** @description The user id. Only present when the request sets `with_user_id=true`. */ user_id?: number; }; /** * @description ISO-8601 instant. * @example 2021-06-24T00:54:40.029056Z */ Instant: string; /** * @example { * "id": 28, * "name": "ACM", * "short_description": "American Company that Manufactures Everything", * "long_description": "The Acme Corporation is an ironic name for the fictional corporation, appearing in the Road Runner/Wile E. Coyote animated shorts, where it was used as a running gag.", * "company_type": "Manufactures Everything", * "image_url": "https://d18qs7yq39787j.cloudfront.net/uploads/company/3862/acme_logo.jpg", * "location": "USA", * "size": "200 - 500 Employees", * "website": "N/A", * "contact": "info@narrative.io", * "created_at": "2017-04-23T11:59:33" * } */ ExternalCompanyInfo: { id?: components["schemas"]["ExternalCompanyId"]; /** @description Name of the company */ name?: string; /** @description A short description of the company */ short_description?: string; /** @description The complete description of the company */ long_description?: string; /** @description The type of company */ company_type?: string; /** @description The url of the logo of the company */ image_url?: string; /** @description The geographical location of the company */ location?: string; /** @description The number of employees */ size?: string; /** @description The url of the website of the company */ website?: string; /** @description Email contact */ contact?: string; /** @description The instant this company was created. */ created_at?: components["schemas"]["Instant"]; }; /** * @example { * "company_id": 42, * "name": "ACM", * "slug": "acm", * "long_description": "The Acme Corporation is an ironic name for the fictional corporation, appearing in the Road Runner/Wile E. Coyote animated shorts, where it was used as a running gag.", * "short_description": "American Company that Manufactures Everything", * "contact_email": "info@acm.io", * "twitter_link": "https://twitter.com/acm_company", * "linkedin_link": "https://www.linkedin.com/company/acm_company", * "image_url": null, * "visibility": "visible", * "status": "active", * "website": null, * "created_at": "2016-06-09T02:00:47Z", * "created_by": "admin@acm.io", * "last_updated_at": "2023-08-17T16:18:10.386058Z", * "last_updated_by": "admin@acm.io" * } */ CompanyResponse: { company_id?: components["schemas"]["ExternalCompanyId"]; /** @description Name of the company */ name?: string; /** @description Unique id for the company */ slug?: string; /** @description A short description of the company */ short_description?: string; /** @description The complete description of the company */ long_description?: string; /** @description The url of the logo of the company */ image_url?: string; /** @description The geographical location of the company */ location?: string; /** @description The number of employees */ size?: string; /** @description The url of the website of the company */ website?: string; /** @description Email contact */ contact_email?: string; /** @description Twitter account */ twitter_link?: string; /** @description LinkedIn account */ linkedin_link?: string; /** @description The instant this company was created. */ created_at?: components["schemas"]["Instant"]; /** @description Contact of user who created the company */ created_by?: string; /** @description The instant this company was created. */ last_updated_at?: components["schemas"]["Instant"]; /** @description Contact of user who updated the company */ last_updated_by?: string; /** @enum {string} */ visibility?: "invisible" | "visible" | "invisible_in_discover"; /** @enum {string} */ status?: "active" | "deleted" | "pending"; }; /** * @example { * "name": "ACM", * "slug": "acm", * "long_description": "The Acme Corporation is an ironic name for the fictional corporation, appearing in the Road Runner/Wile E. Coyote animated shorts, where it was used as a running gag.", * "short_description": "American Company that Manufactures Everything", * "contact_email": "info@acm.io", * "twitter_link": "https://twitter.com/acm_company", * "linkedin_link": "https://www.linkedin.com/company/acm_company", * "image_url": null, * "visibility": "visible", * "status": "active", * "website": null * } */ CompanyUpdateRequest: { company_id?: components["schemas"]["ExternalCompanyId"]; /** @description Name of the company */ name?: string; /** @description Name of the company */ slug?: string; /** @description A short description of the company */ short_description?: string; /** @description The complete description of the company */ long_description?: string; /** @description The url of the logo of the company */ image_url?: string; /** @description The geographical location of the company */ location?: string; /** @description The number of employees */ size?: string; /** @description The url of the website of the company */ website?: string; /** @description Email contact */ contact_email?: string; /** @description Twitter account */ twitter_link?: string; /** @description LinkedIn account */ linkedin_link?: string; /** @enum {string} */ visibility?: "invisible" | "visible" | "invisible_in_discover"; /** @enum {string} */ status?: "active" | "deleted" | "pending"; }; /** * @example { * "records": [ * { * "id": "ea9dddd2-e3ee-40b5-b03e-c3cd37c8a7f0", * "attribute_id": 1, * "created_at": "2021-12-10T00:00:00Z", * "dataset_id": 3, * "mapping": { * "type": "object_mapping", * "property_mappings": [ * { * "path": "foo", * "expression": "upper(`US Kennel ID`)", * "dependencies": { * "properties": [ * "US Kennel ID" * ] * } * }, * { * "path": "bar.baz.qux", * "expression": "weight * 10000", * "dependencies": { * "properties": [ * "weight" * ] * } * } * ] * }, * "status": "active", * "updated_at": "2021-12-10T00:00:01Z", * "created_by": 1, * "updated_by": 1, * "company_id": 100, * "scope": "global", * "source": "admin", * "derived_from": "ea9dddd2-e3ee-40b5-b03e-c3cd37c8a6f0" * }, * { * "id": "ea9dddd2-e3ee-40b5-b03e-c3cd37c8a6f0", * "attribute_id": 1, * "created_at": "2021-12-10T00:00:00Z", * "dataset_id": 3, * "mapping": { * "type": "value_mapping", * "expression": "foo bar baz", * "dependencies": { * "properties": [] * } * }, * "status": "archived", * "updated_at": "2021-12-10T00:00:01Z", * "created_by": 1, * "updated_by": 2, * "company_id": 100, * "scope": "global", * "source": "admin", * "derived_from": null * } * ] * } */ MappingsResponse: { records: components["schemas"]["MappingResponse"][]; }; /** * @description Cached mapping definition for create/update requests. The cache dataset is created automatically when the mapping is created and archived when the mapping is deleted or its `input_expressions` change, so no `cache_dataset_id` is supplied here. The assigned id is returned on the read shape (`CachedMapping`). Rows from the source dataset are joined to the cache at query time using `input_expressions` as the join key. * * cached_mapping is only valid in company-scoped create endpoints (e.g. `POST /mappings/companies/{company_id}`) and is not permitted on opt-out attributes (data_privacy_request_identifier, unique_id, identifier_relation). */ RawCachedMapping: { /** @enum {string} */ type: "cached_mapping"; /** @description One or more SQL expressions evaluated against the source dataset to build the join key. Multi-column keys are concatenated with a separator at query time, so the cache dataset must populate its `input` column with the equivalent encoding. */ input_expressions: components["schemas"]["MappingExpression"][]; }; /** @description Mapping definition for create/update requests. Dependencies are computed server-side and not provided by the client. */ RawMappingDefinition: components["schemas"]["RawObjectMapping"] | components["schemas"]["RawValueMapping"] | components["schemas"]["RawCachedMapping"]; MappingUpdateRequest: { mapping: components["schemas"]["RawMappingDefinition"]; tags?: components["schemas"]["MappingTags"]; }; /** * @example { * "attribute_id": 123, * "dataset_id": 456, * "mapping": { * "type": "object_mapping", * "property_mappings": [ * { * "path": "product.brand", * "expression": "itemBrand" * }, * { * "path": "product.category", * "expression": "itemCategory" * }, * { * "path": "product.id.type", * "expression": "'SKU'" * }, * { * "path": "product.id.value", * "expression": "itemID" * } * ] * } * } */ MappingCreateRequest: { /** @description The target attribute's ID. */ attribute_id: number; /** @description The source dataset's ID. */ dataset_id: number; mapping: components["schemas"]["RawMappingDefinition"]; /** * @description Status to create the mapping in. Defaults to `active` when omitted. Narrower than * `MappingStatus` — a mapping cannot be created already archived. * @enum {string|null} */ status?: "active" | "pending" | null; tags?: components["schemas"]["MappingTags"]; /** * @description Optional source for the mapping. Null or omitted defaults to `company`. * Only `company` and `rosetta_stone` are allowed for user-created mappings. * @enum {string|null} */ source?: "company" | "rosetta_stone" | null; }; /** * @description The mapping that was created, plus the derived mappings it unlocks. * @example { * "id": "ea9dddd2-e3ee-40b5-b03e-c3cd37c8a6f0", * "attribute_id": 291, * "created_at": "2021-12-10T00:00:00Z", * "dataset_id": 3, * "mapping": { * "type": "value_mapping", * "expression": "lower(email)", * "dependencies": { * "properties": [ * "email" * ] * } * }, * "status": "active", * "updated_at": "2021-12-10T00:00:00Z", * "created_by": 1, * "updated_by": 1, * "company_id": 100, * "scope": "global", * "source": "company", * "tags": [], * "derived_from": null, * "derived_mappings": [ * { * "attribute_id": 76, * "created_at": "2021-12-10T00:00:00Z", * "dataset_id": 3, * "mapping": { * "type": "value_mapping", * "expression": "SHA2(lower(email), 256)", * "dependencies": { * "properties": [ * "email" * ] * } * }, * "status": "active", * "updated_at": "2021-12-10T00:00:00Z", * "created_by": 1, * "updated_by": 1, * "company_id": 100, * "scope": "global", * "source": "derived", * "provenance": { * "source_mapping_id": "ea9dddd2-e3ee-40b5-b03e-c3cd37c8a6f0", * "source_attribute_id": 291, * "derivation_path": [ * 42 * ], * "lossy": true, * "imprecise": false * }, * "tags": [], * "derived_from": null * } * ] * } */ MappingCreateResponse: components["schemas"]["MappingResponse"] & { /** * @description The derived mappings the new mapping unlocks: the rows `GET /mappings?source=derived` would return for * it, in the same shape (`source: derived`, no `id`, a `provenance`). Empty when the mapping's attribute is * not the source of any derivation rule, when the mapping was created `pending`, or when every target * attribute already has an explicit mapping on the dataset. */ derived_mappings: components["schemas"]["MappingResponse"][]; }; /** * @description Sampled rows with the mapping applied, one object per row. * * Every record carries both an `input` and an `output`. `applyMapping` builds each row by nesting * the source columns under `input` and the mapped columns under `output` before serializing, so * neither key is ever absent. Their contents are open maps: `input` is keyed by dataset field name * and `output` by attribute name, both of which vary per request. * * A `cached_mapping` is resolved as a join at query time and has no per-row preview, so `records` * is empty for one. * @example { * "records": [ * { * "input": { * "idType": "idType1", * "idValue": "idValue1" * }, * "output": { * "unique_id_f7635d42_51ce_4535_ae8b_9ac64df85501": { * "type": "idType1", * "value": "idValue1" * } * } * }, * { * "input": { * "idType": "idType2", * "idValue": "idValue2" * }, * "output": { * "unique_id_f7635d42_51ce_4535_ae8b_9ac64df85501": { * "type": "idType2", * "value": "idValue2" * } * } * } * ] * } */ MappingPreviewResponse: { records: { /** * @description The source row, limited to the dataset fields the mapping expression references. An * empty object when the expression references none — a mapping to a constant, say. */ input: { [key: string]: unknown; }; /** @description The mapped fields, keyed by attribute name. */ output: { [key: string]: unknown; }; }[]; }; /** * @example { * "data_plane_id": "fef9904e-d263-4930-85f7-1e28cce40f89", * "model": "anthropic.claude-sonnet-4.5", * "messages": [ * { * "role": "system", * "content": [ * { * "type": "text", * "text": "Only generate geographical coordinates in the northern hemisphere" * } * ] * }, * { * "role": "user", * "content": [ * { * "type": "text", * "text": "Generate a geographical coordinate" * } * ] * } * ], * "inference_config": { * "output_format_schema": { * "title": "Longitude and Latitude Values", * "description": "A geographical coordinate.", * "required": [ * "latitude", * "longitude" * ], * "type": "object", * "properties": { * "latitude": { * "type": "number", * "minimum": -90, * "maximum": 90 * }, * "longitude": { * "type": "number", * "minimum": -180, * "maximum": 180 * } * }, * "additionalProperties": false * }, * "max_tokens": 1024, * "temperature": 0.3 * }, * "tags": [ * "test" * ] * } */ RunRequest: { /** * Format: uuid * @description Data plane identifier, must be provided when registering dataset in external dataplane. */ data_plane_id: string; /** @enum {string} */ model: "anthropic.claude-haiku-4.5" | "anthropic.claude-sonnet-4.5" | "anthropic.claude-sonnet-4.6" | "anthropic.claude-sonnet-5.0" | "anthropic.claude-sonnet-5.5" | "anthropic.claude-opus-4.5" | "anthropic.claude-opus-4.6" | "anthropic.claude-opus-4.7" | "anthropic.claude-opus-4.8" | "anthropic.claude-opus-5.0" | "anthropic.claude-opus-5.5" | "openai.gpt-oss-120b" | "openai.gpt-4.1" | "openai.o4-mini"; /** * @description Ordered conversation turns. The current wire shape carries a `content` array of * content blocks (`text` / `tool_use` / `tool_result`) so multi-turn flows with tool * interactions can round-trip without flattening to prose. * * The legacy `{role, text: String}` shape is still accepted on the request side for * backwards compatibility — the API auto-canonicalizes legacy messages into a single * `text` content block. New integrations should use the content-block shape; * responses always emit it. */ messages: ({ /** @enum {string} */ role: "system" | "user" | "assistant"; /** * @description Ordered content blocks. Five variants discriminated by `type`: * - `text` — plain text content. The dominant variant for system/user * messages and final assistant answers. * - `tool_use` — assistant turn requesting a tool call. Carries * `tool_use_id`, fully-aliased `name`, and the `arguments` object. * - `tool_result` — response to a `tool_use`. References the same * `tool_use_id`, nests result content blocks, and flags errors via * `is_error`. * - `reasoning` — an assistant turn's own working, returned when the run * asked for thinking and accepted back here to continue that turn as * the model left it. `text` is optional; `signature` is not. * - `redacted_reasoning` — reasoning the provider encrypted. Opaque * base64, replayable, nothing to read. * * Reasoning blocks may be sent back verbatim or left out — a continuation * without them is accepted. Do not edit one: `signature` covers the * reasoning the model produced, and altering either is a provider error. */ content: ({ /** @enum {string} */ type: "text"; text: string; } | { /** @enum {string} */ type: "tool_use"; /** @example tooluse_DWXPKZ50JDGib5GmShyUgJ */ tool_use_id: string; /** @example n-narrative_datasets_describe */ name: string; arguments: Record; } | { /** @enum {string} */ type: "tool_result"; /** @example tooluse_DWXPKZ50JDGib5GmShyUgJ */ tool_use_id: string; /** @description Nested content blocks; almost always a single `text` block. */ content: unknown[]; is_error: boolean; } | { /** @enum {string} */ type: "reasoning"; /** * @description The working as words, when the model returns it. Absent on models * that reason and withhold the text. */ text?: string; /** * @description Provider-issued and opaque. Send it back unchanged with the block, * or omit the block entirely. * @example CAIS6QMKcAgQEAEYAipATBOWJItj3lNDm2ZmBW70v+WJ5oI6W68N… */ signature: string; } | { /** @enum {string} */ type: "redacted_reasoning"; /** * @description Base64 of the encrypted reasoning. * @example ZW5jcnlwdGVkLXJlYXNvbmluZy1ieXRlcw== */ data: string; })[]; } | { /** @enum {string} */ role: "system" | "user" | "assistant"; text: string; })[]; inference_config: { /** * @description Whether the model should reason before answering, and how hard. One of the bare * string `"disabled"`, `{"type":"effort","level":"low|medium|high"}`, or * `{"type":"budget","budget_tokens":4096}` (floor 1024, and it must be smaller than * `max_tokens`). Omit for the model's own behaviour. A setting the target model does * not accept is a 400 — models differ, and support is per platform, so the same * setting can be accepted on one data plane and refused on another. * @example { * "type": "effort", * "level": "high" * } */ thinking?: "disabled" | { /** @enum {string} */ type: "effort"; /** @enum {string} */ level: "low" | "medium" | "high"; } | { /** @enum {string} */ type: "budget"; budget_tokens: number; }; /** @description A JSON Schema */ output_format_schema: Record; /** Format: double */ max_tokens?: number; /** Format: double */ temperature?: number; /** Format: double */ top_p?: number; /** Format: double */ stop_sequences?: number; }; tags?: string[]; }; /** * @example { * "job_id": "a81e1460-fbdc-4204-bd76-a9e496bf760d" * } */ ModelInferenceRunResponse: { /** * Format: uuid * @description The id of the job that has been enqueued. */ job_id: string; }; FeatureInput: { /** @description Encoding settings for `categorical` features, e.g. `{"max_categories": 100}`. */ categorical?: Record; /** @description Settings for `embedding` features, e.g. `{"model": "e5-base-v2"}`. */ embedding?: Record; /** * @description How the feature is encoded for training. * @enum {string} */ feature_type: "categorical" | "embedding" | "numeric" | "text"; /** * @description Column the feature is read from. Either a plain column name or a path into a variant column * (e.g. `data['merchant']`). The referenced column must exist in the dataset's schema, spelled exactly as it * appears there. */ field_path: string; /** * @description Type of the source field. Required for `categorical` features; ignored for other feature types (`text` * features are always string, `numeric` features number, and `embedding` features array). * @enum {string} */ field_type?: "boolean" | "number" | "string"; /** * @description Name of the feature, unique within the request. Must consist of only alphanumeric characters and * underscores. */ name: string; /** @description Settings for `numeric` features, e.g. `{"scaler": "standard"}`. */ numeric?: Record; /** @description Optional preprocessing steps applied to `categorical` features before encoding. */ preprocess?: Record[]; /** @description TF-IDF settings for `text` features, e.g. `{"max_features": 10000}`. */ tfidf?: Record; }; TrainClassifierRequest: { /** * Format: int64 * @description Id of the dataset to train on. The dataset must be active on a Snowflake data plane. */ dataset_id: number; /** @description Whether the training output should include debug information. Defaults to false. */ debug?: boolean; /** @description Features to train on. Feature names must be unique. */ feature_inputs: components["schemas"]["FeatureInput"][]; /** * @description Column used to track individual rows in training outputs. Same format as `label_column`. If omitted, the * model is trained without row tracking. */ id_column?: string; /** * @description Column holding the training labels. Either a plain column name (e.g. `category`) or a path into a variant * column (e.g. `data['category']`). The referenced column must exist in the dataset's schema, spelled exactly * as it appears there. */ label_column: string; /** * @description Classifier configuration, e.g. `{"type": "logistic_regression", "C": 1.0}`. Supported types: * `logistic_regression`, `random_forest`, `gradient_boosting`, `svm`, `naive_bayes`. Defaults to logistic * regression. */ model?: Record; /** * @description Name under which the trained model is saved in the model registry. Must consist of only alphanumeric * characters and underscores. */ model_name: string; /** @description Version under which the trained model is saved in the model registry. */ model_version?: string; /** @description Random seed for reproducibility. */ random_state?: number; /** @description Whether the trained model should be saved to the model registry. Defaults to true. */ save_model?: boolean; /** @description Whether to use a stratified train/test split. Defaults to true. */ stratify?: boolean; /** @description Tags attached to the created job. */ tags?: string[]; /** @description Fraction of the data held out as the test set. Defaults to 0.2. */ test_size?: number; }; TrainClassifierResponse: { /** * Format: uuid * @description Id of the created training job. Poll the jobs API for status and results. */ job_id: string; }; /** * @description A unique identifier for the model within the company's namespace. * * Model names must consist of only alphanumeric characters, underscores, dashes, and dots, * and be <= 256 characters long. */ ModelName: string; /** * @description A human readable name for the model. * * Model names must be non-empty and can only contain up to 512 characters. */ ModelDisplayName: string; /** * @example { * "type": "hugging_face", * "organization": "meta-llama" * } */ HuggingFaceRepository: { /** @enum {string} */ type: "hugging_face"; /** @description The HuggingFace organization name. */ organization: string; }; /** * @example { * "type": "narrative", * "company_id": 1 * } */ NarrativeRepository: { /** @enum {string} */ type: "narrative"; /** * Format: int64 * @description The company ID that owns this Narrative repository. */ company_id: number; }; ModelRepository: components["schemas"]["HuggingFaceRepository"] | components["schemas"]["NarrativeRepository"]; /** @description No companies are allowed. */ ModelParticipantsNone: { /** @enum {string} */ type: "none"; }; /** @description All companies are allowed. */ ModelParticipantsAll: { /** @enum {string} */ type: "all"; }; /** @description Only specified companies are allowed. */ ModelParticipantsInclusion: { /** @enum {string} */ type: "inclusion"; /** @description List of company IDs that are allowed. */ companies: number[]; }; ModelParticipants: components["schemas"]["ModelParticipantsNone"] | components["schemas"]["ModelParticipantsAll"] | components["schemas"]["ModelParticipantsInclusion"]; /** * @description Defines which companies have access to train and run inference on this model. * @example { * "training": { * "type": "all" * }, * "inference": { * "type": "inclusion", * "companies": [ * 1, * 2, * 3 * ] * } * } */ ModelCollaborators: { training?: components["schemas"]["ModelParticipants"]; inference?: components["schemas"]["ModelParticipants"]; }; /** * @description Current status of the model. * @enum {string} */ ModelStatus: "active" | "archived"; /** * @example { * "id": 2, * "company_id": 1, * "name": "Llama-3.1-8B-Instruct", * "license_id": "META-LLAMA-COMMUNITY-3.1", * "repository": { * "type": "hugging_face", * "organization": "meta-llama" * }, * "collaborators": { * "training": { * "type": "all" * }, * "inference": { * "type": "all" * } * }, * "description": "Fine-tuned Llama model for instruction following", * "tags": [ * "llm", * "instruct" * ], * "base_model_id": null, * "created_at": "2024-01-15T10:30:00Z", * "updated_at": null, * "archived_at": null, * "version": 1, * "status": "active" * } */ ModelResponse: { /** * Format: int64 * @description Unique identifier for the model. */ id: number; /** * Format: int64 * @description The ID of the company that owns this model. */ company_id: number; name: components["schemas"]["ModelName"]; display_name?: components["schemas"]["ModelDisplayName"]; /** @description The license identifier (e.g., "META-LLAMA-COMMUNITY-3.1", "apache-2.0"). */ license_id: string; repository: components["schemas"]["ModelRepository"]; collaborators: components["schemas"]["ModelCollaborators"]; /** @description Optional description of the model. */ description?: string; /** @description List of tags associated with the model. */ tags: string[]; /** * Format: int64 * @description ID of the base model this model was derived from (if applicable). */ base_model_id?: number; /** * Format: date-time * @description When the model was created. */ created_at: string; /** * Format: date-time * @description When the model was last updated. */ updated_at?: string; /** * Format: date-time * @description When the model was archived (if applicable). */ archived_at?: string; /** @description Model version number. */ version: number; status: components["schemas"]["ModelStatus"]; }; /** * Format: int64 * @description The number of the previous page, or null on the first page. * @example 1 */ ModelPrevPage: number | null; /** * Format: int64 * @description The number of the next page, or null on the last page. * @example 2 */ ModelNextPage: number | null; /** * Format: int64 * @description Total number of model records. * @example 15 */ ModelTotalRecords: number; /** * Format: int64 * @description Total number of pages. * @example 2 */ ModelTotalPages: number; /** * @example { * "prev_page": null, * "current_page": 1, * "next_page": null, * "total_records": 2, * "total_pages": 1, * "records": [ * { * "id": 1, * "company_id": 1, * "name": "Llama-3.2-1B", * "license_id": "META-LLAMA-COMMUNITY-3.2", * "repository": { * "type": "hugging_face", * "organization": "meta-llama" * }, * "collaborators": { * "training": { * "type": "all" * }, * "inference": { * "type": "all" * } * }, * "description": "Base Llama 3.2 1B model", * "tags": [ * "llm", * "base" * ], * "base_model_id": null, * "created_at": "2024-01-10T08:00:00Z", * "updated_at": null, * "archived_at": null, * "version": 1, * "status": "active" * }, * { * "id": 2, * "company_id": 1, * "name": "Llama-3.1-8B-Instruct", * "license_id": "META-LLAMA-COMMUNITY-3.1", * "repository": { * "type": "hugging_face", * "organization": "meta-llama" * }, * "collaborators": { * "training": { * "type": "all" * }, * "inference": { * "type": "all" * } * }, * "description": "Fine-tuned Llama model for instruction following", * "tags": [ * "llm", * "instruct" * ], * "base_model_id": null, * "created_at": "2024-01-15T10:30:00Z", * "updated_at": null, * "archived_at": null, * "version": 1, * "status": "active" * } * ] * } */ ModelsPaginatedResponse: { records: components["schemas"]["ModelResponse"][]; prev_page?: components["schemas"]["ModelPrevPage"]; current_page?: components["schemas"]["CurrentPage"]; next_page?: components["schemas"]["ModelNextPage"]; total_records?: components["schemas"]["ModelTotalRecords"]; total_pages?: components["schemas"]["ModelTotalPages"]; }; /** * @example { * "description": "Fine-tuned for marketing content generation", * "tags": [ * "llm", * "instruct", * "marketing" * ] * } */ UpdateModelRequest: { /** @description The license identifier. */ license_id?: string; /** @description Optional description of the model. */ description?: string; /** @description List of tags to associate with the model. */ tags?: string[]; collaborators?: components["schemas"]["ModelCollaborators"]; display_name?: components["schemas"]["ModelDisplayName"]; }; /** * Format: uuid * @description A dataplane represent where you would run the query. Your query get compiled * to the SQL dialect that your data engine understands. If you leave it blank, * your query will target Narrative's dataplane on AWS using Apache Spark. We * currently support Snowflake and we plan to support other dataplanes in the * future. See https://next.narrative.io/products/narrative-anywhere for more * details. */ DataPlaneId: string; ValidateRequest: { nql: components["schemas"]["NQL"]; data_plane_id?: components["schemas"]["DataPlaneId"] | null; }; /** @description The text of the query fragment this node was parsed from. */ Nql: string; /** * @description The alias given with `AS`. Only present on aliased nodes: select-list expressions, FROM items and * common table expressions. When it is present the node's `nql` is the full ` AS ` text. */ Alias: string; /** * @description One node of the parsed query. Object nodes are told apart by `type`. A JSON array is a list of nodes, * which is how the right-hand side of `IN (...)` is represented. */ Ast: components["schemas"]["Select"] | components["schemas"]["AggFunction"] | components["schemas"]["AstList"] | components["schemas"]["BinaryOp"] | components["schemas"]["Case"] | components["schemas"]["CreateMaterializedView"] | components["schemas"]["Explain"] | components["schemas"]["Function"] | components["schemas"]["Lit"] | components["schemas"]["IdentAmbiguous"] | components["schemas"]["IdentColumn"] | components["schemas"]["IdentTable"] | components["schemas"]["IdentLambdaParamRef"] | components["schemas"]["Join"] | components["schemas"]["Lambda"] | components["schemas"]["LambdaParam"] | components["schemas"]["Op"] | components["schemas"]["TypeSpec"] | components["schemas"]["Window"] | components["schemas"]["Unknown"]; /** select */ Select: { /** @constant */ type: "select"; nql: components["schemas"]["Nql"]; as?: components["schemas"]["Alias"]; columns: components["schemas"]["Ast"][]; /** @description The FROM item, or null for a select with no FROM clause. */ from?: components["schemas"]["Ast"] | null; group_by: components["schemas"]["Ast"][]; having?: components["schemas"]["Ast"] | null; is_distinct: boolean; limit?: components["schemas"]["Ast"] | null; order_by: components["schemas"]["Ast"][]; qualify?: components["schemas"]["Ast"] | null; where?: components["schemas"]["Ast"] | null; /** @description Named windows declared in a `WINDOW` clause. */ windows: components["schemas"]["Ast"][]; /** @description The common table expressions of a `WITH` clause. Each is a `select` node whose `as` is the CTE name. */ with: components["schemas"]["Ast"][]; }; /** aggregate function */ AggFunction: { /** @constant */ type: "agg_function"; nql: components["schemas"]["Nql"]; as?: components["schemas"]["Alias"]; args: components["schemas"]["Ast"][]; /** @description The function name as written, for example `SUM` or `COUNT`. */ name: string; /** * @description The `ALL` or `DISTINCT` quantifier, or null when none was written. * @enum {string|null} */ quantifier?: "all" | "distinct" | null; }; /** * list * @description A list of nodes, for example the values of an `IN (...)` clause. */ AstList: AstListNode; /** binary operator */ BinaryOp: { /** @constant */ type: "binary_op"; nql: components["schemas"]["Nql"]; as?: components["schemas"]["Alias"]; /** @description The operator as written, for example `+`, `=`, `AND` or `IN`. */ name: string; left: components["schemas"]["Ast"]; right: components["schemas"]["Ast"]; }; /** when */ CaseArgWhen: { /** @constant */ type: "when"; nql: components["schemas"]["Nql"]; condition: components["schemas"]["Ast"]; value: components["schemas"]["Ast"]; }; /** else */ CaseArgElse: { /** @constant */ type: "else"; nql: components["schemas"]["Nql"]; value: components["schemas"]["Ast"]; }; CaseArg: components["schemas"]["CaseArgWhen"] | components["schemas"]["CaseArgElse"]; /** case */ Case: { /** @constant */ type: "case"; nql: components["schemas"]["Nql"]; as?: components["schemas"]["Alias"]; /** @description The `WHEN ... THEN ...` branches in order, followed by the `ELSE` branch if there is one. */ args: components["schemas"]["CaseArg"][]; }; /** create materialized view */ CreateMaterializedView: { /** @constant */ type: "create_materialized_view"; nql: components["schemas"]["Nql"]; /** @description The name of the materialized view being created. */ name: string; select: components["schemas"]["Select"]; }; /** explain */ Explain: { /** @constant */ type: "explain"; nql: components["schemas"]["Nql"]; query: components["schemas"]["Ast"]; }; /** function */ Function: { /** @constant */ type: "function"; nql: components["schemas"]["Nql"]; as?: components["schemas"]["Alias"]; args: components["schemas"]["Ast"][]; /** @description The function name as written, for example `ARRAY` or `NAMED_STRUCT`. */ name: string; }; /** * a simple type * @description The type of a literal as the parser inferred it. Told apart by `type`. */ SimpleType: components["schemas"]["NqlArrayType"] | components["schemas"]["NqlBinaryType"] | components["schemas"]["NqlBooleanType"] | components["schemas"]["NqlDoubleType"] | components["schemas"]["NqlLongType"] | components["schemas"]["NqlIntervalType"] | components["schemas"]["NqlObjectType"] | components["schemas"]["OtherType"] | components["schemas"]["NqlStringType"] | components["schemas"]["TimestampType"]; /** array */ NqlArrayType: { /** @constant */ type: "array"; /** @description The element type, or null when it could not be inferred. */ items?: components["schemas"]["SimpleType"] | null; }; /** binary */ NqlBinaryType: { /** @constant */ type: "binary"; }; /** boolean */ NqlBooleanType: { /** @constant */ type: "bool"; }; /** double */ NqlDoubleType: { /** @constant */ type: "double"; }; /** long */ NqlLongType: { /** @constant */ type: "long"; }; /** interval */ NqlIntervalType: { /** @constant */ type: "interval"; /** @enum {string} */ period: "day" | "day_hour" | "day_minute" | "day_second" | "hour" | "hour_minute" | "hour_second" | "minute" | "minute_second" | "month" | "second" | "year" | "year_month"; }; /** object */ NqlObjectType: { /** @constant */ type: "object"; /** @description The types of the object's fields, in order. */ properties: components["schemas"]["SimpleType"][]; }; /** other */ OtherType: { /** @constant */ type: "other"; }; /** string */ NqlStringType: { /** @constant */ type: "string"; }; /** timestamp */ TimestampType: { /** @constant */ type: "timestamp"; }; /** literal */ Lit: { /** @constant */ type: "literal"; nql: components["schemas"]["Nql"]; as?: components["schemas"]["Alias"]; value_type: components["schemas"]["SimpleType"]; /** @description The literal's value as text, or null when it has no textual form. */ value?: string | null; }; /** * ambiguous * @description A dotted name that could not be resolved to a table or column. */ IdentAmbiguous: { /** @constant */ type: "ambiguous"; nql: components["schemas"]["Nql"]; as?: components["schemas"]["Alias"]; /** @description The name split on its dots. */ parts: string[]; }; /** * column * @description A column of a dataset, materialized view or view. */ RegularColumn: { /** @constant */ column_type: "column"; }; /** * attribute * @description A column that resolved to an attribute. */ AttributeColumn: { /** @constant */ column_type: "attribute"; /** @description The attribute's id. */ id: number; /** @description The attribute's name. */ name: string; }; /** * reference * @description A column of a `rosetta_stone` or `reference` table. */ ReferenceColumn: { /** @constant */ column_type: "reference"; }; /** @description What the column resolved to. Told apart by `column_type`. */ ColumnMetadata: components["schemas"]["RegularColumn"] | components["schemas"]["AttributeColumn"] | components["schemas"]["ReferenceColumn"]; /** column */ IdentColumn: { /** @constant */ type: "column"; nql: components["schemas"]["Nql"]; as?: components["schemas"]["Alias"]; db?: string | null; /** @description The schema part of the name, for example `company_data`, or null when it was not written. */ schema?: string | null; table: string; column: string; metadata: components["schemas"]["ColumnMetadata"]; }; /** dataset */ DatasetTable: { /** @constant */ table_type: "dataset"; id: components["schemas"]["DatasetId"]; name: components["schemas"]["DatasetName"]; }; /** access_rule */ AccessRulesTable: { /** @constant */ table_type: "access_rule"; id: components["schemas"]["AccessRuleId"]; name?: components["schemas"]["AccessRuleName"] | null; }; /** materialized_view */ MaterializedViewTable: { /** @constant */ table_type: "materialized_view"; id: components["schemas"]["DatasetId"]; name: components["schemas"]["DatasetName"]; }; /** * rosetta_stone * @description The `narrative.rosetta_stone` table. */ RosettaStoneTable: { /** @constant */ table_type: "rosetta_stone"; }; /** reference */ ReferenceTable: { /** @constant */ table_type: "reference"; }; /** view */ ViewTable: { /** @constant */ table_type: "view"; id: components["schemas"]["ViewId"]; name: components["schemas"]["ViewName"]; }; /** @description What the table resolved to. Told apart by `table_type`. */ TableMetadata: components["schemas"]["DatasetTable"] | components["schemas"]["AccessRulesTable"] | components["schemas"]["MaterializedViewTable"] | components["schemas"]["RosettaStoneTable"] | components["schemas"]["ReferenceTable"] | components["schemas"]["ViewTable"]; /** table */ IdentTable: { /** @constant */ type: "table"; nql: components["schemas"]["Nql"]; as?: components["schemas"]["Alias"]; db?: string | null; /** @description The schema part of the name, for example `company_data`, or null when it was not written. */ schema?: string | null; table: string; metadata: components["schemas"]["TableMetadata"]; }; /** * lambda parameter reference * @description A reference to a parameter of an enclosing lambda, for example `metadata.company_id`. */ IdentLambdaParamRef: { /** @constant */ type: "lambda_param_ref"; nql: components["schemas"]["Nql"]; /** @description The name split on its dots. */ parts: string[]; }; /** * join * @description A join between two FROM items. Unlike other nodes it carries no `nql` unless it is aliased. */ Join: { /** @constant */ type: "join"; nql?: components["schemas"]["Nql"]; as?: components["schemas"]["Alias"]; /** @description The `ON` or `USING` condition, or null when the join has none. */ condition?: components["schemas"]["Ast"] | null; /** @enum {string} */ condition_type: "none" | "on" | "using"; left: components["schemas"]["Ast"]; /** @enum {string} */ join_type: "as_of" | "comma" | "cross" | "full" | "inner" | "left" | "left_as_of" | "left_anti" | "left_semi" | "right"; right: components["schemas"]["Ast"]; }; /** * type specification * @description A type written in the query, for example the target of a `CAST` or a lambda parameter's row type. */ TypeSpec: { /** @constant */ type: "type_spec"; nql: components["schemas"]["Nql"]; /** @description The type in lower case, as the parser normalised it. */ value: string; }; /** lambda parameter */ LambdaParam: { /** @constant */ type: "lambda_param"; nql: components["schemas"]["Nql"]; name: string; type_spec: components["schemas"]["TypeSpec"]; }; /** * lambda * @description A lambda expression such as `(metadata) -> metadata.company_id = 10`. */ Lambda: { /** @constant */ type: "lambda"; nql: components["schemas"]["Nql"]; parameters: components["schemas"]["LambdaParam"][]; /** @description The lambda body, or null when it could not be resolved. */ expression?: components["schemas"]["Ast"] | null; }; /** * operator * @description An operator that is neither binary nor an aggregate, for example a unary `NOT` or a table function call. */ Op: { /** @constant */ type: "operator"; nql: components["schemas"]["Nql"]; as?: components["schemas"]["Alias"]; args: components["schemas"]["Ast"][]; name: string; }; /** @description A reference to a table, a column or a lambda parameter. Told apart by `type`. */ Ident: components["schemas"]["IdentAmbiguous"] | components["schemas"]["IdentColumn"] | components["schemas"]["IdentTable"] | components["schemas"]["IdentLambdaParamRef"]; /** window */ Window: { /** @constant */ type: "window"; nql: components["schemas"]["Nql"]; as?: components["schemas"]["Alias"]; lower_bound?: components["schemas"]["Ast"] | null; /** @description The name of a window declared in a `WINDOW` clause, or null for an inline window. */ name?: components["schemas"]["Ident"] | null; order_by: components["schemas"]["Ast"][]; partitions: components["schemas"]["Ast"][]; upper_bound?: components["schemas"]["Ast"] | null; }; /** * unknown * @description A fragment the serializer has no representation for. Only `nql` is available. */ Unknown: { /** @constant */ type: "unknown"; nql: components["schemas"]["Nql"]; as?: components["schemas"]["Alias"]; }; /** * no ast * @description Returned when the statement is valid but has no AST to show. */ EmptyAst: Record; /** * @description The parsed statement as an AST. A `MERGE` statement has no AST representation and returns an empty * object instead, as does a statement whose AST could not be serialized. */ ValidateResponse: components["schemas"]["Ast"] | components["schemas"]["EmptyAst"]; /** * Format: uuid * @description The ID of the compute pool to run on. The compute pool must be active, belong to your company, and be * associated with the target data plane. If not specified, the default compute pool for the data plane will be * used (if one is configured). * @example 5c8f4a2e-3b1d-4f6a-9c7e-2d8b1a0f5e93 */ ComputePoolId: string; ForecastInput: { nql: components["schemas"]["NQL"]; compiled_sql: string; }; ForecastResult: { /** @constant */ type: "success"; /** @constant */ nql_type: "forecast"; /** * Format: int64 * @description The number of rows the query would return. */ rows: number; /** * Format: int64 * @description cost in micro cents USD */ cost: number; }; /** @description A forecast job, started by an `EXPLAIN` statement. */ ForecastRunResponse: components["schemas"]["RunResponseBase"] & { /** @description The query and its compiled SQL as sent to the executor. */ input: components["schemas"]["ForecastInput"]; /** * @description The forecast once the job has completed, or the failure that ended it. Null while the job is * pending or running. */ result?: components["schemas"]["ForecastResult"] | components["schemas"]["RunFailureResult"] | null; }; NqlRunResponse: components["schemas"]["ForecastRunResponse"] | components["schemas"]["CreateMaterialiedViewRunResponse"]; ExecuteRequest: { nql: components["schemas"]["NQL"]; data_plane_id?: components["schemas"]["DataPlaneId"] | null; compute_pool_id?: components["schemas"]["ComputePoolId"] | null; create_as_view?: components["schemas"]["CreateAsView"] | null; }; /** @description A created workflow whose run was started, so the run ID is always present. */ CreateWorkflowResponseWithRunId: components["schemas"]["WorkflowResponse"] & { run_id: components["schemas"]["WorkflowRunId"]; }; BucketPolicyAccess: { /** * @description Providing access for the root user of specified account_id. * @enum {string} */ type?: "bucket_policy"; /** * @description Your company's 12 digit AWS account ID. Root user of that account will be granted to reach the bucket. * @example 12345678901 */ account_id: string; }; RoleAccess: { /** * @description Authenticate using an AWS IAM role. * @enum {string} */ type?: "role"; /** * @description Applicable authentication types: `role` * * Your company's 12 digit AWS account ID. * @example 12345678901 */ account_id: string; /** * @description Applicable authentication types: `role` * * An optional external identifier that, if specified, must be provided when assuming the bucket access role. * * An external identifier will only be associated with the role if one was provided at bucket creation. * * [Learn more](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html?icmpid=docs_iam_console). */ external_id?: string; /** * @description Applicable authentication types: `role` * * The ARN of the role to assume to perform bucket management operations. * @example arn:aws:iam::704349335716:role/nio-yourcompany-821627dd2931-access */ role?: string; }; CompanyBucketAuth: components["schemas"]["BucketPolicyAccess"] | components["schemas"]["RoleAccess"]; /** * @description An AWS S3 bucket created inside Narrative's AWS account assigned to a specific company. * @example { * "id": "45b40bf5-02fc-4f18-bfcd-50ac58dabfa1", * "company_id": 1, * "auth": { * "type": "bucket_policy", * "account_id": "123456789012" * }, * "name": "nio-yourcompany-821627dd2931", * "created_at": "2021-08-31T20:22:02Z", * "updated_at": "2021-08-31T20:22:02Z" * } */ CompanyBucketResponse: { /** * @description Unique identifier for the bucket. * @example 4d5451ff-5fe6-4db3-9398-4075bbd275b0 */ id?: string; auth?: components["schemas"]["CompanyBucketAuth"]; /** @description The ID of the company owning the bucket. */ company_id?: number; /** * @description The AWS S3 bucket name. The bucket name is of the form `nio-${resource_id}-${suffix}` where `resouce_id` is the resource ID provided at bucket creation and `suffix` is 12 randomly chosen alphanumeric characters. * * A random suffix is appended to the bucket name for two reasons: * - AWS S3 bucket names must be globally unique, i.e. the bucket namespace is shared by all AWS accounts. * Appending a random suffix helps ensure that we can create a bucket which includes your preferred resource * ID. * - Another consequence of AWS S3 bucket names needing to be globally unique is that anyone can easily check if * a bucket with a given name exists. By appending a random suffix to your bucket we are preventing information * leakage by making it impractical for an attacker to determine whether you are a customer of Narrative by * simply guessing your resource ID and checking whether a bucket with the name `nio-${resource_id}` exists. * @example nio-yourcompanyname-50ac58dabfa1 */ name?: string; /** * @description ISO-8601 timestamp indicating when the bucket was created. * @example 2021-08-26T21:06:07.710357Z */ created_at?: string; /** * @description ISO-8601 timestamp indicating when the bucket was last updated. * @example 2021-08-26T21:06:07.710357Z */ updated_at?: string; /** @description Is it allowed to change access type. Changes are allowed by default. Restrictions could be applied in case bucket was manually config */ is_access_mutable?: boolean; }; /** @description An AWS S3 bucket created inside Narrative's AWS account assigned to a specific company. */ CompanyBucketsResponse: { records?: components["schemas"]["CompanyBucketResponse"][]; }; CompanyBucketRequest: { /** * @description Your 12 digit AWS account ID. That ID will be used: * - to enable root-based access in case of "bucket_policy" access type; * - to create (or use existing) IAM Role that will be available for specified user. * @example 12345678901 */ account_id: string; /** * @description A short identifier that will be a part of your bucket's name. * * A typical choice would be your company's name, lowercased and spaces replaced with `-`. * * Resource IDs must: * - consist of only **lowercase** alphanumeric characters or `-` * - be at least 2 and less than 43 characters long * @example yourcompany */ resource_id: string; /** * @example { * "type": "role", * "external_id": "22a7553b-9240-4b81-93ae-54ccbcde0a8" * } */ access?: { /** * @description Access using: * - bucket policy that shares access to the root of AWS account * - an AWS IAM role * @enum {string} */ type?: "bucket_policy" | "role"; /** * @description Warning! External ID is used only(!) for "role" type of access. * * You can optionally increase the security of your role by requiring an external identifier which prevents "confused deputy" attacks. * * If specified, users in your AWS account will have to provide the external identifier when assuming the bucket access role Narrative creates for you to manage your bucket. * * [Learn more](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html?icmpid=docs_iam_console). * * External IDs must: * - consist of any of the following characters: alphanumeric characters, `=`, `,`, `.`, `@`, `:`, `/`, `-`, `_` * - be at least 2 and less than 1224 characters long * @example null */ external_id?: string; }; }; /** * @example { * "type": "bucket_policy" * } */ BucketPolicyAccessTypeRequest: { /** * @description Access using bucket policy that shares access to the root of AWS account * @enum {string} */ type: "bucket_policy"; }; /** * @example { * "type": "role", * "external_id": "22a7553b-9240-4b81-93ae-54ccbcde0a8" * } */ RoleAccessTypeRequest: { /** * @description Access using an AWS IAM role * @enum {string} */ type: "role"; /** * @description You can optionally increase the security of your role by requiring an external identifier which prevents "confused deputy" attacks. * * If specified, users in your AWS account will have to provide the external identifier when assuming the bucket access role Narrative creates for you to manage your bucket. * * [Learn more](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html?icmpid=docs_iam_console). * * External IDs must: * - consist of any of the following characters: alphanumeric characters, `=`, `,`, `.`, `@`, `:`, `/`, `-`, `_` * - be at least 2 and less than 1224 characters long * @example null */ external_id?: string; }; UpdateBucketAccessTypeRequest: { /** * @description Full name of the bucket that should be affected. * @example nio-yourcompany-iwhhrql8sgvp */ bucket_name: string; new_access: components["schemas"]["BucketPolicyAccessTypeRequest"] | components["schemas"]["RoleAccessTypeRequest"]; }; UpdateSlugRequest: { slug?: string; }; UpdateSlugResponse: { app_id?: number; slug?: string; }; UploadUrl: { /** * @description The path where the file will be uploaded to * @example /lists/idlist.csv */ path?: string; /** * @description The upload url to be called to actually do the file upload * @example https://narrative-file-upload-dev.s3.amazonaws.com/companyId%3D1/my-list.csv?X-Amz-Security-Token=REDACTED&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20210122T151716Z&X-Amz-SignedHeaders=host&X-Amz-Expires=1799&X-Amz-Credential=REDACTED&X-Amz-Signature=REDACTED */ url?: string; /** * @description The expiry time after which the upload won't be accepted * @example 2021-01-22T15:47:16.036Z */ expiry?: string; }; /** * @description The ID of the company to which the usage will be applied. * @example 1 */ UsageCompanyId: number; /** * @description Optional. The ID of the user that triggered the usage event. * @example 2 */ CreatedBy: number; /** * @description An arbitrary collection of key-value pairs that can be used to categorize or tag the event. * * These key-values become aggregable dimensions in usage reports. * @example { * "dataset_id": "123" * } */ Dimensions: { [key: string]: string; }; /** * Format: date-time * @description ISO-8601 timestamp indicating when the usage event occurred. Cannot be more than 72 hours in the past. * @example 2022-11-10T00:00:00Z */ EventTimestamp: string; /** * @description The type of usage event. `event_type` works alongside dimensions and measures to describe the details of the * event. * @example processing-dataset-ingestion */ UsageEventType: string; /** * Format: uuid * @description A UUID that ensures the usage event is processed and stored only once, even if the event is sent multiple times. * * This unique identifier helps to prevent duplicate usage events from being recorded and allows for reliable * processing and storage of the event. If a usage event with a previously used idempotency_key is received, the * original stored event is returned instead of creating a new event. * @example 882e0a91-10a2-47c7-8e70-69344d725a6f */ UsageIdempotencyKey: string; /** * @description A set of additional numerical values associated with the usage event that are beyond what is captured in the * usage field. These values may be used for reporting purposes and can provide additional context about the event. * @example { * "rows": 8212837 * } */ Measures: { [key: string]: number; }; /** * @description Unique identifier for the product for . * @example general-purpose-processing-aws-us-east-1 */ Sku: string; /** * @description The amount of the product referred to by the `sku` that is being used, expressed as a numerical value and * corresponding unit of measure. * * The unit field must match the unit of measure for the product, and the value field indicates the amount of the * product used in terms of the given unit. */ Usage: { /** @example gigabytes */ unit: string; /** * Format: double * @example 181.281 */ value: number; }; CreateUsageRequest: { company_id: components["schemas"]["UsageCompanyId"]; created_by?: components["schemas"]["CreatedBy"]; dimensions: components["schemas"]["Dimensions"]; event_timestamp: components["schemas"]["EventTimestamp"]; event_type: components["schemas"]["UsageEventType"]; idempotency_key: components["schemas"]["UsageIdempotencyKey"]; measures?: components["schemas"]["Measures"]; sku: components["schemas"]["Sku"]; usage: components["schemas"]["Usage"]; }; CreateUsageResponse: { /** * Format: uuid * @description Unique identifier for the usage event. * @example fe0212f6-3440-44e6-b049-ef6c5ad1f396 */ id: string; /** * @description The id of the application that created the usage event. * @example 5 */ app_id: number; company_id: components["schemas"]["UsageCompanyId"]; /** * Format: date-time * @description ISO-8601 timestamp indicating when the usage event was persisted. * @example 2022-11-10T00:00:00Z */ created_at: string; created_by?: components["schemas"]["CreatedBy"]; dimensions: components["schemas"]["Dimensions"]; event_timestamp: components["schemas"]["EventTimestamp"]; event_type: components["schemas"]["UsageEventType"]; idempotency_key: components["schemas"]["UsageIdempotencyKey"]; measures?: components["schemas"]["Measures"]; sku: components["schemas"]["Sku"]; usage: components["schemas"]["Usage"]; }; /** * @example { * "bucket_suffix": "/my-subscription", * "number_of_files": "5" * } */ QuickSettings: Record; /** * @example { * "metadata": { * "revision": 42, * "timestamp": "2021-11-23T20:37:32.452Z" * }, * "payload_type": "PerformDelivery", * "payload": { * "subscriptionId": "0889d6d0-d31b-4196-b2fd-66e219f2e5e4", * "transactionBatchId": "4202d94d-41eb-4e45-9468-fd75d47804ac", * "profileId": "d13867f7-a6c0-4f83-b129-f6c6f2de7c15", * "quickSettings": { * "bucketprefix": "/mydelivery" * } * } * } */ Command: { metadata?: { revision?: number; /** Format: date-time */ timestamp?: string; }; /** @enum {string} */ payload_type?: "PerformDelivery"; payload?: { /** Format: uuid */ subscriptionId?: string; /** Format: uuid */ transactionBatchId?: string; /** Format: uuid */ profileId?: string; quickSettings?: components["schemas"]["QuickSettings"]; }; }; PaginatedCommands: { records?: components["schemas"]["Command"][]; }; /** * @example [ * { * "company_id": 1, * "file": "part-00001-cefc489b-7d3b-4409-8632-19122002bbd3-c000.json", * "size": 8022466827, * "subscription_id": "31ebdb17-6799-4447-a99c-6e3aa8da3237", * "transaction_batch_id": "f6eeafa3-d599-4469-825c-bf0da93f68af", * "timestamp": "2022-04-20T23:37:39Z" * }, * { * "company_id": 1, * "file": "part-00002-cefc489b-7d3b-4409-8632-19122002bbd3-c000.json", * "size": 8022349030, * "subscription_id": "31ebdb17-6799-4447-a99c-6e3aa8da3237", * "transaction_batch_id": "f6eeafa3-d599-4469-825c-bf0da93f68af", * "timestamp": "2022-04-20T23:36:52Z" * } * ] */ DeliveryFiles: { company_id?: number; file?: string; /** @description File size in bytes */ size?: number; /** Format: uuid */ subscription_id?: string; /** Format: uuid */ transaction_batch_id?: string; /** @description ISO-8601 timestamp indicating when the file was created */ timestamp?: string; }[]; /** @description Name of the image that you want to upload. */ UploadImageUrlRequest: { /** @example logo.png */ image_name?: string; }; /** @description Presigned AWS URL, permanent URL and expiration. */ UploadImageUrlResponse: { /** @example https://fake-test-cdn.s3.amazonaws.com/images/company-logos/local/companyId_1__56ff5f47-7660-4c0c-807e-af2c8a3e666b_logo.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20221206T163031Z&X-Amz-SignedHeaders=host */ upload_url?: string; /** @example https://fake-test-cdn.s3.amazonaws.com/images/company-logos/local/companyId_1__56ff5f47-7660-4c0c-807e-af2c8a3e666b_logo.png */ permanent_url?: string; /** @example 2022-12-06T17:00:31.098Z */ expiry?: string; /** @example image/png */ content_type?: string; }; /** * @example { * "resource": "test_resource", * "status": { * "type": "active" * }, * "verb": { * "type": "read" * } * } */ CreatePermissionRequest: { /** @description Resource type associated with a permissions */ resource: string; /** @description Status of a permission */ status: { /** @enum {string} */ type: "active" | "archived" | "pending"; }; /** @description Verb (action) associated with a permissions */ verb: { /** @enum {string} */ type: "read" | "write"; }; }; /** * @example { * "billing_month": "2022-08-31T22:00:00Z", * "company_id": 1, * "company_name": "test_company1", * "dataset_id": 322, * "avg_gb_hours": 4 * } */ DatasetStorageBillingView: { /** Format: date-time */ billing_month: number; company_id: number; company_name: string; dataset_id: number; avg_gb_hours?: number; }; DatasetStorageBillingViewResponse: components["schemas"]["DatasetStorageBillingView"][]; AccessTokenInfo: { /** * Format: date-time * @description The expiry time of this access token. To the second precision, in UTC and formatted as a ISO 8601 time. */ expires_at: string; }; /** @enum {string} */ Access: "read" | "write" | "admin"; ResourcePermissions: { access: components["schemas"]["Access"][]; resource: components["schemas"]["PermissionResource"]; }; Permissions: components["schemas"]["ResourcePermissions"][]; /** * @example { * "user_id": 407, * "access_token": { * "expires_at": "2026-01-01T00:00:00Z" * }, * "name": "John Doe", * "email": "john.doe@narrative.io", * "role": "partner_admin", * "company_access_list": [ * 1 * ], * "accessible_companies": [ * { * "company_id": 1, * "slug": "narrative", * "name": "Narrative, Inc (id 1!)", * "short_description": "Another New Short Description", * "long_description": "Narrative Long Description", * "contact_email": null, * "website": "https://app-dev.narrative.io/", * "data_shop_url": "https://shop.nicks.io/", * "twitter_link": "https://twitter.com/narrative_io", * "linkedin_link": "https://www.linkedin.com/company/narrative-io", * "image_url": null, * "status": "active", * "visibility": "visible" * } * ], * "current_company_scope": { * "company_id": 1, * "slug": "narrative", * "name": "Narrative, Inc (id 1!)", * "short_description": "Another New Short Description", * "long_description": "Narrative Long Description", * "contact_email": null, * "website": "https://app-dev.narrative.io/", * "data_shop_url": "https://shop.nicks.io/", * "twitter_link": "https://twitter.com/narrative_io", * "linkedin_link": "https://www.linkedin.com/company/narrative-io", * "image_url": null, * "status": "active", * "visibility": "visible" * }, * "created_at": "2022-11-29T21:42:24.978707Z", * "created_by": null, * "last_updated_at": null, * "last_updated_by": null * } */ WhoamiResponse: { /** @description The user id */ user_id?: number; /** @description Information about the access token used to make this request. */ access_token?: components["schemas"]["AccessTokenInfo"]; /** @description Name of the user */ name?: string; /** * Format: email * @description Email address of the user */ email?: string; /** * @description The user's role. * * - `global_admin` — Narrative staff, unrestricted across companies * - `partner_admin` — administers their own company * - `partner_user` — ordinary member of their own company * @enum {string} */ role?: "global_admin" | "partner_admin" | "partner_user"; /** * @deprecated * @description IDs of companies that could be accessed by the user. Deprecated, use accessible_companies instead. Will be removed in a future release. */ company_access_list?: number[]; /** @description Companies that could be accessed by the user, with full company details. */ accessible_companies?: components["schemas"]["PublicCompanyResponse"][]; current_company_scope?: components["schemas"]["PublicCompanyResponse"]; permissions?: components["schemas"]["Permissions"]; /** @description The instant this user account was created. */ created_at?: components["schemas"]["Instant"]; /** @description Email address of the user who created this account. Null when no creator was recorded. */ created_by?: string | null; /** @description The instant this user account was last updated. Null when it has never been updated. */ last_updated_at?: components["schemas"]["Instant"] | null; /** @description Email address of the user who last updated this account. Null when it has never been updated. */ last_updated_by?: string | null; }; UserUpdateRequest: { /** @description User name */ name?: string; }; UserUpdateResponse: { /** @description User name */ name?: string; id?: components["schemas"]["UserId"]; }; /** * @description A filter is stored as an object with a single `values` array, not as a bare array — the request body takes the * array form and the response returns this wrapped form. * @example { * "values": [ * "9a3cf334-4c6d-4d3f-a7d6-22b6e6f2ac1b", * "d35a12c1-7a2f-46b9-8d60-9e0a2a84c205" * ] * } */ JobIdFilter: { values: components["schemas"]["JobId"][]; }; /** * @example { * "values": [ * "completed", * "failed" * ] * } */ JobStateFilter: { values: components["schemas"]["State"][]; }; /** * @example { * "values": [ * "datasets_deliver_data", * "materialize-view" * ] * } */ JobTypeFilter: { values: string[]; }; /** * @description An ISO 8601 local date-time with no offset or zone — `2025-04-29T16:12:45.123456`. Read it as UTC. This is * deliberately not `format: date-time`, which means RFC 3339 and would require an offset the server does not send. * Note that the delivered event envelope uses a different format: its `created_at` does carry a `Z`. * @example 2025-04-29T16:12:45.123456 */ LocalDateTime: string; /** * @description A webhook subscription. The `job_*` filters are only set on job subscriptions and `app_id` only on app * subscriptions; the unused ones come back as `null` rather than being omitted. * @example { * "summary": "Job subscription with all three filters set", * "value": { * "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", * "app_id": null, * "name": "job_updates", * "secret": "8b6dba8c-9a8b-4a3a-8469-9dc7a33c3e17", * "status": "active", * "company_id": 42, * "job_ids": { * "values": [ * "9a3cf334-4c6d-4d3f-a7d6-22b6e6f2ac1b", * "d35a12c1-7a2f-46b9-8d60-9e0a2a84c205" * ] * }, * "job_states": { * "values": [ * "completed", * "failed" * ] * }, * "job_types": { * "values": [ * "datasets_deliver_data", * "materialize-view" * ] * }, * "url": "https://webhooks.mycompany.com/events", * "created_at": "2025-04-29T16:12:45.123456", * "updated_at": "2025-04-29T16:12:45.123456" * } * } * @example { * "summary": "App subscription", * "value": { * "id": "6b0d0f0a-2c4e-4b6a-9c1d-3e5f7a9b1c3d", * "app_id": 1234, * "name": null, * "secret": "c1a2b3c4-d5e6-4f70-8192-a3b4c5d6e7f8", * "status": "active", * "company_id": 42, * "job_ids": null, * "job_states": null, * "job_types": null, * "url": "https://webhooks.mycompany.com/app-events", * "created_at": "2025-04-29T16:12:45.123456", * "updated_at": "2025-04-29T16:12:45.123456" * } * } */ WebhookSubscriptionResponse: { /** Format: uuid */ id: string; /** * Format: int64 * @description The app this subscription follows. Null on job subscriptions. */ app_id?: number | null; /** @description The label supplied at creation time. Null if none was given. */ name?: string | null; /** * Format: uuid * @description Sent back on every delivery in the `X-Narrative-Secret` header. Compare it against this value to confirm a * callback came from Narrative. */ secret: string; /** * @description Archiving is one-way. The read endpoints only return active subscriptions, so in practice this is always * `active` — an archived subscription responds 404. * @enum {string} */ status: "active" | "archived"; /** * Format: int64 * @description The company that owns the subscription. */ company_id: number; /** @description The `job_ids` filter, or null if the subscription does not filter by job. */ job_ids?: components["schemas"]["JobIdFilter"] | null; /** @description The `states` filter, or null if the subscription does not filter by state. */ job_states?: components["schemas"]["JobStateFilter"] | null; /** @description The `job_types` filter, or null if the subscription does not filter by type. */ job_types?: components["schemas"]["JobTypeFilter"] | null; /** * Format: uri * @description The endpoint events are delivered to. */ url: string; created_at: components["schemas"]["LocalDateTime"]; updated_at: components["schemas"]["LocalDateTime"]; }; WebhookSubscriptionsResponse: components["schemas"]["WebhookSubscriptionResponse"][]; /** * @description Subscribe to job lifecycle events. `job_ids`, `job_types` and `states` are three independent filters, combined * with AND: a job event is delivered only if it satisfies every filter you set. Omitting a filter (or sending * `null`) means "any value", so a request with all three omitted receives every job event for your company. * @example { * "summary": "Every terminal event for one job type", * "value": { * "type": "webhook_subscription_jobs", * "job_types": [ * "datasets_deliver_data" * ], * "states": [ * "completed", * "failed" * ], * "url": "https://webhooks.mycompany.com/events", * "name": "delivery_outcomes" * } * } * @example { * "summary": "Follow two specific jobs to completion", * "value": { * "type": "webhook_subscription_jobs", * "job_ids": [ * "9a3cf334-4c6d-4d3f-a7d6-22b6e6f2ac1b", * "d35a12c1-7a2f-46b9-8d60-9e0a2a84c205" * ], * "states": [ * "completed" * ], * "url": "https://webhooks.mycompany.com/events" * } * } * @example { * "summary": "Every job event for the company", * "value": { * "type": "webhook_subscription_jobs", * "url": "https://webhooks.mycompany.com/events", * "name": "firehose" * } * } */ JobsWebhookSubscriptionRequest: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "webhook_subscription_jobs"; /** @description Deliver events only for these jobs. Omit to match any job. */ job_ids?: components["schemas"]["JobId"][] | null; /** * @description Deliver events only for jobs of these types. Omit to match any type. Job types are open-ended strings — * new ones are added as the platform grows — so this is not validated against a fixed list. Common values * include `datasets_deliver_data`, `datasets_sample`, `datasets_calculate_column_stats`, * `datasets_delete_table`, `materialize-view`, `model_training_run`, `model_inference_run` and * `nql-forecast`. */ job_types?: string[] | null; /** @description Deliver events only when a job enters one of these states. Omit to match any state. */ states?: components["schemas"]["State"][] | null; /** * Format: uri * @description The HTTPS endpoint Narrative POSTs each event to. It should return a 2xx quickly; anything else is retried. */ url: string; /** @description A label for your own use. Narrative does not interpret it. */ name?: string | null; }; /** * @description Subscribe to the events a Narrative app emits through `POST /apps/events`. Job events are never delivered to an * app subscription. * @example { * "summary": "All events from an installed app", * "value": { * "type": "webhook_subscription_app", * "app_id": 1234, * "url": "https://webhooks.mycompany.com/app-events", * "name": "app_events" * } * } */ AppWebhookSubscriptionRequest: { /** * @description discriminator enum property added by openapi-typescript * @enum {string} */ type: "webhook_subscription_app"; /** * Format: int64 * @description The app whose events you want. This is the numeric app id, not a UUID. */ app_id: number; /** * Format: uri * @description The HTTPS endpoint Narrative POSTs each event to. It should return a 2xx quickly; anything else is retried. */ url: string; /** @description A label for your own use. Narrative does not interpret it. */ name?: string | null; }; /** * @description A subscription is either job-based or app-based, chosen by `type`. The two kinds carry different filters and * cannot be mixed in one subscription. */ CreateWebhookSubscriptionRequest: components["schemas"]["JobsWebhookSubscriptionRequest"] | components["schemas"]["AppWebhookSubscriptionRequest"]; GetComputePoolsResponse: { records: components["schemas"]["ComputePoolResponse"][]; }; CreateComputePoolRequest: { /** @description Required for the `snowflake_warehouse` provider (carries the warehouse name and alias). Optional for the `aws_emr` provider — the only meaningful field there is the `type` discriminator, which the server fills in automatically when the field is omitted. Sent as null when omitted. */ external_id?: components["schemas"]["ExternalId"] | null; /** @description A unique slug identifier for the compute pool within a (company, data plane) scope. */ name: string; /** @description A human-readable name for the compute pool. */ display_name: string; /** @description An optional description of the compute pool. */ description?: string | null; tags?: string[] | null; collaborators?: components["schemas"]["ComputePoolCollaborators"] | null; provider: components["schemas"]["Provider"]; }; UpdateComputePoolRequest: { display_name?: string | null; description?: string | null; tags?: string[] | null; /** @description Leave the provider untouched by sending null. */ provider?: components["schemas"]["Provider"] | null; collaborators?: components["schemas"]["ComputePoolCollaborators"] | null; }; GetDataPlanesResponse: { records: components["schemas"]["DataPlaneResponse"][]; }; CreateDataPlaneRequest: { description?: string | null; display_name: string; external_id: string; platform: components["schemas"]["Platform"]; tags: string[]; /** @description Who else may use the data plane. Nobody, when omitted or null. */ collaborators?: components["schemas"]["DataPlaneCollaborators"] | null; }; EnqueueHealthCheckRequest: { /** * Format: uuid * @description Optional compute pool to target for the health check. If omitted, the data plane's default compute pool is used. */ compute_pool_id?: string | null; }; /** @description A paginated list of workflows. */ ListWorkflowsResponse: { /** @description The list of workflows. */ records: components["schemas"]["WorkflowResponse"][]; prev_page?: components["schemas"]["PrevPage"]; current_page: components["schemas"]["CurrentPage"]; next_page?: components["schemas"]["NextPage"]; total_records: components["schemas"]["TotalRecords"]; total_pages: components["schemas"]["TotalPages"]; }; CreateWorkflowRequest: { specification: components["schemas"]["WorkflowSpecification"]; /** * Format: uuid * @description The data plane to associate the workflow with. * @example d1e2f3a4-b5c6-7890-abcd-ef1234567890 */ data_plane_id: string; /** * @description If true, the workflow will be triggered immediately after creation. * @example false */ trigger_immediately?: boolean | null; /** * @description If true, the workflow schedule will be created immediately after creation. * @example false */ schedule_immediately?: boolean | null; tags?: components["schemas"]["WorkflowTags"]; }; TriggerWorkflowResponse: { run_id: components["schemas"]["WorkflowRunId"]; }; ScheduleWorkflowRequest: { /** * @description If true, the workflow will also be triggered immediately after scheduling. * @example false */ trigger_immediately?: boolean | null; }; ScheduleWorkflowResponse: { /** @description The run ID if the workflow was triggered immediately after scheduling. */ run_id?: components["schemas"]["WorkflowRunId"] | null; }; /** * @description The status of a workflow run. * @example completed * @enum {string} */ WorkflowRunStatus: "running" | "completed" | "failed" | "canceled" | "terminated" | "unknown"; /** @description A single execution of a workflow. */ WorkflowRun: { run_id: components["schemas"]["WorkflowRunId"]; status: components["schemas"]["WorkflowRunStatus"]; /** * Format: date-time * @description ISO-8601 timestamp of when the run started. * @example 2025-01-15T10:30:00Z */ start_time: string; /** * Format: date-time * @description ISO-8601 timestamp of when the run completed, or null if still running. * @example 2025-01-15T10:35:00Z */ close_time?: string | null; }; /** * Format: byte * @description Opaque token for cursor-based pagination. Pass this value to the `page_token` query parameter to retrieve the next page of results. * @example eyJsYXN0UnVuSWQiOiJhYmMxMjMifQ== */ PageToken: string; /** @description A paginated list of workflow runs. */ ListRunsResponse: { /** @description The list of workflow runs. */ runs: components["schemas"]["WorkflowRun"][]; /** @description Token to retrieve the next page of results, or null if there are no more results. */ next_page_token?: components["schemas"]["PageToken"] | null; }; /** * @description The body Narrative POSTs to a subscription's `url`. Every delivery has the same four-field envelope; `type` tells * you what `data` contains. * @example { * "summary": "Job event", * "value": { * "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", * "created_at": "2025-04-29T16:14:02.900Z", * "type": "job.completed", * "data": { * "job_id": "9a3cf334-4c6d-4d3f-a7d6-22b6e6f2ac1b", * "created_at": "2025-04-29T16:12:45.123456Z", * "data_plane_id": "2a5b9ad7-dc8f-47bb-8e62-843a38f8054c", * "data_plane_name": "us-east-1 production", * "ended_at": "2025-04-29T16:14:02.900Z", * "executor": null, * "idempotency_key": "some-key", * "input": { * "dataset_id": 10736, * "dataset_name": "my_dataset" * }, * "request_source": { * "type": "api_user", * "company_id": 42, * "user_id": 1248, * "user_name": "jane@mycompany.com", * "company_name": "My Company" * }, * "result": { * "rows": 1500 * }, * "state": "completed", * "type": "datasets_deliver_data", * "updated_at": "2025-04-29T16:14:02.900Z", * "dequeued_at": "2025-04-29T16:12:50Z" * } * } * } * @example { * "summary": "App event", * "value": { * "id": "0b1f6f8e-9a7c-4f7b-9a51-2f4f1f9a3c21", * "created_at": "2025-04-29T16:14:02.900Z", * "type": "my_test_app.s3_delivery.completed", * "data": { * "company_id": 42, * "connection_id": "f79cbdae-4848-47ca-95e8-69588364d185", * "app_name": "My Test App", * "dataset": { * "id": 10736, * "name": "my_dataset", * "display_name": "My Dataset" * }, * "profile": { * "id": "2a5b9ad7-dc8f-47bb-8e62-843a38f8054c", * "name": "default" * }, * "rows_delivered": 1500 * } * } * } */ WebhookDelivery: { /** * Format: uuid * @description Unique per delivery attempt-group. Retries of the same event reuse this id, so use it to make your handler * idempotent. */ id: string; /** * Format: date-time * @description When the event was queued, RFC 3339 with a `Z` offset. Note this differs from the `created_at` on * `WebhookSubscriptionResponse`, which has no offset. */ created_at: string; /** * @description `job.` for job events — `job.pending`, `job.scheduled`, `job.running`, `job.completed`, * `job.pending_cancellation`, `job.cancelled`, `job.failed`. * * `.` for app events, where `` is the app's name lowercased with a leading * "the" dropped, punctuation removed and spaces replaced by underscores — so an app named "My Test App" * reporting `s3_delivery.completed` produces `my_test_app.s3_delivery.completed`. * @example job.completed * @example my_test_app.s3_delivery.completed */ type: string; /** * @description `JobEventData` when `type` starts with `job.`, otherwise the app event payload. App payloads are * app-defined, so they are not described here beyond the fields Narrative adds. */ data: Record; }; }; responses: { /** @description Unauthorized */ Unauthorized: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; parameters: { /** * @description The token's `id`. Anything that is not a UUID does not match the route and returns 404. * @example 546c65d6-e589-4d3c-b1fe-7e61711cc418 */ AccessTokenId: string; /** @description Access rule identifier. */ AccessRuleId: number; /** @description Company slug. */ CompanySlug: string; /** @description Access rule name. */ AccessRuleName: string; /** * @description If present, returns only owned rules. This is a flag: the value is not read, so `owned_only=false` still * enables it. Ignored for unauthenticated requests. */ OwnedOnly: boolean; /** * @description If present, returns only shared (not owned) rules. This is a flag: the value is not read, so * `shared_only=false` still enables it. Ignored for unauthenticated requests. */ SharedOnly: boolean; /** * @description Check whether tag is presented. Repeat the parameter to pass several tags; a rule matches if any of them is * attached to it. If any value is invalid the whole filter is ignored. */ TagParam: string[]; /** * @description Check whether owned by the company. Repeat the parameter to pass several ids. If any value is invalid the * whole filter is ignored. */ OwnedByCompanyIdFilter: number[]; /** * @description Number of page. Starts from the first (1) page. A value that is not a non-negative integer gets a 404 with * an empty body. */ PageNumber: number; /** * @description Number of records to return. Defaults to 100. A value that is not a positive integer gets a 404 with an * empty body. */ per_page: number; /** * @description Check whether the rule is associated with specified dataset. Repeat the parameter to pass several ids. If * any value is invalid the whole filter is ignored. */ AccessRuleDatasetIdParam: number[]; /** * @description When set, only access rules on this data plane are returned. Omitted returns rules on any plane. A value * that is not a UUID gets a 404 with an empty body. */ DataPlaneIdParam: string; /** @description Free-text search term. When provided, access rules are ranked by their relevance to the search term. */ AccessRuleKeywordQueryParam: string; /** @description Query identifier. */ QueryId: string; /** @description If `true` returns only queries that are owned by the requestor. If `false` returns only queries that have been shared with the requestor. If not provided returns both. */ IsOwnedParam: boolean; /** @description Filters queries that are tagged with `tag`. Can appear multiple times, in which case they're OR-d together */ QueryTagParam: string; /** @description Number of page. Stars from the first (1) page. */ PageNumberQueryParam: number; /** @description Number of records to return. */ PerPageQueryParam: number; /** @description View identifier. */ ViewId: string; /** @description If `true` returns only views that are owned by the requestor. If `false` returns only views that have been shared with the requestor. If not provided returns both. */ ViewIsOwnedParam: boolean; /** @description Filters views that are tagged with `tag`. Can appear multiple times, in which case they're OR-d together */ ViewTagParam: string; /** * @description Unique identifier for an app invite. * @example a1b2c3d4-e5f6-7890-abcd-ef1234567890 */ AppInviteId: string; /** * @description The invite code used to look up an app invite. * @example abc123def456ghi789jkl012 */ AppInviteCode: string; /** @description a filter for app categories */ AppCategory: "destination_connector"[]; /** @description the app id */ ApplicationId: number; /** @description unique app name */ AppSlug: string; /** @description schema version id */ SchemaVersionId: string; /** @description the profile id */ AppProfileIdParam: string; /** * @description When `true` (the default), `$ref` type references are resolved and the referenced attribute's type * definition is returned in their place. When `false`, the raw `$ref` node is returned as stored. */ Resolve: boolean; /** @description Free-text search term. When provided, attributes are ranked by their relevance to the search term. */ AttributeKeywordQueryParam: string; /** * @description Optional minimum relevance score, in the half-open interval `(0, 1]`. By default no threshold is * applied and all matches are returned, ranked by relevance. Supply `min_score` to restrict the * results to attributes scoring at or above the given value; below-threshold attributes are then * excluded from both the results and the `total` count. Can only be supplied together with `q`; * supplying it without `q` returns 400. */ MinScore: number; /** @description Either an attribute name or an attribute id */ AttributeNameOrId: number | string; /** * @description Which way to walk from the attribute. `descendants` follows rules from source to target and reaches what can * be derived from the attribute; `ancestors` follows them from target to source and reaches what the attribute * can be derived from. The default walks both ways. */ DerivationDirection: "descendants" | "ancestors" | "both"; /** @description Only return connections to this app. */ AppId: number; /** @description Only return connections of this type. */ ConnectionType: "dataset" | "model"; /** @description Only return connections from this dataset. */ ConnectionDatasetIdParam: number; /** @description Only return connections from this model. */ ModelId: number; /** @description Only return connections created against this app profile. */ ProfileIdParam: string; /** @description Unique identifier for a connection. */ ConnectionId: string; /** @description Number of page. Starts from the first (1) page. */ DatasetPageNumberParam: number; /** @description Free-text keyword query matched against dataset name. */ DatasetKeywordQueryParam: string; /** @description Narrow results to datasets on this data plane. */ DatasetDataPlaneIdParam: string; /** @description Filter to datasets carrying this tag. When supplied multiple times, only datasets carrying every supplied tag are returned (all-of semantics). */ DatasetTagParam: string; /** * @description Return only the dataset's mappings with one of these sources; the datasets themselves are not filtered. * Repeat the parameter to name several; omitted, every stored mapping is returned. Naming `derived` adds the * derived mappings the dataset's stored mappings imply, whatever their own source: each is computed on the * request by applying a derivation rule to a stored mapping, has no `id` because nothing is stored, and carries * a `provenance` saying how it was produced. */ DatasetMappingSourceParam: components["schemas"]["MappingSource"][]; /** @description Unique identifier for a dataset. */ DatasetIdParam: number; /** @description The number of rows to sample from the dataset. */ SampleSize: number; /** * @description Defaults to true: returns a redacted sample, masking every column specified by the dataset's * redaction. Set to false to get the unredacted sample. A dataset with no stored redaction * returns the unredacted sample either way. */ Redacted: boolean; /** * @description If true will return 100 records. If false, only returns the most recent record. * Pagination api with `per_page` and `offset` parameters should be used instead of this one. */ AllRecords: boolean; /** @description Number of records to skip (it's usually page_number * per_page). */ Offset: number; /** @description The maximum number of bins to return for the histograms. */ HistogramBinLimit: number; /** @description Unique identifier for a snapshot. */ SnapshotId: number; /** * @description ISO-8601 timestamp that will be inclusively used as minimal timestamp of a snapshot. * @example 2021-06-24T00:54:40 */ FromTimestamp: string; /** * @description ISO-8601 timestamp that will be exclusively used as maximal timestamp of a snapshot. * @example 2021-06-24T00:54:40 */ UntilTimestamp: string; /** * @description ISO-8601 timestamp that will be inclusively used as maximal timestamp of a snapshot. * @example 2021-06-24T00:54:40 */ ToTimestamp: string; /** * @description Snapshot Id that will be inclusively used as the beginning of snapshot search range. That snapshot should exist. * @example 12345989746723134 */ FromSnapshot: number; /** * @description Snapshot Id that will be exclusively used as the end of snapshot search range. That snapshot should exist. * @example 12345989746723134 */ UntilSnapshot: number; /** * @description Snapshot Id that will be inclusively used as the end of snapshot search range. That snapshot should exist. * @example 12345989746723134 */ ToSnapshot: number; /** @description Unique identifier for a file. */ FileId: string; /** @description Id of the derivation rule. */ DerivationId: number; /** @description Unique identifier for an encryption material */ EncryptionMaterialId: string; /** @description Filter installations by app category. Can be specified multiple times to filter by multiple categories. */ InstallationAppCategoryParam: "destination_connector"[]; /** * @description Filter installations by company. Only meaningful with an app client-credentials token; with a * company-scoped token the value must match the authenticated company. * @example 456 */ InstallationsCompanyIdFilter: number; /** * @description The unique identifier for the installation. * @example 12345 */ InstallationIdParam: number; /** @description The installation ID */ InstallationId: string; /** @description The profile ID */ InstallationProfileIdParam: string; /** @description Filter jobs by data plane ID. */ data_plane_id: string; /** @description Filter jobs where the input has a dataset_id (such as materalized-view) */ dataset_id: number; /** @description Number of records to skip (page_number * per_page). */ offset: number; /** @description Order the results by a specific field. By default, job are order by created_at in descending order. */ order_by: "created_at_asc" | "created_at_desc" | "updated_at_asc" | "updated_at_desc"; /** @description Number of records to return. Defaults to 500, which is also the maximum; larger values are rejected with a 400. */ JobsPerPageParam: number; /** @description Filter jobs by state. Repeat the parameter to match any of several states. */ state: ("cancelled" | "completed" | "failed" | "pending" | "pending_cancellation" | "running" | "scheduled")[]; /** * @description Filter jobs by tag. Repeat the parameter to filter by multiple tags (e.g. `?tag=workflow_enqueued&tag=workflow_id=`); * a job matches if it carries any of the supplied tags. */ tag: string[]; /** * @description Filter jobs by type. Repeat the parameter to match any of several types. Job types are free strings on the * server; see `JobResponse` for the ones this spec describes. */ type: string[]; /** @description Filter jobs by the id of the workflow that enqueued them. Only jobs enqueued by a workflow carry a workflow id. */ workflow_id: string; /** @description Filter jobs by the id of the workflow run that enqueued them. Only jobs enqueued by a workflow run carry a workflow run id. */ workflow_run_id: string; /** @description Unique identifier for a job. */ JobId: string; /** * @description The id of an existing company * @example 345 */ CompanyIdPathParam: number; /** * @description Return only mappings with one of these sources. Repeat the parameter to name several; omitted, every stored * mapping is returned. Naming `derived` adds the derived mappings the stored mappings imply, whatever their own * source: each is computed on the request by applying a derivation rule to a stored mapping, has no `id` because * nothing is stored, and carries a `provenance` saying how it was produced. */ Source: components["schemas"]["MappingSource"][]; /** * @description Return only mappings whose expression reads this dataset field. Name a top-level column (`email`) to match * every mapping that reads it or anything nested under it, or a dotted path (`address.postal_code`) to match * only mappings that read that nested field. Repeat the parameter to match any of several. Matching uses the * dependencies computed when a mapping was saved, so with `source=derived` a derived mapping matches through * the expression it was built from. Requires `dataset_id`; a request with `depends_on_dataset_field` and no * `dataset_id` is rejected. */ DependsOnDatasetField: string[]; /** * @description Unique identifier for a mapping. * @example ea9dddd2-e3ee-40b5-b03e-c3cd37c8a6f0 */ MappingId: string; /** * @description Skip validation of the mapping expressions against the query engine. Structural validation of the * request still runs. The flag is enabled by being present; any value is ignored. */ SkipValidation: boolean; /** @description Page number. Starts from the first (1) page. */ PageNumberParam: number; /** @description Number of records to return per page. */ PerPageParam: number; /** @description Filter models by repository type. Can be specified multiple times to filter by multiple types. */ RepositoryType: "hugging_face" | "narrative"; /** @description Sort order for results. */ OrderBy: "created_at_asc" | "created_at_desc"; /** @description Unique identifier for a model. */ ModelIdParam: number; /** * @description A slash-separated path where the uploaded file should be stored * @example /lists/idlist.csv */ UploadPath: string; /** @description Unique identifier for an delivery record. */ DeliveryId: number; /** @description Name of a delivery file. */ FileName: string; /** * @description The subscription's `id`. Anything that is not a UUID does not match the route and returns 404. * @example 3fa85f64-5717-4562-b3fc-2c963f66afa6 */ WebhookSubscriptionId: string; /** * @description Narrow results to workflows on this data plane. * @example f79cbdae-4848-47ca-95e8-69588364d185 */ WorkflowDataPlaneIdParam: string; /** * @description Unique identifier for a workflow. * @example a1b2c3d4-e5f6-7890-abcd-ef1234567890 */ WorkflowId: string; /** * @description The maximum number of runs to return per page. Defaults to 10. * @example 10 */ PageSize: number; /** * @description Opaque token from a previous response to retrieve the next page of results. * @example eyJsYXN0UnVuSWQiOiJhYmMxMjMifQ== */ PageToken: string; /** * @description Unique identifier for a workflow execution run. * @example b7e3f1a2-4c5d-6e7f-8a9b-0c1d2e3f4a5b */ RunIdParam: string; }; requestBodies: never; headers: never; pathItems: never; } export type $defs = Record; export interface operations { getAccessRule: { parameters: { query?: never; header?: never; path: { /** @description Access rule identifier. */ access_rule_id: components["parameters"]["AccessRuleId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["AccessRuleV2Response"]; }; }; /** * @description No active access rule with this id was found. The body is the message as a JSON string. A non-numeric id * gets a 404 with an empty body. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": string; }; }; }; }; updateAccessRule: { parameters: { query?: never; header?: never; path: { /** @description Access rule identifier. */ access_rule_id: components["parameters"]["AccessRuleId"]; }; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["AccessRuleUpdateRequest"]; }; }; responses: { /** @description OK. The updated rule, which the caller always owns. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["OwnedAccessRuleV2Response"]; }; }; /** * @description Bad Request. Returned when a field is invalid, and when the body has no key other than `nql`, `schema`, * `owner`, `is_owned` and `metadata`, which cannot be updated. An empty object is rejected the same way. * Alongside at least one other key those fields, like any unknown key, are ignored. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description No active access rule with this id was found. The body is the message as a JSON string. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": string; }; }; /** @description Conflict — the rule already has a different name. A name can only be set once. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Response"]; }; }; }; }; deleteAccessRule: { parameters: { query?: never; header?: never; path: { /** @description Access rule identifier. */ access_rule_id: components["parameters"]["AccessRuleId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK. The body is empty. */ 200: { headers: { [name: string]: unknown; }; content?: never; }; /** @description No active access rule with this id was found. The body is the message as a JSON string. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": string; }; }; }; }; getAccessRuleByName: { parameters: { query?: never; header?: never; path: { /** @description Company slug. */ company_slug: components["parameters"]["CompanySlug"]; /** @description Access rule name. */ access_rule_name: components["parameters"]["AccessRuleName"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["AccessRuleV2Response"]; }; }; /** * @description No active access rule with this name was found. The body is the message as a JSON string. A slug or name * that is not valid gets a 404 with an empty body. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": string; }; }; }; }; listAccessRules: { parameters: { query?: { /** * @description If present, returns only owned rules. This is a flag: the value is not read, so `owned_only=false` still * enables it. Ignored for unauthenticated requests. */ owned_only?: components["parameters"]["OwnedOnly"]; /** * @description If present, returns only shared (not owned) rules. This is a flag: the value is not read, so * `shared_only=false` still enables it. Ignored for unauthenticated requests. */ shared_only?: components["parameters"]["SharedOnly"]; /** * @description Check whether tag is presented. Repeat the parameter to pass several tags; a rule matches if any of them is * attached to it. If any value is invalid the whole filter is ignored. */ tag?: components["parameters"]["TagParam"]; /** * @description Check whether owned by the company. Repeat the parameter to pass several ids. If any value is invalid the * whole filter is ignored. */ company_id?: components["parameters"]["OwnedByCompanyIdFilter"]; /** * @description Number of page. Starts from the first (1) page. A value that is not a non-negative integer gets a 404 with * an empty body. */ page?: components["parameters"]["PageNumber"]; /** * @description Number of records to return. Defaults to 100. A value that is not a positive integer gets a 404 with an * empty body. */ per_page?: components["parameters"]["per_page"]; /** * @description Check whether the rule is associated with specified dataset. Repeat the parameter to pass several ids. If * any value is invalid the whole filter is ignored. */ dataset_id?: components["parameters"]["AccessRuleDatasetIdParam"]; /** * @description When set, only access rules on this data plane are returned. Omitted returns rules on any plane. A value * that is not a UUID gets a 404 with an empty body. */ data_plane_id?: components["parameters"]["DataPlaneIdParam"]; /** @description Free-text search term. When provided, access rules are ranked by their relevance to the search term. */ q?: components["parameters"]["AccessRuleKeywordQueryParam"]; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["AccessRulesV2PaginatedResponse"]; }; }; }; }; createAccessRule: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["AccessRuleCreateRequest"]; }; }; responses: { /** @description OK. The created rule, which the caller always owns. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["OwnedAccessRuleV2Response"]; }; }; /** * @description Bad Request. A body that does not decode (missing or invalid field, malformed JSON) and a query that reads * from a view dataset get the plain error shape. An NQL query that fails to parse or validate gets the * RFC error shape. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"] | components["schemas"]["Response"]; }; }; /** @description Conflict — an access rule, table or view with this name already exists. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Response"]; }; }; /** * @description Unprocessable Entity — the NQL query parsed but is semantically invalid, for example an output * column whose type is not supported (such as DECIMAL), or a query that produces no output columns. * visit https://docs.narrative.io/guides/nql/troubleshooting for more details */ 422: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Response"]; }; }; }; }; listAgentConversations: { parameters: { query?: { /** @description Number of page. Stars from the first (1) page. */ page?: components["parameters"]["PageNumberQueryParam"]; /** @description Number of records to return. */ per_page?: components["parameters"]["PerPageQueryParam"]; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** * @description Paginated list of the caller's conversations, newest first. Empty `records` if * the caller has no conversations yet. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ListConversationsResponse"]; }; }; /** @description Token does not have `agent_conversations:read` permission, or has expired. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** * @description No bearer token, or one the platform does not recognize; the body is empty. A token with no user * attached, such as a company API key, also gets a 403, with an `{error, error_description}` * body. Conversations belong to a user, so these endpoints need a user token. */ 403: { headers: { [name: string]: unknown; }; content?: never; }; }; }; createAgentConversation: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["CreateConversationRequest"]; }; }; responses: { /** @description Conversation created. Returns the persisted conversation row. */ 201: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ConversationResponse"]; }; }; /** * @description Invalid request body. A validation failure (alias regex mismatch, duplicate aliases, * tool wire name too long, a `thinking` setting the model does not take) gets an RFC 7807 body. A body that doesn't * decode, such as one missing a required `defaults` field, gets `{error, error_description}`. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["RFCError"] | components["schemas"]["Error"]; }; }; /** @description Token does not have `agent_conversations:write` permission, or has expired. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** * @description No bearer token, or one the platform does not recognize; the body is empty. A token with no user * attached, such as a company API key, also gets a 403, with an `{error, error_description}` * body. Conversations belong to a user, so these endpoints need a user token. */ 403: { headers: { [name: string]: unknown; }; content?: never; }; }; }; getAgentConversation: { parameters: { query?: never; header?: never; path: { /** @description The conversation's UUID. */ id: components["schemas"]["ConversationId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description The conversation row. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ConversationResponse"]; }; }; /** @description Token does not have `agent_conversations:read` permission, or has expired. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** * @description No bearer token, or one the platform does not recognize; the body is empty. A token with no user * attached, such as a company API key, also gets a 403, with an `{error, error_description}` * body. Conversations belong to a user, so these endpoints need a user token. */ 403: { headers: { [name: string]: unknown; }; content?: never; }; /** * @description The conversation was not found. The response body's `type` URL is * `https://docs.narrative.io/reference/architecture/agent-conversations/errors/conversation-not-found`. * An `id` that is not a UUID is also a 404, with an empty body. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["RFCError"]; }; }; }; }; listAgentConversationMessages: { parameters: { query?: { /** * @description Return messages with `sequence_no > since`. Use the previous response's * `current_version` as the next request's `since` for gap-free incremental reads. * * Default `0` returns the entire conversation from the beginning. A negative or * non-integer value returns a 404 with an empty body, because the route stops matching. */ since?: number; }; header?: never; path: { /** @description The conversation's UUID. */ id: components["schemas"]["ConversationId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description A page of messages with `sequence_no > since`, plus the current head version. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ListMessagesResponse"]; }; }; /** @description Token does not have `agent_conversations:read` permission, or has expired. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** * @description No bearer token, or one the platform does not recognize; the body is empty. A token with no user * attached, such as a company API key, also gets a 403, with an `{error, error_description}` * body. Conversations belong to a user, so these endpoints need a user token. */ 403: { headers: { [name: string]: unknown; }; content?: never; }; /** * @description The conversation was not found. An `id` that is not a UUID is also a 404, with an * empty body. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["RFCError"]; }; }; }; }; createAgentRun: { parameters: { query?: never; header?: never; path: { /** @description The conversation's UUID. */ id: components["schemas"]["ConversationId"]; }; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["CreateRunRequest"]; }; }; responses: { /** * @description Run accepted; workflow is starting. Body carries the run row, initially with * `status: "pending"`. Poll `GET /agents/runs/{id}` for terminal state. * * An idempotent retry (a `client_op_id` posted before) also gets a 202, carrying the * original run, which may have moved past `pending`. */ 202: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["RunResponse"]; }; }; /** * @description Validation error. See `type` URL in the response body for the specific * failure class. A body that isn't valid JSON, or doesn't decode (an unknown * `payload.kind`, an empty `outputs`), gets `{error, error_description}` instead. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["RFCError"] | components["schemas"]["Error"]; }; }; /** @description Token does not have `agent_conversations:write` permission, or has expired. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** * @description No bearer token, or one the platform does not recognize; the body is empty. A token with no user * attached, such as a company API key, also gets a 403, with an `{error, error_description}` * body. Conversations belong to a user, so these endpoints need a user token. * * A company over its credit limit, or with no credit account, also gets a 403, with an * RFC 7807 body whose `type` is null. No run is created. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["RFCError"] | components["schemas"]["Error"]; }; }; /** @description The conversation was not found. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["RFCError"]; }; }; /** * @description Two causes, told apart by the body's `type`: * * - `/version-conflict` — `expected_version` does not match the conversation's * current `version`. The body carries the actual current version in `detail`. * Refetch the conversation and retry. * - `/run-in-progress` — another run on this conversation is still `pending` or * `running`. The body names it (and what it is waiting on) in `detail`. Poll that * run until it reaches a terminal state, then retry. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["RFCError"]; }; }; }; }; cancelAgentWaitable: { parameters: { query?: never; header?: never; path: { /** @description The conversation's UUID. */ id: components["schemas"]["ConversationId"]; /** * @description The handle to stop waiting on, exactly as `job_monitor` returned it. Opaque — do not * parse or construct one. The pattern is the alphabet handles are drawn from, not their * format: a segment outside it does not match this route and returns 404, the same answer * an unusable handle gets. */ handle: string; }; cookie?: never; }; requestBody?: never; responses: { /** @description The handle, with the moment its claim was dropped. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["WaitableResponse"]; }; }; /** @description Token does not have `agent_conversations:write` permission, or has expired. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** * @description No bearer token, or one the platform does not recognize; the body is empty. A token with no user * attached, such as a company API key, also gets a 403, with an `{error, error_description}` * body. Conversations belong to a user, so these endpoints need a user token. */ 403: { headers: { [name: string]: unknown; }; content?: never; }; /** * @description The conversation or the handle was not found. An expired handle is reported the same way, * and so is a conversation `id` that is not a UUID, with an empty body. The * response body's `type` URL is * `https://docs.narrative.io/reference/architecture/agent-conversations/errors/waitable-not-found`. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["RFCError"]; }; }; }; }; getAgentRun: { parameters: { query?: never; header?: never; path: { /** @description The run's UUID. */ id: components["schemas"]["RunId"]; }; cookie?: never; }; requestBody?: never; responses: { /** * @description Run state. `status` indicates which lifecycle position the run is in; populated * fields vary accordingly (see description). */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["RunResponse"]; }; }; /** @description Token does not have `agent_conversations:read` permission, or has expired. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** * @description No bearer token, or one the platform does not recognize; the body is empty. A token with no user * attached, such as a company API key, also gets a 403, with an `{error, error_description}` * body. Conversations belong to a user, so these endpoints need a user token. */ 403: { headers: { [name: string]: unknown; }; content?: never; }; /** @description The run was not found. An `id` that is not a UUID is also a 404, with an empty body. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["RFCError"]; }; }; }; }; RefreshOAuthToken: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** @description Request or refresh token */ requestBody: { content: { "application/x-www-form-urlencoded": { /** * @example refresh_token * @enum {string} */ grant_type: "refresh_token" | "client_credentials"; /** * @description A client specific identifier provided by Narrative * @example zzzzzzzzzzzzz */ client_id?: string; /** * @description The token used to refresh the API session. Required if `grant_type` is `refresh_token` * @example yyyyyyyyyyy */ refresh_token?: string; }; }; }; responses: { /** @description Refreshed token */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["AccessToken"]; }; }; }; }; clearCompanyDefaultComputePool: { parameters: { query?: never; header?: never; path: { /** * @description The id of an existing company * @example 345 */ company_id: components["parameters"]["CompanyIdPathParam"]; /** @description The data plane whose company-level default is being cleared. */ data_plane_id: string; }; cookie?: never; }; requestBody?: never; responses: { /** @description Default cleared */ 204: { headers: { [name: string]: unknown; }; content?: never; }; /** @description The company was not found. The body is the message as a JSON string. A `company_id` that is not a number, or a `data_plane_id` that is not a UUID, gets a 404 with an empty body. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": string; }; }; }; }; setCompanyDefaultComputePool: { parameters: { query?: never; header?: never; path: { /** * @description The id of an existing company * @example 345 */ company_id: components["parameters"]["CompanyIdPathParam"]; /** @description The data plane this default applies to. */ data_plane_id: string; /** @description The compute pool to use as the default on `data_plane_id`. */ compute_pool_id: string; }; cookie?: never; }; requestBody?: never; responses: { /** @description Default set */ 204: { headers: { [name: string]: unknown; }; content?: never; }; /** @description The pool is archived, lives on a different data plane, or the company has no access to it */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description The company was not found. The body is the message as a JSON string. A `company_id` that is not a number, or a `data_plane_id` or `compute_pool_id` that is not a UUID, gets a 404 with an empty body. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": string; }; }; }; }; listComputePools: { parameters: { query?: never; header?: never; path: { /** @description The data plane ID */ data_plane_id: string; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["GetComputePoolsResponse"]; }; }; /** @description The data plane does not exist or is not accessible to the caller. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; createComputePool: { parameters: { query?: never; header?: never; path: { /** @description The data plane this compute pool belongs to. */ data_plane_id: string; }; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["CreateComputePoolRequest"]; }; }; responses: { /** @description Created. The new compute pool, which the caller always owns. */ 201: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ComputePoolOwnedResponse"]; }; }; /** @description The request body is not valid, the provider does not match the data plane's platform or the `external_id`, or the data plane does not exist or the caller cannot manage compute pools on it. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description Conflict - a compute pool with this name already exists for the data plane */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; getComputePool: { parameters: { query?: never; header?: never; path: { data_plane_id: string; compute_pool_id: string; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ComputePoolResponse"]; }; }; /** @description No active compute pool with this id was found. The body is empty. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; updateComputePool: { parameters: { query?: never; header?: never; path: { data_plane_id: string; compute_pool_id: string; }; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["UpdateComputePoolRequest"]; }; }; responses: { /** @description OK. The updated compute pool, which the caller always owns. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ComputePoolOwnedResponse"]; }; }; /** @description The request body is not valid, or the new provider does not match the pool's `external_id`. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description No active compute pool with this id was found. The body is empty. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; deleteComputePool: { parameters: { query?: never; header?: never; path: { data_plane_id: string; compute_pool_id: string; }; cookie?: never; }; requestBody?: never; responses: { /** @description Archived. The body is empty. */ 200: { headers: { [name: string]: unknown; }; content?: never; }; /** @description The pool is on an AWS data plane and is still the default compute pool for the data plane, a dataset or a company. Change or clear that default first. On a Snowflake data plane the pool is archived and those defaults are moved or cleared instead. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description No active compute pool with this id was found. The body is empty. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; listDataPlanes: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["GetDataPlanesResponse"]; }; }; }; }; createDataPlane: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["CreateDataPlaneRequest"]; }; }; responses: { /** @description Created. The new data plane, which the caller always owns. Its `compute_pools` list is empty. */ 201: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["DataPlaneOwnedResponse"]; }; }; /** @description The request body is not valid. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; }; }; getDataPlane: { parameters: { query?: never; header?: never; path: { data_plane_id: string; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["DataPlaneResponse"]; }; }; /** @description No active data plane with this id was found, or `data_plane_id` is not a UUID. The body is empty. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; deleteDataPlane: { parameters: { query?: never; header?: never; path: { data_plane_id: string; }; cookie?: never; }; requestBody?: never; responses: { /** @description Archived. The body is empty. */ 200: { headers: { [name: string]: unknown; }; content?: never; }; /** @description No active data plane with this id was found. The body is empty. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; sendDataPlaneHeartbeat: { parameters: { query?: never; header?: never; path: { data_plane_id: string; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK. The body is empty. */ 200: { headers: { [name: string]: unknown; }; content?: never; }; /** @description The data plane secret header is missing or wrong. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description No active data plane with this id was found. The body is empty. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; triggerDataPlaneHealthCheck: { parameters: { query?: never; header?: never; path: { data_plane_id: string; }; cookie?: never; }; requestBody?: { content: { "application/json": components["schemas"]["EnqueueHealthCheckRequest"]; }; }; responses: { /** @description Created */ 201: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["JobResponse"]; }; }; /** @description No active data plane with this id was found. The body is empty. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; setDataPlaneCollaborators: { parameters: { query?: never; header?: never; path: { data_plane_id: string; }; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["DataPlaneCollaborators"]; }; }; responses: { /** @description Collaborators replaced. The body is empty. */ 200: { headers: { [name: string]: unknown; }; content?: never; }; /** @description The request body is not valid. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description The data plane or one of the referenced companies was not found. The body is empty. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; addDataPlaneCollaborator: { parameters: { query?: never; header?: never; path: { data_plane_id: string; collaborator_company_id: components["schemas"]["CompanyId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description Collaborator added. The body is empty. */ 200: { headers: { [name: string]: unknown; }; content?: never; }; /** @description The data plane or the collaborator company was not found. The body is empty. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; removeDataPlaneCollaborator: { parameters: { query?: never; header?: never; path: { data_plane_id: string; collaborator_company_id: components["schemas"]["CompanyId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description Collaborator removed. The body is empty. */ 200: { headers: { [name: string]: unknown; }; content?: never; }; /** @description The data plane or the collaborator company was not found. The body is empty. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; setDataPlaneDefaultComputePool: { parameters: { query?: never; header?: never; path: { data_plane_id: string; compute_pool_id: string; }; cookie?: never; }; requestBody?: never; responses: { /** @description Default compute pool set. The updated data plane, which the caller always owns. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["DataPlaneOwnedResponse"]; }; }; /** @description Invalid compute pool (does not exist, is not active, belongs to a different company, or is not associated with this data plane) */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description No active data plane with this id was found. The body is empty. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; clearDataPlaneDefaultComputePool: { parameters: { query?: never; header?: never; path: { data_plane_id: string; }; cookie?: never; }; requestBody?: never; responses: { /** @description Default compute pool cleared. The updated data plane, which the caller always owns. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["DataPlaneOwnedResponse"]; }; }; /** @description No active data plane with this id was found. The body is empty. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; putRetentionPolicy: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a dataset. */ dataset_id: components["parameters"]["DatasetIdParam"]; }; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["SnapshotRetentionPolicy"] | components["schemas"]["UnifiedV1Request"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["DatasetResponse"]; }; }; }; }; listJobs: { parameters: { query?: { /** @description Filter jobs by data plane ID. */ data_plane_id?: components["parameters"]["data_plane_id"]; /** @description Filter jobs where the input has a dataset_id (such as materalized-view) */ dataset_id?: components["parameters"]["dataset_id"]; /** @description Number of records to skip (page_number * per_page). */ offset?: components["parameters"]["offset"]; /** @description Order the results by a specific field. By default, job are order by created_at in descending order. */ order_by?: components["parameters"]["order_by"]; /** @description Number of records to return. Defaults to 500, which is also the maximum; larger values are rejected with a 400. */ per_page?: components["parameters"]["JobsPerPageParam"]; /** @description Filter jobs by state. Repeat the parameter to match any of several states. */ state?: components["parameters"]["state"]; /** * @description Filter jobs by tag. Repeat the parameter to filter by multiple tags (e.g. `?tag=workflow_enqueued&tag=workflow_id=`); * a job matches if it carries any of the supplied tags. */ tag?: components["parameters"]["tag"]; /** * @description Filter jobs by type. Repeat the parameter to match any of several types. Job types are free strings on the * server; see `JobResponse` for the ones this spec describes. */ type?: components["parameters"]["type"]; /** @description Filter jobs by the id of the workflow that enqueued them. Only jobs enqueued by a workflow carry a workflow id. */ workflow_id?: components["parameters"]["workflow_id"]; /** @description Filter jobs by the id of the workflow run that enqueued them. Only jobs enqueued by a workflow run carry a workflow run id. */ workflow_run_id?: components["parameters"]["workflow_run_id"]; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["JobsResponse"]; }; }; /** * @description Raised when `per_page` exceeds 500, or when a `state`, `tag`, `workflow_id` or `workflow_run_id` value * cannot be parsed. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** * @description Returned with an empty body when `order_by`, `dataset_id`, `data_plane_id`, `offset` or `per_page` cannot * be parsed: the route does not match a request carrying an unparseable value for one of these. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; getJob: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a job. */ job_id: components["parameters"]["JobId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["JobResponse"]; }; }; /** @description Returned with an empty body when the job cannot be found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; runJob: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a job. */ job_id: components["parameters"]["JobId"]; }; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["RunJobRequest"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["JobResponse"]; }; }; /** @description This error is raised when the request body is malformed. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description Returned with an empty body when the job cannot be found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; scheduleJob: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a job. */ job_id: components["parameters"]["JobId"]; }; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["ScheduleJobRequest"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["JobResponse"]; }; }; /** @description This error is raised when the request body is malformed. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description Returned with an empty body when the job cannot be found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; completeJob: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a job. */ job_id: components["parameters"]["JobId"]; }; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["CompleteJobRequest"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["JobResponse"]; }; }; /** * @description This error is raised when the request body is malformed, names a `type` the server does not support, or * does not match the job's type. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description Returned with an empty body when the job cannot be found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; failJob: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a job. */ job_id: components["parameters"]["JobId"]; }; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["FailJobRequest"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["JobResponse"]; }; }; /** @description This error is raised when the request body is malformed. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description Returned with an empty body when the job cannot be found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; requestJobCancellation: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a job. */ job_id: components["parameters"]["JobId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["JobResponse"]; }; }; /** @description This error is raised when cancellation is not supported for the job's type or data plane. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description Returned with an empty body when the job cannot be found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; cancelJob: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a job. */ job_id: components["parameters"]["JobId"]; }; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["JobResponse"]; }; }; /** @description This error is raised when the job is not in `pending_cancellation` or a terminal state. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description Returned with an empty body when the job cannot be found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; rescheduleJob: { parameters: { query?: never; header?: never; path: { /** @description Unique identifier for a job. */ job_id: components["parameters"]["JobId"]; }; cookie?: never; }; requestBody?: { content: { "application/json": components["schemas"]["RescheduleJobRequest"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["RescheduleJobResponse"]; }; }; /** @description Returned with an empty body when the job cannot be found. */ 404: { headers: { [name: string]: unknown; }; content?: never; }; }; }; listMcpConnections: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description The caller's connections. Empty `connections` if there are none. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ListMcpConnectionsResponse"]; }; }; /** @description Missing or invalid bearer token. */ 401: { headers: { [name: string]: unknown; }; content?: never; }; /** @description Token does not have `agent_conversations:read` permission. */ 403: { headers: { [name: string]: unknown; }; content?: never; }; }; }; createMcpConnection: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["CreateMcpConnectionRequest"]; }; }; responses: { /** * @description Pending connection created. Returns the `connection_id` and the `authorization_url` the * user must visit to authorize. */ 201: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["McpConnectionCreatedResponse"]; }; }; /** * @description Invalid request or the server can't be connected via DCR. See the common-causes table * above. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["RFCError"]; }; }; /** @description Missing or invalid bearer token. */ 401: { headers: { [name: string]: unknown; }; content?: never; }; /** @description Token does not have `agent_conversations:write` permission. */ 403: { headers: { [name: string]: unknown; }; content?: never; }; }; }; mcpConnectionCallback: { parameters: { query?: { /** * @description The one-time state issued by `POST /mcp-connections`; identifies the authorization flow this * callback belongs to. Optional only so that a malformed callback still redirects the browser * to a page that can explain itself; in practice the authorization server always returns it. */ state?: string; /** * @description The one-time authorization code issued by the external authorization server. Present on * success, mutually exclusive with `error`. */ code?: string; /** * @description An RFC 6749 §4.1.2.1 error code, sent instead of `code` when the user declines or the * authorization server refuses. */ error?: string; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** * @description The browser is redirected to the Narrative app's callback page, which completes the * connection. Every outcome is reported this way — success, the user declining, an expired * `state` — with the details in the query parameters rather than in an error body. */ 303: { headers: { /** @description The app's MCP connection callback page, with `state` and/or `error` applied. */ Location?: string; [name: string]: unknown; }; content?: never; }; }; }; completeMcpConnection: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["CompleteMcpConnectionRequest"]; }; }; responses: { /** * @description Connection completed. Returns the status view, normally with `status: connected` and the * access token's `expires_at`. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["McpConnectionSummary"]; }; }; /** * @description The `state` is malformed, unknown, or expired; the authorization code has not arrived yet; or * the token exchange / connection validation against the external server failed. See the * common-errors table above. */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["RFCError"]; }; }; /** @description Missing or invalid bearer token. */ 401: { headers: { [name: string]: unknown; }; content?: never; }; /** @description Token does not have `agent_conversations:write` permission. */ 403: { headers: { [name: string]: unknown; }; content?: never; }; /** @description No connection with this id was found. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["RFCError"]; }; }; }; }; getMcpConnection: { parameters: { query?: never; header?: never; path: { /** @description The connection id returned by `POST /mcp-connections`. */ id: string; }; cookie?: never; }; requestBody?: never; responses: { /** @description The connection's status view. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["McpConnectionSummary"]; }; }; /** @description Missing or invalid bearer token. */ 401: { headers: { [name: string]: unknown; }; content?: never; }; /** @description Token does not have `agent_conversations:read` permission. */ 403: { headers: { [name: string]: unknown; }; content?: never; }; /** @description No connection with this id was found. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["RFCError"]; }; }; }; }; deleteMcpConnection: { parameters: { query?: never; header?: never; path: { /** @description The connection id returned by `POST /mcp-connections`. */ id: string; }; cookie?: never; }; requestBody?: never; responses: { /** @description Connection deleted. No body. */ 204: { headers: { [name: string]: unknown; }; content?: never; }; /** @description Missing or invalid bearer token. */ 401: { headers: { [name: string]: unknown; }; content?: never; }; /** @description Token does not have `agent_conversations:write` permission. */ 403: { headers: { [name: string]: unknown; }; content?: never; }; /** @description No connection with this id was found. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["RFCError"]; }; }; }; }; createUsage: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["CreateUsageRequest"]; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["CreateUsageResponse"]; }; }; }; }; webhookDelivery: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["WebhookDelivery"]; }; }; responses: { /** @description Any 2xx marks the event delivered. The response body is recorded for troubleshooting but not otherwise used. */ 200: { headers: { [name: string]: unknown; }; content?: never; }; /** @description Any non-2xx is treated as a failed attempt and retried. */ default: { headers: { [name: string]: unknown; }; content?: never; }; }; }; } interface AstListNode extends Array { } export {};