{
  "openapi": "3.1.0",
  "info": {
    "title": "Supersonik Client API",
    "version": "1.0.0",
    "description": "Server-to-server API for discovering published Supersonik demos, creating contextualized demo links, and reading authorized demo activity, details, and transcripts.",
    "contact": {
      "name": "Supersonik support",
      "email": "support@supersonik.ai",
      "url": "https://supersonik.ai/contact"
    },
    "termsOfService": "https://supersonik.ai/terms-of-service"
  },
  "externalDocs": {
    "description": "Supersonik Client API & Setup Guide",
    "url": "https://supersonik.ai/docs/client-api"
  },
  "servers": [
    {
      "url": "https://api.supersonik.ai",
      "description": "Production"
    }
  ],
  "security": [
    {
      "clientApiBearer": []
    }
  ],
  "tags": [
    {
      "name": "Published demos",
      "description": "Discover published demo configurations."
    },
    {
      "name": "Demos",
      "description": "Create contextualized links and read demo activity."
    }
  ],
  "paths": {
    "/v1/client/launch-configs": {
      "get": {
        "operationId": "listPublishedDemoConfigurations",
        "summary": "List published demos",
        "description": "Returns every published demo configuration for the authenticated organization with a ready-to-use URL.",
        "tags": ["Published demos"],
        "responses": {
          "200": {
            "description": "Published demo configurations."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/v1/client/demos": {
      "get": {
        "operationId": "listDemos",
        "summary": "List demos",
        "description": "Returns a newest-first page of demos for the authenticated organization.",
        "tags": ["Demos"],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum results per page, within the limit configured for the integration.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "start_time_from",
            "in": "query",
            "description": "Inclusive lower bound on demo start time.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "start_time_to",
            "in": "query",
            "description": "Inclusive upper bound on demo start time.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "demo_type",
            "in": "query",
            "description": "Demo types to include. Repeat the parameter to select multiple values.",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": ["prod", "test"]
              }
            }
          },
          {
            "name": "validity",
            "in": "query",
            "description": "Validity verdicts to include. Repeat the parameter to select multiple values.",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": ["valid", "invalid", "unknown"]
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of demos."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "operationId": "createContextualizedDemoLink",
        "summary": "Create a contextualized demo link",
        "description": "Creates a reusable demo URL carrying server-supplied context for a published demo owned by the authenticated organization.",
        "tags": ["Demos"],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateContextualizedDemoLinkRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Contextualized demo link created."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/v1/client/demos/{demo_id}": {
      "get": {
        "operationId": "getDemoDetails",
        "summary": "Get demo details",
        "description": "Returns details, participants, context, parameters, Insights, and transcript URL for one authorized demo.",
        "tags": ["Demos"],
        "parameters": [
          {
            "$ref": "#/components/parameters/DemoId"
          }
        ],
        "responses": {
          "200": {
            "description": "Demo details."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/client/demos/{demo_id}/transcript": {
      "get": {
        "operationId": "getDemoTranscript",
        "summary": "Get demo transcript",
        "description": "Returns the ordered conversation transcript for one authorized demo.",
        "tags": ["Demos"],
        "parameters": [
          {
            "$ref": "#/components/parameters/DemoId"
          }
        ],
        "responses": {
          "200": {
            "description": "Demo transcript."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "clientApiBearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "Organization-scoped Client API key issued by Supersonik for server-side use."
      }
    },
    "parameters": {
      "DemoId": {
        "name": "demo_id",
        "in": "path",
        "required": true,
        "description": "Supersonik demo identifier.",
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      }
    },
    "schemas": {
      "CreateContextualizedDemoLinkRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": ["demo_url_slug", "context"],
        "properties": {
          "demo_url_slug": {
            "type": "string",
            "description": "Slug of a published demo owned by the authenticated organization."
          },
          "context": {
            "type": "object",
            "description": "Customer-defined JSON context, limited to 32 KB serialized and five nesting levels.",
            "additionalProperties": true
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "detail": {}
        }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Invalid request.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Missing, invalid, or expired Client API key.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotFound": {
        "description": "The demo does not exist or is outside the authenticated organization.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    }
  }
}
