{
  "openapi": "3.1.0",
  "info": {
    "title": "Confidence API",
    "version": "1.0.0",
    "summary": "Warehouse-native experimentation and feature management platform by Spotify.",
    "description": "The Confidence API lets you manage feature flags, run A/B tests and rollouts, define metrics, and perform statistical analysis — all on top of your own data warehouse.\n\nThis document is an index of the available API surfaces. Each workflow has its own detailed OpenAPI specification linked below.\n\n## Workflow specifications\n\n- [A/B Test workflow](/openapi/abtest.json) — create, launch, monitor, and end A/B tests\n- [Rollout workflow](/openapi/rollout.json) — create, launch, ramp, and end rollouts\n- [Reanalysis workflow](/openapi/reanalysis.json) — re-run statistical analysis on past experiments\n\n## Additional API surfaces\n\nThe Confidence platform exposes additional APIs for flags, metrics, stats, IAM, and connectors. See the [API documentation](https://confidence.spotify.com/docs/api/quickstart) for full reference.\n\n## Authentication\n\nAll API requests require a Bearer token. Create an API client in the Confidence console under Settings → API Clients. Pass the token in the `Authorization: Bearer <token>` header.",
    "contact": {
      "name": "Confidence Team",
      "url": "https://confidence.spotify.com/contact"
    },
    "license": {
      "name": "Proprietary"
    },
    "termsOfService": "https://confidence.spotify.com/terms-of-service"
  },
  "externalDocs": {
    "description": "Confidence API documentation",
    "url": "https://confidence.spotify.com/docs/api/quickstart"
  },
  "servers": [
    {
      "url": "https://experiments.confidence.dev",
      "description": "Production (US)"
    },
    {
      "url": "https://experiments.eu.confidence.dev",
      "description": "Production (EU)"
    },
    {
      "url": "https://experiments.us.confidence.dev",
      "description": "Production (US, explicit region)"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "A/B Tests",
      "description": "Create, launch, monitor, and end A/B tests. Full schema: [openapi/abtest.json](https://confidence.spotify.com/openapi/abtest.json)"
    },
    {
      "name": "Rollouts",
      "description": "Create, launch, ramp, and end feature rollouts. Full schema: [openapi/rollout.json](https://confidence.spotify.com/openapi/rollout.json)"
    },
    {
      "name": "Reanalysis",
      "description": "Re-run statistical analysis on completed experiments. Full schema: [openapi/reanalysis.json](https://confidence.spotify.com/openapi/reanalysis.json)"
    },
    {
      "name": "Site Search",
      "description": "Search Confidence documentation and marketing content."
    }
  ],
  "paths": {
    "/v1/workflows/abtest": {
      "summary": "A/B test workflow",
      "description": "Create and manage A/B tests. See [openapi/abtest.json](https://confidence.spotify.com/openapi/abtest.json) for the full specification including request and response schemas.",
      "post": {
        "operationId": "Abtest.create",
        "summary": "Create a new A/B test",
        "description": "Creates a new A/B test workflow instance. Specify the experiment display name, owner, flag to test, treatments, audience, metrics, and statistical settings. Returns the created workflow instance including its unique resource name.",
        "tags": ["A/B Tests"],
        "externalDocs": {
          "description": "Full A/B test workflow OpenAPI specification",
          "url": "https://confidence.spotify.com/openapi/abtest.json"
        },
        "responses": {
          "200": {
            "description": "A/B test created successfully."
          }
        }
      }
    },
    "/v1/workflows/abtest/instances": {
      "summary": "List A/B test instances",
      "get": {
        "operationId": "Abtest.list",
        "summary": "List A/B test instances",
        "description": "Returns a paginated list of A/B test workflow instances. Use pageToken for pagination. Each instance includes its current state, configuration, and metadata.",
        "tags": ["A/B Tests"],
        "responses": {
          "200": {
            "description": "List of A/B test instances."
          }
        }
      }
    },
    "/v1/workflows/rollout": {
      "summary": "Rollout workflow",
      "description": "Create and manage rollouts. See [openapi/rollout.json](https://confidence.spotify.com/openapi/rollout.json) for the full specification including request and response schemas.",
      "post": {
        "operationId": "Rollout.create",
        "summary": "Create a new rollout",
        "description": "Creates a new rollout workflow instance. Define the rollout display name, owner, flag, treatment, ramp percentage, audience, and monitoring metrics. Returns the created workflow instance.",
        "tags": ["Rollouts"],
        "externalDocs": {
          "description": "Full rollout workflow OpenAPI specification",
          "url": "https://confidence.spotify.com/openapi/rollout.json"
        },
        "responses": {
          "200": {
            "description": "Rollout created successfully."
          }
        }
      }
    },
    "/v1/workflows/rollout/instances": {
      "summary": "List rollout instances",
      "get": {
        "operationId": "Rollout.list",
        "summary": "List rollout instances",
        "description": "Returns a paginated list of rollout workflow instances. Use pageToken for pagination. Each instance includes its current state, ramp percentage, and metadata.",
        "tags": ["Rollouts"],
        "responses": {
          "200": {
            "description": "List of rollout instances."
          }
        }
      }
    },
    "/v1/workflows/reanalysis": {
      "summary": "Reanalysis workflow",
      "description": "Re-run statistical analysis on past experiments. See [openapi/reanalysis.json](https://confidence.spotify.com/openapi/reanalysis.json) for the full specification including request and response schemas.",
      "post": {
        "operationId": "Reanalysis.create",
        "summary": "Create a new reanalysis",
        "description": "Creates a new reanalysis workflow instance to re-run the statistical analysis on a previously completed experiment. Specify the source experiment, metric overrides, and analysis parameters. Returns the created workflow instance.",
        "tags": ["Reanalysis"],
        "externalDocs": {
          "description": "Full reanalysis workflow OpenAPI specification",
          "url": "https://confidence.spotify.com/openapi/reanalysis.json"
        },
        "responses": {
          "200": {
            "description": "Reanalysis created successfully."
          }
        }
      }
    },
    "/api/search": {
      "summary": "Search Confidence documentation",
      "servers": [
        {
          "url": "https://confidence.spotify.com",
          "description": "Confidence website"
        }
      ],
      "get": {
        "operationId": "Site.search",
        "summary": "Search documentation and content",
        "description": "Full-text search over Confidence documentation, blog posts, glossary terms, comparisons, and marketing pages. Returns up to 5 matching results ranked by relevance. No authentication required.",
        "tags": ["Site Search"],
        "security": [],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Search query string (max 200 characters).",
            "schema": {
              "type": "string",
              "maxLength": 200,
              "minLength": 1
            }
          },
          {
            "name": "bootcamp",
            "in": "query",
            "required": false,
            "description": "Set to \"1\" to include Confidence Bootcamp learning content in results.",
            "schema": {
              "type": "string",
              "enum": ["1"]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Search results.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Missing or empty query parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "API client token from the Confidence console (Settings → API Clients)"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "description": "Standard error response.",
        "required": ["error"],
        "properties": {
          "error": {
            "type": "object",
            "required": ["code", "message"],
            "properties": {
              "code": {
                "type": "string",
                "description": "Machine-readable error code.",
                "examples": ["NOT_FOUND", "MISSING_PARAMETER", "EMPTY_QUERY"]
              },
              "message": {
                "type": "string",
                "description": "Human-readable error message."
              },
              "hint": {
                "type": "string",
                "description": "Suggestion for how to fix the error."
              }
            }
          }
        }
      },
      "SearchResponse": {
        "type": "object",
        "description": "Documentation search results.",
        "required": ["results"],
        "properties": {
          "results": {
            "type": "array",
            "description": "Matching documents, ranked by relevance (max 5).",
            "maxItems": 5,
            "items": {
              "$ref": "#/components/schemas/SearchResult"
            }
          }
        }
      },
      "SearchResult": {
        "type": "object",
        "description": "A single search result pointing to a documentation page or section.",
        "required": ["url", "title"],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Absolute URL of the matching page or section."
          },
          "title": {
            "type": "string",
            "description": "Title of the matching section."
          },
          "pageTitle": {
            "type": "string",
            "description": "Title of the parent page, if the match is a subsection."
          }
        }
      }
    }
  }
}
