{
  "openapi": "3.1.0",
  "info": {
    "title": "Supademo API",
    "version": "2026-08-25",
    "summary": "Workspace and event-trigger endpoints for the Supademo interactive demo platform.",
    "description": "The publicly documented HTTP surface of Supademo. Authentication is a workspace API key sent as a bearer token; create one at https://app.supademo.com/settings/workspace#api. Endpoints are documented at https://docs.supademo.com/workspace-settings/integrations/zapier/developer-docs and this file is generated from that documentation. Supademo also exposes an MCP server for agent use, documented at https://docs.supademo.com/customize/mcp-server.",
    "contact": {
      "name": "Supademo Support",
      "email": "support@supademo.com",
      "url": "https://docs.supademo.com"
    },
    "termsOfService": "https://supademo.com/terms",
    "license": {
      "name": "Proprietary",
      "identifier": "LicenseRef-Proprietary"
    }
  },
  "servers": [
    {
      "url": "https://app.supademo.com",
      "description": "Production"
    }
  ],
  "externalDocs": {
    "url": "https://docs.supademo.com/workspace-settings/integrations/zapier/developer-docs",
    "description": "Source documentation for every operation in this file"
  },
  "tags": [
    {
      "name": "Authentication",
      "description": "Verify an API key and read the workspace it belongs to."
    },
    {
      "name": "Event triggers",
      "description": "Subscribe an HTTPS endpoint to workspace events, or read a sample payload."
    }
  ],
  "security": [
    {
      "workspaceApiKey": []
    }
  ],
  "paths": {
    "/api/integration/zapier/me": {
      "get": {
        "operationId": "getAuthenticatedWorkspace",
        "summary": "Verify an API key and return its workspace",
        "description": "Validates the bearer API key and returns the name of the workspace it belongs to. Use this to confirm credentials before calling any other operation.",
        "tags": [
          "Authentication"
        ],
        "security": [
          {
            "workspaceApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "The API key is valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticatedWorkspace"
                },
                "example": {
                  "name": "My Workspace",
                  "message": "Authorized"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/api/integration/zapier/connect": {
      "get": {
        "operationId": "getTriggerSamplePayload",
        "summary": "Read a sample payload for an event trigger",
        "description": "Returns a representative payload for the named trigger, so a client can learn the shape of the events it will receive before subscribing. This operation does not require authentication.",
        "tags": [
          "Event triggers"
        ],
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/Trigger"
          }
        ],
        "responses": {
          "200": {
            "description": "A list of sample events for the requested trigger.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/NewLeadEvent"
                      }
                    },
                    {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DemoViewEvent"
                      }
                    }
                  ]
                },
                "examples": {
                  "new-lead": {
                    "value": [
                      {
                        "email": "team@supademo.com"
                      }
                    ]
                  },
                  "demo-view": {
                    "value": [
                      {
                        "name": "Jack Doe",
                        "email": "team@supademo.com",
                        "company": "Supademo",
                        "demoTitle": "New Demo",
                        "demoLink": "https://app.supademo.com/demo/123",
                        "demoViewedAt": "2021-09-01T12:00:00Z"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          }
        }
      },
      "post": {
        "operationId": "subscribeTrigger",
        "summary": "Subscribe a URL to an event trigger",
        "description": "Registers an HTTPS URL to receive events for the named trigger. Creates the integration if none exists for the workspace, otherwise updates the existing trigger configuration. Requires a workspace whose plan includes integrations.",
        "tags": [
          "Event triggers"
        ],
        "security": [
          {
            "workspaceApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Trigger"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubscribeRequest"
              },
              "example": {
                "url": "https://hooks.zapier.com/hooks/catch/1234567/abcde"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The subscription was created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscribeResponse"
                },
                "example": {
                  "integrationId": "new-integration-id"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      },
      "delete": {
        "operationId": "unsubscribeTrigger",
        "summary": "Remove a trigger from an integration",
        "description": "Deletes the named trigger from an existing integration, identified by the integrationId returned when it was created.",
        "tags": [
          "Event triggers"
        ],
        "security": [
          {
            "workspaceApiKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Trigger"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UnsubscribeRequest"
              },
              "example": {
                "integrationId": "existing-integration-id"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The trigger was removed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                },
                "example": {
                  "message": "Unsubscribed"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "workspaceApiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "A workspace API key, sent as `Authorization: Bearer <API_KEY>`. Create and revoke keys at https://app.supademo.com/settings/workspace#api. A key carries the permissions of the workspace it belongs to; Supademo does not currently issue narrower, named scopes, so treat a key as full workspace access and store it accordingly."
      }
    },
    "parameters": {
      "Trigger": {
        "name": "trigger",
        "in": "query",
        "required": true,
        "description": "Which workspace event to operate on.",
        "schema": {
          "$ref": "#/components/schemas/TriggerName"
        }
      }
    },
    "schemas": {
      "TriggerName": {
        "type": "string",
        "enum": [
          "new-lead",
          "demo-view"
        ],
        "description": "`new-lead` fires when a viewer submits their details in a demo. `demo-view` fires when a demo is viewed."
      },
      "AuthenticatedWorkspace": {
        "type": "object",
        "required": [
          "name",
          "message"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Display name of the workspace the key belongs to."
          },
          "message": {
            "type": "string",
            "description": "Literal \"Authorized\" when the key is valid."
          }
        }
      },
      "SubscribeRequest": {
        "type": "object",
        "required": [
          "url"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "description": "HTTPS endpoint that will receive the events."
          }
        }
      },
      "SubscribeResponse": {
        "type": "object",
        "required": [
          "integrationId"
        ],
        "properties": {
          "integrationId": {
            "type": "string",
            "description": "Identifier for the integration. Required to unsubscribe."
          }
        }
      },
      "UnsubscribeRequest": {
        "type": "object",
        "required": [
          "integrationId"
        ],
        "properties": {
          "integrationId": {
            "type": "string",
            "description": "The integration to remove the trigger from."
          }
        }
      },
      "NewLeadEvent": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "description": "Email the viewer submitted."
          }
        }
      },
      "DemoViewEvent": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Viewer name, when known."
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "Viewer email, when known."
          },
          "company": {
            "type": "string",
            "description": "Viewer company, when known."
          },
          "demoTitle": {
            "type": "string",
            "description": "Title of the demo viewed."
          },
          "demoLink": {
            "type": "string",
            "format": "uri",
            "description": "Public URL of the demo viewed."
          },
          "demoViewedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the view occurred, ISO 8601."
          }
        }
      },
      "Message": {
        "type": "object",
        "required": [
          "message"
        ],
        "properties": {
          "message": {
            "type": "string"
          }
        }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "A required parameter or body field is missing. The message names the field.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Message"
            },
            "example": {
              "message": "Bad Request: trigger"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "The API key is missing, invalid, or its workspace plan does not permit the action.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Message"
            },
            "example": {
              "message": "Unauthorized"
            }
          }
        }
      },
      "InternalError": {
        "description": "The request could not be processed.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Message"
            },
            "example": {
              "message": "Internal Server Error"
            }
          }
        }
      }
    }
  }
}
