{ "openapi": "3.1.1", "info": { "title": "Amplitude Developer API", "version": "0.1.0", "license": { "name": "Proprietary", "url": "https://amplitude.com/terms" }, "summary": "OpenAPI-first contract for Amplitude CLI, MCP, SDK, and docs.", "description": "Public developer-facing API contract for Amplitude resources.\nThis spec is intended to be the canonical source for generated CLI, MCP tools,\nSDKs, and documentation.\n" }, "jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema", "servers": [ { "url": "https://developer-api.amplitude.com", "description": "Production (US)" }, { "url": "https://developer-api.eu.amplitude.com", "description": "Production (EU)" } ], "security": [ { "bearerAuth": [] } ], "tags": [ { "name": "Agent Analytics", "description": "Saved findings about agent cost, efficiency, and quality." }, { "name": "MCP Analytics", "description": "Read the active MCP taxonomy, its topics, and its episodes." }, { "name": "Projects", "description": "Project discovery and project-scoped navigation." }, { "name": "Taxonomy Events", "description": "Event taxonomy operations." }, { "name": "Taxonomy Event Properties", "description": "Event-property taxonomy operations (scoped to an event)." }, { "name": "Taxonomy User Properties", "description": "User-property taxonomy operations (scoped to a project)." }, { "name": "Analytics", "description": "Saved chart discovery, query, and get-metric read operations." }, { "name": "Heatmaps", "description": "Click map and scroll map queries for a page URL." }, { "name": "Zoning", "description": "Zone metric queries for a page URL." }, { "name": "Feature Flags", "description": "Feature flag configuration and rollout operations." }, { "name": "Guides", "description": "Guide (tour nudge) configuration operations." }, { "name": "Surveys", "description": "Survey nudge configuration operations." }, { "name": "Themes", "description": "Guide and survey theme operations." }, { "name": "Destinations", "description": "Destination (connection) catalog and CRUD operations." }, { "name": "Skills", "description": "Skill documents for implementing Amplitude, intended for AI agents." }, { "name": "AI Context", "description": "Organization- and project-level customer AI context for Global Agent." }, { "name": "Auth", "description": "Signup, OAuth device-flow, and token endpoints (RFC 8628 / RFC 6749)." } ], "paths": { "/v1/projects/{project_id}/agent-analytics/insights": { "get": { "tags": ["Agent Analytics"], "operationId": "listAgentAnalyticsInsights", "summary": "List saved Agent Analytics insights", "description": "Returns saved cost, efficiency, and quality findings, ranked by magnitude\ntimes confidence. These are periodically evaluated findings, not live\nqueries. Healthy and closed findings can remain visible. Thumbs-downed\nfindings are excluded. Use each finding's project_id for individual reads.\n", "x-required-scopes": ["analytics:read"], "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/Limit" }, { "$ref": "#/components/parameters/Cursor" }, { "name": "agent_name", "in": "query", "allowEmptyValue": true, "description": "Exact agent name. Omit for all scopes; an empty string selects project-level findings only.", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Saved findings and an opaque next-page cursor. Keep the same project and agent filter when paging.", "content": { "application/json": { "schema": { "type": "object", "required": ["data", "pagination"], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/AgentInsight" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "502": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/agent-analytics/insights/{insight_id}": { "get": { "tags": ["Agent Analytics"], "operationId": "getAgentAnalyticsInsight", "summary": "Get a saved Agent Analytics insight", "description": "Returns one finding by its stable UUID and own project_id. Missing, cross-project, and thumbs-downed findings return 404.", "x-required-scopes": ["analytics:read"], "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "name": "insight_id", "in": "path", "required": true, "description": "Stable insight UUID returned by the list operation, not a finding key such as tool-failures.", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Saved finding.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/AgentInsight" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "502": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/agent-analytics/datasets": { "post": { "tags": ["Agent Analytics"], "operationId": "createAgentAnalyticsDataset", "summary": "Create an Agent Analytics dataset", "description": "Creates an empty dataset. Add sessions with the dataset sessions endpoint.\n`name` is not an identity key, so repeating a create makes another dataset,\neven with the same `Idempotency-Key`.\n\nListing and reading datasets is served by the Agent Analytics MCP read\nsurface, not by this API.\n", "x-required-scopes": ["analytics:write"], "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["name"], "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "description": { "type": ["string", "null"] }, "agent_name": { "type": ["string", "null"], "description": "Scope the dataset to one agent. Omit for a project-level dataset." } } } } } }, "responses": { "201": { "description": "Dataset created.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/AgentAnalyticsDataset" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "502": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/agent-analytics/datasets/{dataset_id}": { "patch": { "tags": ["Agent Analytics"], "operationId": "updateAgentAnalyticsDataset", "summary": "Update an Agent Analytics dataset", "description": "Updates dataset metadata. Absent fields are unchanged; an explicit `null`\nclears `description`. `id`, `agent_name`, and `source_type` are immutable —\ncreate a new dataset to change the agent scope.\n", "x-required-scopes": ["analytics:write"], "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/DatasetId" }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "minProperties": 1, "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "description": { "type": ["string", "null"] } } } } } }, "responses": { "200": { "description": "Updated dataset.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/AgentAnalyticsDataset" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "502": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/agent-analytics/datasets/{dataset_id}/sessions": { "post": { "tags": ["Agent Analytics"], "operationId": "addAgentAnalyticsDatasetSessions", "summary": "Add sessions to an Agent Analytics dataset", "description": "Adds sessions to a dataset. Sessions already in the dataset are ignored, so\nthe call is safe to repeat. Every session must belong to the path project;\na session from another project fails the whole request with `422`.\n", "x-required-scopes": ["analytics:write"], "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/DatasetId" }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AgentAnalyticsSessionIds" } } } }, "responses": { "200": { "description": "Dataset after the sessions were added, with refreshed counts.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/AgentAnalyticsDataset" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "422": { "$ref": "#/components/responses/ValidationProblem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "502": { "$ref": "#/components/responses/Problem" } } }, "delete": { "tags": ["Agent Analytics"], "operationId": "removeAgentAnalyticsDatasetSessions", "summary": "Remove sessions from an Agent Analytics dataset", "description": "Removes sessions from a dataset. The sessions themselves are untouched;\nonly their dataset membership is removed. Sessions that are not in the\ndataset are ignored, so the call is safe to repeat.\n\nTakes the same body as the add operation, so an add is undone in one call\nrather than one call per session. `dry_run=true` validates the dataset and\nthe session ids without mutating, returning `204` on a hit and `404` if the\ndataset does not exist.\n", "x-required-scopes": ["analytics:write"], "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/DatasetId" }, { "$ref": "#/components/parameters/DryRun" }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AgentAnalyticsSessionIds" } } } }, "responses": { "204": { "description": "Sessions removed from the dataset, or dry-run hit." }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "422": { "$ref": "#/components/responses/ValidationProblem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "502": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/agent-analytics/evaluators": { "post": { "tags": ["Agent Analytics"], "operationId": "createAgentAnalyticsEvaluator", "summary": "Create an Agent Analytics evaluator", "description": "Creates an evaluator in the inactive state. Activation is a separate\npermission and is not exposed by this API — activate in the Agent Analytics\nUI once the evaluator has been reviewed.\n\n`tags` constrains what a result may record. Supplying them for a `binary` or\n`categorical` evaluator is what keeps results to a known set of values\nrather than free-form model output.\n\nListing and reading evaluators is served by the Agent Analytics MCP read\nsurface, not by this API.\n", "x-required-scopes": ["analytics:write"], "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["topic", "output_type", "description"], "properties": { "topic": { "type": "string", "minLength": 1, "maxLength": 255, "description": "Human-readable evaluator name." }, "output_type": { "type": "string", "enum": ["binary", "categorical", "score"] }, "description": { "type": "string", "minLength": 1, "description": "Evaluator prompt or rubric." }, "tags": { "type": "array", "description": "Required for `binary` and `categorical` evaluators.", "items": { "$ref": "#/components/schemas/AgentAnalyticsEvaluatorTag" } }, "suite_id": { "type": ["string", "null"] } } } } } }, "responses": { "201": { "description": "Evaluator created, inactive.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/AgentAnalyticsEvaluator" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "422": { "$ref": "#/components/responses/ValidationProblem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "502": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/agent-analytics/evaluators/{evaluator_stable_id}": { "patch": { "tags": ["Agent Analytics"], "operationId": "updateAgentAnalyticsEvaluator", "summary": "Update an Agent Analytics evaluator", "description": "Updates an evaluator addressed by its stable identifier. Absent fields are\nunchanged. Each update creates a new inactive version; the response `id` is\nthat new version, and `stable_id` is unchanged.\n\nUpdating does not activate. An evaluator already active in the UI keeps\nserving its current active version until the new one is promoted there.\n", "x-required-scopes": ["analytics:write"], "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/EvaluatorStableId" }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "minProperties": 1, "properties": { "topic": { "type": "string", "minLength": 1, "maxLength": 255 }, "description": { "type": "string", "minLength": 1 }, "tags": { "type": "array", "description": "Replaces the full tag set when present.", "items": { "$ref": "#/components/schemas/AgentAnalyticsEvaluatorTag" } }, "suite_id": { "type": ["string", "null"] } } } } } }, "responses": { "200": { "description": "New inactive evaluator version.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/AgentAnalyticsEvaluator" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "422": { "$ref": "#/components/responses/ValidationProblem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "502": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/agent-analytics/eval-runs": { "get": { "tags": ["Agent Analytics"], "operationId": "listAgentAnalyticsEvalRuns", "summary": "List Agent Analytics eval runs", "description": "Returns eval runs for the project, most recent first. A run is a batch\nevaluation of sessions by one or more evaluators; it is asynchronous, so a\nfreshly triggered run is returned with a pending status and no results.\n", "x-required-scopes": ["analytics:read"], "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/Limit" }, { "$ref": "#/components/parameters/Cursor" }, { "name": "status", "in": "query", "required": false, "description": "Filter to runs in one lifecycle state.", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Eval runs and an opaque next-page cursor.", "content": { "application/json": { "schema": { "type": "object", "required": ["data", "pagination"], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/AgentAnalyticsEvalRun" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "502": { "$ref": "#/components/responses/Problem" } } }, "post": { "tags": ["Agent Analytics"], "operationId": "triggerAgentAnalyticsEvalRun", "summary": "Trigger an Agent Analytics eval run", "description": "Starts an asynchronous eval run and returns it immediately with a pending\nstatus. Poll the run by id, or read results through the Agent Analytics read\nsurface once it completes.\n\nTarget the run either at a dataset or at a session list, not both. Caps are\nenforced server-side: 10 evaluators and 100 targeted sessions per run.\nFor larger datasets, only the first 100 members are targeted and the\nacceptance response includes a truncation warning. This selection warning\nis not persisted on the run returned by later get/list calls.\n", "x-required-scopes": ["analytics:write"], "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["evaluator_ids"], "oneOf": [ { "required": ["dataset_id"], "not": { "required": ["session_ids"] } }, { "required": ["session_ids"], "not": { "required": ["dataset_id"] } } ], "properties": { "evaluator_ids": { "type": "array", "minItems": 1, "maxItems": 10, "items": { "type": "string" }, "description": "Evaluator version identifiers returned by create or update. Evaluator updates use stable identifiers instead." }, "dataset_id": { "type": "string", "description": "Evaluate the sessions in this dataset. Mutually exclusive with `session_ids`; exactly one of the two is required." }, "session_ids": { "type": "array", "minItems": 1, "maxItems": 100, "items": { "type": "string" }, "description": "Evaluate these sessions. Mutually exclusive with `dataset_id`; exactly one of the two is required." }, "sample_size": { "type": "integer", "minimum": 1, "maximum": 100, "default": 100, "description": "Retained for compatibility. This endpoint targets explicit session\nIDs, including when expanding a dataset, so sample_size does not\nreduce the selected sessions. All supplied IDs are targeted,\nwith dataset expansion capped at the first 100 members.\n" } } } } } }, "responses": { "201": { "description": "Eval run accepted and queued.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/AgentAnalyticsEvalRun" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "422": { "$ref": "#/components/responses/ValidationProblem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "502": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/agent-analytics/eval-runs/{eval_run_id}": { "get": { "tags": ["Agent Analytics"], "operationId": "getAgentAnalyticsEvalRun", "summary": "Get an Agent Analytics eval run", "description": "Returns one eval run by id, including progress counters and, once the run\nfinishes, cost and latency. Per-session results are read through the Agent\nAnalytics read surface, not here.\n", "x-required-scopes": ["analytics:read"], "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/EvalRunId" } ], "responses": { "200": { "description": "Eval run.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/AgentAnalyticsEvalRun" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "502": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/mcp-analytics/servers": { "get": { "tags": ["MCP Analytics"], "operationId": "listMcpAnalyticsServers", "summary": "List MCP Analytics servers", "description": "Returns the MCP servers configured for the project. A project with no MCP\nservers returns 200 and an empty `data` array.\n", "x-required-scopes": ["analytics:read"], "parameters": [ { "$ref": "#/components/parameters/ProjectId" } ], "responses": { "200": { "description": "MCP servers for the project. The list is complete, so `has_more` is false.", "content": { "application/json": { "schema": { "type": "object", "required": ["data", "pagination"], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/McpAnalyticsServer" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "502": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/mcp-analytics/servers/{server_id}/taxonomy": { "get": { "tags": ["MCP Analytics"], "operationId": "getMcpAnalyticsTaxonomy", "summary": "Get the active MCP taxonomy", "description": "Returns the server's active topic tree. The resource id is the server id.\nA visible server with no pinned taxonomy returns 200, null run fields, and\n`nodes: []`. An unknown server returns 404.\n", "x-required-scopes": ["analytics:read"], "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "name": "server_id", "in": "path", "required": true, "description": "Server id.", "schema": { "type": "string", "pattern": "^[0-9]+$" } }, { "name": "parent_id", "in": "query", "required": false, "description": "Node selector. Omit it for every node in the active tree. `root`\nreturns root nodes. Any other value is a stable topic id and returns\nthat topic's direct children. An unknown parent returns 404 when a\ntaxonomy is pinned.\n", "schema": { "type": "string", "minLength": 1, "maxLength": 256 } } ], "responses": { "200": { "description": "Active taxonomy for the server.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/McpAnalyticsTaxonomy" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "502": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/mcp-analytics/servers/{server_id}/topics/{topic_id}": { "get": { "tags": ["MCP Analytics"], "operationId": "getMcpAnalyticsTopic", "summary": "Get an MCP taxonomy topic", "description": "Returns one topic and up to eight example episodes. Examples are not a\npage. Use the episode list to page through episodes.\n", "x-required-scopes": ["analytics:read"], "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "name": "server_id", "in": "path", "required": true, "description": "Server id.", "schema": { "type": "string", "pattern": "^[0-9]+$" } }, { "name": "topic_id", "in": "path", "required": true, "description": "Stable topic id. `root` is not a topic id.", "schema": { "type": "string", "minLength": 1, "maxLength": 256 } } ], "responses": { "200": { "description": "Topic and its example episodes.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/McpAnalyticsTopicDetail" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "502": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/mcp-analytics/servers/{server_id}/topics/{topic_id}/episodes": { "get": { "tags": ["MCP Analytics"], "operationId": "listMcpAnalyticsEpisodes", "summary": "List episodes for an MCP topic", "description": "Returns a page of episode summaries for one topic. The default page size\nis 25 and the maximum is 100. Keep the same filters\nwhen following `next_cursor`.\n", "x-required-scopes": ["analytics:read"], "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "name": "server_id", "in": "path", "required": true, "description": "Server id.", "schema": { "type": "string", "pattern": "^[0-9]+$" } }, { "name": "topic_id", "in": "path", "required": true, "description": "Stable topic id.", "schema": { "type": "string", "minLength": 1, "maxLength": 256 } }, { "name": "started_after", "in": "query", "required": false, "description": "Include episodes that started at or after this RFC 3339 timestamp.", "schema": { "type": "string", "format": "date-time" } }, { "name": "started_before", "in": "query", "required": false, "description": "Include episodes that started before this RFC 3339 timestamp.", "schema": { "type": "string", "format": "date-time" } }, { "name": "lane", "in": "query", "required": false, "description": "Exact stored lane.", "schema": { "type": "string", "minLength": 1, "maxLength": 128 } }, { "name": "client_name", "in": "query", "required": false, "description": "Exact stored client name.", "schema": { "type": "string", "minLength": 1, "maxLength": 256 } }, { "name": "auth_type", "in": "query", "required": false, "description": "Exact stored auth type.", "schema": { "type": "string", "minLength": 1, "maxLength": 128 } }, { "name": "has_error", "in": "query", "required": false, "description": "Whether the episode recorded an error.", "schema": { "type": "boolean" } }, { "name": "is_thrash", "in": "query", "required": false, "description": "Whether the episode was classified as thrash.", "schema": { "type": "boolean" } }, { "name": "cursor", "in": "query", "required": false, "description": "Opaque cursor from `pagination.next_cursor` on the previous response.", "schema": { "type": "string", "minLength": 1, "maxLength": 2048 } }, { "name": "limit", "in": "query", "required": false, "description": "Number of episodes to return. Defaults to 25, maximum 100.", "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 25 } } ], "responses": { "200": { "description": "Episode page. Keep the same filters when requesting the next cursor.", "content": { "application/json": { "schema": { "type": "object", "required": ["data", "pagination"], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/McpAnalyticsEpisodeSummary" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "502": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/mcp-analytics/episodes/{episode_id}": { "get": { "tags": ["MCP Analytics"], "operationId": "getMcpAnalyticsEpisode", "summary": "Get an MCP episode", "description": "Returns one episode, including its project, server, auth type, and topic\nbreadcrumb. A missing or cross-project episode returns 404.\n", "x-required-scopes": ["analytics:read"], "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "name": "episode_id", "in": "path", "required": true, "description": "Episode id returned by the topic or episode list.", "schema": { "type": "string", "minLength": 1, "maxLength": 512 } } ], "responses": { "200": { "description": "Episode detail.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/McpAnalyticsEpisode" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "502": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/mcp-analytics/episodes/{episode_id}/calls": { "get": { "tags": ["MCP Analytics"], "operationId": "listMcpAnalyticsEpisodeCalls", "summary": "List tool calls in an MCP episode", "description": "Returns the complete episode tool flow in event time and event id order, including recorded\nproperties, rationale, duration, and errors. Properties are returned as\nrecorded; individual input or output fields may be absent.\nA missing or cross-project episode returns 404.\n", "x-required-scopes": ["analytics:read"], "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "name": "episode_id", "in": "path", "required": true, "description": "Episode id returned by the topic or episode list.", "schema": { "type": "string", "minLength": 1, "maxLength": 512 } } ], "responses": { "200": { "description": "Complete ordered tool call list. An existing episode with no recorded calls returns an empty list.", "content": { "application/json": { "schema": { "type": "object", "required": ["data", "pagination"], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/McpAnalyticsCall" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "502": { "$ref": "#/components/responses/Problem" } } } }, "/v1/auth/device-authorization": { "post": { "tags": ["Auth"], "operationId": "deviceAuthorization", "summary": "Start a device authorization request", "description": "RFC 8628 device authorization endpoint. Initiates the device flow and returns a device_code, user_code, and verification URIs for the user to approve out of band, then poll the token endpoint. When `offline_access` is requested, `openid` is also required.\n", "x-required-scopes": [], "security": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeviceAuthorizationRequest" } }, "application/x-www-form-urlencoded": { "schema": { "$ref": "#/components/schemas/DeviceAuthorizationRequest" } } } }, "responses": { "200": { "description": "Device authorization started.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeviceAuthorizationResponse" } } } }, "400": { "description": "Invalid request (RFC 6749 §5.2 OAuth error).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OAuthError" } } } }, "401": { "description": "Client authentication failed (RFC 6749 §5.2 OAuth error).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OAuthError" } } } }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "description": "Server error (RFC 6749 §5.2 OAuth error).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OAuthError" } } } } } } }, "/v1/auth/signup": { "post": { "tags": ["Auth"], "operationId": "signup", "summary": "Sign up for an Amplitude account", "description": "Sign up for an Amplitude account. The response either provides credentials for the new account or starts an OAuth flow to complete signup.\n", "x-required-scopes": [], "security": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SignupRequest" } } } }, "responses": { "200": { "description": "Signup result with credentials, an OAuth flow, or additional signup information.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SignupResponse" } } } }, "400": { "description": "Invalid signup request.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SignupError" } } } }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "description": "Signup could not be completed due to a server error.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SignupError" } } } }, "502": { "description": "Signup upstream service error.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SignupError" } } } }, "503": { "description": "Signup authentication service is temporarily unavailable.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SignupError" } } } } } } }, "/v1/auth/token": { "post": { "tags": ["Auth"], "operationId": "token", "summary": "Exchange a grant for tokens", "description": "RFC 6749 §3.2 token endpoint. Supports the `device_code` grant (RFC 8628) and the `refresh_token` grant. Authenticated by the fixed confidential device-flow client (injected server-side). Does not require a Bearer token.\n", "x-required-scopes": [], "security": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TokenRequest" } }, "application/x-www-form-urlencoded": { "schema": { "$ref": "#/components/schemas/TokenRequest" } } } }, "responses": { "200": { "description": "Tokens issued.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TokenResponse" } } } }, "400": { "description": "Invalid or unsupported grant (RFC 6749 §5.2 OAuth error).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OAuthError" } } } }, "401": { "description": "Client authentication failed (RFC 6749 §5.2 OAuth error).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OAuthError" } } } }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "description": "Server error (RFC 6749 §5.2 OAuth error).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OAuthError" } } } } } } }, "/v1/context": { "get": { "tags": ["Projects"], "operationId": "getContext", "summary": "Get authenticated context", "description": "Returns the authenticated principal and organization context.", "x-required-scopes": ["projects:read"], "responses": { "200": { "description": "Successful response.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "type": "object", "required": ["object", "principal", "org"], "properties": { "object": { "type": "string", "const": "context" }, "principal": { "type": "object", "required": [ "object", "login_id", "org_id", "auth_type", "scopes" ], "properties": { "object": { "type": "string", "const": "principal" }, "login_id": { "type": "string" }, "org_id": { "type": "string" }, "org_name": { "type": ["string", "null"] }, "auth_type": { "type": "string", "enum": [ "oauth", "pat", "service_account", "api_key" ] }, "scopes": { "type": "array", "items": { "type": "string" } } } }, "org": { "type": "object", "required": ["id", "object", "name"], "properties": { "id": { "type": "string" }, "object": { "type": "string", "const": "org" }, "name": { "type": ["string", "null"] } } } } } } } } } }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects": { "get": { "tags": ["Projects"], "operationId": "listProjects", "summary": "List projects", "description": "Returns projects visible to the authenticated principal.", "x-required-scopes": ["projects:read"], "parameters": [ { "$ref": "#/components/parameters/Cursor" }, { "$ref": "#/components/parameters/Limit" }, { "$ref": "#/components/parameters/Sort" }, { "$ref": "#/components/parameters/Query" } ], "responses": { "200": { "description": "Successful response.", "content": { "application/json": { "schema": { "type": "object", "required": ["data", "pagination"], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Project" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/api-key": { "get": { "tags": ["Projects"], "operationId": "getProjectApiKey", "summary": "Retrieve a project API key", "description": "Provides the API key for a project. A project ID is required when the\norganization has more than one project.\n", "x-required-scopes": ["projects:read"], "parameters": [ { "name": "project_id", "in": "query", "required": false, "description": "The project ID. Required when the organization has more than one project.\n", "schema": { "type": "string", "pattern": "^[1-9][0-9]*$", "example": "12345" } } ], "responses": { "200": { "description": "The project API key alongside the project name and ID.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/ProjectApiKey" } } }, "example": { "data": { "object": "project_api_key", "project_id": "12345", "project_name": "Example Project", "api_key": "example-project-api-key" } } } } }, "400": { "description": "The query is invalid, or a project ID is required because the organization\nhas more than one project.\n", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" }, "examples": { "projectSelectionRequired": { "summary": "A project must be selected", "value": { "type": "https://developer-api.amplitude.com/problems/project-selection-required", "title": "Project API key request failed", "status": 400, "detail": "Supply project_id to select a project.", "error_code": "project_selection_required", "retryable": false } } } } } }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "description": "Permission to retrieve the project API key is denied, or the endpoint is\nunavailable.\n", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" }, "examples": { "projectKeyAccessDenied": { "summary": "Permission to view the API key is required", "value": { "type": "https://developer-api.amplitude.com/problems/project-key-access-denied", "title": "Project API key request failed", "status": 403, "detail": "Access to the project API key is denied.", "error_code": "project_key_access_denied", "retryable": false } } } } } }, "404": { "description": "The project does not exist in the authenticated organization or is not\naccessible to the caller (`project_not_found`).\n", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" }, "example": { "type": "https://developer-api.amplitude.com/problems/project-not-found", "title": "Project API key request failed", "status": 404, "detail": "Project not found.", "error_code": "project_not_found", "retryable": false } } } }, "422": { "description": "API key retrieval is not supported for this project. For example,\nportfolio views and warehouse-native projects do not support this\noperation.\n", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" }, "example": { "type": "https://developer-api.amplitude.com/problems/project-api-key-not-available", "title": "Project API key request failed", "status": 422, "detail": "API key retrieval is not available for this project.", "error_code": "project_api_key_not_available", "retryable": false } } } }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" }, "502": { "description": "The project API key could not be retrieved (`upstream_error`). Retry later.\n", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" }, "example": { "type": "https://developer-api.amplitude.com/problems/upstream-error", "title": "Project API key request failed", "status": 502, "detail": "Unable to retrieve the project API key. Retry later.", "error_code": "upstream_error", "retryable": true } } } }, "503": { "description": "The project API key is missing or unusable. Ask an administrator of your\norganization to review the project's API key settings.\n\nIf the endpoint is temporarily unavailable, retry later.\n", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" }, "examples": { "projectApiKeyUnavailable": { "summary": "The API key configuration needs attention", "value": { "type": "https://developer-api.amplitude.com/problems/project-api-key-unavailable", "title": "Project API key request failed", "status": 503, "detail": "The project API key is missing or unusable. Ask an administrator of your organization to review the project's API key settings.", "error_code": "project_api_key_unavailable", "retryable": false } }, "endpointNotAvailable": { "summary": "The endpoint is temporarily unavailable", "value": { "type": "https://developer-api.amplitude.com/problems/operation-availability-unavailable", "title": "Operation availability unavailable", "status": 503, "detail": "Operation availability could not be determined. Retry the request.", "error_code": "operation_availability_unavailable", "retryable": true } } } } } } } } }, "/v1/events/check-recent-ingestion": { "post": { "tags": ["Analytics"], "operationId": "checkRecentEventIngestionByApiKey", "summary": "Check recent event ingestion with an ingestion API key", "description": "Checks whether Amplitude received any events for the project associated\nwith the supplied ingestion API key during the preceding eight hours.\n\n`observed` means at least one event was received in the evaluated window.\n`not_observed` means no events were received. `inconclusive` means no events\nwere found, but the available data could not confirm their absence. Use the\nreturned window when reporting or comparing results.\n\nThe window uses server upload time: when Amplitude received each event,\nrather than the event time supplied by the sender.\n\nProvide `polling_timeout_seconds` to request server polling guidance.\nWhile another check is advised, successful responses include\n`poll_after_seconds`; its omission means clients should stop polling.\n", "x-required-scopes": [], "security": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["api_key"], "properties": { "api_key": { "type": "string", "pattern": "\\S", "description": "Ingestion API key for the Amplitude project to check." }, "polling_timeout_seconds": { "$ref": "#/components/schemas/RecentEventIngestionPollingTimeoutSeconds" } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "Recent event ingestion status for the evaluated window.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "type": "object", "required": ["status", "window"], "properties": { "status": { "type": "string", "enum": ["observed", "not_observed", "inconclusive"], "description": "`observed` when at least one event was received;\n`not_observed` when none were received; `inconclusive`\nwhen none were found but their absence could not be\nconfirmed.\n" }, "poll_after_seconds": { "$ref": "#/components/schemas/RecentEventIngestionPollAfterSeconds" }, "window": { "type": "object", "required": [ "lookback_hours", "start", "end", "basis" ], "properties": { "lookback_hours": { "type": "integer", "const": 8, "description": "Number of hours evaluated." }, "start": { "type": "string", "format": "date-time", "description": "Start of the evaluated window." }, "end": { "type": "string", "format": "date-time", "description": "End of the evaluated window." }, "basis": { "type": "string", "const": "server_upload_time", "description": "The window is based on when Amplitude received each\nevent.\n" } }, "additionalProperties": false } }, "additionalProperties": false } } }, "example": { "data": { "status": "observed", "window": { "lookback_hours": 8, "start": "2026-09-03T09:00:00Z", "end": "2026-09-03T17:00:00Z", "basis": "server_upload_time" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "description": "The supplied API key is invalid.", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" }, "example": { "type": "https://developer-api.amplitude.com/problems/invalid-api-key", "title": "Invalid API key", "status": 401, "detail": "The supplied API key is invalid.", "error_code": "invalid_api_key", "retryable": false } } } }, "403": { "description": "The endpoint is unavailable.", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" }, "example": { "type": "https://developer-api.amplitude.com/problems/operation-not-enabled", "title": "Endpoint unavailable", "status": 403, "detail": "This endpoint is unavailable.", "error_code": "operation_not_enabled", "retryable": false } } } }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" }, "502": { "description": "The ingestion status could not be determined. Retryable responses use\n`unreliable_dataset_response` or `upstream_error` as the `error_code`.\n", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "503": { "description": "Endpoint not available.", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" }, "example": { "type": "https://developer-api.amplitude.com/problems/operation-availability-unavailable", "title": "Endpoint not available", "status": 503, "detail": "This endpoint is not available.", "error_code": "operation_availability_unavailable", "retryable": true } } } } } } }, "/v1/skills": { "get": { "tags": ["Skills"], "operationId": "listSkills", "summary": "List available skills", "description": "Returns the skills currently available for implementing Amplitude, with each skill's name and when-to-use description.", "security": [], "responses": { "200": { "description": "Available skills.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "type": "array", "items": { "type": "object", "required": ["name", "description"], "properties": { "name": { "type": "string", "description": "Identifier used to retrieve the skill." }, "description": { "type": "string", "description": "When to use this skill." } } } } } } } } }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } } }, "/v1/skills/{name}": { "get": { "tags": ["Skills"], "operationId": "getSkill", "summary": "Get a skill document", "description": "Returns the requested skill document verbatim as markdown, including frontmatter.", "security": [], "parameters": [ { "name": "name", "in": "path", "required": true, "description": "Skill identifier as listed by `GET /v1/skills`.", "schema": { "type": "string" } } ], "responses": { "200": { "description": "The requested skill document as markdown.", "content": { "text/markdown": { "schema": { "type": "string" } } } }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } } }, "/v1/destination-types": { "get": { "tags": ["Destinations"], "operationId": "listDestinationTypes", "summary": "List destination partner types", "x-required-scopes": ["destinations:read"], "parameters": [ { "$ref": "#/components/parameters/Cursor" }, { "$ref": "#/components/parameters/Limit" } ], "responses": { "200": { "description": "Successful response.", "content": { "application/json": { "schema": { "type": "object", "required": ["data", "pagination"], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/DestinationType" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } } } } }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } } }, "/v1/destination-types/{partner}": { "parameters": [ { "$ref": "#/components/parameters/Partner" } ], "get": { "tags": ["Destinations"], "operationId": "getDestinationType", "summary": "Get destination partner type", "x-required-scopes": ["destinations:read"], "responses": { "200": { "description": "Successful response.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/DestinationType" } } } } } }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/events": { "get": { "tags": ["Taxonomy Events"], "operationId": "listEvents", "summary": "List event taxonomy entries", "x-required-scopes": ["taxonomy:read"], "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/Cursor" }, { "$ref": "#/components/parameters/Limit" }, { "$ref": "#/components/parameters/Query" } ], "responses": { "200": { "description": "Successful response.", "content": { "application/json": { "schema": { "type": "object", "required": ["data", "pagination"], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Event" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } }, "post": { "tags": ["Taxonomy Events"], "operationId": "createEvent", "summary": "Create event taxonomy entry", "x-required-scopes": ["taxonomy:write"], "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["event_type"], "properties": { "event_type": { "type": "string" }, "description": { "type": ["string", "null"] } }, "additionalProperties": false } } } }, "responses": { "201": { "description": "Event created.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/Event" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "409": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/events/check-recent-ingestion": { "parameters": [ { "$ref": "#/components/parameters/ProjectId" } ], "post": { "tags": ["Analytics"], "operationId": "checkRecentEventIngestion", "summary": "Check recent event ingestion", "description": "Checks whether events reached an Amplitude project during a recent time\nwindow. Provide `event_type` to check one exact event type, or omit it to\ncheck for any event. The default lookback is 10 minutes. The returned\nwindow can begin up to five minutes earlier so the evaluation covers the\ncomplete starting interval.\n\n`observed` means at least one matching event was found. `not_observed`\nmeans no matching event was found in the evaluated window. `inconclusive`\nmeans no matching event was found, but complete recent data was not\navailable to confirm its absence. Use the returned window when reporting\nor comparing results.\n\nThis POST computes a result and does not mutate state, so it does not\nrequire an `Idempotency-Key`.\n\nProvide `polling_timeout_seconds` to request server polling guidance.\nWhile another check is advised, successful responses include\n`poll_after_seconds`; its omission means clients should stop polling.\n", "x-required-scopes": ["analytics:read"], "requestBody": { "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RecentEventIngestionCheckRequest" } } } }, "responses": { "200": { "description": "Ingestion check completed successfully.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/RecentEventIngestionCheck" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "description": "The caller cannot use this operation. `operation_not_enabled` means the\noperation is not enabled for the caller's organization;\n`insufficient_scope` means the token lacks `analytics:read`.\n", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" }, "examples": { "operationNotEnabled": { "summary": "Endpoint unavailable", "value": { "type": "https://developer-api.amplitude.com/problems/operation-not-enabled", "title": "Endpoint unavailable", "status": 403, "detail": "This endpoint is unavailable for your organization.", "error_code": "operation_not_enabled", "retryable": false } }, "insufficientScope": { "summary": "Missing required scope", "value": { "type": "https://developer-api.amplitude.com/problems/forbidden", "title": "Insufficient scope", "status": 403, "detail": "Token missing required scopes.", "error_code": "insufficient_scope", "retryable": false } } } } } }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" }, "502": { "description": "The ingestion status could not be determined. Retryable responses use\n`event_type_not_queryable`, `unreliable_dataset_response`, or\n`upstream_error` as the `error_code`.\n", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "503": { "description": "Endpoint not available.", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" }, "examples": { "endpointNotAvailable": { "summary": "Endpoint not available", "value": { "type": "https://developer-api.amplitude.com/problems/operation-availability-unavailable", "title": "Endpoint not available", "status": 503, "detail": "This endpoint is not available.", "error_code": "operation_availability_unavailable", "retryable": true } } } } } } } } }, "/v1/projects/{project_id}/events/{event_id}": { "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/EventId" } ], "get": { "tags": ["Taxonomy Events"], "operationId": "getEvent", "summary": "Get event taxonomy entry", "x-required-scopes": ["taxonomy:read"], "responses": { "200": { "description": "Successful response.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/Event" } } } } } }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } }, "patch": { "tags": ["Taxonomy Events"], "operationId": "updateEvent", "summary": "Update event taxonomy entry", "x-required-scopes": ["taxonomy:write"], "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "description": { "type": ["string", "null"] }, "is_active": { "type": "boolean" } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "Event updated.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/Event" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } }, "delete": { "tags": ["Taxonomy Events"], "operationId": "deleteEvent", "summary": "Soft-delete event taxonomy entry", "x-required-scopes": ["taxonomy:write"], "parameters": [ { "$ref": "#/components/parameters/DryRun" }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "responses": { "204": { "description": "Event soft-deleted." }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/events/{event_id}/event-properties": { "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/EventId" } ], "get": { "tags": ["Taxonomy Event Properties"], "operationId": "listEventProperties", "summary": "List event properties for an event", "description": "Returns properties bound to a specific event, including ingested-only\nproperties (those with `is_in_schema: false`). Use the `is_in_schema`\nflag to detect whether a `PATCH` will succeed before issuing it.\n", "x-required-scopes": ["taxonomy:read"], "parameters": [ { "$ref": "#/components/parameters/Cursor" }, { "$ref": "#/components/parameters/Limit" }, { "$ref": "#/components/parameters/Query" } ], "responses": { "200": { "description": "Successful response.", "content": { "application/json": { "schema": { "type": "object", "required": ["data", "pagination"], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/EventProperty" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } }, "post": { "tags": ["Taxonomy Event Properties"], "operationId": "createEventProperty", "summary": "Create event property", "description": "Creates an event property and adds it to the project's tracking plan\n(`is_in_schema: true` after success). If the property already exists in\nthe schema, the existing resource is returned without modification.\nIf the property exists ingested-only (`is_in_schema: false`), this call\npromotes it into the schema with the metadata supplied here.\n", "x-required-scopes": ["taxonomy:write"], "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["property_name"], "properties": { "property_name": { "type": "string", "minLength": 1 }, "description": { "type": ["string", "null"] }, "data_type": { "$ref": "#/components/schemas/PropertyDataType" }, "is_array_type": { "type": "boolean", "default": false }, "enum_values": { "type": "array", "items": { "type": "string" } }, "regex": { "type": ["string", "null"] }, "is_hidden": { "type": "boolean", "default": false }, "classifications": { "type": "array", "items": { "type": "string" } } }, "additionalProperties": false } } } }, "responses": { "201": { "description": "Event property created.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/EventProperty" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "409": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/events/{event_id}/event-properties/{event_property_id}": { "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/EventId" }, { "$ref": "#/components/parameters/EventPropertyId" } ], "get": { "tags": ["Taxonomy Event Properties"], "operationId": "getEventProperty", "summary": "Get event property", "x-required-scopes": ["taxonomy:read"], "responses": { "200": { "description": "Successful response.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/EventProperty" } } } } } }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } }, "patch": { "tags": ["Taxonomy Event Properties"], "operationId": "updateEventProperty", "summary": "Update event property metadata", "description": "Updates metadata on an event property. Returns `422 not_in_schema` if\nthe property is ingested-only (`is_in_schema: false`); promote it via\n`POST` first. Field absent means leave unchanged; field with `null`\nclears (where allowed). `enum_values` and `classifications` replace the\narray entirely — there is no per-item add/remove.\n", "x-required-scopes": ["taxonomy:write"], "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "description": { "type": ["string", "null"] }, "data_type": { "$ref": "#/components/schemas/PropertyDataType" }, "is_array_type": { "type": "boolean" }, "enum_values": { "type": "array", "items": { "type": "string" } }, "regex": { "type": ["string", "null"] }, "is_hidden": { "type": "boolean" }, "classifications": { "type": "array", "items": { "type": "string" } } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "Event property updated.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/EventProperty" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "422": { "description": "Property is not part of the project's tracking plan. Returned when\nattempting to PATCH a property with `is_in_schema: false`.\n", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } }, "delete": { "tags": ["Taxonomy Event Properties"], "operationId": "deleteEventProperty", "summary": "Delete event property", "x-required-scopes": ["taxonomy:write"], "parameters": [ { "$ref": "#/components/parameters/DryRun" }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "responses": { "204": { "description": "Event property deleted." }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/tracking-plan/export": { "parameters": [ { "$ref": "#/components/parameters/ProjectId" } ], "get": { "tags": ["Taxonomy Events"], "operationId": "exportTrackingPlanCsv", "summary": "Export a tracking plan as CSV", "description": "Streams a CSV export of the project tracking plan, in the same format as\nthe Events and User Properties downloads in Data. Exports the default\nbranch unless `branch_id` or `branch_name` selects another one, and\nincludes that branch's unpublished changes.\n\nWhen `type=events`, optional `event_names` filters rows to exactly matching\nevent names (case-sensitive). Matching event rows and their event-property rows\nplus referenced property-group definition rows are returned, preserving the CSV\nformat and headers expected by import.\n`event_names` is not accepted with `type=user_properties`.\n\nUnknown names are returned in `X-Unmatched-Event-Names` as URL-encoded,\ncomma-separated names. Set `strict=true` to fail with 422 instead when any\nrequested event name is unknown. Deleted events count as unknown when\n`include_deleted=false`.\n", "x-required-scopes": ["taxonomy:read"], "parameters": [ { "name": "type", "in": "query", "required": false, "description": "Export format. Defaults to `events`.", "schema": { "type": "string", "enum": ["events", "user_properties"], "default": "events" } }, { "name": "branch_id", "in": "query", "required": false, "description": "Optional branch identifier. Mutually exclusive with `branch_name`.", "schema": { "type": "string", "minLength": 1 } }, { "name": "branch_name", "in": "query", "required": false, "description": "Optional branch name. Mutually exclusive with `branch_id`.", "schema": { "type": "string", "minLength": 1 } }, { "name": "include_deleted", "in": "query", "required": false, "description": "Include deleted events or properties in the export.", "schema": { "type": "boolean", "default": false } }, { "name": "lookback_days", "in": "query", "required": false, "description": "Lookback window in days for the volume and query columns of the `events` export. Defaults to 30. Ignored for `user_properties`.", "schema": { "type": "integer", "minimum": 1, "maximum": 365, "default": 30 } }, { "name": "event_names", "in": "query", "required": false, "description": "Optional event-name filter for `type=events`. Repeat this parameter\n(`event_names=a&event_names=b`) and/or pass comma-separated values\n(`event_names=a,b`). GET comma-separated values trim surrounding\nwhitespace from each split segment. Matches are otherwise exact and\ncase-sensitive.\n", "schema": { "type": "array", "minItems": 1, "maxItems": 1000, "items": { "type": "string", "minLength": 1, "maxLength": 1024 } }, "style": "form", "explode": true }, { "name": "strict", "in": "query", "required": false, "description": "When true, return 422 if any requested `event_names` are unknown.\nWhen false (default), unknown names are reported in\n`X-Unmatched-Event-Names`.\n", "schema": { "type": "boolean", "default": false } } ], "responses": { "200": { "description": "CSV response body.", "headers": { "Content-Disposition": { "description": "Suggested attachment filename.", "schema": { "type": "string" } }, "X-Unmatched-Event-Names": { "description": "URL-encoded, comma-separated unknown event names from `event_names` (present only when `strict=false` and unknown names exist).\n", "schema": { "type": "string" } }, "X-Unmatched-Event-Count": { "description": "Total number of unknown event names, including names omitted from the header when truncated.", "schema": { "type": "integer", "minimum": 0 } }, "X-Unmatched-Event-Names-Truncated": { "description": "True when `X-Unmatched-Event-Names` was truncated to stay within header size limits.", "schema": { "type": "boolean" } } }, "content": { "text/csv": { "schema": { "type": "string" } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "422": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" }, "502": { "$ref": "#/components/responses/Problem" }, "503": { "$ref": "#/components/responses/AvailabilityUnavailableProblem" }, "504": { "description": "The export did not start in time.", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } } } }, "post": { "tags": ["Taxonomy Events"], "operationId": "exportTrackingPlanCsvBody", "summary": "Export a tracking plan as CSV (JSON body variant)", "description": "Exports tracking-plan CSV with the same response semantics as `GET` export.\nUse this variant when `event_names` is long and would exceed URL limits.\nRequest `Content-Type` must be `application/json`.\n", "x-required-scopes": ["taxonomy:read"], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "additionalProperties": false, "properties": { "type": { "type": "string", "enum": ["events", "user_properties"], "default": "events", "description": "Export format." }, "branch_name": { "type": "string", "minLength": 1, "description": "Optional branch name. Omit for default branch." }, "branch_id": { "type": "string", "minLength": 1, "description": "Optional branch identifier. Mutually exclusive with `branch_name`." }, "include_deleted": { "type": "boolean", "default": false, "description": "Include deleted events or properties." }, "lookback_days": { "type": "integer", "minimum": 1, "maximum": 365, "default": 30, "description": "Lookback window in days for `events` volume/query columns. Ignored for `user_properties`.\n" }, "event_names": { "type": "array", "minItems": 1, "maxItems": 1000, "items": { "type": "string", "minLength": 1, "maxLength": 1024 }, "description": "Optional event-name filter for `type=events`. Matches are exact and case-sensitive. Not accepted with `type=user_properties`.\n" }, "strict": { "type": "boolean", "default": false, "description": "When true, return 422 if any requested `event_names` are unknown.\n" } } } } } }, "responses": { "200": { "description": "CSV response body.", "headers": { "Content-Disposition": { "description": "Suggested attachment filename.", "schema": { "type": "string" } }, "X-Unmatched-Event-Names": { "description": "URL-encoded, comma-separated unknown event names from `event_names` (present only when `strict=false` and unknown names exist).\n", "schema": { "type": "string" } }, "X-Unmatched-Event-Count": { "description": "Total number of unknown event names, including names omitted from the header when truncated.", "schema": { "type": "integer", "minimum": 0 } }, "X-Unmatched-Event-Names-Truncated": { "description": "True when `X-Unmatched-Event-Names` was truncated to stay within header size limits.", "schema": { "type": "boolean" } } }, "content": { "text/csv": { "schema": { "type": "string" } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "413": { "$ref": "#/components/responses/Problem" }, "415": { "$ref": "#/components/responses/Problem" }, "422": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" }, "502": { "$ref": "#/components/responses/Problem" }, "503": { "$ref": "#/components/responses/AvailabilityUnavailableProblem" }, "504": { "description": "The export did not start in time.", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } } } } }, "/v1/projects/{project_id}/tracking-plan/import": { "parameters": [ { "$ref": "#/components/parameters/ProjectId" } ], "post": { "tags": ["Taxonomy Events"], "operationId": "importTrackingPlanCsv", "summary": "Import a tracking plan from CSV", "description": "Sends a tracking-plan CSV as the request body and applies it to a new import branch.\nThis endpoint always imports into a branch and never writes to main directly.\nCreating the branch publishes any pending changes on main's staging version\nfirst, as creating a branch in the product does. When the import fails after\nthe branch was created (422 for invalid rows, 502 for a server failure), the\nerror payload includes `details.branch` so callers can inspect or delete the\nbranch. A duplicate `branch_name` returns 409 before anything is created.\n", "x-required-scopes": ["taxonomy:write"], "parameters": [ { "name": "branch_name", "in": "query", "required": false, "description": "Optional name for the import branch, 1 to 256 characters. When omitted,\nthe import uses `import`, or `import-N` if that name is taken. A name\nthat already exists returns 409.\n", "schema": { "type": "string", "minLength": 1, "maxLength": 256 } } ], "requestBody": { "required": true, "description": "The CSV file contents, at most 50 MB.", "content": { "text/csv": { "schema": { "type": "string" } } } }, "responses": { "201": { "description": "Import completed on an import branch.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "type": "object", "required": [ "object", "project_id", "branch_id", "import_type", "event_count", "template_count", "user_property_count" ], "properties": { "object": { "type": "string", "enum": ["tracking_plan_import"] }, "project_id": { "type": "string" }, "branch_id": { "type": "string" }, "branch_name": { "type": ["string", "null"] }, "current_version_id": { "type": ["string", "null"] }, "staging_version_id": { "type": ["string", "null"] }, "import_type": { "type": "string", "enum": ["events", "user_properties"], "description": "Public import target type. `events` includes event, template,\nevent-property, and template-property rows; `user_properties`\nincludes user-property rows.\n" }, "event_count": { "type": "integer" }, "template_count": { "type": "integer" }, "user_property_count": { "type": "integer" }, "breakdown": { "type": ["object", "null"], "description": "Per-type import counters. Units:\n- templates/events/user_properties: definition rows changed.\n- template_properties/event_properties `created|updated`:\n property definition rows changed.\n- template_properties/event_properties `unmapped`: properties\n removed from templates/events; the property definition is kept.\n", "properties": { "templates": { "type": "object", "required": ["created", "updated", "removed"], "properties": { "created": { "type": "integer" }, "updated": { "type": "integer" }, "removed": { "type": "integer" } } }, "template_properties": { "type": "object", "required": ["created", "updated", "unmapped"], "properties": { "created": { "type": "integer" }, "updated": { "type": "integer" }, "unmapped": { "type": "integer" } } }, "events": { "type": "object", "required": ["created", "updated", "removed"], "properties": { "created": { "type": "integer" }, "updated": { "type": "integer" }, "removed": { "type": "integer" } } }, "event_properties": { "type": "object", "required": ["created", "updated", "unmapped"], "properties": { "created": { "type": "integer" }, "updated": { "type": "integer" }, "unmapped": { "type": "integer" } } }, "user_properties": { "type": "object", "required": ["created", "updated", "removed"], "properties": { "created": { "type": "integer" }, "updated": { "type": "integer" }, "removed": { "type": "integer" } } } } } } } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "409": { "description": "The requested `branch_name` already exists. Nothing was created; choose\nanother name.\n", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "413": { "$ref": "#/components/responses/Problem" }, "415": { "$ref": "#/components/responses/Problem" }, "422": { "description": "The CSV is not valid tracking-plan data. `details.branch` is present when\nthe error was found after the import branch was created.\n", "content": { "application/problem+json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/ProblemDetails" }, { "type": "object", "properties": { "details": { "type": ["object", "null"], "properties": { "branch": { "type": "object", "required": ["id", "name"], "properties": { "id": { "type": "string" }, "name": { "type": "string" } } } } } } } ] } } } }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" }, "502": { "description": "The import did not finish. Not retryable when `details.branch` is present\n(the branch was created) or when the connection was lost mid-import (the\nimport may have started): a retry could create a second branch. List the\nproject's branches to find the result. A 502 without `details.branch`\nthat is marked retryable means the import was never started.\n", "content": { "application/problem+json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/ProblemDetails" }, { "type": "object", "properties": { "details": { "type": ["object", "null"], "properties": { "branch": { "type": "object", "required": ["id", "name"], "properties": { "id": { "type": "string" }, "name": { "type": "string" } } } } } } } ] } } } }, "504": { "description": "The import did not respond in time and may still complete. Not\nretryable: a retry may create a second branch. List the project's\nbranches to find the result.\n", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } } } } }, "/v1/projects/{project_id}/scheduled-event-actions": { "parameters": [ { "$ref": "#/components/parameters/ProjectId" } ], "get": { "tags": ["Taxonomy Events"], "operationId": "listScheduledEventActions", "summary": "List scheduled event deletions and blocks", "x-required-scopes": ["taxonomy:read"], "parameters": [ { "$ref": "#/components/parameters/Cursor" }, { "$ref": "#/components/parameters/Limit" }, { "$ref": "#/components/parameters/Query" }, { "$ref": "#/components/parameters/ScheduledEventActionEventTypeFilter" }, { "$ref": "#/components/parameters/ScheduledEventActionKindFilter" }, { "$ref": "#/components/parameters/ScheduledEventActionStatusFilter" } ], "responses": { "200": { "description": "Successful response. Defaults to pending actions.", "content": { "application/json": { "schema": { "type": "object", "required": ["data", "pagination"], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/ScheduledEventAction" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } }, "post": { "tags": ["Taxonomy Events"], "operationId": "createScheduledEventActions", "summary": "Schedule event deletions and blocks", "description": "Each `event_type` must already exist on the project and may appear only once\nin `items`. Update and cancel take scheduled-action ids, so they do not look\nup the event again.\nOne pending scheduled action is allowed per event type. If that event\nalready has a pending deletion or block, cancel it before creating another.\nThe whole request fails if any item cannot be created.\n", "x-required-scopes": ["taxonomy:write"], "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "additionalProperties": false, "required": ["items"], "properties": { "items": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["event_type", "action", "days_from_now"], "properties": { "event_type": { "type": "string", "minLength": 1 }, "action": { "$ref": "#/components/schemas/ScheduledEventActionKind" }, "days_from_now": { "type": "integer", "minimum": 1, "description": "Days until the action runs. The server computes `target_date`." } } } } } } } } }, "responses": { "201": { "description": "Scheduled actions created.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/ScheduledEventAction" } } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } }, "patch": { "tags": ["Taxonomy Events"], "operationId": "updateScheduledEventActions", "summary": "Reschedule event deletions and blocks", "description": "The whole request fails if any id is not a pending scheduled action on the project.\n", "x-required-scopes": ["taxonomy:write"], "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "additionalProperties": false, "required": ["items"], "properties": { "items": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["id", "days_from_now"], "properties": { "id": { "type": "string", "minLength": 1 }, "days_from_now": { "type": "integer", "minimum": 1, "description": "New delay until the action runs. The server computes `target_date`." } } } } } } } } }, "responses": { "200": { "description": "Scheduled actions updated.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/ScheduledEventAction" } } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } }, "delete": { "tags": ["Taxonomy Events"], "operationId": "deleteScheduledEventActions", "summary": "Cancel scheduled event deletions and blocks", "description": "The whole request fails if any id is not a pending scheduled action on the project.\n", "x-required-scopes": ["taxonomy:write"], "parameters": [ { "$ref": "#/components/parameters/DryRun" }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "additionalProperties": false, "required": ["ids"], "properties": { "ids": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } } } } } } }, "responses": { "204": { "description": "Scheduled actions canceled." }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/scheduled-event-actions/{scheduled_event_action_id}": { "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/ScheduledEventActionId" } ], "get": { "tags": ["Taxonomy Events"], "operationId": "getScheduledEventAction", "summary": "Get a scheduled event deletion or block", "x-required-scopes": ["taxonomy:read"], "responses": { "200": { "description": "Successful response.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/ScheduledEventAction" } } } } } }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/user-properties": { "parameters": [ { "$ref": "#/components/parameters/ProjectId" } ], "get": { "tags": ["Taxonomy User Properties"], "operationId": "listUserProperties", "summary": "List user properties for a project", "x-required-scopes": ["taxonomy:read"], "parameters": [ { "$ref": "#/components/parameters/Cursor" }, { "$ref": "#/components/parameters/Limit" }, { "$ref": "#/components/parameters/Query" } ], "responses": { "200": { "description": "Successful response.", "content": { "application/json": { "schema": { "type": "object", "required": ["data", "pagination"], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/UserProperty" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } }, "post": { "tags": ["Taxonomy User Properties"], "operationId": "createUserProperty", "summary": "Create user property", "description": "Creates a user property and adds it to the project's tracking plan.\nSame idempotency semantics as creating an event property.\n", "x-required-scopes": ["taxonomy:write"], "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["property_name"], "properties": { "property_name": { "type": "string", "minLength": 1 }, "display_name": { "type": ["string", "null"] }, "description": { "type": ["string", "null"] }, "data_type": { "$ref": "#/components/schemas/PropertyDataType" }, "is_array_type": { "type": "boolean", "default": false }, "enum_values": { "type": "array", "items": { "type": "string" } }, "regex": { "type": ["string", "null"] }, "is_hidden": { "type": "boolean", "default": false }, "classifications": { "type": "array", "items": { "type": "string" } } }, "additionalProperties": false } } } }, "responses": { "201": { "description": "User property created.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/UserProperty" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "409": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/user-properties/{user_property_id}": { "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/UserPropertyId" } ], "get": { "tags": ["Taxonomy User Properties"], "operationId": "getUserProperty", "summary": "Get user property", "x-required-scopes": ["taxonomy:read"], "responses": { "200": { "description": "Successful response.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/UserProperty" } } } } } }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } }, "patch": { "tags": ["Taxonomy User Properties"], "operationId": "updateUserProperty", "summary": "Update user property metadata", "description": "Updates metadata on a user property. Returns `422 not_in_schema` if the\nproperty is ingested-only. Same patch semantics as updating an event property\n(field absent = unchanged, `null` = clear, arrays replace).\n\nOnly `display_name`, `description`, `is_hidden`, and `classifications`\nare mutable via PATCH today. Type/shape fields (`data_type`,\n`is_array_type`, `enum_values`, `regex`) are settable only at creation.\n`is_official` is read-only in this API version.\n", "x-required-scopes": ["taxonomy:write"], "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "display_name": { "type": ["string", "null"] }, "description": { "type": ["string", "null"] }, "is_hidden": { "type": "boolean" }, "classifications": { "type": "array", "items": { "type": "string" } } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "User property updated.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/UserProperty" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "422": { "description": "Property is not part of the project's tracking plan. Returned when\nattempting to PATCH a property with `is_in_schema: false`.\n", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } }, "delete": { "tags": ["Taxonomy User Properties"], "operationId": "deleteUserProperty", "summary": "Delete user property", "x-required-scopes": ["taxonomy:write"], "parameters": [ { "$ref": "#/components/parameters/DryRun" }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "responses": { "204": { "description": "User property deleted." }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/charts": { "get": { "tags": ["Analytics"], "operationId": "listCharts", "summary": "List charts", "description": "Returns saved charts in the project. Results are paginated with cursor-based\npagination. Chart definitions are omitted; use GET chart with\n`include_definition=true` to retrieve a read-only definition.\n\nPagination uses an opaque numeric cursor (offset into the current sorted\nsearch result set). Each list query can access at most **10,000** matching\ncharts from the search index; pages beyond that window return fewer items\nand `next_cursor: null` even when more charts may exist in the project.\nUse filters (`q`, `chart_type`) to narrow large projects.\n\nSortable fields are `updated_at` and `name`; prefix with `-` for descending.\nDefaults to `-updated_at` (most recently updated first). `created_at` is not\nsupported in this API version.\n", "x-required-scopes": ["analytics:read"], "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/Cursor" }, { "$ref": "#/components/parameters/Limit" }, { "$ref": "#/components/parameters/Query" }, { "$ref": "#/components/parameters/ChartType" }, { "$ref": "#/components/parameters/Sort" } ], "responses": { "200": { "description": "Successful response.", "content": { "application/json": { "schema": { "type": "object", "required": ["data", "pagination"], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Chart" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/charts/{chart_id}": { "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/ChartId" } ], "get": { "tags": ["Analytics"], "operationId": "getChart", "summary": "Get chart", "description": "Returns chart metadata. The chart definition is omitted by default. Set\n`include_definition=true` to include a read-only definition object. The\ndefinition shape is unstable and not intended for authoring.\n", "x-required-scopes": ["analytics:read"], "parameters": [ { "$ref": "#/components/parameters/IncludeDefinition" } ], "responses": { "200": { "description": "Successful response.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/Chart" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/charts/{chart_id}/query": { "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/ChartId" } ], "post": { "tags": ["Analytics"], "operationId": "queryChart", "summary": "Query chart", "description": "Computes and returns normalized results for a saved chart. v1 supports\n`event_segmentation`, `sessions`, `funnels`, and `retention` chart types;\nother chart types return `422` with `error_code: unsupported_chart_type`.\nResults reflect the authenticated caller's project access and chart\npermissions.\n\nThis POST computes a result and does not mutate state. It is therefore a\nread operation and does not require an `Idempotency-Key`.\n\nOmitting `time_range` uses the chart's saved range; if the chart has no\nsaved range, the server defaults to the last 30 days.\n\nQuery is synchronous with bounded defaults. Expensive queries may return\n`504` when exceeding the server timeout; async query jobs are planned for\na follow-up slice. Retryable responses may include retry advice where\ntheir endpoint-specific error contract provides it.\n", "x-required-scopes": ["analytics:read"], "requestBody": { "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChartQueryRequest" } } } }, "responses": { "200": { "description": "Query completed successfully.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/AnalyticsResult" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "422": { "description": "Chart type is not supported for public query in this version. The\nrequest was understood but cannot be processed. Returned with\n`error_code: unsupported_chart_type`; `detail` names the chart type\nand the currently supported set.\n", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" }, "502": { "$ref": "#/components/responses/Problem" }, "504": { "description": "Query exceeded the synchronous timeout.", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } } } } }, "/v1/ai-context": { "get": { "tags": ["AI Context"], "operationId": "getOrgAiContext", "summary": "Get organization AI context", "description": "Returns the customer-managed AI context configured for the organization in\nSettings → AI Controls. Empty string when nothing is configured.\n", "x-required-scopes": ["analytics:read"], "responses": { "200": { "description": "Successful response.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/AiContext" } } } } } }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" }, "503": { "$ref": "#/components/responses/AvailabilityUnavailableProblem" } } }, "put": { "tags": ["AI Context"], "operationId": "setOrgAiContext", "summary": "Set organization AI context", "description": "Replaces the customer-managed AI context for the organization in\nSettings → AI Controls. Send `\"context\": \"\"` to clear the stored value.\nRequires an `Idempotency-Key` header on every request.\n", "x-required-scopes": ["analytics:write"], "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AiContextWrite" } } } }, "responses": { "200": { "description": "Successful response.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/AiContext" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" }, "503": { "$ref": "#/components/responses/AvailabilityUnavailableProblem" } } } }, "/v1/projects/{project_id}/ai-context": { "parameters": [ { "$ref": "#/components/parameters/ProjectId" } ], "get": { "tags": ["AI Context"], "operationId": "getProjectAiContext", "summary": "Get project AI context", "description": "Returns the customer-managed AI context configured for a project in\nSettings → AI Controls. Empty string when nothing is configured.\n", "x-required-scopes": ["analytics:read"], "responses": { "200": { "description": "Successful response.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/AiContext" } } } } } }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" }, "503": { "$ref": "#/components/responses/AvailabilityUnavailableProblem" } } }, "put": { "tags": ["AI Context"], "operationId": "setProjectAiContext", "summary": "Set project AI context", "description": "Replaces the customer-managed AI context for a project in\nSettings → AI Controls. Send `\"context\": \"\"` to clear the stored value.\nRequires an `Idempotency-Key` header on every request.\n", "x-required-scopes": ["analytics:write"], "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AiContextWrite" } } } }, "responses": { "200": { "description": "Successful response.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/AiContext" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" }, "503": { "$ref": "#/components/responses/AvailabilityUnavailableProblem" } } } }, "/v1/projects/{project_id}/metrics": { "get": { "tags": ["Analytics"], "operationId": "listMetrics", "summary": "List metrics", "description": "Returns saved metrics in the project. Results are paginated with cursor-based\npagination. Full metric definitions are included in list responses.\n\nSortable fields are `updated_at` and `name`; prefix with `-` for descending.\nDefaults to `-updated_at` (most recently updated first).\n", "x-required-scopes": ["analytics:read"], "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/Cursor" }, { "$ref": "#/components/parameters/Limit" }, { "$ref": "#/components/parameters/Query" }, { "$ref": "#/components/parameters/MetricTypeFilter" }, { "$ref": "#/components/parameters/Sort" } ], "responses": { "200": { "description": "Successful response.", "content": { "application/json": { "schema": { "type": "object", "required": ["data", "pagination"], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Metric" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/MetricForbiddenProblem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" }, "503": { "$ref": "#/components/responses/AvailabilityUnavailableProblem" } } } }, "/v1/projects/{project_id}/metrics/{metric_id}": { "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/MetricId" } ], "get": { "tags": ["Analytics"], "operationId": "getMetric", "summary": "Get metric", "description": "Returns the full saved metric definition including type-specific params,\nversion, and metadata.\n", "x-required-scopes": ["analytics:read"], "responses": { "200": { "description": "Successful response.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/Metric" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/MetricForbiddenProblem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" }, "503": { "$ref": "#/components/responses/AvailabilityUnavailableProblem" } } } }, "/v1/projects/{project_id}/heatmaps/click-map": { "parameters": [ { "$ref": "#/components/parameters/ProjectId" } ], "post": { "tags": ["Heatmaps"], "operationId": "queryClickMap", "summary": "Query click map", "description": "Returns click counts for one page URL, grouped by the CSS selector of the\nclicked element or by page coordinate, ranked by count. Filter by device\nviewport band and date range. Results reflect the authenticated caller's\nproject access and data access controls.\n\nThis POST computes a result and does not mutate state. It is therefore a\nread operation and does not require an `Idempotency-Key`.\n\nOmitting `time_range` uses the last 30 days in the project timezone. The\nspan of `time_range` cannot exceed 90 days.\n", "x-required-scopes": ["analytics:read"], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ClickMapQueryRequest" } } } }, "responses": { "200": { "description": "Click map computed successfully.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/ClickMap" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/HeatmapForbiddenProblem" }, "404": { "$ref": "#/components/responses/Problem" }, "422": { "$ref": "#/components/responses/NotConfiguredProblem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" }, "502": { "$ref": "#/components/responses/Problem" }, "503": { "$ref": "#/components/responses/AvailabilityUnavailableProblem" }, "504": { "$ref": "#/components/responses/UpstreamTimeoutProblem" } } } }, "/v1/projects/{project_id}/heatmaps/scroll-map": { "parameters": [ { "$ref": "#/components/parameters/ProjectId" } ], "post": { "tags": ["Heatmaps"], "operationId": "queryScrollMap", "summary": "Query scroll map", "description": "Returns the scroll-depth distribution for one page URL as a cumulative\nhistogram from the top of the page, plus the average fold and the deepest\nscroll observed. Filter by device viewport band and date range. Results\nreflect the authenticated caller's project access and data access\ncontrols.\n\nThis POST computes a result and does not mutate state. It is therefore a\nread operation and does not require an `Idempotency-Key`.\n\nOmitting `time_range` uses the last 30 days in the project timezone. The\nspan of `time_range` cannot exceed 90 days.\n", "x-required-scopes": ["analytics:read"], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ScrollMapQueryRequest" } } } }, "responses": { "200": { "description": "Scroll map computed successfully.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/ScrollMap" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/HeatmapForbiddenProblem" }, "404": { "$ref": "#/components/responses/Problem" }, "422": { "$ref": "#/components/responses/NotConfiguredProblem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" }, "502": { "$ref": "#/components/responses/Problem" }, "503": { "$ref": "#/components/responses/AvailabilityUnavailableProblem" }, "504": { "$ref": "#/components/responses/UpstreamTimeoutProblem" } } } }, "/v1/projects/{project_id}/zoning/zone-metrics": { "parameters": [ { "$ref": "#/components/parameters/ProjectId" } ], "post": { "tags": ["Zoning"], "operationId": "queryZoneMetrics", "summary": "Query zone metrics", "description": "Returns one metric for every zone on a page URL, ranked by value. A zone\nis identified by the CSS selector of its element. Results reflect the\nauthenticated caller's project access and data access controls.\n\nThis POST computes a result and does not mutate state. It is therefore a\nread operation and does not require an `Idempotency-Key`.\n\nOmitting `time_range` uses the last 30 days in the project timezone. The\nspan of `time_range` cannot exceed 90 days.\n", "x-required-scopes": ["analytics:read"], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ZoneMetricsQueryRequest" } } } }, "responses": { "200": { "description": "Zone metrics computed successfully.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/ZoneMetrics" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/ZoningForbiddenProblem" }, "404": { "$ref": "#/components/responses/Problem" }, "422": { "$ref": "#/components/responses/NotConfiguredProblem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" }, "502": { "$ref": "#/components/responses/Problem" }, "503": { "$ref": "#/components/responses/AvailabilityUnavailableProblem" }, "504": { "$ref": "#/components/responses/UpstreamTimeoutProblem" } } } }, "/v1/projects/{project_id}/flags": { "get": { "tags": ["Feature Flags"], "operationId": "listFeatureFlags", "summary": "List feature flags", "x-required-scopes": ["flags:read"], "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/Cursor" }, { "$ref": "#/components/parameters/Limit" }, { "name": "key", "in": "query", "required": false, "description": "Filter this list by an exact flag key within the project. Returns the standard list response, or an empty list when no active flag matches. Get, update, and archive require the returned numeric id; those operations do not accept a flag key or resolve one automatically.", "schema": { "type": "string", "minLength": 1 } } ], "responses": { "200": { "description": "Successful response.", "content": { "application/json": { "schema": { "type": "object", "required": ["data", "pagination"], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/FeatureFlag" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } }, "post": { "tags": ["Feature Flags"], "operationId": "createFeatureFlag", "summary": "Create feature flag", "x-required-scopes": ["flags:write"], "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["key", "name"], "properties": { "key": { "type": "string", "pattern": "^[a-z0-9_-]+$", "description": "Lowercase letters, numbers, hyphens, and underscores only." }, "name": { "type": "string" }, "description": { "type": ["string", "null"] }, "evaluation_mode": { "type": "string", "enum": ["local", "remote"], "default": "remote" }, "bucketing_key": { "type": "string" }, "variants": { "type": "array", "items": { "$ref": "#/components/schemas/Variant" } }, "deployment_ids": { "type": "array", "items": { "type": "string" } }, "rollout_percentage": { "type": "integer", "minimum": 0, "maximum": 100 }, "rollout_weights": { "$ref": "#/components/schemas/RolloutWeights" }, "testers": { "type": "array", "items": { "$ref": "#/components/schemas/Tester" } }, "target_segments": { "type": "array", "items": { "$ref": "#/components/schemas/TargetSegmentInput" } } }, "additionalProperties": false } } } }, "responses": { "201": { "description": "Feature flag created.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/FeatureFlag" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "409": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/flags/{flag_id}": { "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/FlagId" } ], "get": { "tags": ["Feature Flags"], "operationId": "getFeatureFlag", "summary": "Get feature flag", "x-required-scopes": ["flags:read"], "responses": { "200": { "description": "Successful response.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/FeatureFlag" } } } } } }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } }, "patch": { "tags": ["Feature Flags"], "operationId": "updateFeatureFlag", "summary": "Update feature flag", "description": "Updates feature flag metadata and rollout settings. Variant, tester, deployment, and link mutations will be exposed through dedicated subresources in a later slice.", "x-required-scopes": ["flags:write"], "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": ["string", "null"] }, "enabled": { "type": "boolean" }, "evaluation_mode": { "type": "string", "enum": ["local", "remote"] }, "bucketing_key": { "type": "string" }, "rollout_percentage": { "type": "integer", "minimum": 0, "maximum": 100 }, "tags": { "type": "array", "items": { "type": "string" } } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "Feature flag updated.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/FeatureFlag" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "409": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } }, "delete": { "tags": ["Feature Flags"], "operationId": "archiveFeatureFlag", "summary": "Archive feature flag", "x-required-scopes": ["flags:write"], "parameters": [ { "$ref": "#/components/parameters/DryRun" }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "responses": { "204": { "description": "Feature flag archived." }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/guides": { "get": { "tags": ["Guides"], "operationId": "listGuides", "summary": "List guides", "description": "Returns guides in the project. Results use the standard\nDeveloper API list envelope with cursor pagination (`cursor`, `limit`).\n\nFull-text search (`q`) and custom sort orders are not supported yet.\n", "x-required-scopes": ["guides:read"], "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/Cursor" }, { "$ref": "#/components/parameters/Limit" }, { "name": "platform", "in": "query", "required": false, "schema": { "$ref": "#/components/schemas/NudgePlatform" } }, { "name": "created_after", "in": "query", "required": false, "schema": { "type": "string", "format": "date-time" } }, { "name": "created_before", "in": "query", "required": false, "schema": { "type": "string", "format": "date-time" } }, { "name": "created_by", "in": "query", "required": false, "description": "Filter by creator email or login id (exact match).", "schema": { "type": "string" } }, { "name": "include_archived", "in": "query", "required": false, "schema": { "type": "boolean", "default": false } } ], "responses": { "200": { "description": "Successful response.", "content": { "application/json": { "schema": { "type": "object", "required": ["data", "pagination"], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/GuideSummary" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } }, "post": { "tags": ["Guides"], "operationId": "createGuide", "summary": "Create guide", "description": "Creates an unpublished draft guide. Publish, schedule, and test\ninstrumentation are not available via API in v1. At most one content\nvariant is accepted on create; the `control` key is reserved.\n", "x-required-scopes": ["guides:write"], "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["title"], "properties": { "title": { "type": "string", "minLength": 1, "maxLength": 255 }, "description": { "type": ["string", "null"] }, "platform": { "$ref": "#/components/schemas/NudgePlatform" }, "priority": { "type": "integer", "minimum": 1, "maximum": 4 }, "variants": { "type": "array", "items": { "$ref": "#/components/schemas/GuideSurveyVariantInput" } } }, "additionalProperties": false } } } }, "responses": { "201": { "description": "Guide created.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/Guide" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "409": { "$ref": "#/components/responses/ValidationProblem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/guides/{guide_id}": { "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/GuideId" } ], "get": { "tags": ["Guides"], "operationId": "getGuide", "summary": "Get guide", "x-required-scopes": ["guides:read"], "parameters": [ { "name": "include_unpublished_changes", "in": "query", "required": false, "description": "When true, return the latest draft (unpublished edits) when one exists.\nDefault false returns the live published guide.\n", "schema": { "type": "boolean", "default": false } }, { "name": "include_translations", "in": "query", "required": false, "description": "When true, add `localization` (the project's default locale and other\nlocales) and each variant's `translations` and `translation_status`.\nRead with `include_unpublished_changes=true` before writing\ntranslations, so keys and `latest_version` match the draft. When\nlocalization is disabled in the project settings, only\n`localization: {enabled: false}` is added.\n", "schema": { "type": "boolean", "default": false } } ], "responses": { "200": { "description": "Successful response.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/Guide" } } } } } }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } }, "patch": { "tags": ["Guides"], "operationId": "updateGuide", "summary": "Update guide", "description": "Updates metadata, targeting, and content variants. For published guides,\nchanges apply to a draft until publish in the UI. `latest_version` is\nrequired and must match the current draft, otherwise the update returns\n`409`. The check runs before the write rather than atomically with it, so it\nreduces but does not fully prevent lost updates from concurrent writers.\nPublish, schedule, and test instrumentation are not\navailable via API in v1. Status fields on the response are derived read-only.\nWhen `variants` is sent, it must list every existing variant by `id` with\nits unchanged `variant` key; steps within a variant can be added, edited,\nreordered, or removed. `tags` is not writable in v1 and returns `400`.\n\nTo add, change, or clear translations, send\n`variants: [{\"id\": \"\", \"translations\": {...}}]`. Entries\nthat carry only `id` and `translations` may name a subset of the variants\nand need no `variant` key. `translations` maps locale to translation key to\ntext. Take the keys and their default-locale text from\n`translation_status.sources` on a `GET` with\n`include_translations=true&include_unpublished_changes=true`. Translations\nmerge into what is stored: keys you leave out keep their text, `null`\nclears a key, and `null` for a locale clears every key in it. Only steps\nand blocks that already exist can be translated, so add new content\nfirst, then translate it in a later request. The default locale is edited\nthrough the guide content, not `translations`. When the request sends\ntranslations, the response includes `localization`, `translations`, and\n`translation_status`. Translations return `400` when localization is\ndisabled in the project settings or the locale isn't one of the\nproject's locales.\n", "x-required-scopes": ["guides:write"], "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "title": { "type": "string", "minLength": 1, "maxLength": 255 }, "description": { "type": ["string", "null"] }, "platform": { "$ref": "#/components/schemas/NudgePlatform" }, "priority": { "type": "integer", "minimum": 1, "maximum": 4 }, "page_target_segments": { "type": "array", "description": "Pages where the guide is eligible. Empty means every page.\nEach item uses camelCase keys.\n", "items": { "$ref": "#/components/schemas/GuideSurveyPageTarget" } }, "temporarily_hide_page_target_segments": { "type": "array", "description": "Page rules that are saved but not currently applied.", "items": { "$ref": "#/components/schemas/GuideSurveyPageTarget" } }, "hide_if_page_targeting_not_met": { "type": "boolean" }, "trigger_config": { "$ref": "#/components/schemas/GuideSurveyTriggerConfig" }, "lifecycle": { "$ref": "#/components/schemas/GuideSurveyLifecycle" }, "dismissible": { "type": "boolean" }, "snoozable": { "type": "boolean" }, "snoozable_on_all_steps": { "type": "boolean" }, "snooze_duration": { "$ref": "#/components/schemas/GuideSurveySnoozeDuration" }, "snooze_label": { "type": "string", "maxLength": 255, "description": "Snooze button label." }, "template_source": { "type": "string", "maxLength": 255 }, "show_step_counter": { "type": "boolean" }, "step_counter_format": { "type": "string", "enum": ["numeric", "verbose"], "description": "`numeric` shows \"1/3\"; `verbose` shows \"Step 1 of 3\"." }, "tags": { "type": "array", "items": { "type": "string" } }, "variants": { "type": "array", "items": { "$ref": "#/components/schemas/GuideSurveyVariantUpdateInput" } }, "latest_version": { "type": "integer", "description": "Expected `latest_version` from the last GET with\n`include_unpublished_changes=true`.\n" } }, "required": ["latest_version"], "additionalProperties": false } } } }, "responses": { "200": { "description": "Guide updated.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/Guide" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "409": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } }, "delete": { "tags": ["Guides"], "operationId": "archiveGuide", "summary": "Archive guide", "description": "Archives an unpublished guide. A guide counts as published while its flag is\nenabled, unless it's only in test mode without a schedule; archiving a\npublished guide returns `409` with `error_code: cannot_archive_published`.\nUnpublish it in Amplitude first. Use `dry_run=true` to check whether a guide\ncan be archived. An already archived guide returns `404`, like `GET`.\n", "x-required-scopes": ["guides:write"], "parameters": [ { "$ref": "#/components/parameters/DryRun" }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "responses": { "204": { "description": "Guide archived, or with `dry_run=true`, the guide can be archived." }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "409": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/surveys": { "get": { "tags": ["Surveys"], "operationId": "listSurveys", "summary": "List surveys", "description": "Returns surveys in the project. Results use the standard Developer API list\nenvelope with cursor pagination (`cursor`, `limit`).\n\nFull-text search (`q`) and custom sort orders are not supported yet.\n", "x-required-scopes": ["surveys:read"], "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/Cursor" }, { "$ref": "#/components/parameters/Limit" }, { "name": "platform", "in": "query", "required": false, "schema": { "$ref": "#/components/schemas/NudgePlatform" } }, { "name": "created_after", "in": "query", "required": false, "schema": { "type": "string", "format": "date-time" } }, { "name": "created_before", "in": "query", "required": false, "schema": { "type": "string", "format": "date-time" } }, { "name": "created_by", "in": "query", "required": false, "description": "Filter by creator email or login id (exact match).", "schema": { "type": "string" } }, { "name": "include_archived", "in": "query", "required": false, "schema": { "type": "boolean", "default": false } } ], "responses": { "200": { "description": "Successful response.", "content": { "application/json": { "schema": { "type": "object", "required": ["data", "pagination"], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/SurveySummary" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } }, "post": { "tags": ["Surveys"], "operationId": "createSurvey", "summary": "Create survey", "description": "Creates an unpublished draft survey. Publish, schedule, and test\ninstrumentation are not available via API in v1. At most one content\nvariant is accepted on create; the `control` key is reserved.\n", "x-required-scopes": ["surveys:write"], "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["title"], "properties": { "title": { "type": "string", "minLength": 1, "maxLength": 255 }, "description": { "type": ["string", "null"] }, "platform": { "$ref": "#/components/schemas/NudgePlatform" }, "priority": { "type": "integer", "minimum": 1, "maximum": 4 }, "variants": { "type": "array", "items": { "$ref": "#/components/schemas/GuideSurveyVariantInput" }, "example": [ { "variant": "treatment-nps", "steps": [ { "title": "How likely are you to recommend us to a friend or colleague?", "form_factor": { "type": "popover", "position": "center", "footerLayout": "split", "titleAlignment": "start", "contentAlignment": "start" }, "content": [ { "type": "survey_rating", "meta": { "type": "nps", "options": 10, "lowerLabel": "Not likely at all", "upperLabel": "Extremely likely" } }, { "type": "button", "meta": { "label": "Submit", "buttonType": "primary", "action": { "type": "no_action" } } } ] } ] } ] } }, "additionalProperties": false } } } }, "responses": { "201": { "description": "Survey created.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/Survey" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "409": { "$ref": "#/components/responses/ValidationProblem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/surveys/{survey_id}": { "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/SurveyId" } ], "get": { "tags": ["Surveys"], "operationId": "getSurvey", "summary": "Get survey", "x-required-scopes": ["surveys:read"], "parameters": [ { "name": "include_unpublished_changes", "in": "query", "required": false, "description": "When true, return the latest draft (unpublished edits) when one exists.\nDefault false returns the live published survey.\n", "schema": { "type": "boolean", "default": false } }, { "name": "include_translations", "in": "query", "required": false, "description": "When true, add `localization` (the project's default locale and other\nlocales) and each variant's `translations` and `translation_status`.\nRead with `include_unpublished_changes=true` before writing\ntranslations, so keys and `latest_version` match the draft. When\nlocalization is disabled in the project settings, only\n`localization: {enabled: false}` is added.\n", "schema": { "type": "boolean", "default": false } } ], "responses": { "200": { "description": "Successful response.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/Survey" } } } } } }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } }, "patch": { "tags": ["Surveys"], "operationId": "updateSurvey", "summary": "Update survey", "description": "Updates metadata, targeting, and content variants. For published surveys,\nchanges apply to a draft until publish in the UI. `latest_version` is\nrequired and must match the current draft, otherwise the update returns\n`409`. The check runs before the write rather than atomically with it, so it\nreduces but does not fully prevent lost updates from concurrent writers.\nPublish, schedule, and test instrumentation are not\navailable via API in v1. Status fields on the response are derived read-only.\nWhen `variants` is sent, it must list every existing variant by `id` with\nits unchanged `variant` key; steps within a variant can be added, edited,\nreordered, or removed. `tags` is not writable in v1 and returns `400`.\n\nTo add, change, or clear translations, send\n`variants: [{\"id\": \"\", \"translations\": {...}}]`. Entries\nthat carry only `id` and `translations` may name a subset of the variants\nand need no `variant` key. `translations` maps locale to translation key to\ntext. Take the keys and their default-locale text from\n`translation_status.sources` on a `GET` with\n`include_translations=true&include_unpublished_changes=true`. Translations\nmerge into what is stored: keys you leave out keep their text, `null`\nclears a key, and `null` for a locale clears every key in it. Only steps\nand blocks that already exist can be translated, so add new content\nfirst, then translate it in a later request. The default locale is edited\nthrough the survey content, not `translations`. When the request sends\ntranslations, the response includes `localization`, `translations`, and\n`translation_status`. Translations return `400` when localization is\ndisabled in the project settings or the locale isn't one of the\nproject's locales.\n", "x-required-scopes": ["surveys:write"], "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "title": { "type": "string", "minLength": 1, "maxLength": 255 }, "description": { "type": ["string", "null"] }, "platform": { "$ref": "#/components/schemas/NudgePlatform" }, "priority": { "type": "integer", "minimum": 1, "maximum": 4 }, "page_target_segments": { "type": "array", "description": "Pages where the survey is eligible. Empty means every page.\nEach item uses camelCase keys.\n", "items": { "$ref": "#/components/schemas/GuideSurveyPageTarget" } }, "temporarily_hide_page_target_segments": { "type": "array", "description": "Page rules that are saved but not currently applied.", "items": { "$ref": "#/components/schemas/GuideSurveyPageTarget" } }, "hide_if_page_targeting_not_met": { "type": "boolean" }, "trigger_config": { "$ref": "#/components/schemas/GuideSurveyTriggerConfig" }, "lifecycle": { "$ref": "#/components/schemas/GuideSurveyLifecycle" }, "dismissible": { "type": "boolean" }, "snoozable": { "type": "boolean" }, "snoozable_on_all_steps": { "type": "boolean" }, "snooze_duration": { "$ref": "#/components/schemas/GuideSurveySnoozeDuration" }, "snooze_label": { "type": "string", "maxLength": 255, "description": "Snooze button label." }, "template_source": { "type": "string", "maxLength": 255 }, "show_step_counter": { "type": "boolean" }, "step_counter_format": { "type": "string", "enum": ["numeric", "verbose"], "description": "`numeric` shows \"1/3\"; `verbose` shows \"Step 1 of 3\"." }, "tags": { "type": "array", "items": { "type": "string" } }, "variants": { "type": "array", "items": { "$ref": "#/components/schemas/GuideSurveyVariantUpdateInput" } }, "latest_version": { "type": "integer", "description": "Expected `latest_version` from the last GET with\n`include_unpublished_changes=true`.\n" } }, "required": ["latest_version"], "additionalProperties": false } } } }, "responses": { "200": { "description": "Survey updated.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/Survey" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "409": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } }, "delete": { "tags": ["Surveys"], "operationId": "archiveSurvey", "summary": "Archive survey", "description": "Archives an unpublished survey. A survey counts as published while its flag\nis enabled, unless it's only in test mode without a schedule; archiving a\npublished survey returns `409` with `error_code: cannot_archive_published`.\nUnpublish it in Amplitude first. Use `dry_run=true` to check whether a\nsurvey can be archived. An already archived survey returns `404`, like `GET`.\n", "x-required-scopes": ["surveys:write"], "parameters": [ { "$ref": "#/components/parameters/DryRun" }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "responses": { "204": { "description": "Survey archived, or with `dry_run=true`, the survey can be archived." }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "409": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/releases": { "get": { "tags": ["Analytics"], "operationId": "listReleases", "summary": "List releases", "description": "Returns product releases in the project. Results use the standard Developer\nAPI list envelope with cursor pagination (`cursor`, `limit`, default 50,\nmaximum 200), ordered by release start time descending, then id descending.\n\nFilter by release start time with `release_start_after` and\n`release_start_before`. Full-text search (`q`) and custom sort orders are\nnot supported yet.\n", "x-required-scopes": ["analytics:read"], "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/Cursor" }, { "$ref": "#/components/parameters/Limit" }, { "name": "release_start_after", "in": "query", "required": false, "schema": { "type": "string", "format": "date-time" } }, { "name": "release_start_before", "in": "query", "required": false, "schema": { "type": "string", "format": "date-time" } }, { "name": "include_deleted", "in": "query", "required": false, "schema": { "type": "boolean", "default": false } } ], "responses": { "200": { "description": "Successful response.", "content": { "application/json": { "schema": { "type": "object", "required": ["data", "pagination"], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/ReleaseSummary" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/releases/{release_id}": { "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/ReleaseId" } ], "get": { "tags": ["Analytics"], "operationId": "getRelease", "summary": "Get release", "x-required-scopes": ["analytics:read"], "responses": { "200": { "description": "Successful response.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/Release" } } } } } }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/themes": { "get": { "tags": ["Themes"], "operationId": "listThemes", "summary": "List themes", "description": "Returns the guides and surveys themes in the project, newest first.\nResults use the standard Developer API list envelope with cursor\npagination (`cursor`, `limit`). List items omit `config`; get a theme\nby id to read it.\n\nInternal themes (per-guide or per-survey overrides) are not listed. Read\nthem by id through a guide or survey's `theme_id`. Assistant themes are\nnot part of this API.\n", "x-required-scopes": ["guides:read", "surveys:read"], "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/Cursor" }, { "$ref": "#/components/parameters/Limit" }, { "name": "platform", "in": "query", "required": false, "schema": { "$ref": "#/components/schemas/NudgePlatform" } }, { "name": "include_archived", "in": "query", "required": false, "schema": { "type": "boolean", "default": false } } ], "responses": { "200": { "description": "Successful response.", "content": { "application/json": { "schema": { "type": "object", "required": ["data", "pagination"], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/ThemeSummary" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } }, "post": { "tags": ["Themes"], "operationId": "createTheme", "summary": "Create theme", "description": "Creates a guides and surveys theme. Both the live theme and the draft\nstart as Amplitude's built-in default theme, and `config` is merged into\nthe draft (see `ThemeConfigPatch`), so you only send the values you want\nto change. Nothing changes for users until the draft is published in\nAmplitude. The response carries the draft `config`.\n\nThe new theme isn't the default unless the platform has no default theme\nand you can publish theme changes, in which case Amplitude makes it the\ndefault, as it does in the theme editor. A `platform` that isn't enabled\nfor the project returns `400`. Publishing, archiving, and changing the\ndefault theme are not available via API.\n", "x-required-scopes": ["guides:write", "surveys:write"], "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "platform": { "$ref": "#/components/schemas/NudgePlatform" }, "config": { "$ref": "#/components/schemas/ThemeConfigPatch" } }, "required": ["name"], "additionalProperties": false }, "examples": { "minimal": { "summary": "Start from the built-in default", "value": { "name": "Holiday" } }, "brandColors": { "summary": "Set brand colors", "description": "Only the sent values change; everything else keeps the built-in\ndefault.\n", "value": { "name": "Brand", "platform": "web", "config": { "lightMode": { "varDefaults": { "--base-accent": "rgb(37, 99, 235)", "--font-font-family": "Inter, system-ui, sans-serif" } }, "darkMode": { "varDefaults": { "--base-accent": "rgb(96, 165, 250)", "--font-font-family": "Inter, system-ui, sans-serif" } } } } } } } } }, "responses": { "201": { "description": "Theme created.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/Theme" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/themes/{theme_id}": { "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/ThemeId" } ], "get": { "tags": ["Themes"], "operationId": "getTheme", "summary": "Get theme", "description": "Returns a guides and surveys theme. `config` is the live theme by default.\nArchived themes return `404`.\n", "x-required-scopes": ["guides:read", "surveys:read"], "parameters": [ { "name": "include_unpublished_changes", "in": "query", "required": false, "description": "When true, `config` is the unpublished draft instead of the live\ntheme. Use `has_unpublished_changes` to check whether a draft differs.\n", "schema": { "type": "boolean", "default": false } } ], "responses": { "200": { "description": "Successful response.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/Theme" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } }, "patch": { "tags": ["Themes"], "operationId": "updateTheme", "summary": "Update theme", "description": "Renames a theme or changes its draft. `config` is merged into the current\ndraft (see `ThemeConfigPatch`): send only the values you want to change,\nand `null` to reset a value to Amplitude's built-in default. The live theme\nis not changed; publish the draft in Amplitude. The response carries the\nfull draft `config`.\n\nTo make sure nobody changed the theme since you read it, send the\n`updated_at` from your last read; if the theme has changed since, the\nupdate returns `409` and nothing is written. Omit `updated_at` to skip the\ncheck: concurrent patches then both apply, and a later one wins for any\nvalue both set. The check runs before the write rather than atomically\nwith it, so it narrows but does not close that window. Internal themes\nreturn `409` with\n`error_code: theme_is_internal`; edit them on their guide or survey in\nAmplitude.\n", "x-required-scopes": ["guides:write", "surveys:write"], "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "config": { "$ref": "#/components/schemas/ThemeConfigPatch" }, "updated_at": { "type": "string", "description": "Optional. The `updated_at` from your last read of this theme;\nthe update returns `409` if the theme has changed since.\n" } }, "additionalProperties": false }, "examples": { "changeColors": { "summary": "Change a few values", "value": { "config": { "lightMode": { "varDefaults": { "--base-accent": "rgb(37, 99, 235)" }, "componentOverrides": { "tooltip": { "--background-color": "#ffffff" } } }, "darkMode": { "varDefaults": { "--base-accent": "rgb(96, 165, 250)" } } } } }, "resetToDefault": { "summary": "Reset values to the built-in default", "description": "`null` resets a variable to its built-in default value and\nremoves values the default doesn't have, like `customCss`.\n", "value": { "config": { "lightMode": { "varDefaults": { "--base-accent": null }, "customCss": null } } } }, "resetMode": { "summary": "Reset a whole mode", "value": { "config": { "darkMode": null } } }, "renameIfUnchanged": { "summary": "Rename only if nobody changed the theme", "value": { "name": "Brand 2027", "updated_at": "2026-10-27T10:00:00.123456Z" } } } } } }, "responses": { "200": { "description": "Theme updated.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/Theme" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "409": { "description": "The write conflicts with the theme's current state. `error_code` is\n`conflict` when `updated_at` is stale and `theme_is_internal` for\ninternal themes.\n", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" }, "examples": { "staleUpdatedAt": { "summary": "updated_at is stale", "value": { "type": "https://developer-api.amplitude.com/problems/conflict", "title": "Conflict", "status": 409, "detail": "updated_at 2026-10-27T10:00:00.123456Z is stale; the theme was last updated at 2026-10-27T11:42:08.004211Z. Fetch the theme again and retry, or omit updated_at to skip this check.", "error_code": "conflict", "retryable": false } }, "internalTheme": { "summary": "Internal theme", "value": { "type": "https://developer-api.amplitude.com/problems/conflict", "title": "Conflict", "status": 409, "detail": "This theme belongs to a single guide or survey. Edit it on that guide or survey in Amplitude.", "error_code": "theme_is_internal", "retryable": false } } } } } }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/destinations": { "get": { "tags": ["Destinations"], "operationId": "listDestinations", "summary": "List destinations", "x-required-scopes": ["destinations:read"], "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/Cursor" }, { "$ref": "#/components/parameters/Limit" }, { "$ref": "#/components/parameters/Query" }, { "$ref": "#/components/parameters/PartnerFilter" }, { "$ref": "#/components/parameters/EnabledFilter" }, { "$ref": "#/components/parameters/KindFilter" } ], "responses": { "200": { "description": "Successful response.", "content": { "application/json": { "schema": { "type": "object", "required": ["data", "pagination"], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Destination" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } }, "post": { "tags": ["Destinations"], "operationId": "createDestination", "summary": "Create a destination", "description": "Always creates a new destination; the server assigns the `id` used for\nevery subsequent lookup. `display_name` is not an identity key, so\nrepeating a create makes another destination. When `dry_run=true`, returns\na plan envelope without mutating. Credential config (secret, OAuth,\nservice account, custom HTTP header, ads account, and encrypted text)\nis write-only and omitted from the response.\n", "x-required-scopes": ["destinations:write"], "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/DryRun" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["partner", "display_name"], "properties": { "partner": { "type": "string" }, "display_name": { "type": "string", "minLength": 1 }, "kind": { "type": "array", "items": { "$ref": "#/components/schemas/DestinationConnectorKind" }, "minItems": 1, "description": "Optional connector kinds. When omitted, the kind is inferred\nfrom the partner's capabilities; a multi-capability partner with\nno kind is rejected as ambiguous. When provided it is\nauthoritative and validated against the partner. The three\nfamilies are mutually exclusive: a subset of [event, identify],\nor [cohort], or [warehouse_export] — never combined.\n" }, "config": { "type": "object", "additionalProperties": true }, "enabled": { "type": "boolean" }, "event_filter": { "$ref": "#/components/schemas/DestinationEventFilter" }, "property_mappings": { "type": "object", "additionalProperties": true }, "send_events": { "type": "boolean" }, "send_users": { "type": "boolean" } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "Dry-run plan (no mutation).", "content": { "application/json": { "schema": { "type": "object", "required": ["data", "plan"], "properties": { "data": { "$ref": "#/components/schemas/Destination" }, "plan": { "$ref": "#/components/schemas/PlanDetails" } } } } } }, "201": { "description": "Destination created.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/Destination" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "422": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/destinations/{id}": { "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/DestinationId" } ], "get": { "tags": ["Destinations"], "operationId": "getDestination", "summary": "Get a destination", "x-required-scopes": ["destinations:read"], "responses": { "200": { "description": "Successful response.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/Destination" } } } } } }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } }, "patch": { "tags": ["Destinations"], "operationId": "updateDestination", "summary": "Update a destination", "x-required-scopes": ["destinations:write"], "parameters": [ { "$ref": "#/components/parameters/DryRun" }, { "$ref": "#/components/parameters/IfMatch" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "display_name": { "type": "string" }, "kind": { "type": "array", "items": { "$ref": "#/components/schemas/DestinationConnectorKind" }, "minItems": 1 }, "config": { "type": "object", "additionalProperties": true }, "enabled": { "type": "boolean" }, "event_filter": { "oneOf": [ { "$ref": "#/components/schemas/DestinationEventFilter" }, { "type": "null" } ] }, "property_mappings": { "oneOf": [ { "type": "object", "additionalProperties": true }, { "type": "null" } ] }, "send_events": { "type": "boolean" }, "send_users": { "type": "boolean" } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "Destination updated, or dry-run plan.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/Destination" }, "plan": { "$ref": "#/components/schemas/PlanDetails" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "412": { "$ref": "#/components/responses/Problem" }, "422": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/destinations/{id}/test": { "parameters": [ { "$ref": "#/components/parameters/ProjectId" }, { "$ref": "#/components/parameters/DestinationId" } ], "post": { "tags": ["Destinations"], "operationId": "testDestination", "summary": "Test an event streaming destination connection", "x-required-scopes": ["destinations:write"], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "test_event_payload": { "type": "string", "minLength": 1, "description": "JSON event to send to the destination. Omit the field to use\nthe partner's example event. An empty string is rejected.\n" } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "Test result.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "$ref": "#/components/schemas/DestinationTestResult" } } } } } }, "400": { "$ref": "#/components/responses/ValidationProblem" }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } } }, "/v1/projects/{project_id}/snowflake-keys": { "parameters": [ { "$ref": "#/components/parameters/ProjectId" } ], "post": { "tags": ["Destinations"], "operationId": "generateSnowflakeRsaKey", "summary": "Generate an RSA key pair for Snowflake authentication", "description": "Generates a Snowflake-compatible RSA key pair. The private key is stored\nserver-side in an ephemeral cache; you receive the public key (paste into\nyour Snowflake user via `ALTER USER SET RSA_PUBLIC_KEY = '...'`) and\nan ephemeral ID to pass as `snowflake_private_key_ephemeral_id` in the\ndestination `config` on a subsequent `POST /destinations` for a Snowflake\ndirect-load destination.\n\nThis is the CLI equivalent of the \"Generate RSA Key\" step in the Amplitude\nUI wizard, so customers do not have to run `openssl genrsa` and manage\nprivate keys locally.\n", "x-required-scopes": ["destinations:write"], "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "responses": { "201": { "description": "Key pair generated.", "content": { "application/json": { "schema": { "type": "object", "required": ["data"], "properties": { "data": { "type": "object", "required": ["public_key", "ephemeral_id"], "properties": { "public_key": { "type": "string", "description": "RSA public key in PEM format. Add to your Snowflake user." }, "ephemeral_id": { "type": "string", "description": "Reference to the server-held private key. Pass as `snowflake_private_key_ephemeral_id` in destination create/update config." } } } } } } } }, "401": { "$ref": "#/components/responses/Problem" }, "403": { "$ref": "#/components/responses/Problem" }, "404": { "$ref": "#/components/responses/Problem" }, "429": { "$ref": "#/components/responses/RateLimitProblem" }, "500": { "$ref": "#/components/responses/Problem" } } } } }, "components": { "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "JWT" } }, "parameters": { "ProjectId": { "name": "project_id", "in": "path", "required": true, "description": "Amplitude project identifier, backed by the canonical app ID.", "schema": { "type": "string", "pattern": "^[0-9]+$", "example": "12345" } }, "Cursor": { "name": "cursor", "in": "query", "required": false, "description": "Opaque cursor from `pagination.next_cursor` on the previous response.\nNumeric offsets are capped by the underlying search index (10,000 results\nper query). Well-formed pagination stops before that window; requests whose\ncursor would exceed it return 400 `pagination_not_supported`.\n", "schema": { "type": ["string", "null"] } }, "Limit": { "name": "limit", "in": "query", "required": false, "description": "Number of items to return. Defaults to 50, max 200.", "schema": { "type": "integer", "minimum": 1, "maximum": 200, "default": 50 } }, "Sort": { "name": "sort", "in": "query", "required": false, "description": "Sort field. Prefix with `-` for descending. Supported values are `updated_at` and `name`.", "schema": { "type": "string", "example": "-updated_at" } }, "Query": { "name": "q", "in": "query", "required": false, "description": "Full-text search query.", "schema": { "type": "string" } }, "DryRun": { "name": "dry_run", "in": "query", "required": false, "description": "Validate request without performing mutation.", "schema": { "type": "boolean", "default": false } }, "IdempotencyKey": { "name": "Idempotency-Key", "in": "header", "required": true, "description": "Required on write operations. Keys aren't stored yet, so retrying a write\nwith the same key performs it again; a retried create makes another\nresource. Check whether the first attempt succeeded before you retry.\n", "schema": { "type": "string", "minLength": 8, "maxLength": 255 } }, "EventId": { "name": "event_id", "in": "path", "required": true, "description": "Public event identifier. This value is the event type name (the string used when sending the event to Amplitude).", "schema": { "type": "string", "minLength": 1 } }, "EventPropertyId": { "name": "event_property_id", "in": "path", "required": true, "description": "Public event property identifier. Equal to `property_name`. URL-encode\nwhen the property name contains spaces or special characters.\n", "schema": { "type": "string", "minLength": 1 } }, "UserPropertyId": { "name": "user_property_id", "in": "path", "required": true, "description": "Public user property identifier. Equal to `property_name`. URL-encode\nwhen the property name contains spaces or special characters.\n", "schema": { "type": "string", "minLength": 1 } }, "FlagId": { "name": "flag_id", "in": "path", "required": true, "description": "Numeric feature flag ID required by get, update, and archive. A flag key is not accepted or resolved automatically. Find the ID with list flags filtered by the key query parameter.", "schema": { "type": "string", "pattern": "^[0-9]+$" } }, "ChartId": { "name": "chart_id", "in": "path", "required": true, "description": "Saved chart identifier.", "schema": { "type": "string", "minLength": 1 } }, "ChartType": { "name": "chart_type", "in": "query", "required": false, "description": "Filter list results to a specific chart type. Use `unknown` to return charts\nwhose type is not represented by a public API value.\n", "schema": { "$ref": "#/components/schemas/ChartType" } }, "MetricId": { "name": "metric_id", "in": "path", "required": true, "description": "Saved metric identifier.", "schema": { "type": "string", "minLength": 1 } }, "IncludeDefinition": { "name": "include_definition", "in": "query", "required": false, "description": "When true, include the read-only chart definition on GET chart. The definition\nshape is unstable and not intended for authoring.\n", "schema": { "type": "boolean", "default": false } }, "ScheduledEventActionId": { "name": "scheduled_event_action_id", "in": "path", "required": true, "description": "Scheduled event action identifier.", "schema": { "type": "string", "minLength": 1 } }, "ScheduledEventActionEventTypeFilter": { "name": "event_type", "in": "query", "required": false, "description": "Filter list results to a single event type.", "schema": { "type": "string", "minLength": 1 } }, "ScheduledEventActionKindFilter": { "name": "action", "in": "query", "required": false, "description": "Filter list results to scheduled deletions or blocks.", "schema": { "$ref": "#/components/schemas/ScheduledEventActionKind" } }, "ScheduledEventActionStatusFilter": { "name": "status", "in": "query", "required": false, "description": "Filter list results by lifecycle. Omit to return pending actions.", "schema": { "$ref": "#/components/schemas/ScheduledEventActionStatus" } }, "ExperimentId": { "name": "experiment_id", "in": "path", "required": true, "description": "Experiment identifier. Experiments are backed by flag configurations and use the same identifier namespace.", "schema": { "type": "string", "minLength": 1 } }, "Partner": { "name": "partner", "in": "path", "required": true, "description": "Destination partner key (e.g. braze, kinesis_datastream).", "schema": { "type": "string", "minLength": 1 } }, "DestinationId": { "name": "id", "in": "path", "required": true, "description": "Destination id.", "schema": { "type": "string", "minLength": 1 } }, "PartnerFilter": { "name": "partner", "in": "query", "required": false, "description": "Filter by destination partner key.", "schema": { "type": "string", "minLength": 1 } }, "EnabledFilter": { "name": "enabled", "in": "query", "required": false, "description": "Filter by enabled/active flag.", "schema": { "type": "boolean" } }, "IfMatch": { "name": "If-Match", "in": "header", "required": false, "description": "Optimistic concurrency token. Must equal the resource `version` for the\nwrite to proceed; otherwise the API returns 412.\n", "schema": { "type": "integer", "minimum": 0 } }, "DatasetId": { "name": "dataset_id", "in": "path", "required": true, "description": "Stable dataset identifier, returned by create or by the Agent Analytics read surface.", "schema": { "type": "string" } }, "EvaluatorStableId": { "name": "evaluator_stable_id", "in": "path", "required": true, "description": "Evaluator identifier that survives updates. Prefer this over a version\nidentifier, which changes each time the evaluator is updated.\n", "schema": { "type": "string" } }, "EvalRunId": { "name": "eval_run_id", "in": "path", "required": true, "description": "Stable eval run identifier returned by trigger or list.", "schema": { "type": "string" } }, "MetricTypeFilter": { "name": "metric_type", "in": "query", "required": false, "description": "Filter list results to a specific metric type.", "schema": { "$ref": "#/components/schemas/MetricType" } }, "GuideId": { "name": "guide_id", "in": "path", "required": true, "description": "Guide (tour nudge) identifier.", "schema": { "type": "string", "pattern": "^[0-9]+$" } }, "SurveyId": { "name": "survey_id", "in": "path", "required": true, "description": "Survey nudge identifier.", "schema": { "type": "string", "pattern": "^[0-9]+$" } }, "ReleaseId": { "name": "release_id", "in": "path", "required": true, "description": "Product release identifier.", "schema": { "type": "string", "minLength": 1 } }, "ThemeId": { "name": "theme_id", "in": "path", "required": true, "description": "Guides and surveys theme identifier.", "schema": { "type": "string", "pattern": "^[0-9]+$" } }, "KindFilter": { "name": "kind", "in": "query", "required": false, "description": "Filter by a single connector kind; matches destinations whose `kind` array\ncontains this value.\n", "schema": { "$ref": "#/components/schemas/DestinationConnectorKind" } } }, "responses": { "Problem": { "description": "Error response encoded as RFC 9457 Problem Details.", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "ValidationProblem": { "description": "Validation failure response encoded as RFC 9457 Problem Details.", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "RateLimitProblem": { "description": "Request rate limit exceeded.", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" }, "example": { "type": "https://developer-api.amplitude.com/problems/rate-limit-exceeded", "title": "Rate limit exceeded", "status": 429, "detail": "Too many requests.", "error_code": "rate_limit_exceeded", "retryable": true } } } }, "AvailabilityUnavailableProblem": { "description": "Endpoint availability could not be determined. Retry the request.", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" }, "example": { "type": "https://developer-api.amplitude.com/problems/operation-availability-unavailable", "title": "Operation availability unavailable", "status": 503, "detail": "Operation availability could not be determined. Retry the request.", "error_code": "operation_availability_unavailable", "retryable": true } } } }, "MetricForbiddenProblem": { "description": "The caller cannot use this operation. `operation_not_enabled` means the\noperation is not enabled for the caller's organization;\n`insufficient_scope` means the token lacks `analytics:read`.\n", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" }, "examples": { "operationNotEnabled": { "summary": "Endpoint unavailable", "value": { "type": "https://developer-api.amplitude.com/problems/operation-not-enabled", "title": "Endpoint unavailable", "status": 403, "detail": "This endpoint is unavailable for your organization.", "error_code": "operation_not_enabled", "retryable": false } }, "insufficientScope": { "summary": "Missing required scope", "value": { "type": "https://developer-api.amplitude.com/problems/forbidden", "title": "Insufficient scope", "status": 403, "detail": "Token missing required scopes.", "error_code": "insufficient_scope", "retryable": false } } } } } }, "HeatmapForbiddenProblem": { "description": "The caller cannot use this operation. `operation_not_enabled` means the\noperation is not enabled for the caller's organization;\n`insufficient_scope` means the token lacks `analytics:read`; `forbidden`\nmeans the caller lacks permission to view heatmaps in the project;\n`data_access_restricted` means data access controls exclude the requested\ndata.\n", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" }, "examples": { "operationNotEnabled": { "summary": "Endpoint unavailable", "value": { "type": "https://developer-api.amplitude.com/problems/operation-not-enabled", "title": "Endpoint unavailable", "status": 403, "detail": "This endpoint is unavailable for your organization.", "error_code": "operation_not_enabled", "retryable": false } }, "insufficientScope": { "summary": "Missing required scope", "value": { "type": "https://developer-api.amplitude.com/problems/forbidden", "title": "Insufficient scope", "status": 403, "detail": "Token missing required scopes.", "error_code": "insufficient_scope", "retryable": false } }, "forbidden": { "summary": "Missing project permission", "value": { "type": "https://developer-api.amplitude.com/problems/forbidden", "title": "Forbidden", "status": 403, "detail": "You do not have permission to view heatmaps in this project.", "error_code": "forbidden", "retryable": false } }, "dataAccessRestricted": { "summary": "Data access restricted", "value": { "type": "https://developer-api.amplitude.com/problems/data-access-restricted", "title": "Data access restricted", "status": 403, "detail": "Data access controls exclude the requested data.", "error_code": "data_access_restricted", "retryable": false } } } } } }, "NotConfiguredProblem": { "description": "The project does not capture the events or properties this query needs.\nReturned with `error_code: session_replay_not_configured`; `detail` names\nwhat is missing.\n", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" }, "example": { "type": "https://developer-api.amplitude.com/problems/session-replay-not-configured", "title": "Session replay not configured", "status": 422, "detail": "The project is missing required events: [Amplitude] Element Clicked.", "error_code": "session_replay_not_configured", "retryable": false } } } }, "UpstreamTimeoutProblem": { "description": "The query exceeded the synchronous timeout. Narrow the date range and retry.", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" }, "example": { "type": "https://developer-api.amplitude.com/problems/upstream-timeout", "title": "Upstream timeout", "status": 504, "detail": "The query did not complete in time. Narrow the date range and retry.", "error_code": "upstream_timeout", "retryable": true } } } }, "ZoningForbiddenProblem": { "description": "The caller cannot use this operation. `operation_not_enabled` means the\noperation is not enabled for the caller's organization;\n`insufficient_scope` means the token lacks `analytics:read`; `forbidden`\nmeans the caller lacks access to the project; `data_access_restricted`\nmeans data access controls exclude the requested data.\n", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" }, "examples": { "operationNotEnabled": { "summary": "Endpoint unavailable", "value": { "type": "https://developer-api.amplitude.com/problems/operation-not-enabled", "title": "Endpoint unavailable", "status": 403, "detail": "This endpoint is unavailable for your organization.", "error_code": "operation_not_enabled", "retryable": false } }, "insufficientScope": { "summary": "Missing required scope", "value": { "type": "https://developer-api.amplitude.com/problems/forbidden", "title": "Insufficient scope", "status": 403, "detail": "Token missing required scopes.", "error_code": "insufficient_scope", "retryable": false } }, "forbidden": { "summary": "Missing project permission", "value": { "type": "https://developer-api.amplitude.com/problems/forbidden", "title": "Forbidden", "status": 403, "detail": "You do not have permission to view zoning in this project.", "error_code": "forbidden", "retryable": false } }, "dataAccessRestricted": { "summary": "Data access restricted", "value": { "type": "https://developer-api.amplitude.com/problems/data-access-restricted", "title": "Data access restricted", "status": 403, "detail": "Data access controls exclude the requested data.", "error_code": "data_access_restricted", "retryable": false } } } } } } }, "schemas": { "ObjectMeta": { "type": "object", "required": ["id", "object", "created_at", "updated_at"], "properties": { "id": { "type": "string" }, "object": { "type": "string", "description": "Stable resource-type discriminator. Each resource sets a fixed value\n(declared via `const` on the concrete schema, e.g. `project`, `event`).\nClients can use this field to safely narrow polymorphic responses.\n" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" } } }, "Pagination": { "type": "object", "required": ["next_cursor", "has_more"], "properties": { "next_cursor": { "type": ["string", "null"], "description": "Cursor for the next page, or `null` on the last page. Chart list\nresponses may stop before all project charts are enumerated because\nthe search backend caps each query at 10,000 sorted hits.\n" }, "has_more": { "type": "boolean" } } }, "ProblemDetails": { "type": "object", "required": ["type", "title", "status", "error_code", "retryable"], "properties": { "type": { "type": "string", "format": "uri" }, "title": { "type": "string" }, "status": { "type": "integer", "minimum": 400, "maximum": 599 }, "detail": { "type": ["string", "null"] }, "details": { "type": ["object", "null"], "additionalProperties": true }, "instance": { "type": ["string", "null"], "format": "uri" }, "error_code": { "type": "string" }, "retryable": { "type": "boolean" }, "retry_after_seconds": { "type": ["integer", "null"], "minimum": 0 }, "validation_errors": { "type": ["array", "null"], "items": { "$ref": "#/components/schemas/ValidationError" } } } }, "ValidationError": { "type": "object", "required": ["field", "message", "code"], "properties": { "field": { "type": "string" }, "message": { "type": "string" }, "code": { "type": "string" } } }, "Project": { "allOf": [ { "$ref": "#/components/schemas/ObjectMeta" }, { "type": "object", "required": ["name"], "properties": { "id": { "type": "string", "pattern": "^[0-9]+$" }, "object": { "type": "string", "const": "project", "description": "Resource-type discriminator. Always `project`." }, "name": { "type": "string" }, "description": { "type": ["string", "null"] } } } ] }, "ProjectApiKey": { "type": "object", "description": "A project API key and the project it belongs to.", "required": ["object", "project_id", "project_name", "api_key"], "properties": { "object": { "type": "string", "const": "project_api_key", "description": "Resource type." }, "project_id": { "type": "string", "pattern": "^[1-9][0-9]*$", "description": "Amplitude project identifier.", "example": "12345" }, "project_name": { "type": ["string", "null"], "description": "Project name, or null when no name is available.", "example": "Example Project" }, "api_key": { "type": "string", "minLength": 1, "description": "The project API key.", "example": "example-project-api-key" } } }, "Event": { "type": "object", "required": [ "id", "object", "project_id", "event_type", "display_name", "is_active" ], "properties": { "id": { "type": "string", "description": "Canonical event identifier. Equal to `event_type`." }, "object": { "type": "string", "const": "event", "description": "Resource-type discriminator. Always `event`." }, "project_id": { "type": "string", "pattern": "^[0-9]+$" }, "event_type": { "type": "string" }, "display_name": { "type": "string" }, "description": { "type": ["string", "null"] }, "is_active": { "type": "boolean" } } }, "EventProperty": { "type": "object", "required": [ "id", "object", "project_id", "event_type", "property_name", "is_hidden", "is_in_schema", "is_array_type", "enum_values", "classifications" ], "properties": { "id": { "type": "string", "description": "Stable resource identifier. Equal to `property_name`.\n" }, "object": { "type": "string", "const": "event_property", "description": "Resource-type discriminator. Always `event_property`." }, "project_id": { "type": "string", "pattern": "^[0-9]+$" }, "event_type": { "type": "string", "description": "Event this property is bound to." }, "property_name": { "type": "string" }, "description": { "type": ["string", "null"] }, "is_hidden": { "type": "boolean", "description": "Hidden from default UI surfaces and API listings." }, "is_in_schema": { "type": "boolean", "description": "Whether this property is part of the project's curated tracking\nplan. `false` means ingested-only (seen via SDK calls but never\nformally added). Properties with `is_in_schema: false` cannot be\nmodified — `PATCH` returns `422 not_in_schema` and metadata writes\nare rejected. `POST` implicitly transitions a property to\n`is_in_schema: true`.\n" }, "data_type": { "$ref": "#/components/schemas/PropertyDataType" }, "is_array_type": { "type": "boolean" }, "enum_values": { "type": "array", "items": { "type": "string" } }, "regex": { "type": ["string", "null"] }, "classifications": { "type": "array", "items": { "type": "string" }, "description": "Data Access Controls (DAC) tags. Examples include `PII`,\n`SENSITIVE`, `INTERNAL`.\n" } } }, "UserProperty": { "type": "object", "required": [ "id", "object", "project_id", "property_name", "is_hidden", "is_in_schema", "is_array_type", "enum_values", "classifications" ], "properties": { "id": { "type": "string", "description": "Stable resource identifier. Equal to `property_name`.\n" }, "object": { "type": "string", "const": "user_property", "description": "Resource-type discriminator. Always `user_property`." }, "project_id": { "type": "string", "pattern": "^[0-9]+$" }, "property_name": { "type": "string" }, "display_name": { "type": ["string", "null"] }, "description": { "type": ["string", "null"] }, "is_official": { "type": ["boolean", "null"], "description": "Curated/official flag. `null` ⇒ inherited / unset upstream.\n" }, "is_hidden": { "type": "boolean" }, "is_in_schema": { "type": "boolean", "description": "Whether this property is part of the project's curated tracking\nplan. Same semantics as `EventProperty.is_in_schema`.\n" }, "data_type": { "$ref": "#/components/schemas/PropertyDataType" }, "is_array_type": { "type": "boolean" }, "enum_values": { "type": "array", "items": { "type": "string" } }, "regex": { "type": ["string", "null"] }, "classifications": { "type": "array", "items": { "type": "string" } } } }, "ScheduledEventActionKind": { "type": "string", "enum": ["delete", "block"], "description": "Work to apply when `target_date` arrives. `delete` removes the event from\nthe tracking plan (soft-delete if ingested). `block` stops ingestion.\n" }, "ScheduledEventActionStatus": { "type": "string", "enum": ["pending", "canceled", "completed"], "description": "Lifecycle of a scheduled event action. List defaults to `pending`." }, "ScheduledEventAction": { "type": "object", "required": [ "id", "object", "project_id", "event_type", "display_name", "action", "target_date", "status", "created_at", "created_by" ], "properties": { "id": { "type": "string", "description": "Stable scheduled-action identifier." }, "object": { "type": "string", "const": "scheduled_event_action", "description": "Resource-type discriminator. Always `scheduled_event_action`." }, "project_id": { "type": "string", "pattern": "^[0-9]+$" }, "event_type": { "type": "string" }, "display_name": { "type": "string", "description": "Event display name when known; otherwise equal to `event_type`." }, "action": { "$ref": "#/components/schemas/ScheduledEventActionKind" }, "target_date": { "type": "string", "format": "date-time" }, "status": { "$ref": "#/components/schemas/ScheduledEventActionStatus" }, "created_at": { "type": "string", "format": "date-time", "description": "When the action was scheduled." }, "created_by": { "type": "string", "description": "Login id of the user who scheduled the action." } } }, "PropertyDataType": { "description": "Logical data type of a property. `null` means untyped at the source;\nclients should treat it as `string` for ingestion.\n", "type": ["string", "null"], "enum": ["string", "number", "boolean", "object", "enum", "any", null] }, "Chart": { "type": "object", "required": [ "id", "object", "project_id", "name", "chart_type", "created_at", "updated_at", "url", "archived" ], "properties": { "id": { "type": "string", "description": "Stable chart identifier." }, "object": { "type": "string", "const": "chart", "description": "Resource-type discriminator. Always `chart`." }, "project_id": { "type": "string", "pattern": "^[0-9]+$" }, "name": { "type": "string" }, "description": { "type": ["string", "null"] }, "chart_type": { "$ref": "#/components/schemas/ChartType" }, "created_at": { "type": ["string", "null"], "format": "date-time", "description": "ISO-8601 creation time, or `null` when unavailable." }, "updated_at": { "type": ["string", "null"], "format": "date-time", "description": "ISO-8601 last-modified time, or `null` when unavailable." }, "created_by": { "type": ["string", "null"], "description": "Chart creator. The creator's email when available, otherwise a login\nidentifier; `null` when the creator cannot be resolved.\n" }, "url": { "type": "string", "format": "uri", "description": "Deep link to the chart in the Amplitude UI." }, "archived": { "type": "boolean", "description": "Whether the chart is archived." }, "definition": { "type": "object", "additionalProperties": true, "description": "Read-only chart definition. Returned only when `include_definition=true`\non GET chart. Shape is unstable and may change between API versions;\nnot intended for authoring.\n" } } }, "ChartType": { "type": "string", "description": "Public chart type discriminator (snake_case). All values may appear on\nlist/get; query returns `422` (`unsupported_chart_type`) for types outside\nthe v1 supported matrix.\n\nUnsupported or unrecognized chart types are surfaced as `unknown`.\n\nNew chart types may be added over time. Clients should treat `unknown` as\n\"a chart type this API version does not model yet\".\n", "enum": [ "event_segmentation", "sessions", "funnels", "retention", "composition", "revenue_ltv", "stickiness", "data_table", "engagement_matrix", "metric_explorer", "growth_accounting", "impact", "users", "unknown" ] }, "ChartQueryRequest": { "type": "object", "description": "v1 query parameters. Filter and group-by overrides are not supported in v1.\n", "properties": { "time_range": { "$ref": "#/components/schemas/TimeRange" }, "timezone": { "type": "string", "description": "IANA timezone identifier (e.g. `America/New_York`).", "example": "America/New_York" }, "exclude_incomplete_datapoints": { "type": "boolean", "default": false, "description": "When true, excludes the current incomplete interval from results.\n" }, "group_by_limit": { "type": "integer", "minimum": 1, "maximum": 1000, "default": 10, "description": "Maximum number of breakdown groups returned per series." }, "time_series_limit": { "type": "integer", "minimum": 0, "maximum": 1000, "default": 100, "description": "Maximum number of time buckets per series. `0` collapses each series to\na single scalar aggregate.\n" } }, "additionalProperties": false }, "AnalyticsResult": { "type": "object", "required": [ "id", "object", "source_type", "source_id", "project_id", "computed_at", "timezone", "result_kind", "metric_semantics", "data", "metadata", "warnings" ], "properties": { "id": { "type": "string", "description": "Identifier for this query execution." }, "object": { "type": "string", "const": "analytics_result", "description": "Resource-type discriminator. Always `analytics_result`." }, "source_type": { "type": "string", "enum": ["chart"], "description": "Source artifact type. v1 supports `chart` only. `dashboard` and `query`\nare reserved for future slices.\n" }, "source_id": { "type": "string", "description": "Identifier of the source chart." }, "project_id": { "type": "string", "pattern": "^[0-9]+$" }, "computed_at": { "type": "string", "format": "date-time" }, "timezone": { "type": "string", "description": "IANA timezone used for computation." }, "result_kind": { "$ref": "#/components/schemas/ResultKind" }, "metric_semantics": { "$ref": "#/components/schemas/MetricSemantics" }, "data": { "$ref": "#/components/schemas/AnalyticsResultData" }, "metadata": { "$ref": "#/components/schemas/AnalyticsResultMetadata" }, "warnings": { "type": "array", "items": { "type": "string" }, "description": "Non-fatal issues encountered during query execution." }, "truncated": { "oneOf": [ { "$ref": "#/components/schemas/TruncationInfo" }, { "type": "null" } ] } } }, "RecentEventIngestionCheckRequest": { "type": "object", "properties": { "event_type": { "type": "string", "pattern": "\\S", "description": "Exact event type to check. Omit to check for any event." }, "lookback_minutes": { "type": "integer", "minimum": 1, "maximum": 1440, "default": 10, "description": "Number of recent minutes to evaluate. The returned window can begin up\nto five minutes earlier to cover the complete starting interval.\n" }, "polling_timeout_seconds": { "$ref": "#/components/schemas/RecentEventIngestionPollingTimeoutSeconds" } }, "additionalProperties": false }, "RecentEventIngestionCheck": { "type": "object", "required": ["id", "object", "project_id", "status", "count", "window"], "properties": { "id": { "type": "string", "description": "Identifier for this ingestion check." }, "object": { "type": "string", "const": "recent_event_ingestion_check", "description": "Resource-type discriminator. Always `recent_event_ingestion_check`." }, "project_id": { "type": "string", "pattern": "^[0-9]+$" }, "event_type": { "type": "string", "description": "Event type evaluated. Omitted when the request checked for any event." }, "status": { "type": "string", "enum": ["observed", "not_observed", "inconclusive"], "description": "`observed` when at least one matching event was found; `not_observed`\nwhen none was found; `inconclusive` when none was found but complete\nrecent data was unavailable.\n" }, "count": { "type": "number", "minimum": 0, "description": "Number of matching events found in the evaluated window." }, "poll_after_seconds": { "$ref": "#/components/schemas/RecentEventIngestionPollAfterSeconds" }, "window": { "type": "object", "required": ["start", "end", "basis"], "properties": { "start": { "type": "string", "format": "date-time", "description": "Start of the evaluated window." }, "end": { "type": "string", "format": "date-time", "description": "End of the evaluated window." }, "basis": { "type": "string", "const": "server_upload_time", "description": "Time basis for the window. `server_upload_time` measures when an\nevent reached Amplitude.\n" } }, "additionalProperties": false } }, "additionalProperties": false }, "TimeRange": { "type": "object", "required": ["start", "end"], "properties": { "start": { "type": "string", "format": "date", "description": "Inclusive start date (project timezone unless `timezone` is set on query)." }, "end": { "type": "string", "format": "date", "description": "Inclusive end date." } }, "additionalProperties": false }, "MetricType": { "type": "string", "description": "Public metric type discriminator (`snake_case`). See the `enum` for supported\nvalues.\n\nUnsupported or unrecognized metric types are surfaced as `unknown`. Clients\nshould treat `unknown` as \"a metric type this API version does not model yet\".\n", "enum": [ "uniques", "totals", "formula", "prop_sum", "prop_avg", "retention", "conversion", "unknown" ] }, "Metric": { "type": "object", "required": [ "id", "object", "project_id", "name", "metric_type", "definition", "version", "created_at", "updated_at", "url", "archived" ], "properties": { "id": { "type": "string", "description": "Stable metric identifier." }, "object": { "type": "string", "const": "metric", "description": "Resource-type discriminator. Always `metric`." }, "project_id": { "type": "string", "pattern": "^[0-9]+$" }, "name": { "type": "string" }, "description": { "type": ["string", "null"] }, "metric_type": { "$ref": "#/components/schemas/MetricType" }, "definition": { "$ref": "#/components/schemas/MetricDefinition" }, "version": { "type": "integer", "minimum": 1, "description": "Optimistic concurrency version. Required on PATCH; incremented on each\nsuccessful update.\n" }, "created_at": { "type": ["string", "null"], "format": "date-time" }, "updated_at": { "type": ["string", "null"], "format": "date-time" }, "created_by": { "type": ["string", "null"], "description": "Creator email or login identifier when available." }, "url": { "type": "string", "format": "uri", "description": "Deep link to the metric in the Amplitude UI." }, "archived": { "type": "boolean", "description": "Whether the metric is archived (soft-deleted)." }, "is_official": { "type": "boolean", "description": "Whether the metric is marked official." }, "is_restricted": { "type": "boolean", "description": "Whether the metric is restricted." }, "key_properties": { "type": "array", "items": { "$ref": "#/components/schemas/MetricKeyProperty" }, "description": "Key properties associated with the metric definition." } } }, "MetricDefinition": { "description": "Type-specific metric definition. The `metric_type` discriminator selects\nthe required fields. Aligns with MCP `shared-schema` capabilities.\n", "oneOf": [ { "$ref": "#/components/schemas/MetricDefinitionUniques" }, { "$ref": "#/components/schemas/MetricDefinitionTotals" }, { "$ref": "#/components/schemas/MetricDefinitionFormula" }, { "$ref": "#/components/schemas/MetricDefinitionPropSum" }, { "$ref": "#/components/schemas/MetricDefinitionPropAvg" }, { "$ref": "#/components/schemas/MetricDefinitionRetention" }, { "$ref": "#/components/schemas/MetricDefinitionConversion" }, { "$ref": "#/components/schemas/MetricDefinitionUnknown" } ], "discriminator": { "propertyName": "metric_type", "mapping": { "uniques": "#/components/schemas/MetricDefinitionUniques", "totals": "#/components/schemas/MetricDefinitionTotals", "formula": "#/components/schemas/MetricDefinitionFormula", "prop_sum": "#/components/schemas/MetricDefinitionPropSum", "prop_avg": "#/components/schemas/MetricDefinitionPropAvg", "retention": "#/components/schemas/MetricDefinitionRetention", "conversion": "#/components/schemas/MetricDefinitionConversion", "unknown": "#/components/schemas/MetricDefinitionUnknown" } } }, "ClickMapQueryRequest": { "type": "object", "description": "Click map query. When `time_range` is omitted the last 30 days in the\nproject timezone are used. The span of `time_range` cannot exceed 90\ndays.\n", "required": ["page_url"], "properties": { "page_url": { "$ref": "#/components/schemas/PageUrl" }, "url_match": { "$ref": "#/components/schemas/HeatmapUrlMatch" }, "device_type": { "$ref": "#/components/schemas/HeatmapDeviceType" }, "viewport_width": { "$ref": "#/components/schemas/ViewportWidth" }, "time_range": { "$ref": "#/components/schemas/TimeRange" }, "group_by": { "type": "string", "description": "`selector` groups clicks by the CSS selector of the clicked element;\n`pixel` groups them by page coordinate.\n", "enum": ["selector", "pixel"], "default": "selector" }, "metric": { "type": "string", "description": "`totals` counts every click; `uniques` counts distinct users who\nclicked.\n", "enum": ["totals", "uniques"], "default": "totals" }, "limit": { "type": "integer", "minimum": 1, "maximum": 200, "default": 50, "description": "Maximum number of rows returned after ranking by `count`." } }, "additionalProperties": false }, "ScrollMapQueryRequest": { "type": "object", "description": "Scroll map query. When `time_range` is omitted the last 30 days in the\nproject timezone are used. The span of `time_range` cannot exceed 90\ndays.\n", "required": ["page_url"], "properties": { "page_url": { "$ref": "#/components/schemas/PageUrl" }, "url_match": { "$ref": "#/components/schemas/HeatmapUrlMatch" }, "device_type": { "$ref": "#/components/schemas/HeatmapDeviceType" }, "viewport_width": { "$ref": "#/components/schemas/ViewportWidth" }, "time_range": { "$ref": "#/components/schemas/TimeRange" } }, "additionalProperties": false }, "ClickMap": { "type": "object", "description": "Ranked click counts for one page. Exactly one of `selectors` and `pixels`\nis populated, chosen by `group_by`; the other is `null`. Rows are sorted\nby `count` descending. Results reflect the caller's data access.\n", "required": [ "id", "object", "project_id", "page_url", "url_match", "device_type", "viewport_width", "group_by", "metric", "time_range", "timezone", "result_count", "truncated", "selectors", "pixels", "warnings" ], "properties": { "id": { "type": "string", "description": "Identifier for this computation." }, "object": { "type": "string", "const": "click_map", "description": "Resource-type discriminator. Always `click_map`." }, "project_id": { "type": "string", "pattern": "^[0-9]+$" }, "page_url": { "type": "string", "description": "The page URL after normalization." }, "url_match": { "$ref": "#/components/schemas/HeatmapUrlMatch" }, "device_type": { "$ref": "#/components/schemas/HeatmapDeviceType" }, "viewport_width": { "type": ["integer", "null"], "description": "Exact viewport width used when `device_type` is `custom`; otherwise `null`." }, "group_by": { "type": "string", "enum": ["selector", "pixel"] }, "metric": { "type": "string", "enum": ["totals", "uniques"] }, "time_range": { "$ref": "#/components/schemas/TimeRange" }, "timezone": { "type": "string", "description": "IANA timezone used to resolve `time_range` day boundaries (the project timezone)." }, "result_count": { "type": "integer", "minimum": 0, "description": "Number of rows returned." }, "truncated": { "type": "boolean", "description": "`true` when more rows were available than `limit` allowed. The\nunderlying query is itself bounded, so `false` does not guarantee\nthat every clicked element on the page is listed.\n" }, "selectors": { "type": ["array", "null"], "items": { "$ref": "#/components/schemas/ClickMapSelectorRow" } }, "pixels": { "type": ["array", "null"], "items": { "$ref": "#/components/schemas/ClickMapPixelRow" } }, "warnings": { "type": "array", "items": { "type": "string" }, "description": "Non-fatal conditions, such as an empty result for the range." } } }, "ScrollMap": { "type": "object", "description": "Scroll-depth distribution for one page, as a cumulative histogram from the\ntop of the page. All buckets are returned in page order. Results reflect\nthe caller's data access.\n", "required": [ "id", "object", "project_id", "page_url", "url_match", "device_type", "viewport_width", "time_range", "timezone", "total_sessions", "average_fold_px", "max_scroll_depth_px", "bucket_count", "buckets", "warnings" ], "properties": { "id": { "type": "string", "description": "Identifier for this computation." }, "object": { "type": "string", "const": "scroll_map", "description": "Resource-type discriminator. Always `scroll_map`." }, "project_id": { "type": "string", "pattern": "^[0-9]+$" }, "page_url": { "type": "string", "description": "The page URL after normalization." }, "url_match": { "$ref": "#/components/schemas/HeatmapUrlMatch" }, "device_type": { "$ref": "#/components/schemas/HeatmapDeviceType" }, "viewport_width": { "type": ["integer", "null"], "description": "Exact viewport width used when `device_type` is `custom`; otherwise `null`." }, "time_range": { "$ref": "#/components/schemas/TimeRange" }, "timezone": { "type": "string", "description": "IANA timezone used to resolve `time_range` day boundaries (the project timezone)." }, "total_sessions": { "type": "integer", "minimum": 0, "description": "Sessions with a scroll event on the page in the range (the first bucket's count)." }, "average_fold_px": { "type": ["integer", "null"], "description": "Average viewport height in pixels, or `null` when unavailable." }, "max_scroll_depth_px": { "type": ["integer", "null"], "description": "Deepest scroll position observed in page pixels, or `null` when unavailable." }, "bucket_count": { "type": "integer", "minimum": 0 }, "buckets": { "type": "array", "items": { "$ref": "#/components/schemas/ScrollMapBucket" } }, "warnings": { "type": "array", "items": { "type": "string" }, "description": "Non-fatal conditions, such as an empty result for the range." } } }, "ZoneMetricsQueryRequest": { "type": "object", "required": ["page_url"], "properties": { "page_url": { "$ref": "#/components/schemas/PageUrl" }, "url_match": { "$ref": "#/components/schemas/ZoningUrlMatch" }, "time_range": { "$ref": "#/components/schemas/TimeRange" }, "metric": { "$ref": "#/components/schemas/ZoneMetric" }, "zone_ids": { "type": "array", "maxItems": 200, "items": { "type": "string", "minLength": 1 }, "description": "Restrict the result to these zones. A zone id is the CSS selector of\nthe element, as returned in `zones[].zone_id`. Omit to rank every zone\non the page.\n" }, "limit": { "type": "integer", "minimum": 1, "maximum": 200, "default": 20, "description": "Maximum number of zones returned after ranking by `value`." } }, "additionalProperties": false, "description": "Zone metrics query. When `time_range` is omitted the last 30 days in the\nproject timezone are used. The span of `time_range` cannot exceed 90\ndays. One metric is computed per request.\n" }, "ZoneMetrics": { "type": "object", "description": "One metric for every zone on a page, ranked by `value` descending.\nResults reflect the caller's data access.\n", "required": [ "id", "object", "project_id", "page_url", "url_match", "metric", "time_range", "timezone", "zone_count", "total_zone_count", "truncated", "zones", "warnings" ], "properties": { "id": { "type": "string", "description": "Identifier for this computation." }, "object": { "type": "string", "const": "zone_metrics", "description": "Resource-type discriminator. Always `zone_metrics`." }, "project_id": { "type": "string", "pattern": "^[0-9]+$" }, "page_url": { "type": "string", "description": "The page URL after normalization." }, "url_match": { "$ref": "#/components/schemas/ZoningUrlMatch" }, "metric": { "$ref": "#/components/schemas/ZoneMetric" }, "time_range": { "$ref": "#/components/schemas/TimeRange" }, "timezone": { "type": "string", "description": "IANA timezone used to resolve `time_range` day boundaries (the project timezone)." }, "zone_count": { "type": "integer", "minimum": 0, "description": "Number of zones returned." }, "total_zone_count": { "type": "integer", "minimum": 0, "description": "Number of zones with data before `limit` was applied." }, "truncated": { "type": "boolean", "description": "`true` when `total_zone_count` exceeds `zone_count`." }, "zones": { "type": "array", "items": { "$ref": "#/components/schemas/ZoneMetricRow" } }, "warnings": { "type": "array", "items": { "type": "string" }, "description": "Non-fatal conditions. Includes a warning when the numbers behind a\nrate were computed from differently aged cache snapshots, which can\npush a rate above its natural bound.\n" } } }, "FeatureFlag": { "allOf": [ { "$ref": "#/components/schemas/FeatureFlagBase" }, { "type": "object", "required": ["object"], "properties": { "object": { "type": "string", "const": "feature_flag", "description": "Resource-type discriminator. Always `feature_flag`." } } } ] }, "Guide": { "allOf": [ { "$ref": "#/components/schemas/GuideSurveySummary" }, { "$ref": "#/components/schemas/GuideSurveyDetail" }, { "type": "object", "properties": { "object": { "type": "string", "const": "guide" }, "type": { "type": "string", "const": "GUIDE" } } } ] }, "GuideSummary": { "allOf": [ { "$ref": "#/components/schemas/GuideSurveySummary" }, { "type": "object", "properties": { "object": { "type": "string", "const": "guide" }, "type": { "type": "string", "const": "GUIDE" } } } ] }, "Survey": { "allOf": [ { "$ref": "#/components/schemas/GuideSurveySummary" }, { "$ref": "#/components/schemas/GuideSurveyDetail" }, { "type": "object", "properties": { "object": { "type": "string", "const": "survey" }, "type": { "type": "string", "const": "SURVEY" } } } ] }, "SurveySummary": { "allOf": [ { "$ref": "#/components/schemas/GuideSurveySummary" }, { "type": "object", "properties": { "object": { "type": "string", "const": "survey" }, "type": { "type": "string", "const": "SURVEY" } } } ] }, "ReleaseType": { "type": "string", "description": "How the release was created. Automatic releases are detected or cut by\nproduct automation; manual releases are user- or Developer API-created\nmarkers; integration releases are created by integrations or the legacy\nReleases API. List and get can return all three types.\n", "enum": ["manual", "automatic", "integration"] }, "Release": { "allOf": [ { "$ref": "#/components/schemas/ReleaseSummary" } ] }, "ReleaseSummary": { "type": "object", "required": [ "id", "object", "project_id", "title", "release_start", "chart_visibility", "type", "deleted" ], "properties": { "id": { "type": "string", "description": "Release identifier." }, "object": { "type": "string", "const": "release" }, "project_id": { "type": "string", "description": "Amplitude project (app) identifier." }, "title": { "type": "string" }, "description": { "type": ["string", "null"] }, "version": { "type": ["string", "null"], "description": "Associated product or app version label." }, "release_start": { "type": "string", "format": "date-time", "description": "Start of the release window (UTC)." }, "release_end": { "type": ["string", "null"], "format": "date-time", "description": "Optional end of the release window (UTC)." }, "platforms": { "type": ["array", "null"], "items": { "type": "string" }, "description": "Optional platform tags associated with the release." }, "chart_visibility": { "type": "boolean", "description": "When true, the release marker is shown on time-series charts." }, "type": { "$ref": "#/components/schemas/ReleaseType" }, "deleted": { "type": "boolean", "description": "Whether the release has been deleted. Default list responses omit\ndeleted releases unless `include_deleted=true`.\n" }, "created_at": { "type": ["string", "null"], "format": "date-time" }, "updated_at": { "type": ["string", "null"], "format": "date-time" }, "created_by": { "type": ["string", "null"], "description": "Creator email or login identifier when available." }, "updated_by": { "type": ["string", "null"], "description": "Last editor email or login identifier when available." }, "url": { "type": "string", "format": "uri", "description": "Deep link to the release in the Amplitude web app." } }, "additionalProperties": false }, "Theme": { "allOf": [ { "$ref": "#/components/schemas/ThemeSummary" }, { "type": "object", "required": ["config"], "properties": { "config": { "oneOf": [ { "$ref": "#/components/schemas/ThemeConfig" }, { "type": "null" } ], "description": "Theme configuration. Live by default; the unpublished draft with\n`include_unpublished_changes=true`. `null` when the theme has no\nsaved configuration.\n" } } } ] }, "ThemeConfig": { "type": "object", "required": ["lightMode", "darkMode"], "properties": { "lightMode": { "$ref": "#/components/schemas/ThemeMode" }, "darkMode": { "$ref": "#/components/schemas/ThemeMode" } }, "description": "Theme editor configuration, one `ThemeMode` per color scheme. Keys are\npassed through unchanged from the theme editor, so they are camelCase and\nCSS variable names keep their `--` prefix.\n" }, "ThemeConfigPatch": { "type": "object", "properties": { "lightMode": { "$ref": "#/components/schemas/ThemeModePatch" }, "darkMode": { "$ref": "#/components/schemas/ThemeModePatch" } }, "additionalProperties": false, "description": "Partial `ThemeConfig`, merged like a JSON merge patch (RFC 7396): objects\nmerge key by key, and any other value replaces what's there. Unlike RFC\n7396, `null` resets a value to Amplitude's built-in default theme, or\nremoves it where the default has none (for example a component override\nor `customCss`). That works at any level, from one variable up to a whole\nmode.\n", "example": { "lightMode": { "varDefaults": { "--base-accent": "rgb(120, 86, 255)" } }, "darkMode": { "varDefaults": { "--base-accent": null } } } }, "ThemeMode": { "type": "object", "required": [ "varDefaults", "varOverrides", "componentOverrides", "mobileOverrides" ], "properties": { "varDefaults": { "$ref": "#/components/schemas/ThemeVariables" }, "varOverrides": { "$ref": "#/components/schemas/ThemeVariables" }, "componentOverrides": { "type": "object", "additionalProperties": true, "description": "Per-component overrides keyed by component slug (for example\n`tooltip` or `modal`). Each entry maps a key to a CSS variable value or\nto a map of CSS variables.\n", "example": { "tooltip": { "--background-color": "#ffffff" } } }, "mobileOverrides": { "type": "object", "additionalProperties": true, "description": "Overrides applied by the mobile SDKs." }, "customCss": { "type": "string", "description": "Custom CSS appended to the theme." } }, "additionalProperties": true }, "ThemeModePatch": { "type": ["object", "null"], "properties": { "varDefaults": { "$ref": "#/components/schemas/ThemeVariablesPatch" }, "varOverrides": { "$ref": "#/components/schemas/ThemeVariablesPatch" }, "componentOverrides": { "type": ["object", "null"], "additionalProperties": true }, "mobileOverrides": { "type": ["object", "null"], "additionalProperties": true }, "customCss": { "type": ["string", "null"] } }, "additionalProperties": true }, "ThemeSummary": { "type": "object", "required": [ "id", "object", "project_id", "name", "platform", "is_default", "is_internal", "is_archived", "has_unpublished_changes", "url", "created_by", "last_modified_by", "created_at", "updated_at" ], "properties": { "id": { "type": "string", "pattern": "^[0-9]+$", "description": "Numeric theme identifier." }, "object": { "type": "string", "const": "theme" }, "project_id": { "type": "string", "pattern": "^[0-9]+$" }, "name": { "type": "string" }, "platform": { "$ref": "#/components/schemas/NudgePlatform" }, "is_default": { "type": "boolean", "description": "Whether this is the project's default theme for its platform. Guides\nand surveys with no `theme_id` use it.\n" }, "is_internal": { "type": "boolean", "description": "Internal themes are per-guide or per-survey overrides created in the\nguide or survey editor. Lists omit them; get them by id through a\nguide or survey's `theme_id`.\n" }, "is_archived": { "type": "boolean" }, "has_unpublished_changes": { "type": "boolean", "description": "Whether the unpublished draft differs from the live theme." }, "url": { "type": ["string", "null"], "format": "uri", "description": "Admin URL for the theme. `null` for internal themes." }, "created_by": { "type": ["string", "null"] }, "last_modified_by": { "type": ["string", "null"] }, "created_at": { "type": ["string", "null"], "format": "date-time" }, "updated_at": { "type": ["string", "null"], "format": "date-time" } } }, "Variant": { "type": "object", "required": ["key"], "properties": { "key": { "type": "string", "pattern": "^[A-Za-z0-9_-]+$", "description": "Stable variant key. The value `off` is reserved." }, "name": { "type": ["string", "null"] }, "description": { "type": ["string", "null"] }, "payload": { "description": "Optional JSON payload returned by evaluation." } } }, "TargetSegment": { "type": "object", "required": ["conditions"], "properties": { "name": { "type": ["string", "null"] }, "conditions": { "type": "array", "items": { "$ref": "#/components/schemas/TargetCondition" } }, "percentage": { "type": ["integer", "null"], "minimum": 0, "maximum": 100, "description": "Segment rollout percentage." }, "rollout_weights": { "$ref": "#/components/schemas/RolloutWeights" }, "bucketing_key": { "type": ["string", "null"] } } }, "TargetSegmentInput": { "type": "object", "required": ["percentage", "rollout_weights"], "properties": { "name": { "type": ["string", "null"] }, "conditions": { "type": "array", "items": { "$ref": "#/components/schemas/TargetCondition" }, "description": "Omitted (or empty) for the catch-all \"all other users\" segment." }, "percentage": { "type": "integer", "minimum": 0, "maximum": 100, "description": "Segment rollout percentage." }, "rollout_weights": { "$ref": "#/components/schemas/RolloutWeights" }, "bucketing_key": { "type": ["string", "null"] } } }, "Destination": { "type": "object", "required": [ "id", "object", "project_id", "partner", "display_name", "kind", "config", "credential_status", "version", "created_at", "updated_at" ], "properties": { "id": { "type": "string", "description": "Server-assigned identifier (read-only)." }, "object": { "type": "string", "const": "destination" }, "project_id": { "type": "string", "pattern": "^[0-9]+$" }, "partner": { "type": "string" }, "display_name": { "type": "string" }, "kind": { "type": "array", "items": { "$ref": "#/components/schemas/DestinationConnectorKind" }, "minItems": 1 }, "config": { "type": "object", "additionalProperties": true, "description": "Partner config keyed by parameter id. Reads return an allowlist of\nnon-credential types: string, boolean, enum, mapped field, event\nmapping, and transformation. Secret, OAuth, service-account, custom\nHTTP header, and ads-account values are write-only and never returned.\nString values the partner marks as sensitive are omitted too.\nStructured values round-trip as decoded JSON.\n" }, "credential_status": { "$ref": "#/components/schemas/DestinationCredentialStatus" }, "version": { "type": "integer", "minimum": 1 }, "enabled": { "type": "boolean", "description": "Event-streaming only. Whether the stream is enabled." }, "paused": { "type": "boolean", "description": "Event-streaming only. Whether the stream is paused." }, "event_filter": { "oneOf": [ { "$ref": "#/components/schemas/DestinationEventFilter" }, { "type": "null" } ], "description": "Event-streaming only. Events (and optional property filters) to stream." }, "property_mappings": { "oneOf": [ { "type": "object", "additionalProperties": true }, { "type": "null" } ], "description": "Event-streaming only. Optional property mappings." }, "send_events": { "type": "boolean", "description": "Event-streaming only. Whether to send events." }, "send_users": { "type": "boolean", "description": "Event-streaming only. Whether to send identify/user updates." }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "created_by": { "type": ["string", "null"] }, "updated_by": { "type": ["string", "null"] } } }, "DestinationType": { "type": "object", "required": [ "id", "object", "partner", "display_name", "types", "parameters" ], "properties": { "id": { "type": "string" }, "object": { "type": "string", "const": "destination_type" }, "partner": { "type": "string", "description": "Partner key (e.g. braze, kinesis_datastream, s3)." }, "display_name": { "type": "string" }, "types": { "type": "array", "items": { "$ref": "#/components/schemas/DestinationConnectorType" }, "minItems": 1 }, "parameters": { "type": "array", "items": { "$ref": "#/components/schemas/DestinationParameter" } } } }, "DestinationParameter": { "type": "object", "required": ["id", "label", "kind", "required"], "properties": { "id": { "type": "string" }, "label": { "type": "string" }, "kind": { "$ref": "#/components/schemas/DestinationParameterKind" }, "required": { "type": "boolean" }, "description": { "type": ["string", "null"] }, "enum_values": { "type": "array", "items": { "type": "string" } }, "write_only": { "type": "boolean" } } }, "PlanDetails": { "type": "object", "required": ["action", "dry_run"], "properties": { "action": { "$ref": "#/components/schemas/PlanAction" }, "dry_run": { "type": "boolean", "const": true }, "diff": { "oneOf": [ { "type": "object", "additionalProperties": { "$ref": "#/components/schemas/PlanDiffEntry" } }, { "type": "null" } ] }, "warnings": { "type": "array", "items": { "type": "string" } } } }, "DeviceAuthorizationRequest": { "type": "object", "properties": { "scope": { "type": "string", "description": "Space-delimited OAuth scopes to request. When `offline_access` is requested, `openid` is also required.\n" } } }, "DeviceAuthorizationResponse": { "type": "object", "required": [ "device_code", "user_code", "verification_uri", "expires_in" ], "properties": { "device_code": { "type": "string" }, "user_code": { "type": "string" }, "verification_uri": { "type": "string" }, "verification_uri_complete": { "type": "string" }, "expires_in": { "type": "integer" }, "interval": { "type": "integer" } } }, "SignupRequest": { "type": "object", "additionalProperties": false, "required": ["email"], "properties": { "email": { "type": "string", "format": "email", "description": "Email address of the user signing up for the Amplitude account." }, "full_name": { "type": "string", "minLength": 1, "description": "Full name of the user signing up for the Amplitude account." }, "scope": { "type": "string", "minLength": 1, "description": "Space-delimited OAuth scopes to request." }, "terms_acceptance": { "type": "object", "properties": { "terms_of_service": { "$ref": "#/components/schemas/SignupDocumentAcceptance" }, "privacy_policy": { "$ref": "#/components/schemas/SignupDocumentAcceptance" } } } } }, "SignupResponse": { "description": "Signup result. The response provides credentials, triggers an OAuth flow, or requests additional signup information.\n", "oneOf": [ { "$ref": "#/components/schemas/SignupCredentialsResponse" }, { "$ref": "#/components/schemas/SignupRequiresAuthResponse" }, { "$ref": "#/components/schemas/SignupNeedsInformationResponse" } ], "discriminator": { "propertyName": "type", "mapping": { "credentials": "#/components/schemas/SignupCredentialsResponse", "requires_auth": "#/components/schemas/SignupRequiresAuthResponse", "needs_information": "#/components/schemas/SignupNeedsInformationResponse" } } }, "SignupError": { "type": "object", "required": ["type", "error"], "properties": { "type": { "const": "error" }, "error": { "type": "object", "required": ["code", "message"], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } }, "OAuthError": { "type": "object", "description": "RFC 6749 §5.2 OAuth error response.", "required": ["error"], "properties": { "error": { "type": "string" }, "error_description": { "type": "string" }, "error_hint": { "type": "string" }, "error_uri": { "type": "string" } } }, "TokenRequest": { "description": "Token grant request. Either the `device_code` grant (RFC 8628) or the `refresh_token` grant, selected by `grant_type`.\n", "oneOf": [ { "$ref": "#/components/schemas/DeviceCodeTokenRequest" }, { "$ref": "#/components/schemas/RefreshTokenRequest" } ], "discriminator": { "propertyName": "grant_type", "mapping": { "urn:ietf:params:oauth:grant-type:device_code": "#/components/schemas/DeviceCodeTokenRequest", "refresh_token": "#/components/schemas/RefreshTokenRequest" } } }, "TokenResponse": { "type": "object", "required": ["access_token", "token_type", "expires_in"], "properties": { "access_token": { "type": "string" }, "token_type": { "type": "string" }, "expires_in": { "type": "integer" }, "refresh_token": { "type": "string" }, "scope": { "type": "string" }, "id_token": { "type": "string" } } }, "AgentInsight": { "type": "object", "required": [ "id", "object", "project_id", "agent_name", "finding_key", "category", "title", "summary", "recommendation", "measurements", "evidence", "magnitude", "confidence", "score", "status", "window_start", "window_end", "evaluated_at" ], "properties": { "id": { "type": "string", "format": "uuid" }, "object": { "type": "string", "const": "agent_analytics_insight" }, "project_id": { "type": "string", "description": "The finding's own project, including when listed through a portfolio." }, "agent_name": { "type": "string", "description": "Empty for project-level findings." }, "finding_key": { "type": "string", "description": "Rule key, such as tool-failures. Not a unique finding identifier." }, "category": { "type": "string", "enum": ["cost", "efficiency", "quality"] }, "title": { "type": "string" }, "summary": { "type": "string" }, "recommendation": { "type": "string" }, "measurements": { "type": "array", "items": { "type": "object", "required": ["key", "label", "value", "unit"], "properties": { "key": { "type": "string" }, "label": { "type": "string" }, "value": { "type": "number" }, "unit": { "type": ["string", "null"] } } } }, "evidence": { "type": "object", "required": ["session_ids", "chart_definition"], "properties": { "session_ids": { "type": "array", "items": { "type": "string" } }, "chart_definition": { "type": ["object", "null"], "additionalProperties": true, "description": "Opaque, read-only chart definition. Its nested keys are preserved; the shape is not intended for authoring." } } }, "magnitude": { "type": "number", "minimum": 0, "maximum": 1 }, "confidence": { "type": "number", "minimum": 0, "maximum": 1 }, "score": { "type": "number", "description": "100 times magnitude times confidence; higher ranks first.", "minimum": 0, "maximum": 100 }, "status": { "type": "string", "enum": ["opened", "in_progress", "closed"] }, "window_start": { "type": "string", "format": "date-time" }, "window_end": { "type": "string", "format": "date-time" }, "evaluated_at": { "type": "string", "format": "date-time" } } }, "AgentAnalyticsDataset": { "type": "object", "required": [ "id", "object", "project_id", "name", "description", "agent_name", "source_type", "session_count", "reviewed_count", "created_at" ], "properties": { "id": { "type": "string", "description": "Stable dataset identifier (ULID)." }, "object": { "type": "string", "const": "agent_analytics_dataset" }, "project_id": { "type": "string" }, "name": { "type": "string", "minLength": 1 }, "description": { "type": ["string", "null"] }, "agent_name": { "type": ["string", "null"], "description": "Agent the dataset is scoped to. Null for project-level datasets." }, "source_type": { "type": "string", "description": "How the dataset was assembled, such as `manual`." }, "session_count": { "type": "integer", "description": "Sessions currently in the dataset." }, "reviewed_count": { "type": "integer", "description": "Sessions in the dataset that carry a human review." }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": ["string", "null"] } } }, "AgentAnalyticsSessionIds": { "type": "object", "required": ["session_ids"], "properties": { "session_ids": { "type": "array", "description": "Session identifiers. All must belong to the path project.", "minItems": 1, "maxItems": 100, "items": { "type": "string" } } } }, "AgentAnalyticsEvaluatorTag": { "type": "object", "required": ["id", "label", "description"], "properties": { "id": { "type": "string" }, "label": { "type": "string", "description": "Value stored on a result for this tag, such as `RESP_DATA_RESPONSE_MISMATCH`." }, "description": { "type": "string" } } }, "AgentAnalyticsEvaluator": { "type": "object", "required": [ "id", "object", "project_id", "stable_id", "topic", "output_type", "description", "tags", "is_active" ], "properties": { "id": { "type": "string", "description": "Identifier for this evaluator version. Changes when the evaluator is updated." }, "object": { "type": "string", "const": "agent_analytics_evaluator" }, "project_id": { "type": "string" }, "stable_id": { "type": "string", "description": "Identifier that survives updates. Use this to address an evaluator across versions." }, "topic": { "type": "string", "description": "Human-readable evaluator name. Called `topic` to match the field already\nreturned by the Agent Analytics read surface.\n", "minLength": 1 }, "output_type": { "type": "string", "enum": ["binary", "categorical", "score"] }, "description": { "type": "string", "description": "Evaluator prompt or rubric." }, "suite_id": { "type": ["string", "null"] }, "suite_name": { "type": ["string", "null"] }, "tags": { "type": "array", "description": "Permitted output values. Required for `binary` and `categorical`\nevaluators; constrains what a result may record.\n", "items": { "$ref": "#/components/schemas/AgentAnalyticsEvaluatorTag" } }, "is_active": { "type": "boolean", "description": "Read-only. Evaluators created or updated through this API are inactive.\nActivation is a separate permission and is not exposed here.\n" } } }, "AgentAnalyticsEvalRun": { "type": "object", "required": [ "id", "object", "project_id", "evaluator_ids", "run_type", "status", "target_mode", "total_sessions", "completed_sessions", "failed_sessions", "warnings" ], "properties": { "id": { "type": "string", "description": "Stable eval run identifier." }, "object": { "type": "string", "const": "agent_analytics_eval_run" }, "project_id": { "type": "string" }, "evaluator_ids": { "type": "array", "items": { "type": "string" } }, "run_type": { "type": "string" }, "status": { "type": "string", "description": "Lifecycle state of the run." }, "target_mode": { "type": "string", "description": "How the run selected its sessions, such as by dataset or by filter." }, "total_sessions": { "type": "integer" }, "completed_sessions": { "type": "integer" }, "failed_sessions": { "type": "integer" }, "total_cost_usd": { "type": ["number", "null"] }, "avg_latency_ms": { "type": ["integer", "null"] }, "warnings": { "type": "array", "items": { "type": "string" } }, "error": { "type": ["string", "null"] }, "created_by": { "type": ["string", "null"] }, "started_at": { "type": ["string", "null"], "format": "date-time" }, "completed_at": { "type": ["string", "null"], "format": "date-time" } } }, "McpAnalyticsServer": { "type": "object", "required": ["id", "object", "project_id", "name"], "properties": { "id": { "type": "string", "description": "Server id, returned as a string." }, "object": { "type": "string", "const": "mcp_analytics_server" }, "project_id": { "type": "string" }, "name": { "type": "string" } } }, "McpAnalyticsTopic": { "type": "object", "required": [ "id", "object", "parent_id", "depth", "name", "description", "episode_count", "share", "hard_error_rate", "thrashing_rate", "mean_calls", "neighbor_ids" ], "properties": { "id": { "type": "string", "description": "Stable topic id. `root` is reserved and is never a topic id." }, "object": { "type": "string", "const": "mcp_analytics_topic" }, "parent_id": { "type": ["string", "null"] }, "depth": { "type": "integer", "minimum": 0 }, "name": { "type": "string" }, "description": { "type": ["string", "null"] }, "episode_count": { "type": ["number", "null"] }, "share": { "type": ["number", "null"] }, "hard_error_rate": { "type": ["number", "null"] }, "thrashing_rate": { "type": ["number", "null"] }, "mean_calls": { "type": ["number", "null"] }, "neighbor_ids": { "type": "array", "items": { "type": "string" } } } }, "McpAnalyticsTaxonomy": { "type": "object", "required": [ "id", "object", "project_id", "server_id", "run_id", "taxonomy_version", "activated_at", "nodes" ], "properties": { "id": { "type": "string", "description": "Server id. It stays stable when a new run is pinned and is present when nothing is pinned." }, "object": { "type": "string", "const": "mcp_analytics_taxonomy" }, "project_id": { "type": "string" }, "server_id": { "type": "string" }, "run_id": { "type": ["string", "null"] }, "taxonomy_version": { "type": ["string", "null"] }, "activated_at": { "type": ["string", "null"], "format": "date-time" }, "nodes": { "type": "array", "items": { "$ref": "#/components/schemas/McpAnalyticsTopic" } } } }, "McpAnalyticsEpisodeSummary": { "type": "object", "required": [ "id", "object", "started_at", "ended_at", "call_count", "error_count", "is_thrash", "client_name", "lane", "confidence" ], "properties": { "id": { "type": "string" }, "object": { "type": "string", "const": "mcp_analytics_episode" }, "started_at": { "type": "string", "format": "date-time" }, "ended_at": { "type": "string", "format": "date-time" }, "call_count": { "type": "integer", "minimum": 0 }, "error_count": { "type": "integer", "minimum": 0 }, "is_thrash": { "type": "boolean" }, "client_name": { "type": "string" }, "lane": { "type": "string" }, "confidence": { "type": ["number", "null"] } } }, "McpAnalyticsTopicDetail": { "allOf": [ { "$ref": "#/components/schemas/McpAnalyticsTopic" }, { "type": "object", "required": ["examples"], "properties": { "examples": { "type": "array", "maxItems": 8, "description": "At most eight episode summaries. This is not a page and has no cursor.", "items": { "$ref": "#/components/schemas/McpAnalyticsEpisodeSummary" } } } } ] }, "McpAnalyticsBreadcrumb": { "type": "object", "required": ["id", "depth", "name"], "properties": { "id": { "type": "string", "description": "Stable topic id, ordered from the root." }, "depth": { "type": "integer", "minimum": 0 }, "name": { "type": "string" } } }, "McpAnalyticsEpisode": { "allOf": [ { "$ref": "#/components/schemas/McpAnalyticsEpisodeSummary" }, { "type": "object", "required": ["project_id", "server_id", "auth_type", "breadcrumb"], "properties": { "project_id": { "type": "string" }, "server_id": { "type": "string" }, "auth_type": { "type": "string" }, "breadcrumb": { "type": "array", "items": { "$ref": "#/components/schemas/McpAnalyticsBreadcrumb" } } } } ] }, "McpAnalyticsCall": { "type": "object", "required": [ "id", "object", "event_time", "tool_name", "is_error", "error_type", "error_message", "error_code", "error_http_status", "duration_ms", "rationale", "properties" ], "properties": { "id": { "type": "string", "description": "Recorded tool call event id." }, "object": { "type": "string", "const": "mcp_analytics_call" }, "event_time": { "type": "string", "format": "date-time" }, "tool_name": { "type": "string" }, "is_error": { "type": "boolean" }, "error_type": { "type": ["string", "null"] }, "error_message": { "type": ["string", "null"] }, "error_code": { "type": ["string", "null"] }, "error_http_status": { "type": ["integer", "null"] }, "duration_ms": { "type": ["integer", "null"] }, "rationale": { "type": ["string", "null"] }, "properties": { "type": ["object", "null"], "additionalProperties": true, "description": "Recorded event properties. Contents depend on the instrumented tool; input and output fields may be absent." } } }, "SignupDocumentAcceptance": { "type": "object", "required": ["url", "accepted"], "properties": { "url": { "type": "string", "format": "uri" }, "accepted": { "const": true } } }, "SignupCredentialsResponse": { "type": "object", "required": ["type", "credentials"], "properties": { "type": { "const": "credentials" }, "credentials": { "$ref": "#/components/schemas/TokenResponse" } } }, "SignupRequiresAuthResponse": { "type": "object", "required": ["type", "requires_auth"], "properties": { "type": { "const": "requires_auth" }, "requires_auth": { "type": "object", "required": ["type", "device_authorization"], "properties": { "type": { "const": "device_authorization" }, "device_authorization": { "$ref": "#/components/schemas/DeviceAuthorizationResponse" } } } } }, "SignupNeedsInformationResponse": { "type": "object", "required": ["type", "needs_information"], "properties": { "type": { "const": "needs_information" }, "needs_information": { "type": "object", "required": ["schema"], "properties": { "schema": { "type": "object", "additionalProperties": true } } } } }, "DeviceCodeTokenRequest": { "type": "object", "required": ["grant_type", "device_code"], "properties": { "grant_type": { "type": "string", "const": "urn:ietf:params:oauth:grant-type:device_code", "description": "The OAuth grant type. Must be `urn:ietf:params:oauth:grant-type:device_code`." }, "device_code": { "type": "string", "description": "The device_code from the device-authorization response." } } }, "RefreshTokenRequest": { "type": "object", "required": ["grant_type", "refresh_token"], "properties": { "grant_type": { "type": "string", "const": "refresh_token", "description": "The OAuth grant type. Must be `refresh_token`." }, "refresh_token": { "type": "string", "description": "The refresh_token issued by a previous token or refresh grant." } } }, "RecentEventIngestionPollingTimeoutSeconds": { "type": "integer", "minimum": 1, "maximum": 120, "description": "Maximum polling window requested by the caller. Clients should complete\nthe initial check even if it exceeds this window and use the window only\nto limit subsequent polls. Its presence requests polling guidance; it is\nnot an HTTP request timeout, and each HTTP request performs one check.\n" }, "RecentEventIngestionPollAfterSeconds": { "type": "integer", "minimum": 1, "description": "Minimum seconds to wait before the next ingestion check. Returned only\nwhen polling was requested and another check is advised. Its omission\nmeans the server does not advise another check.\n" }, "DestinationConnectorType": { "type": "string", "enum": ["event", "identify", "cohort"] }, "DestinationParameterKind": { "type": "string", "enum": [ "string", "number", "boolean", "secret", "oauth", "service_account", "enum", "http_headers", "mapped_field", "event_mapping", "transformation", "ads_account" ] }, "ResultKind": { "type": "string", "description": "High-level shape of the normalized result payload. Adapters set this\nexplicitly per supported chart type; `unknown` means the server could not\nclassify the result shape safely.\n", "enum": [ "timeseries", "scalar", "funnel", "retention", "table", "unknown" ] }, "RecommendedAggregate": { "type": "string", "description": "Recommended aggregation method for downstream consumers. Non-additive metrics\n(e.g. unique users) must not be summed across intervals. `unknown` is used\nwhen the adapter cannot determine a safe aggregate; treat values as\nnon-additive in that case.\n", "enum": ["sum", "last", "mean", "deduped_total", "none", "unknown"] }, "MetricSemantics": { "type": "object", "required": ["additive", "recommended_aggregate"], "properties": { "additive": { "type": "boolean", "description": "When false, values must not be summed across time intervals or groups\nwithout understanding deduplication semantics.\n" }, "recommended_aggregate": { "$ref": "#/components/schemas/RecommendedAggregate" }, "notes": { "type": ["string", "null"], "description": "Human-readable guidance for interpreting values." } } }, "ResultDimension": { "type": "object", "required": ["id", "label", "role"], "properties": { "id": { "type": "string" }, "label": { "type": "string" }, "role": { "type": "string", "enum": ["time", "segment", "breakdown", "step"], "description": "Role of this dimension in the result." } } }, "ResultPoint": { "type": "object", "required": ["x", "y"], "properties": { "x": { "description": "Dimension value (typically an ISO date or category label).", "oneOf": [ { "type": "string" }, { "type": "number" } ] }, "y": { "type": ["number", "null"], "description": "Metric value at this point." }, "complete": { "type": "boolean", "description": "When false, the interval is incomplete (current bucket). Only present\nwhen `exclude_incomplete_datapoints` is false.\n" } } }, "ResultSeries": { "type": "object", "required": ["id", "label", "points"], "properties": { "id": { "type": "string" }, "label": { "type": "string" }, "points": { "type": "array", "items": { "$ref": "#/components/schemas/ResultPoint" } }, "aggregate": { "type": "object", "description": "Optional pre-computed aggregate for the series.", "properties": { "value": { "type": ["number", "null"] }, "method": { "type": "string" } }, "required": ["value", "method"] } } }, "AnalyticsResultData": { "type": "object", "description": "Normalized result payload. Populated fields depend on `result_kind`.\nTimeseries and funnel results use `dimensions` and `series`. Table results\nuse `columns` and `rows`.\n", "properties": { "dimensions": { "type": "array", "items": { "$ref": "#/components/schemas/ResultDimension" } }, "series": { "type": "array", "items": { "$ref": "#/components/schemas/ResultSeries" } }, "columns": { "type": "array", "items": { "type": "string" }, "description": "Column headers for table-shaped results." }, "rows": { "type": "array", "items": { "type": "array", "items": { "oneOf": [ { "type": "string" }, { "type": "number" }, { "type": "boolean" }, { "type": "null" } ] } } } } }, "AnalyticsResultMetadata": { "type": "object", "description": "Echo of effective query parameters and chart context.", "properties": { "chart_type": { "$ref": "#/components/schemas/ChartType" }, "chart_name": { "type": "string" }, "time_range": { "$ref": "#/components/schemas/TimeRange" }, "exclude_incomplete_datapoints": { "type": "boolean" }, "group_by_limit": { "type": "integer" }, "time_series_limit": { "type": "integer" } }, "additionalProperties": true }, "TruncationInfo": { "type": "object", "properties": { "group_by_limit": { "type": "integer", "description": "Applied group-by limit when breakdown was truncated." }, "time_series_limit": { "type": "integer", "description": "Applied time-series limit when buckets were truncated." }, "reason": { "type": "string", "description": "Human-readable explanation of truncation." } } }, "AiContext": { "type": "object", "required": ["object", "scope", "org_id", "project_id", "context"], "properties": { "object": { "type": "string", "const": "ai_context" }, "scope": { "type": "string", "enum": ["organization", "project"] }, "org_id": { "type": "string" }, "project_id": { "type": ["string", "null"] }, "context": { "type": "string", "description": "Customer-managed markdown or plain text; empty when unset." } } }, "AiContextWrite": { "type": "object", "required": ["context"], "properties": { "context": { "type": "string", "minLength": 0, "description": "Full customer-managed context to store. Replaces the existing value;\nsend an empty string to clear.\n" } } }, "PropertyType": { "type": "string", "description": "Property namespace for filters, group-bys, and aggregations.", "enum": ["event", "user", "group"] }, "MetricPropertyFilter": { "type": "object", "required": ["property_key", "operator"], "properties": { "property_key": { "type": "string", "description": "Property key to filter on." }, "operator": { "type": "string", "description": "Filter operator (matches Amplitude property operators)." }, "values": { "type": "array", "items": { "type": "string" }, "default": [], "description": "Values to match against." }, "property_type": { "$ref": "#/components/schemas/PropertyType" }, "group_type": { "type": "string", "default": "", "description": "Group type for group properties. Empty string for non-group." } }, "additionalProperties": false }, "MetricGroupBy": { "type": "object", "required": ["property_type", "value"], "properties": { "property_type": { "$ref": "#/components/schemas/PropertyType" }, "value": { "type": "string", "description": "Property name to group by." }, "group_type": { "type": "string", "default": "", "description": "Group type for group properties. Empty string for non-group." } }, "additionalProperties": false }, "MetricEvent": { "type": "object", "required": ["event_type"], "properties": { "event_type": { "type": "string", "description": "Event name (e.g. `Page View`, `_active`)." }, "filters": { "type": "array", "items": { "$ref": "#/components/schemas/MetricPropertyFilter" }, "default": [] }, "group_by": { "type": "array", "items": { "$ref": "#/components/schemas/MetricGroupBy" }, "description": "Properties to group by. Required for formula metrics that use property\naggregation functions like `PROPSUM(A)` or `PROPAVG(A)`.\n" } }, "additionalProperties": false }, "MetricDefinitionUniques": { "type": "object", "required": ["metric_type", "event"], "properties": { "metric_type": { "type": "string", "const": "uniques" }, "event": { "$ref": "#/components/schemas/MetricEvent" }, "count_group": { "type": "string", "default": "User", "description": "What to count. `User` for unique users, `Event` for event totals." } }, "additionalProperties": false }, "MetricDefinitionTotals": { "type": "object", "required": ["metric_type", "event"], "properties": { "metric_type": { "type": "string", "const": "totals" }, "event": { "$ref": "#/components/schemas/MetricEvent" }, "count_group": { "type": "string", "default": "User" } }, "additionalProperties": false }, "MetricDefinitionFormula": { "type": "object", "required": ["metric_type", "events", "formula"], "properties": { "metric_type": { "type": "string", "const": "formula" }, "events": { "type": "array", "minItems": 1, "maxItems": 6, "items": { "$ref": "#/components/schemas/MetricEvent" }, "description": "Event definitions referenced by letter (A, B, C...) in the formula string.\n" }, "formula": { "type": "string", "description": "Formula string. Reference events by letter. Functions include\n`UNIQUES(A)`, `TOTALS(A)`, `PROPSUM(A)`, `PROPAVG(A)`, `PROPMIN(A)`,\n`PROPMAX(A)`, `PROPCOUNT(A)`, `PROPCOUNTAVG(A)`, `REVENUETOTAL(A)`.\n" } }, "additionalProperties": false }, "MetricAggregationProperty": { "type": "object", "required": ["property_type", "value"], "properties": { "property_type": { "$ref": "#/components/schemas/PropertyType" }, "value": { "type": "string", "description": "Numeric property name to aggregate." }, "group_type": { "type": "string", "default": "" } }, "additionalProperties": false }, "MetricDefinitionPropSum": { "type": "object", "required": ["metric_type", "event", "aggregation_property"], "properties": { "metric_type": { "type": "string", "const": "prop_sum" }, "event": { "$ref": "#/components/schemas/MetricEvent" }, "aggregation_property": { "$ref": "#/components/schemas/MetricAggregationProperty" } }, "additionalProperties": false }, "MetricDefinitionPropAvg": { "type": "object", "required": ["metric_type", "event", "aggregation_property"], "properties": { "metric_type": { "type": "string", "const": "prop_avg" }, "event": { "$ref": "#/components/schemas/MetricEvent" }, "aggregation_property": { "$ref": "#/components/schemas/MetricAggregationProperty" } }, "additionalProperties": false }, "MetricDefinitionRetention": { "type": "object", "required": [ "metric_type", "start_event", "return_event", "return_on", "return_on_interval" ], "properties": { "metric_type": { "type": "string", "const": "retention" }, "start_event": { "$ref": "#/components/schemas/MetricEvent" }, "return_event": { "$ref": "#/components/schemas/MetricEvent" }, "return_on": { "type": "integer", "minimum": 1, "maximum": 30, "description": "Number of intervals to return on." }, "return_on_interval": { "type": "integer", "minimum": 1, "maximum": 30, "description": "Interval length in days. `1` for daily, `7` for weekly, `30` for monthly.\n" } }, "additionalProperties": false }, "FunnelMode": { "type": "string", "enum": ["ordered", "unordered", "sequential"] }, "FunnelPathsToCollect": { "type": "string", "enum": ["uniques", "totals"], "description": "Whether the funnel measures unique users completing the path or total\nconversion path counts.\n" }, "FunnelComputePropertyFunction": { "type": "string", "enum": ["sum", "avg"] }, "MetricDefinitionConversion": { "type": "object", "required": [ "metric_type", "funnel_events", "funnel_mode", "conversion_seconds", "funnel_paths_to_collect" ], "properties": { "metric_type": { "type": "string", "const": "conversion" }, "funnel_events": { "type": "array", "minItems": 2, "maxItems": 12, "items": { "$ref": "#/components/schemas/MetricEvent" }, "description": "Ordered funnel steps (minimum 2 events)." }, "funnel_mode": { "$ref": "#/components/schemas/FunnelMode" }, "conversion_seconds": { "type": "integer", "minimum": 1, "description": "Maximum time window to complete the funnel, in seconds\n(e.g. `86400` = 1 day, `604800` = 7 days).\n" }, "funnel_paths_to_collect": { "$ref": "#/components/schemas/FunnelPathsToCollect" }, "funnel_constant_properties": { "type": "array", "items": { "$ref": "#/components/schemas/MetricAggregationProperty" }, "description": "Properties held constant across funnel steps." }, "funnel_compute_property": { "$ref": "#/components/schemas/MetricAggregationProperty" }, "funnel_compute_property_function": { "$ref": "#/components/schemas/FunnelComputePropertyFunction" } }, "additionalProperties": false }, "MetricDefinitionUnknown": { "type": "object", "required": ["metric_type"], "properties": { "metric_type": { "type": "string", "const": "unknown" } }, "additionalProperties": false, "description": "Placeholder definition for metric types this API version does not model.\nNo type-specific fields are returned.\n" }, "MetricKeyProperty": { "type": "object", "required": ["property_type", "value"], "properties": { "property_type": { "type": "string" }, "value": { "type": "string" }, "group_type": { "type": "string" } } }, "PageUrl": { "type": "string", "minLength": 1, "maxLength": 2048, "description": "Page URL to analyze. Accepts `http` and `https` URLs; a URL without a\nscheme is treated as `https`. The query string and fragment are removed\nbefore matching, so `https://example.com/pricing?utm=x` and\n`https://example.com/pricing` are the same page.\n", "example": "https://example.com/pricing" }, "HeatmapUrlMatch": { "type": "string", "description": "How `page_url` is matched against the page URL recorded on each event.\n`is` matches the exact URL, `contains` matches any URL containing it,\n`has_prefix` matches URLs starting with it, and `glob` treats `*` as a\nwildcard.\n", "enum": ["is", "contains", "has_prefix", "glob"], "default": "is" }, "HeatmapDeviceType": { "type": "string", "description": "Viewport band to include, matching the device selector in the product:\n`desktop` is at least 1440 px wide, `laptop` is 900 to 1440 px, `tablet`\nis 500 to 900 px, `mobile` is at most 500 px. Use `custom` with\n`viewport_width` to match one exact width.\n", "enum": ["desktop", "laptop", "tablet", "mobile", "custom"], "default": "desktop" }, "ViewportWidth": { "type": "integer", "minimum": 1, "maximum": 20000, "description": "Exact viewport width in pixels. Required when `device_type` is `custom`\nand not accepted otherwise.\n" }, "ClickMapSelectorRow": { "type": "object", "required": ["selector", "count"], "properties": { "selector": { "type": "string", "description": "CSS selector of the clicked element." }, "count": { "type": "integer", "minimum": 0, "description": "Clicks (`metric: totals`) or unique users (`metric: uniques`)." } }, "additionalProperties": false }, "ClickMapPixelRow": { "type": "object", "required": ["x", "y", "count"], "properties": { "x": { "type": "integer", "description": "Horizontal page coordinate in pixels." }, "y": { "type": "integer", "description": "Vertical page coordinate in pixels." }, "count": { "type": "integer", "minimum": 0, "description": "Clicks (`metric: totals`) or unique users (`metric: uniques`)." } }, "additionalProperties": false }, "ScrollMapBucket": { "type": "object", "required": [ "depth_from_px", "depth_to_px", "sessions_reached", "percent_reached" ], "properties": { "depth_from_px": { "type": "integer", "minimum": 0, "description": "Lower bound of the scroll-depth bucket in page pixels." }, "depth_to_px": { "type": "integer", "minimum": 0, "description": "Upper bound of the scroll-depth bucket in page pixels." }, "sessions_reached": { "type": "integer", "minimum": 0, "description": "Sessions that scrolled at least to this bucket." }, "percent_reached": { "type": "number", "minimum": 0, "maximum": 1, "description": "`sessions_reached` divided by the sessions counted in the first\nbucket, as a fraction. The first bucket is always `1`.\n" } }, "additionalProperties": false }, "ZoningUrlMatch": { "type": "string", "description": "How `page_url` is matched against the page URL recorded on each event.\n`is` matches the exact URL; `contains` matches any URL containing it.\n", "enum": ["is", "contains"], "default": "is" }, "ZoneMetric": { "type": "string", "description": "Metric computed per zone. Rates are fractions (`0.18` is 18%).\n\n- `click_rate_pageview`: page views with a click in the zone, divided by page views.\n- `click_rate_session`: sessions with a click in the zone, divided by sessions.\n- `rage_click_rate_pageview`: page views with a rage click in the zone, divided by page views.\n- `rage_click_rate_session`: sessions with a rage click in the zone, divided by sessions.\n- `click_distribution`: clicks in the zone, divided by all clicks on the page.\n- `click_recurrence`: clicks in the zone, divided by page views. Can exceed 1.\n- `rage_click_recurrence`: rage clicks in the zone, divided by page views. Can exceed 1.\n- `exposure_rate`: page views where the zone was visible, divided by page views.\n- `attractiveness_rate`: page views where the zone was visible and clicked, divided by page views where it was visible. Can exceed 1.\n- `revenue_per_click`: revenue attributed to the zone, divided by sessions that clicked it, in the project's revenue unit.\n", "enum": [ "click_rate_pageview", "click_rate_session", "rage_click_rate_pageview", "rage_click_rate_session", "click_distribution", "click_recurrence", "rage_click_recurrence", "exposure_rate", "attractiveness_rate", "revenue_per_click" ], "default": "click_rate_pageview" }, "ZoneMetricRow": { "type": "object", "required": ["zone_id", "value"], "properties": { "zone_id": { "type": "string", "description": "CSS selector identifying the zone." }, "value": { "type": "number", "description": "The metric value for this zone. Rates are fractions and are returned uncapped." } }, "additionalProperties": false }, "RolloutWeights": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0 }, "description": "Variant-keyed rollout weights. Values may be normalized to sum to 100 (percentages) or expressed as unnormalized relative weights (for example `{ \"control\": 1, \"treatment\": 1 }` for an even split). Weights are non-negative and may be fractional." }, "TargetCondition": { "type": "object", "required": ["prop", "op", "type", "values"], "properties": { "group_type": { "type": ["string", "null"] }, "prop": { "type": "string", "minLength": 1, "description": "Property name or cohort identifier being targeted." }, "prop_type": { "type": ["string", "null"], "description": "Namespace of the targeted property, for example `user`, `event`, or `group`. Omitted for conditions that target a cohort rather than a property." }, "op": { "type": "string", "description": "Targeting operator applied to the property values.", "enum": [ "is", "is not", "contains", "does not contain", "less", "less or equal", "greater", "greater or equal", "set is", "set is not", "set contains", "set does not contain", "glob match", "glob does not match" ] }, "type": { "type": "string", "description": "Condition type, for example `property` or `cohort`." }, "values": { "type": "array", "minItems": 1, "items": { "type": "string" }, "description": "At least one value to match against. Conditions with no values are rejected." } } }, "Tester": { "type": "object", "required": ["variant_key", "values"], "properties": { "variant_key": { "type": "string" }, "values": { "type": "array", "items": { "type": "string" }, "maxItems": 2000, "description": "User IDs, device IDs, or cohort identifiers included in this variant. At most 2000 entries per variant (the limit is 10 when the entries are cohort identifiers)." } } }, "ParentDependency": { "type": "object", "required": ["flag_id"], "properties": { "flag_id": { "type": "string" }, "allowed_variants": { "type": "array", "items": { "type": "string" } } } }, "ParentDependencies": { "type": "object", "required": ["operator", "flags"], "properties": { "operator": { "type": "string", "enum": ["all", "any"] }, "flags": { "type": "array", "items": { "$ref": "#/components/schemas/ParentDependency" } } } }, "Link": { "type": "object", "required": ["url", "title"], "properties": { "url": { "type": "string", "format": "uri" }, "title": { "type": "string" } } }, "FeatureFlagBase": { "type": "object", "required": [ "id", "project_id", "key", "name", "enabled", "evaluation_mode", "variants", "bucketing_key", "rollout_percentage", "rollout_weights", "target_segments", "version", "archived", "tags" ], "properties": { "id": { "type": "string", "readOnly": true }, "project_id": { "type": "string", "pattern": "^[0-9]+$", "readOnly": true }, "key": { "type": "string" }, "name": { "type": "string" }, "description": { "type": ["string", "null"] }, "deployments": { "type": "array", "items": { "type": "string" }, "readOnly": true, "description": "Deployment IDs associated with this flag. Managed via the create/update deployment fields, not set directly on this field." }, "enabled": { "type": "boolean" }, "evaluation_mode": { "type": "string", "enum": ["local", "remote"] }, "variants": { "type": "array", "items": { "$ref": "#/components/schemas/Variant" } }, "bucketing_key": { "type": "string", "description": "Bucketing key used for assignment. Never null in responses; defaults to `amplitude_id` when not explicitly set." }, "bucketing_salt": { "type": ["string", "null"], "readOnly": true }, "bucketing_unit": { "type": ["string", "null"] }, "rollout_percentage": { "type": "integer", "minimum": 0, "maximum": 100 }, "rollout_weights": { "$ref": "#/components/schemas/RolloutWeights" }, "target_segments": { "type": "array", "items": { "$ref": "#/components/schemas/TargetSegment" } }, "testers": { "type": "array", "items": { "$ref": "#/components/schemas/Tester" } }, "owners": { "type": "array", "items": { "type": "string" } }, "tags": { "type": "array", "items": { "type": "string" } }, "created_by": { "type": ["string", "null"], "readOnly": true }, "last_modified_by": { "type": ["string", "null"], "readOnly": true }, "created_at": { "type": ["string", "null"], "format": "date-time", "readOnly": true }, "updated_at": { "type": ["string", "null"], "format": "date-time", "readOnly": true }, "parent_dependencies": { "allOf": [ { "$ref": "#/components/schemas/ParentDependencies" } ], "readOnly": true }, "links": { "type": "array", "items": { "$ref": "#/components/schemas/Link" } }, "version": { "type": "integer", "readOnly": true, "description": "Server-managed config version used for optimistic concurrency." }, "archived": { "type": "boolean", "readOnly": true, "description": "Whether the resource is archived. Set via the archive (DELETE) operation." }, "url": { "type": ["string", "null"], "format": "uri", "readOnly": true } } }, "NudgePlatform": { "type": "string", "enum": ["web", "ios", "android", "react-native", "desktop", "flutter"], "description": "Target platform. Guides and surveys without an explicit platform are\nreturned as `web`.\n" }, "NudgeType": { "type": "string", "enum": ["GUIDE", "SURVEY"], "description": "Whether the resource is a guide or a survey.\n" }, "NudgeStatus": { "type": "string", "enum": [ "draft", "published", "testing", "scheduled", "scheduled-active", "scheduled-inactive", "experiment-running", "experiment-inactive", "archived" ], "description": "Derived rollout state. Read-only on API responses." }, "GuideSurveyPageTarget": { "type": "object", "additionalProperties": false, "required": ["url", "matchType", "isExclude"], "properties": { "url": { "type": "string", "description": "Page URL or pattern for the URL match types." }, "matchType": { "type": "string", "enum": [ "simple", "exact", "pattern", "contains", "startsWith", "endsWith", "regex", "domSelector" ] }, "isExclude": { "type": "boolean", "description": "When true, matching pages are excluded." }, "operator": { "type": "string", "enum": ["and", "or"], "description": "How this rule combines with the next one." }, "value": { "type": "string", "description": "CSS selector of an element that must be on the page. Required for\n`domSelector`, which is web only.\n" } }, "description": "One page rule. An empty list means every page. Keys stay camelCase, and\nno other keys are allowed. Send `url: \"\"` with `domSelector`.\n" }, "GuideSurveySummary": { "type": "object", "required": [ "id", "object", "project_id", "type", "platform", "title", "is_archived", "priority", "status", "status_description", "key", "start_at", "end_at", "url", "created_at", "updated_at", "latest_version" ], "properties": { "id": { "type": "string", "pattern": "^[0-9]+$", "description": "Numeric nudge identifier." }, "object": { "type": "string", "description": "Resource discriminator. `guide` or `survey` on the public API." }, "project_id": { "type": "string", "pattern": "^[0-9]+$" }, "type": { "$ref": "#/components/schemas/NudgeType" }, "platform": { "$ref": "#/components/schemas/NudgePlatform" }, "title": { "type": ["string", "null"] }, "description": { "type": ["string", "null"] }, "is_archived": { "type": "boolean" }, "priority": { "type": "integer", "minimum": 1, "maximum": 4, "description": "Trigger precedence (4 = urgent, 1 = low)." }, "status": { "$ref": "#/components/schemas/NudgeStatus" }, "status_description": { "type": "string" }, "key": { "type": ["string", "null"], "description": "Feature flag key that controls delivery. Matches the\n`[Guides-Surveys] Key` property on SDK-tracked guide and survey events,\nso use it to join events to this guide or survey.\n" }, "start_at": { "type": ["string", "null"], "format": "date-time", "description": "Scheduled start of the live flag. `null` when no start is scheduled.\n" }, "end_at": { "type": ["string", "null"], "format": "date-time", "description": "Scheduled end of the live flag. `null` when no end is scheduled.\n" }, "url": { "type": "string", "format": "uri", "description": "Admin URL for the guide or survey." }, "page_target_segments": { "type": "array", "items": { "$ref": "#/components/schemas/GuideSurveyPageTarget" }, "description": "Pages where the guide or survey is eligible. Empty means every page.\n" }, "tags": { "type": "array", "items": { "type": "string" } }, "created_by": { "type": ["string", "null"] }, "last_modified_by": { "type": ["string", "null"] }, "created_at": { "type": ["string", "null"], "format": "date-time" }, "updated_at": { "type": ["string", "null"], "format": "date-time" }, "latest_version": { "type": "integer", "description": "Monotonic version for optimistic concurrency. Send the value from the\nlatest GET on PATCH; a stale value returns 409.\n" } } }, "GuideSurveyVariantKey": { "type": "string", "pattern": "^[a-z0-9_-]+$", "description": "Variant key within the nudge: lowercase letters, digits, `-` and `_`.\nKeys must be unique. `off` is reserved, and `control` can't be given to\na new variant.\n" }, "GuideSurveyModalPosition": { "type": "string", "enum": [ "top-left", "top-center", "top-right", "bottom-left", "bottom-center", "bottom-right", "left-center", "right-center", "center" ], "description": "Where a modal or popover sits in the viewport." }, "GuideSurveyStepLayout": { "type": "string", "enum": ["classic", "vertical", "showcase", "horizontal"], "description": "Arrangement of media and text in the step." }, "GuideSurveyMediaPosition": { "type": "string", "enum": ["left", "right"], "description": "Media side for the `horizontal` layout." }, "GuideSurveyContentAlignment": { "type": "string", "enum": ["start", "center", "end"] }, "GuideSurveyFooterLayout": { "type": "string", "enum": ["classic", "split", "centered", "stacked"], "description": "Arrangement of the step's buttons." }, "GuideSurveyModalFormFactor": { "type": "object", "additionalProperties": true, "required": ["type"], "properties": { "type": { "type": "string", "const": "modal" }, "position": { "$ref": "#/components/schemas/GuideSurveyModalPosition" }, "canClickOutsideToClose": { "type": "boolean" }, "fullWidthModal": { "type": "boolean" }, "layout": { "$ref": "#/components/schemas/GuideSurveyStepLayout" }, "mediaPosition": { "$ref": "#/components/schemas/GuideSurveyMediaPosition" }, "contentAlignment": { "$ref": "#/components/schemas/GuideSurveyContentAlignment" }, "titleAlignment": { "$ref": "#/components/schemas/GuideSurveyContentAlignment" }, "footerLayout": { "$ref": "#/components/schemas/GuideSurveyFooterLayout" } } }, "GuideSurveyPopoverFormFactor": { "type": "object", "additionalProperties": true, "required": ["type", "position"], "properties": { "type": { "type": "string", "const": "popover" }, "position": { "$ref": "#/components/schemas/GuideSurveyModalPosition" }, "layout": { "$ref": "#/components/schemas/GuideSurveyStepLayout" }, "mediaPosition": { "$ref": "#/components/schemas/GuideSurveyMediaPosition" }, "contentAlignment": { "$ref": "#/components/schemas/GuideSurveyContentAlignment" }, "titleAlignment": { "$ref": "#/components/schemas/GuideSurveyContentAlignment" }, "footerLayout": { "$ref": "#/components/schemas/GuideSurveyFooterLayout" } } }, "GuideSurveyBannerFormFactor": { "type": "object", "additionalProperties": true, "required": ["type", "position", "placement", "sticky"], "properties": { "type": { "type": "string", "const": "banner" }, "position": { "type": "string", "enum": ["top", "bottom"] }, "placement": { "type": "string", "enum": ["default", "overlay"] }, "sticky": { "type": "boolean", "description": "Keep the banner on screen while the page scrolls." }, "layout": { "type": "string", "enum": ["classic", "vertical"] }, "footerLayout": { "type": "string", "const": "classic" }, "contentAlignment": { "$ref": "#/components/schemas/GuideSurveyContentAlignment" }, "titleAlignment": { "$ref": "#/components/schemas/GuideSurveyContentAlignment" } } }, "GuideSurveyAnchorSelector": { "type": "object", "additionalProperties": true, "required": ["selector", "text", "tag", "attributes"], "properties": { "selector": { "type": "string" }, "text": { "type": "string", "description": "Visible text of the element." }, "tag": { "type": "string", "description": "HTML tag name." }, "attributes": { "type": "object", "additionalProperties": { "type": "string" } }, "strategy": { "type": "string", "enum": ["strict", "fallback", "selector_only"] } }, "description": "Richer element match used alongside `anchor`." }, "GuideSurveyOffset": { "type": "object", "additionalProperties": true, "required": ["x", "y"], "properties": { "x": { "type": "string", "description": "CSS length, for example `0px`." }, "y": { "type": "string", "description": "CSS length, for example `0px`." } }, "description": "Both `x` and `y` are required." }, "GuideSurveyPinFormFactor": { "type": "object", "additionalProperties": true, "required": ["type", "anchor"], "properties": { "type": { "type": "string", "const": "pin" }, "anchor": { "type": "string", "description": "CSS selector the pin attaches to." }, "anchorSelector": { "$ref": "#/components/schemas/GuideSurveyAnchorSelector" }, "position": { "type": "string", "enum": ["auto", "top", "bottom", "left", "right"] }, "alignment": { "type": "string", "enum": ["center", "top", "bottom", "left", "right"] }, "offset": { "$ref": "#/components/schemas/GuideSurveyOffset" }, "pointer": { "type": "object", "additionalProperties": true, "required": ["type"], "properties": { "type": { "type": "string", "enum": ["beacon", "arrow"] } } }, "isOpenByDefault": { "type": "boolean" }, "openOnHover": { "type": "boolean" }, "isShowingMask": { "type": "boolean", "description": "Dim the rest of the page." }, "canClickOutsideToClose": { "type": "boolean" }, "advanceTrigger": { "type": "string", "description": "CSS selector whose click advances to the next step." }, "disableAutoAdvanceOnClick": { "type": "boolean" }, "skipIfNotFound": { "type": "boolean", "description": "Skip the step when the anchor is missing." } } }, "GuideSurveyTooltipMarkerPositioning": { "type": "object", "additionalProperties": true, "required": ["position", "offset"], "properties": { "position": { "type": "string", "enum": ["left", "right", "inline_left", "inline_right"] }, "offset": { "$ref": "#/components/schemas/GuideSurveyOffset" } } }, "GuideSurveyTooltipMarker": { "description": "The marker users hover or click to open the tooltip. Every marker type\nalso accepts `width` (number) and `elementIsMarker` (boolean).\n", "oneOf": [ { "type": "object", "additionalProperties": true, "required": ["type", "positioning"], "properties": { "type": { "type": "string", "const": "beacon" }, "positioning": { "$ref": "#/components/schemas/GuideSurveyTooltipMarkerPositioning" } } }, { "type": "object", "additionalProperties": true, "required": ["type", "icon", "positioning"], "properties": { "type": { "type": "string", "const": "icon" }, "icon": { "type": "string", "enum": [ "helpCircle", "helpSquare", "infoCircle", "bookClosed", "lightBulb", "lightning" ] }, "positioning": { "$ref": "#/components/schemas/GuideSurveyTooltipMarkerPositioning" } } }, { "type": "object", "additionalProperties": true, "required": ["type", "source", "positioning"], "properties": { "type": { "type": "string", "const": "image" }, "source": { "type": "string", "description": "Image URL." }, "positioning": { "$ref": "#/components/schemas/GuideSurveyTooltipMarkerPositioning" } } } ] }, "GuideSurveyTooltipFormFactor": { "type": "object", "additionalProperties": true, "required": ["type", "anchor", "showOn", "marker"], "properties": { "type": { "type": "string", "const": "tooltip" }, "anchor": { "type": "string", "description": "CSS selector the tooltip attaches to." }, "showOn": { "type": "string", "enum": ["hover", "click"] }, "marker": { "$ref": "#/components/schemas/GuideSurveyTooltipMarker" }, "anchorSelector": { "$ref": "#/components/schemas/GuideSurveyAnchorSelector" }, "pointer": { "type": "object", "additionalProperties": true, "required": ["type"], "properties": { "type": { "type": "string", "enum": ["arrow", "none"] } } } } }, "GuideSurveyCardSize": { "type": "object", "additionalProperties": true, "required": ["type"], "properties": { "type": { "type": "string", "enum": ["auto", "fixed", "full"] }, "value": { "type": "number", "description": "Pixels, used with `fixed`." } } }, "GuideSurveyCardFormFactor": { "type": "object", "additionalProperties": true, "required": ["type", "anchor", "position"], "properties": { "type": { "type": "string", "const": "card" }, "anchor": { "type": "string", "description": "CSS selector the card attaches to." }, "position": { "type": "string", "enum": ["prepend", "append", "replace", "before", "after"] }, "anchorSelector": { "$ref": "#/components/schemas/GuideSurveyAnchorSelector" }, "alignment": { "$ref": "#/components/schemas/GuideSurveyContentAlignment" }, "cardWidth": { "$ref": "#/components/schemas/GuideSurveyCardSize" }, "cardHeight": { "$ref": "#/components/schemas/GuideSurveyCardSize" }, "cardMargin": { "type": "object", "additionalProperties": true, "required": ["top", "right", "bottom", "left"], "properties": { "top": { "type": "number" }, "right": { "type": "number" }, "bottom": { "type": "number" }, "left": { "type": "number" } } } } }, "GuideSurveyChecklistFormFactor": { "type": "object", "additionalProperties": true, "required": ["type"], "properties": { "type": { "type": "string", "const": "checklist" }, "layout": { "type": "string", "const": "classic" }, "footerLayout": { "type": "string", "const": "classic" } } }, "GuideSurveyStepFormFactor": { "oneOf": [ { "$ref": "#/components/schemas/GuideSurveyModalFormFactor" }, { "$ref": "#/components/schemas/GuideSurveyPopoverFormFactor" }, { "$ref": "#/components/schemas/GuideSurveyBannerFormFactor" }, { "$ref": "#/components/schemas/GuideSurveyPinFormFactor" }, { "$ref": "#/components/schemas/GuideSurveyTooltipFormFactor" }, { "$ref": "#/components/schemas/GuideSurveyCardFormFactor" }, { "$ref": "#/components/schemas/GuideSurveyChecklistFormFactor" } ], "description": "Step layout. `type` selects it. Every form factor also accepts\n`zIndexOverride` (number or null) and `textAnimation` (`typewriter`).\nModal, popover, pin, tooltip, and card accept the step layout keys\n`layout`, `mediaPosition`, `contentAlignment`, `titleAlignment`, and\n`footerLayout`; banner and checklist accept a narrower set. Tooltips and cards can't be snoozed.\n" }, "GuideSurveyMarkdownBlock": { "type": "object", "required": ["type", "meta"], "properties": { "uuid": { "type": ["string", "null"] }, "type": { "type": "string", "const": "markdown" }, "meta": { "type": "object", "required": ["value"], "properties": { "value": { "type": "string", "description": "Markdown text. Inline HTML is allowed and is sanitized on save." }, "alignment": { "$ref": "#/components/schemas/GuideSurveyContentAlignment" }, "textAnimation": { "type": "string", "const": "typewriter" } }, "additionalProperties": true } }, "description": "Body text." }, "GuideSurveyImageBlock": { "type": "object", "required": ["type", "meta"], "properties": { "uuid": { "type": ["string", "null"] }, "type": { "type": "string", "const": "image" }, "meta": { "type": "object", "required": ["src", "filename", "size"], "properties": { "src": { "type": "string", "description": "Image URL." }, "filename": { "type": "string" }, "size": { "type": "string" }, "altText": { "type": "string" }, "style": { "type": "object", "properties": { "scale": { "type": "string" }, "radius": { "type": "string" }, "fit": { "type": "string", "enum": ["cover", "contain"] }, "height": { "type": "string" } }, "additionalProperties": true }, "action": { "type": "object", "additionalProperties": true, "required": ["type", "value"], "properties": { "type": { "type": "string", "const": "link" }, "value": { "type": "string", "description": "URL to open." }, "operation": { "type": "string", "enum": ["self", "blank", "router"] } }, "description": "Optional link opened when the image is clicked. No other action type is allowed." } }, "additionalProperties": true } } }, "GuideSurveyVideoBlock": { "type": "object", "required": ["type", "meta"], "properties": { "uuid": { "type": ["string", "null"] }, "type": { "type": "string", "const": "video" }, "meta": { "type": "object", "required": ["type", "src"], "properties": { "type": { "type": "string", "const": "url" }, "src": { "type": "string", "description": "Video URL, for example a YouTube, Vimeo or Loom link." }, "style": { "type": "object", "properties": { "radius": { "type": "string" } }, "additionalProperties": true } }, "additionalProperties": true } } }, "GuideSurveyButtonAction": { "type": "object", "required": ["type"], "properties": { "type": { "type": "string", "description": "Common actions:\n- `step_forward`, `step_back`: go to the next or previous step.\n- `complete`: finish the guide or survey.\n- `dismiss`: close it.\n- `snooze`: hide it for a while, with optional `interval` (`hour`, `day`, `week`) and `value`.\n- `go_to_step`: jump to a step. `value` is the 0-based position of the step in the variant's `steps`, not its id.\n- `link`: open the URL in `value`; `operation` is `self` (same tab), `blank` (new tab) or `router`.\n- `nudge`: start another guide or survey. `value` is its numeric id, and `productType` is `guide` or `survey`.\n- `no_action`: no action of its own. The button still advances: to the next step, or on the last step it finishes the guide or survey. The dashboard's survey templates use it for the submit button. It does not keep the user on the step; `stay_on_step` does.\n\nButtons built in the dashboard can also use `stay_on_step`,\n`click` (`value` is a CSS selector), `callback`, `app_review`,\n`open_resource_center`, `open_ai_assistant`, `open_chat`, `document`,\n`video`, and `use_conditional_logic`. Send those back unchanged.\n" } }, "additionalProperties": true, "example": { "type": "link", "value": "https://example.com/pricing", "operation": "blank" } }, "GuideSurveyButtonBlock": { "type": "object", "required": ["type", "meta"], "properties": { "uuid": { "type": ["string", "null"] }, "type": { "type": "string", "const": "button" }, "meta": { "type": "object", "properties": { "label": { "type": "string" }, "buttonType": { "type": "string", "enum": ["primary", "secondary", "snooze"] }, "action": { "$ref": "#/components/schemas/GuideSurveyButtonAction" }, "grow": { "type": "boolean", "description": "Stretch the button to fill the footer row." }, "width": { "type": "string", "description": "CSS width, for example `100%`." }, "actions": { "type": "object", "additionalProperties": true, "description": "Optional action sequence the dashboard writes for buttons with side\neffects: `{type: \"action_sequence\", navigation: , effects: []}`.\nWhen present, the SDK runs it instead of `action`, so update both or\nneither.\n" } }, "additionalProperties": true } } }, "GuideSurveyQuestionValidation": { "type": "object", "properties": { "required": { "type": "object", "required": ["value"], "properties": { "value": { "type": "boolean" }, "message": { "type": ["string", "null"], "description": "Error shown when a required question is left empty. Required when `value` is `true`." } }, "additionalProperties": false } }, "additionalProperties": true }, "GuideSurveyTextQuestionBlock": { "type": "object", "required": ["type", "meta"], "properties": { "uuid": { "type": ["string", "null"] }, "type": { "type": "string", "enum": ["survey_text", "survey_text_short"], "description": "`survey_text` is a multi-line answer; `survey_text_short` is a single line." }, "meta": { "type": "object", "required": ["prompt"], "properties": { "prompt": { "type": "string", "description": "Placeholder shown in the empty answer field. Required; send `\"\"` for none." }, "label": { "type": "string" }, "ariaLabel": { "type": "string" }, "prefill": { "type": "object", "required": ["enabled", "userProperty"], "properties": { "enabled": { "type": "boolean" }, "userProperty": { "type": "string", "description": "User property whose value fills the answer." } }, "additionalProperties": true, "description": "`survey_text_short` only." }, "validation": { "$ref": "#/components/schemas/GuideSurveyQuestionValidation" } }, "additionalProperties": true } }, "description": "Free-text survey question. Put the question itself in a `markdown` block or the step `title`." }, "GuideSurveyListQuestionBlock": { "type": "object", "required": ["type", "meta"], "properties": { "uuid": { "type": ["string", "null"] }, "type": { "type": "string", "const": "survey_list" }, "meta": { "type": "object", "required": ["options", "listType", "displayType"], "properties": { "options": { "type": "array", "items": { "type": "string" } }, "listType": { "type": "string", "enum": ["single", "multiple"] }, "displayType": { "type": "string", "enum": ["list", "dropdown", "grid"] }, "isOrderRandom": { "type": "boolean" }, "otherOption": { "type": "object", "required": ["enabled", "label", "placeholderLabel"], "properties": { "enabled": { "type": "boolean" }, "label": { "type": "string" }, "placeholderLabel": { "type": "string" } }, "additionalProperties": false }, "label": { "type": "string" }, "validation": { "$ref": "#/components/schemas/GuideSurveyQuestionValidation" } }, "additionalProperties": true } }, "description": "Multiple-choice survey question." }, "GuideSurveyRatingQuestionBlock": { "type": "object", "required": ["type", "meta"], "properties": { "uuid": { "type": ["string", "null"] }, "type": { "type": "string", "const": "survey_rating" }, "meta": { "type": "object", "required": ["type", "options", "lowerLabel", "upperLabel"], "properties": { "type": { "type": "string", "enum": ["stars", "numbers", "emojis", "nps"], "description": "`nps` is a 0–10 scale and takes `options: 10`." }, "options": { "type": "integer", "description": "Number of choices on the scale. Allowed values depend on `type`:\n`stars` 3 or 5, `numbers` 3, 5, 7 or 10, `emojis` 2, 3 or 5, and\n`nps` 10.\n" }, "emojis": { "type": "array", "items": { "type": "string" }, "description": "Exactly one emoji per option. Required when `type` is `emojis`." }, "lowerLabel": { "type": "string" }, "upperLabel": { "type": "string" }, "label": { "type": "string" }, "validation": { "$ref": "#/components/schemas/GuideSurveyQuestionValidation" } }, "additionalProperties": true } }, "description": "Rating survey question." }, "GuideSurveyHiddenFieldBlock": { "type": "object", "required": ["type", "meta"], "properties": { "uuid": { "type": ["string", "null"] }, "type": { "type": "string", "const": "survey_hidden" }, "meta": { "type": "object", "required": ["label", "source"], "properties": { "label": { "type": "string" }, "source": { "oneOf": [ { "type": "object", "required": ["type", "value"], "properties": { "type": { "type": "string", "const": "static" }, "value": { "type": "string", "description": "The value to record." } }, "additionalProperties": false }, { "type": "object", "required": ["type", "property"], "properties": { "type": { "type": "string", "const": "event_property" }, "property": { "type": "string", "description": "Property of the event that triggered the survey." } }, "additionalProperties": false } ] } }, "additionalProperties": false } }, "description": "Not shown to the user. Adds a value to each survey response." }, "GuideSurveyContentBlock": { "oneOf": [ { "$ref": "#/components/schemas/GuideSurveyMarkdownBlock" }, { "$ref": "#/components/schemas/GuideSurveyImageBlock" }, { "$ref": "#/components/schemas/GuideSurveyVideoBlock" }, { "$ref": "#/components/schemas/GuideSurveyButtonBlock" }, { "$ref": "#/components/schemas/GuideSurveyTextQuestionBlock" }, { "$ref": "#/components/schemas/GuideSurveyListQuestionBlock" }, { "$ref": "#/components/schemas/GuideSurveyRatingQuestionBlock" }, { "$ref": "#/components/schemas/GuideSurveyHiddenFieldBlock" } ], "description": "One content block. `type` selects the block and the shape of `meta`." }, "GuideSurveyStepContent": { "type": "array", "items": { "$ref": "#/components/schemas/GuideSurveyContentBlock" }, "description": "The step body: content blocks rendered top to bottom, below the step\n`title`. `meta` keys are camelCase. Keep a block's existing `uuid` when\nyou edit it, because survey responses are keyed by it; a block sent\nwithout one (or with `null`) is given one on save. To change one block,\nsend the step's whole `content` array back with that block edited. Send\n`[]` for an empty step, not `null`.\n\nA step can have at most one `markdown` block, one `image` or one `video`\n(not both), two buttons, ten survey questions, and ten `survey_hidden`\nfields. Survey question blocks are only allowed in surveys, and only on\nsteps with the `classic` or `vertical` layout. A checklist item can have\nat most one button. A snooze button needs the variant's `snooze_label`.\n", "example": [ { "uuid": "3f0c2a8e-5b1d-4c7a-9e2f-1a6b8d4c0e11", "type": "markdown", "meta": { "value": "Track any event in two clicks." } }, { "uuid": "8d2e6f1a-7c3b-4e9d-a0f5-2b7c9e1d3a42", "type": "button", "meta": { "label": "Next", "buttonType": "primary", "action": { "type": "step_forward" } } } ] }, "GuideSurveyContentV2Container": { "type": "object", "additionalProperties": true, "required": ["type", "children"], "properties": { "type": { "type": "string", "const": "layout" }, "children": { "type": "array", "items": { "oneOf": [ { "$ref": "#/components/schemas/GuideSurveyContentV2Container" }, { "$ref": "#/components/schemas/GuideSurveyContentBlock" }, { "$ref": "#/components/schemas/GuideSurveyTitleBlock" }, { "$ref": "#/components/schemas/GuideSurveyStepCounterBlock" } ] } }, "id": { "type": "string", "description": "Container id, unique within the step." }, "direction": { "type": "string", "enum": ["row", "column"] }, "justify": { "type": "string", "enum": ["start", "center", "end", "space-between", "space-around"] }, "align": { "$ref": "#/components/schemas/GuideSurveyContentAlignment" }, "gap": { "type": "string", "description": "CSS length, for example `8px`." }, "padding": { "type": "string" }, "margin": { "type": "string" }, "pinned": { "type": "boolean" }, "wrap": { "type": "boolean" }, "overflow": { "type": "string", "enum": ["auto", "hidden"] }, "minHeight": { "type": "string" }, "width": { "type": "string" } }, "description": "A block-builder container. `children` are containers or content blocks,\nplus the `title` and `step_counter` blocks that only exist in trees.\n" }, "GuideSurveyTitleBlock": { "type": "object", "additionalProperties": true, "required": ["type", "meta"], "properties": { "uuid": { "type": ["string", "null"] }, "type": { "type": "string", "const": "title" }, "meta": { "type": "object", "additionalProperties": true, "required": ["value"], "properties": { "value": { "type": "string" }, "alignment": { "$ref": "#/components/schemas/GuideSurveyContentAlignment" }, "textAnimation": { "type": "string", "const": "typewriter" } } } }, "description": "The step title inside a block-builder tree." }, "GuideSurveyStepCounterBlock": { "type": "object", "additionalProperties": true, "required": ["type", "meta"], "properties": { "uuid": { "type": ["string", "null"] }, "type": { "type": "string", "const": "step_counter" }, "meta": { "type": "object", "additionalProperties": true, "properties": { "format": { "type": "string", "enum": ["numeric", "verbose"] } } } }, "description": "Shows the step number inside a block-builder tree." }, "GuideSurveyStepContentV2": { "oneOf": [ { "$ref": "#/components/schemas/GuideSurveyContentV2Container" }, { "type": "null" } ], "description": "Block-builder layout: a tree of `layout` containers whose `children`\nare containers or content blocks, including the step's `title` block.\nReturned only on steps built in the block builder; when present, the\ndashboard and SDK render this tree, not `title` and `content`.\n\nOn update, only accepted on resources that already have a step with a\ntree; a flat-only guide or survey can't be converted through the API.\nOn create, any step may take one, so a resource read with `content_v2`\ncan be copied. Block `uuid`s must be unique within the step. Keep a block's\nexisting `uuid` when you edit it, because survey responses are keyed by\nit; a block sent without one is given one on save. The saved tree is\nnormalized to the shape the block builder saves, and the step title is\ntaken from its `title` block. On a step with a tree, send `title` and\n`content` only together with `content_v2`. Not supported on banner or\nchecklist steps or on mobile platforms. `null` switches the step back\nto `content`.\n" }, "GuideSurveyStepInput": { "type": "object", "description": "Step payload on create/update. `id` is optional — omit for new steps; include\nwhen updating an existing step row. A negative `id` is a step added to a\npublished guide or survey's draft that has not been published yet.\n", "properties": { "id": { "type": "string" }, "title": { "type": "string", "maxLength": 255, "description": "Step title. Omit it to leave it unchanged; `null` is rejected." }, "form_factor": { "$ref": "#/components/schemas/GuideSurveyStepFormFactor" }, "content": { "$ref": "#/components/schemas/GuideSurveyStepContent" }, "content_v2": { "$ref": "#/components/schemas/GuideSurveyStepContentV2" }, "sort_key": { "type": ["integer", "null"], "description": "Ignored on input. Steps are shown in the order of `steps`." } }, "additionalProperties": false }, "GuideSurveyVariantInput": { "type": "object", "description": "Variant payload on create/update. `id` is optional — omit for new variants;\ninclude when updating an existing variant row. A negative `id` is a variant\nadded to a published guide or survey's draft that has not been published yet.\n`variant` key is required. Create doesn't take translations: create the\nguide or survey, then send `translations` with an update.\n", "required": ["variant"], "properties": { "id": { "type": "string" }, "variant": { "$ref": "#/components/schemas/GuideSurveyVariantKey" }, "display_title": { "type": "string", "description": "Variant title. Omit it to leave it unchanged; `null` is rejected." }, "display_description": { "type": ["string", "null"] }, "snooze_label": { "type": "string", "maxLength": 255, "description": "Snooze button label for this variant. Omit it to leave it unchanged; `null` is rejected." }, "done_label": { "type": "string", "maxLength": 255, "description": "Label of the last step's button. Omit it to leave it unchanged; `null` is rejected." }, "steps": { "type": "array", "minItems": 1, "items": { "$ref": "#/components/schemas/GuideSurveyStepInput" } } }, "additionalProperties": false }, "GuideSurveyImmediateTrigger": { "type": "object", "additionalProperties": true, "required": ["type"], "properties": { "type": { "type": "string", "enum": ["immediately", "none"] } }, "description": "`immediately` shows as soon as the page matches. `none` does not fire on\nits own. Neither accepts `data.delay`, and neither can be combined with\nother triggers.\n" }, "GuideSurveyTriggerFilter": { "type": "object", "additionalProperties": true, "required": ["subprop_key", "subprop_op", "subprop_value"], "properties": { "subprop_key": { "type": "string", "minLength": 1, "description": "Property name." }, "subprop_op": { "type": "string", "description": "Comparison operator, for example `is`, `is not`, or `contains`." }, "subprop_value": { "type": "array", "minItems": 1, "items": { "type": "string" }, "description": "Values to compare against." }, "subprop_type": { "type": ["string", "null"], "description": "Property type, for example `event` or `user`." }, "group_type": { "type": ["string", "null"] } }, "description": "One property condition." }, "GuideSurveyBehaviorTrigger": { "type": "object", "additionalProperties": true, "required": ["type"], "properties": { "type": { "type": "string", "enum": [ "smart_delay", "rage_click", "user_confusion", "exit_intent" ] }, "data": { "type": "object", "additionalProperties": true, "properties": { "delay": { "type": "number", "minimum": 0, "description": "Milliseconds to wait after the trigger fires. Omit it rather than sending null." }, "sessionPropertyFilters": { "type": "array", "description": "Session property conditions. The inner arrays are AND groups, and\nthe outer array ORs them.\n", "items": { "type": "array", "items": { "$ref": "#/components/schemas/GuideSurveyTriggerFilter" } } } } } }, "description": "Fires on user behavior. `user_confusion` and `exit_intent` are web only.\n" }, "GuideSurveyElementTrigger": { "type": "object", "additionalProperties": true, "required": ["type", "data"], "properties": { "type": { "type": "string", "enum": ["element_appeared", "element_clicked"] }, "data": { "type": "object", "additionalProperties": true, "required": ["selector"], "properties": { "selector": { "type": "string", "description": "CSS selector of the element." }, "delay": { "type": "number", "minimum": 0, "description": "Milliseconds to wait after the element appears or is clicked." } } } }, "description": "Fires when a CSS selector appears or is clicked." }, "GuideSurveyEventTrigger": { "type": "object", "additionalProperties": true, "required": ["type", "data"], "properties": { "type": { "type": "string", "const": "analytics_event" }, "data": { "type": "object", "additionalProperties": true, "required": ["event"], "properties": { "event": { "type": "string", "description": "Analytics event type that fires the trigger." }, "event_count": { "type": "integer", "minimum": 1, "description": "Times the event must occur. Omitted means once." }, "delay": { "type": "number", "minimum": 0, "description": "Milliseconds to wait after the event count is reached." }, "filters": { "type": "array", "description": "Event property conditions. Every condition must match.", "items": { "$ref": "#/components/schemas/GuideSurveyTriggerFilter" } } } } }, "description": "Fires after an analytics event." }, "GuideSurveyAfterTimeTrigger": { "type": "object", "additionalProperties": true, "required": ["type", "data"], "properties": { "type": { "type": "string", "const": "after_time" }, "data": { "type": "object", "additionalProperties": true, "required": ["unit", "value"], "properties": { "unit": { "type": "string", "enum": ["second", "minute"] }, "value": { "type": "number", "description": "How long to wait on the page before showing." } } } }, "description": "Fires after the user has been on the page for `value` `unit`s. Does not\naccept `data.delay`.\n" }, "GuideSurveyTrigger": { "oneOf": [ { "$ref": "#/components/schemas/GuideSurveyImmediateTrigger" }, { "$ref": "#/components/schemas/GuideSurveyBehaviorTrigger" }, { "$ref": "#/components/schemas/GuideSurveyElementTrigger" }, { "$ref": "#/components/schemas/GuideSurveyEventTrigger" }, { "$ref": "#/components/schemas/GuideSurveyAfterTimeTrigger" } ], "description": "One trigger. `type` selects which fields `data` uses." }, "GuideSurveyTriggerConfig": { "description": "When the guide or survey appears. One trigger, or an array of triggers\nwhere any match fires it. Nested keys keep their stored names (`selector`,\n`event`, `event_count`, `delay`, `filters`). Don't send `null`: the dashboard can't open a\nguide or survey without a trigger. Send `{\"type\": \"immediately\"}` to\nshow right away.\n", "x-help-schema": true, "oneOf": [ { "$ref": "#/components/schemas/GuideSurveyTrigger" }, { "type": "array", "minItems": 1, "items": { "$ref": "#/components/schemas/GuideSurveyTrigger" } } ] }, "GuideSurveyCooldownLimit": { "type": "object", "additionalProperties": true, "required": ["max", "period"], "properties": { "max": { "type": "integer", "minimum": 1, "description": "Maximum impressions in the period." }, "periodCount": { "type": "integer", "minimum": 1, "description": "How many `period`s the limit covers. Omitted means 1." }, "period": { "type": "string", "enum": ["day", "week", "month", "year", "session"] } } }, "GuideSurveyLifecycle": { "type": "object", "additionalProperties": true, "x-help-schema": true, "description": "How often the guide or survey may show again. `periodCount` is camelCase;\nthe other keys are snake_case. Send the whole object, not `null`.\n", "required": [ "stop_showing_if_completed", "stop_showing_if_dismissed", "cooldown_limits" ], "properties": { "stop_showing_if_completed": { "type": "boolean" }, "stop_showing_if_dismissed": { "type": "boolean" }, "survey_response_cap": { "type": "object", "additionalProperties": true, "properties": { "enabled": { "type": "boolean" }, "value": { "type": "integer", "minimum": 1, "description": "Stop after this many survey responses. Required when `enabled` is true." } } }, "cooldown_limits": { "type": "array", "items": { "$ref": "#/components/schemas/GuideSurveyCooldownLimit" } }, "even_distribution": { "type": "object", "additionalProperties": true, "required": ["enabled", "recurrence_period_days"], "properties": { "enabled": { "type": "boolean" }, "recurrence_period_days": { "type": "integer", "minimum": 1, "description": "Days over which impressions are spread evenly. Always required when `even_distribution` is sent." } } } } }, "GuideSurveySnoozeDuration": { "type": "object", "additionalProperties": true, "required": ["interval", "value"], "x-help-schema": true, "description": "How long a snooze lasts.", "properties": { "interval": { "type": "string", "enum": ["hour", "day", "week"] }, "value": { "type": "number", "exclusiveMinimum": 0, "description": "Number of intervals." } } }, "GuideSurveyStep": { "type": "object", "required": ["id"], "properties": { "id": { "type": "string" }, "title": { "type": ["string", "null"], "maxLength": 255 }, "form_factor": { "$ref": "#/components/schemas/GuideSurveyStepFormFactor" }, "content": { "$ref": "#/components/schemas/GuideSurveyStepContent" }, "content_v2": { "$ref": "#/components/schemas/GuideSurveyStepContentV2" }, "sort_key": { "type": ["integer", "null"] } }, "additionalProperties": false }, "GuideSurveyTranslationValue": { "description": "Translated text. `content.survey_list` keys take an array of option\nlabels in the same order as the source; every other key takes a string.\nMarkdown and title HTML is sanitized like step content.\n", "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] }, "GuideSurveyTranslations": { "type": "object", "readOnly": true, "description": "Stored translations, locale to translation key to text. Returned with\n`include_translations=true` and on updates that send translations.\n", "additionalProperties": { "type": "object", "additionalProperties": { "$ref": "#/components/schemas/GuideSurveyTranslationValue" } } }, "GuideSurveyTranslationStatus": { "type": "object", "readOnly": true, "description": "What is left to translate. `sources` lists every translatable key with its\ncurrent default-locale text. Per locale, `missing` keys have no\ntranslation and `outdated` keys were translated from text that has since\nchanged.\n", "required": ["sources", "locales"], "properties": { "sources": { "type": "object", "additionalProperties": { "$ref": "#/components/schemas/GuideSurveyTranslationValue" } }, "locales": { "type": "object", "additionalProperties": { "type": "object", "required": ["missing", "outdated"], "properties": { "missing": { "type": "array", "items": { "type": "string" } }, "outdated": { "type": "array", "items": { "type": "string" } } } } } } }, "GuideSurveyVariant": { "type": "object", "required": ["id", "variant"], "properties": { "id": { "type": "string" }, "variant": { "$ref": "#/components/schemas/GuideSurveyVariantKey" }, "display_title": { "type": ["string", "null"] }, "display_description": { "type": ["string", "null"] }, "snooze_label": { "type": ["string", "null"], "maxLength": 255 }, "done_label": { "type": ["string", "null"], "maxLength": 255 }, "steps": { "type": "array", "items": { "$ref": "#/components/schemas/GuideSurveyStep" } }, "translations": { "$ref": "#/components/schemas/GuideSurveyTranslations" }, "translation_status": { "$ref": "#/components/schemas/GuideSurveyTranslationStatus" } } }, "ExperimentVariantSummary": { "type": "object", "required": ["key"], "properties": { "key": { "type": "string" }, "name": { "type": ["string", "null"] }, "description": { "type": ["string", "null"] }, "payload": { "description": "Optional JSON payload associated with the experiment variant." } } }, "GuideSurveyLocalization": { "type": "object", "readOnly": true, "description": "The project's localization settings. `locales` are the languages other\nthan `default_locale` that translations can be written for. Configure them\nin project settings. When localization is disabled, only `enabled: false`\nis returned and variants carry no `translations` or `translation_status`.\n", "required": ["enabled"], "properties": { "enabled": { "type": "boolean" }, "default_locale": { "type": "string" }, "locales": { "type": "array", "items": { "type": "string" } } } }, "GuideSurveyDetail": { "type": "object", "properties": { "temporarily_hide_page_target_segments": { "type": "array", "items": { "$ref": "#/components/schemas/GuideSurveyPageTarget" }, "description": "Page rules that are saved but not currently applied." }, "hide_if_page_targeting_not_met": { "type": "boolean" }, "trigger_config": { "$ref": "#/components/schemas/GuideSurveyTriggerConfig" }, "lifecycle": { "$ref": "#/components/schemas/GuideSurveyLifecycle" }, "dismissible": { "type": "boolean" }, "snoozable": { "type": "boolean" }, "snoozable_on_all_steps": { "type": "boolean" }, "snooze_duration": { "$ref": "#/components/schemas/GuideSurveySnoozeDuration" }, "snooze_label": { "type": ["string", "null"] }, "template_source": { "type": ["string", "null"] }, "show_step_counter": { "type": "boolean" }, "step_counter_format": { "type": ["string", "null"] }, "theme_id": { "type": ["string", "null"], "pattern": "^[0-9]+$", "readOnly": true, "description": "Theme applied to this guide or survey. `null` means the project's\ndefault theme for the platform. Fetch it with the Themes API.\n" }, "variants": { "type": "array", "items": { "$ref": "#/components/schemas/GuideSurveyVariant" } }, "experiment_variants": { "type": "array", "items": { "$ref": "#/components/schemas/ExperimentVariantSummary" }, "description": "Read-only experiment variant keys when the nudge is experiment-backed." }, "flag_config": { "oneOf": [ { "$ref": "#/components/schemas/FeatureFlag" }, { "type": "null" } ], "readOnly": true, "description": "The Experiment feature flag that delivers this nudge, in the same\nshape as the Feature Flags API. Includes audience targeting\n(`target_segments`) and rollout. With\n`include_unpublished_changes=true`, draft rollout and targeting\nsettings are applied over the live flag.\n" }, "localization": { "$ref": "#/components/schemas/GuideSurveyLocalization" } } }, "GuideSurveyTranslationsInput": { "type": "object", "description": "Locale (one of `localization.locales`) to translation key to text.\nMerged into the stored translations: keys you leave out are kept, `null`\nclears a key, and `null` for a locale clears every key in it.\n\nKeys name a field by where it sits in the variant: `display_title`,\n`display_description`, `snooze_label`, `done_label`;\n`steps[].title`; and block fields as\n`steps[].blocks[].`, for example\n`content.markdown`, `content.title`, `content.button[primary]`,\n`content.survey_rating.lowerLabel`, or `content.survey_list`. Copy keys\nfrom `translation_status.sources` instead of building them. A key must\nname a field that has default-locale text.\n", "additionalProperties": { "oneOf": [ { "type": "null" }, { "type": "object", "additionalProperties": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/GuideSurveyTranslationValue" } ] } } ] }, "example": { "fr": { "steps[123].title": "Bienvenue", "steps[123].blocks[3f0c1d2e-0000-4000-8000-000000000001].content.markdown": "Ravi de vous voir." }, "de": null } }, "GuideSurveyVariantUpdateInput": { "type": "object", "description": "Variant payload on update. `id` names an existing variant. `variant` may be\nomitted; when sent it must equal the stored key. An entry that carries only\n`id` and `translations` is translation-only: a list made of\ntranslation-only entries may name a subset of the variants. Any other\nfield on any entry makes it a content update, which must list every\nvariant.\n", "properties": { "id": { "type": "string" }, "variant": { "$ref": "#/components/schemas/GuideSurveyVariantKey" }, "display_title": { "type": "string", "description": "Variant title. Omit it to leave it unchanged; `null` is rejected." }, "display_description": { "type": ["string", "null"] }, "snooze_label": { "type": "string", "maxLength": 255, "description": "Snooze button label for this variant. Omit it to leave it unchanged; `null` is rejected." }, "done_label": { "type": "string", "maxLength": 255, "description": "Label of the last step's button. Omit it to leave it unchanged; `null` is rejected." }, "steps": { "type": "array", "minItems": 1, "items": { "$ref": "#/components/schemas/GuideSurveyStepInput" } }, "translations": { "$ref": "#/components/schemas/GuideSurveyTranslationsInput" } }, "additionalProperties": false }, "ThemeVariablesPatch": { "type": ["object", "null"], "additionalProperties": { "oneOf": [ { "type": "string" }, { "type": "number" }, { "type": "null" } ] }, "description": "Variables to set, or `null` to reset a variable to its default. Setting a\nname that isn't a known theme variable returns `400`. `null` is\naccepted for any name, so you can remove one stored earlier.\n" }, "ThemeVariables": { "type": "object", "additionalProperties": { "oneOf": [ { "type": "string" }, { "type": "number" } ] }, "description": "CSS variable values keyed by variable name. Colors accept any CSS color\n(`#ff0000`, `rgb()`, `color-mix()`, `var(--token)`). Sizes need a unit\n(`12px`, `1.5rem`, `100%`). Numbers such as font weights may be JSON\nnumbers or numeric strings. Any value may reference another variable with\n`var(--name)`.\n", "example": { "--base-accent": "rgb(120, 86, 255)", "--font-size-base": "14px", "--font-weight-bold": 700 } }, "DestinationConnectorKind": { "type": "string", "enum": ["event", "identify", "cohort", "warehouse_export"], "description": "Authoritative connector kind on a destination. `event`/`identify`/`cohort`\nare for streaming and cohort destinations; `warehouse_export` is for\nwarehouse-export destinations. Routing is derived from the array of these\nvalues, so there is no separate routing field. `warehouse_export` cannot\nbe combined with the other kinds.\n" }, "DestinationCredentialStatus": { "type": "string", "enum": ["connected", "disconnected", "expired"] }, "DestinationEventFilter": { "type": "object", "required": ["events"], "properties": { "events": { "type": "array", "items": { "type": "string" }, "minItems": 1 }, "property_filters": { "type": "object", "additionalProperties": true } } }, "PlanAction": { "type": "string", "enum": ["create", "update", "noop"] }, "PlanDiffEntry": { "type": "object", "required": ["from", "to"], "properties": { "from": {}, "to": {} } }, "DestinationTestResult": { "type": "object", "required": ["ok"], "properties": { "ok": { "type": "boolean" }, "detail": { "type": ["string", "null"] }, "example_payload": { "oneOf": [ { "type": "object", "additionalProperties": true }, { "type": "null" } ] } } } } } }