{
  "openapi": "3.0.3",
  "info": {
    "title": "Event Schedule API",
    "version": "1.0",
    "description": "API for managing events, schedules, and tickets on Event Schedule. To get started, register an account, then create a schedule before adding events. On the hosted service a schedule must be on the Pro or Enterprise plan for the API to read or write it (creating a schedule, deleting one, recording a sale, the category lists and fan content are the exceptions). A new schedule starts on the Free plan with no trial, so subscribe before adding events. A team admin's key reaches a schedule only while it is on Enterprise. Selfhosted installs have every endpoint. Reference: https://eventschedule.com/docs/developer/api"
  },
  "servers": [
    {
      "url": "{baseUrl}/api",
      "variables": {
        "baseUrl": {
          "default": "https://eventschedule.com"
        }
      }
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "paths": {
    "/register/send-code": {
      "post": {
        "operationId": "send_verification_code",
        "tags": ["Authentication"],
        "summary": "Send verification code",
        "description": "Sends a 6-digit verification code to the provided email address. This is only required in hosted mode (eventschedule.com). Selfhosted instances do not require email verification. Rate limited to 5 codes per email per hour.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["email"],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email",
                    "description": "Email address to send the verification code to"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Verification code sent successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "example": "Verification code sent to user@example.com"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Registration codes not required (selfhosted mode)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation error or email already registered",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many verification code requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/register": {
      "post": {
        "operationId": "register",
        "tags": ["Authentication"],
        "summary": "Register a new account",
        "description": "Creates a new user account and returns an API key. In hosted mode, a verification code (from /register/send-code) is required. In selfhosted mode, registration is only allowed while no users exist, unless the install sets ALLOW_REGISTRATION; there, an address with an account waiting for its owner is emailed a set-password link and answered 422. Rate limited to 3 registrations per IP per hour.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["name", "email", "password"],
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 255,
                    "description": "Full name of the user"
                  },
                  "email": {
                    "type": "string",
                    "format": "email",
                    "maxLength": 255,
                    "description": "Email address for the account"
                  },
                  "password": {
                    "type": "string",
                    "minLength": 8,
                    "description": "Account password (minimum 8 characters)"
                  },
                  "verification_code": {
                    "type": "string",
                    "description": "6-digit verification code from /register/send-code (required in hosted mode only)"
                  },
                  "timezone": {
                    "type": "string",
                    "maxLength": 100,
                    "description": "IANA timezone identifier",
                    "example": "America/New_York"
                  },
                  "language_code": {
                    "type": "string",
                    "description": "Preferred language code",
                    "enum": ["en", "es", "de", "fr", "it", "pt", "he", "nl", "ar", "et", "ru", "ro"]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Account created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "api_key": {
                          "type": "string",
                          "description": "API key for authenticating future requests. Store this securely."
                        },
                        "api_key_expires_at": {
                          "type": "string",
                          "format": "date-time",
                          "description": "ISO 8601 timestamp when the API key expires"
                        },
                        "user": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "description": "Encoded user ID"
                            },
                            "name": {
                              "type": "string",
                              "description": "User's full name"
                            },
                            "email": {
                              "type": "string",
                              "format": "email",
                              "description": "User's email address"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Registration is closed (selfhosted mode with existing users)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many registration attempts",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/login": {
      "post": {
        "operationId": "login",
        "tags": ["Authentication"],
        "summary": "Login to an existing account",
        "description": "Authenticates with email and password, returning a new API key. If an active API key already exists, returns a 409 error - disable and re-enable API access in account settings to generate a new key. Store the key securely. Accounts with two-factor authentication enabled must generate an API key from the web UI instead. Rate limited to 5 attempts per IP per 15 minutes.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["email", "password"],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email",
                    "description": "Account email address"
                  },
                  "password": {
                    "type": "string",
                    "description": "Account password"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Login successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "api_key": {
                          "type": "string",
                          "description": "New API key for authenticating future requests. Store this securely."
                        },
                        "api_key_expires_at": {
                          "type": "string",
                          "format": "date-time",
                          "description": "ISO 8601 timestamp when the API key expires"
                        },
                        "user": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "description": "Encoded user ID"
                            },
                            "name": {
                              "type": "string",
                              "description": "User's full name"
                            },
                            "email": {
                              "type": "string",
                              "format": "email",
                              "description": "User's email address"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid email or password",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "An active API key already exists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Account has two-factor authentication enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many login attempts",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/schedules": {
      "get": {
        "operationId": "list_schedules",
        "tags": ["Schedules"],
        "summary": "List schedules",
        "description": "Returns a paginated list of schedules owned or administered by the authenticated user.",
        "parameters": [
          {
            "name": "subdomain",
            "in": "query",
            "description": "Filter schedules by exact subdomain match",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "query",
            "description": "Filter schedules by name (partial match)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "description": "Filter schedules by type",
            "schema": {
              "type": "string",
              "enum": ["venue", "talent", "curator"]
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page number (default 1)",
            "schema": {
              "type": "integer",
              "default": 1,
              "minimum": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "Number of results per page (default 100, max 500)",
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 500
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of schedules",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Schedule"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "create_schedule",
        "tags": ["Schedules"],
        "summary": "Create a schedule",
        "description": "Creates a new schedule. No plan check, but on the hosted service the schedule starts on the Free plan with no trial, and most other endpoints need it on Pro or Enterprise. The subdomain is generated from the name. On hosted one account may own up to 50 schedules, and a schedule given no email takes the account's own.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["name", "type"],
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 255,
                    "description": "Name of the schedule"
                  },
                  "type": {
                    "type": "string",
                    "enum": ["venue", "talent", "curator"],
                    "description": "Type of schedule"
                  },
                  "email": {
                    "type": "string",
                    "format": "email",
                    "maxLength": 255,
                    "description": "Contact email for the schedule"
                  },
                  "description": {
                    "type": "string",
                    "description": "Description of the schedule (supports markdown)"
                  },
                  "short_description": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "Short description of the schedule (plain text, max 200 characters)"
                  },
                  "timezone": {
                    "type": "string",
                    "maxLength": 100,
                    "description": "IANA timezone identifier",
                    "example": "America/New_York"
                  },
                  "language_code": {
                    "type": "string",
                    "description": "Language code for the schedule",
                    "enum": ["en", "es", "de", "fr", "it", "pt", "he", "nl", "ar", "et", "ru", "ro"]
                  },
                  "website": {
                    "type": "string",
                    "maxLength": 255,
                    "description": "Website URL for the schedule"
                  },
                  "address1": {
                    "type": "string",
                    "maxLength": 255,
                    "description": "Street address (primarily for venue type)"
                  },
                  "city": {
                    "type": "string",
                    "maxLength": 255,
                    "description": "City (primarily for venue type)"
                  },
                  "state": {
                    "type": "string",
                    "maxLength": 255,
                    "description": "State or province (primarily for venue type)"
                  },
                  "postal_code": {
                    "type": "string",
                    "maxLength": 20,
                    "description": "Postal or ZIP code (primarily for venue type)"
                  },
                  "country_code": {
                    "type": "string",
                    "maxLength": 10,
                    "description": "Country code (primarily for venue type)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Schedule created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Schedule"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/schedules/{subdomain}": {
      "get": {
        "operationId": "show_schedule",
        "tags": ["Schedules"],
        "summary": "Show a schedule",
        "description": "Returns details of a specific schedule. The authenticated user must be an owner or admin of the schedule.",
        "parameters": [
          {
            "name": "subdomain",
            "in": "path",
            "required": true,
            "description": "The subdomain identifier of the schedule",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Schedule details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Schedule"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Schedule not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "update_schedule",
        "tags": ["Schedules"],
        "summary": "Update a schedule",
        "description": "Updates an existing schedule. Requires a Pro plan. Only the fields provided will be updated. The authenticated user must be an owner or admin of the schedule.",
        "parameters": [
          {
            "name": "subdomain",
            "in": "path",
            "required": true,
            "description": "The subdomain identifier of the schedule",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 255,
                    "description": "Name of the schedule"
                  },
                  "email": {
                    "type": "string",
                    "format": "email",
                    "maxLength": 255,
                    "description": "Contact email for the schedule"
                  },
                  "description": {
                    "type": "string",
                    "description": "Description of the schedule (supports markdown)"
                  },
                  "short_description": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "Short description of the schedule (plain text, max 200 characters)"
                  },
                  "timezone": {
                    "type": "string",
                    "maxLength": 100,
                    "description": "IANA timezone identifier"
                  },
                  "language_code": {
                    "type": "string",
                    "description": "Language code for the schedule",
                    "enum": ["en", "es", "de", "fr", "it", "pt", "he", "nl", "ar", "et", "ru", "ro"]
                  },
                  "website": {
                    "type": "string",
                    "maxLength": 255,
                    "description": "Website URL for the schedule"
                  },
                  "address1": {
                    "type": "string",
                    "maxLength": 255,
                    "description": "Street address"
                  },
                  "city": {
                    "type": "string",
                    "maxLength": 255,
                    "description": "City"
                  },
                  "state": {
                    "type": "string",
                    "maxLength": 255,
                    "description": "State or province"
                  },
                  "postal_code": {
                    "type": "string",
                    "maxLength": 20,
                    "description": "Postal or ZIP code"
                  },
                  "country_code": {
                    "type": "string",
                    "maxLength": 10,
                    "description": "Country code"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Schedule updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Schedule"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Not a Pro account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Schedule not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "delete_schedule",
        "tags": ["Schedules"],
        "summary": "Delete a schedule",
        "description": "Soft-deletes a schedule, marking it as deleted. The schedule will no longer appear in listings or be accessible. Only the schedule owner can perform this action.",
        "parameters": [
          {
            "name": "subdomain",
            "in": "path",
            "required": true,
            "description": "The subdomain identifier of the schedule",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Schedule deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "example": "Schedule deleted successfully"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Only the schedule owner can delete it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Schedule not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/schedules/{subdomain}/groups": {
      "get": {
        "operationId": "list_groups",
        "tags": ["Sub-schedules"],
        "summary": "List sub-schedules",
        "description": "Returns all sub-schedules for a given schedule. The authenticated user must be an owner or admin of the schedule.",
        "parameters": [
          {
            "name": "subdomain",
            "in": "path",
            "required": true,
            "description": "The subdomain identifier of the parent schedule",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of sub-schedules",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Group"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Schedule not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "create_group",
        "tags": ["Sub-schedules"],
        "summary": "Create a sub-schedule",
        "description": "Creates a new sub-schedule within a schedule. Requires a Pro plan. The slug is automatically generated from the name.",
        "parameters": [
          {
            "name": "subdomain",
            "in": "path",
            "required": true,
            "description": "The subdomain identifier of the parent schedule",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["name"],
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 255,
                    "description": "Name of the sub-schedule"
                  },
                  "color": {
                    "type": "string",
                    "maxLength": 50,
                    "description": "Color for the sub-schedule (e.g. hex code)",
                    "example": "#4E81FA"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Sub-schedule created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Group"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Not a Pro account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Schedule not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/schedules/{subdomain}/groups/{group_id}": {
      "put": {
        "operationId": "update_group",
        "tags": ["Sub-schedules"],
        "summary": "Update a sub-schedule",
        "description": "Updates an existing sub-schedule. Requires a Pro plan. Only the fields provided will be updated.",
        "parameters": [
          {
            "name": "subdomain",
            "in": "path",
            "required": true,
            "description": "The subdomain identifier of the parent schedule",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "group_id",
            "in": "path",
            "required": true,
            "description": "The encoded ID of the sub-schedule",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 255,
                    "description": "Name of the sub-schedule"
                  },
                  "color": {
                    "type": "string",
                    "maxLength": 50,
                    "description": "Color for the sub-schedule (e.g. hex code)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sub-schedule updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Group"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Not a Pro account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Schedule or sub-schedule not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "delete_group",
        "tags": ["Sub-schedules"],
        "summary": "Delete a sub-schedule",
        "description": "Permanently deletes a sub-schedule. Requires a Pro plan.",
        "parameters": [
          {
            "name": "subdomain",
            "in": "path",
            "required": true,
            "description": "The subdomain identifier of the parent schedule",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "group_id",
            "in": "path",
            "required": true,
            "description": "The encoded ID of the sub-schedule",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sub-schedule deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "example": "Sub-schedule deleted successfully"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Not a Pro account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Schedule or sub-schedule not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/events": {
      "get": {
        "operationId": "list_events",
        "tags": ["Events"],
        "summary": "List events",
        "description": "Returns a paginated list of the events GET /events/{id} would answer for this key, newest start first: events the caller's schedules own and events on a venue or talent schedule the caller runs, never an event a curator schedule only lists or one a schedule turned down. Drafts, internal, unlisted and cancelled events are included. Appointment bookings are left out. starts_after and starts_before compare a recurring event's first date.",
        "parameters": [
          {
            "name": "subdomain",
            "in": "query",
            "description": "Filter events by schedule subdomain",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "starts_after",
            "in": "query",
            "description": "Filter events starting on or after this date",
            "schema": {
              "type": "string",
              "format": "date",
              "example": "2025-01-01"
            }
          },
          {
            "name": "starts_before",
            "in": "query",
            "description": "Filter events starting on or before this date",
            "schema": {
              "type": "string",
              "format": "date",
              "example": "2025-12-31"
            }
          },
          {
            "name": "venue_id",
            "in": "query",
            "description": "Filter events by venue (encoded venue schedule ID)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category_id",
            "in": "query",
            "description": "Filter events by category ID",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "name",
            "in": "query",
            "description": "Filter events by name (partial match)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "schedule_type",
            "in": "query",
            "description": "Filter by event type",
            "schema": {
              "type": "string",
              "enum": ["single", "recurring"]
            }
          },
          {
            "name": "tickets_enabled",
            "in": "query",
            "description": "Filter by whether tickets are enabled",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "rsvp_enabled",
            "in": "query",
            "description": "Filter by whether free registration (RSVP) is enabled",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "group_id",
            "in": "query",
            "description": "Filter events by sub-schedule (encoded sub-schedule ID)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "is_cancelled",
            "in": "query",
            "description": "true for cancelled events only, false to leave them out. Without it both are listed.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "external_id",
            "in": "query",
            "description": "The event your own system knows by this id, matched exactly. With subdomain it is one event or none.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page number (default 1)",
            "schema": {
              "type": "integer",
              "default": 1,
              "minimum": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "Number of results per page (default 100, max 500)",
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 500
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of events",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Event"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/events/{id}": {
      "get": {
        "operationId": "show_event",
        "tags": ["Events"],
        "summary": "Show an event",
        "description": "Returns details of a specific event. The authenticated user must own the event or be an owner/admin on one of its associated schedules.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The encoded ID of the event",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Event details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Event"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Unauthorized to view this event",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Event not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "update_event",
        "tags": ["Events"],
        "summary": "Update an event",
        "description": "Updates an existing event. Requires a Pro plan. Supports partial updates - only the fields provided will be changed. Existing tickets, event parts, and recurring configuration are preserved if not explicitly provided.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The encoded ID of the event",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EventInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Event updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Event"
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "example": "Event updated successfully"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Unauthorized or not a Pro account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Event not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "delete_event",
        "tags": ["Events"],
        "summary": "Delete an event",
        "description": "Permanently deletes an event. Only the person who made the event, or an owner or admin of the schedule that owns it, can: a schedule that only lists the event gets a 403. An event that has sales is not deleted: cancel it with POST /events/{id}/cancel instead.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The encoded ID of the event",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Event deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "example": "Event deleted successfully"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Unauthorized to delete this event",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Event not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The event has sales and cannot be deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/events/{id}/cancel": {
      "post": {
        "operationId": "cancel_event",
        "tags": ["Events"],
        "summary": "Cancel an event",
        "description": "Calls an event off without deleting it. The event keeps its page and every sale, leaves the public calendar and any connected calendar, and stops selling. Running boost campaigns and installment plans are stopped. Sales are not refunded. An event that is already cancelled is left as it is. An appointment booking is cancelled through its sale.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The encoded ID of the event",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "notify_attendees": {
                    "type": "boolean",
                    "description": "Email the people who bought, registered or asked to be told. Nobody is emailed about a draft."
                  },
                  "message": {
                    "type": "string",
                    "maxLength": 280,
                    "description": "A note added under the cancellation email"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The event, cancelled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Event"
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "example": "Event cancelled successfully"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Unauthorized to edit this event",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Event not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation error (a message longer than 280 characters)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/events/{id}/restore": {
      "post": {
        "operationId": "restore_event",
        "tags": ["Events"],
        "summary": "Restore a cancelled event",
        "description": "Undoes a cancellation. The event returns to the public calendar and to connected calendars. Nobody is emailed, and a boost campaign or installment plan that the cancellation stopped stays stopped. An event that is not cancelled is left as it is.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The encoded ID of the event",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The event, restored",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Event"
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "example": "Event restored successfully"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Unauthorized to edit this event",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Event not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "An appointment booking cannot be restored",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/events/{subdomain}": {
      "post": {
        "operationId": "create_event",
        "tags": ["Events"],
        "summary": "Create an event",
        "description": "Creates a new event under the specified schedule. Requires a Pro plan. The authenticated user must be an owner or admin of the schedule. For venue schedules, the venue is automatically set. For talent schedules, the member is automatically set.",
        "parameters": [
          {
            "name": "subdomain",
            "in": "path",
            "required": true,
            "description": "The subdomain identifier of the schedule to create the event under",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EventInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "With upsert: the event that already had this external_id, updated. meta.created is false",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Event"
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "example": "Event updated successfully"
                        },
                        "created": {
                          "type": "boolean",
                          "example": false
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "201": {
            "description": "Event created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Event"
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "example": "Event created successfully"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Unauthorized or not a Pro account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Schedule not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The schedule already has an event with this external_id and the request did not ask to upsert. Nothing is created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "The encoded ID of the event that holds the external_id"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/events/flyer/{event_id}": {
      "post": {
        "operationId": "upload_flyer",
        "tags": ["Events"],
        "summary": "Upload event flyer image",
        "description": "Uploads a flyer image for an event. Requires a Pro plan. The authenticated user must own the event. Any existing flyer image will be replaced.",
        "parameters": [
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "description": "The encoded ID of the event",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": ["flyer_image"],
                "properties": {
                  "flyer_image": {
                    "type": "string",
                    "format": "binary",
                    "description": "The flyer image file to upload"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Flyer uploaded successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Event"
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "example": "Flyer uploaded successfully"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Unauthorized or not a Pro account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Event not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/categories": {
      "get": {
        "operationId": "list_categories",
        "tags": ["Categories"],
        "summary": "List event categories",
        "description": "Returns the built-in event categories with their English names. A schedule can rename, remove or add categories of its own, and category_id is checked against that schedule's list: use GET /categories/{subdomain} for the exact set a schedule accepts. Not paginated, and no plan check.",
        "responses": {
          "200": {
            "description": "List of categories",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Category"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/categories/{subdomain}": {
      "get": {
        "operationId": "list_schedule_categories",
        "tags": ["Categories"],
        "summary": "List a schedule's event categories",
        "description": "Returns the categories one schedule accepts as category_id, after its own renames, removals and additions. Not paginated, and no plan check.",
        "parameters": [
          {
            "name": "subdomain",
            "in": "path",
            "required": true,
            "description": "The schedule's subdomain",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The schedule's categories",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Category"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Schedule not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sales": {
      "get": {
        "operationId": "list_sales",
        "tags": ["Sales"],
        "summary": "List sales",
        "description": "Returns a paginated list of sales for events the authenticated user owns or administers. Can be filtered by event, schedule, status, buyer email, and event date.",
        "parameters": [
          {
            "name": "event_id",
            "in": "query",
            "description": "Filter sales by event (encoded event ID)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subdomain",
            "in": "query",
            "description": "Filter sales by schedule subdomain",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter sales by status",
            "schema": {
              "type": "string",
              "enum": ["unpaid", "paid", "cancelled", "refunded", "expired"]
            }
          },
          {
            "name": "email",
            "in": "query",
            "description": "Filter sales by buyer email (exact match)",
            "schema": {
              "type": "string",
              "format": "email"
            }
          },
          {
            "name": "event_date",
            "in": "query",
            "description": "Filter sales by event date (Y-m-d)",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page number (default 1)",
            "schema": {
              "type": "integer",
              "default": 1,
              "minimum": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "Number of results per page (default 100, max 500)",
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 500
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of sales",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Sale"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "create_sale",
        "tags": ["Sales"],
        "summary": "Create a sale",
        "description": "Creates a new ticket sale for an event. The caller must be the event's maker or an owner or admin of a schedule it is on (a curator that only lists it is refused). The event must have tickets enabled and still be selling; a priced ticket needs the schedule on Pro or Enterprise, a free one sells on any plan. event_date must be one of the event's own dates, else a 422, and stock is checked under a lock. Tickets can be referenced by encoded ticket ID or by ticket type name. Sales are created with 'unpaid' status unless the total is zero (free tickets), in which case they are automatically marked as 'paid'.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["event_id", "name", "email", "tickets"],
                "properties": {
                  "event_id": {
                    "type": "string",
                    "description": "Encoded ID of the event"
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 255,
                    "description": "Name of the ticket buyer"
                  },
                  "email": {
                    "type": "string",
                    "format": "email",
                    "maxLength": 255,
                    "description": "Email of the ticket buyer"
                  },
                  "tickets": {
                    "type": "object",
                    "description": "Map of ticket identifier (encoded ticket ID or ticket type name) to quantity",
                    "additionalProperties": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "example": {
                      "General Admission": 2,
                      "VIP": 1
                    }
                  },
                  "event_date": {
                    "type": "string",
                    "format": "date",
                    "description": "Specific date for recurring events (Y-m-d format). If omitted, defaults to the event's start date."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Sale created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Sale"
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "example": "Sale created successfully"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation error or tickets not available",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sales/{id}": {
      "get": {
        "operationId": "show_sale",
        "tags": ["Sales"],
        "summary": "Show a sale",
        "description": "Returns details of a specific sale. The authenticated user must be able to edit the associated event.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The encoded ID of the sale",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sale details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Sale"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Unauthorized or not a Pro account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Sale not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "update_sale",
        "tags": ["Sales"],
        "summary": "Update sale status",
        "description": "Performs a status action on a sale. Available actions: mark_paid (unpaid -> paid), refund (paid -> refunded, or amount_mismatch -> refunded on Stripe, PayPal and Razorpay), cancel (unpaid or paid -> cancelled). On a Stripe, PayPal or Razorpay sale, refund sends the money back through the provider; send amount to return part of it, which leaves the sale paid and answers 'Partial refund sent'. Every other method only records the refund and ignores amount. An installment plan is refunded in full only. A named guest's row of a group answers 403: act on the group's primary row.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The encoded ID of the sale",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["action"],
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": ["mark_paid", "refund", "cancel"],
                    "description": "The action to perform on the sale"
                  },
                  "amount": {
                    "type": "number",
                    "minimum": 0.01,
                    "description": "With refund: the part to send back. Omitted, the whole remaining balance goes back"
                  },
                  "idempotency_key": {
                    "type": "string",
                    "maxLength": 64,
                    "pattern": "^[A-Za-z0-9_.:-]+$",
                    "description": "With refund: a key of your own. A repeat with the same key returns the first attempt's outcome instead of refunding twice; a repeat while the first is still running answers 409"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sale updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Sale"
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "example": "Sale updated successfully"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Unauthorized or not a Pro account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Sale not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "A refund whose outcome could not be confirmed, or one still in progress under the same idempotency_key. Nothing is retried; check the provider before acting",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Action cannot be performed on current sale status, a refund the provider refused, or amount sent for an installment plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "delete_sale",
        "tags": ["Sales"],
        "summary": "Delete a sale",
        "description": "Soft-deletes a sale, marking it as deleted. The sale will no longer appear in listings.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The encoded ID of the sale",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sale deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "example": "Sale deleted successfully"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Unauthorized or not a Pro account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Sale not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/feedback": {
      "get": {
        "operationId": "list_feedback",
        "tags": ["Feedback"],
        "summary": "List post-event feedback",
        "description": "Returns star ratings and comments left by attendees after events on schedules the authenticated user owns or administers. Requires a Pro plan.",
        "parameters": [
          {
            "name": "event_id",
            "in": "query",
            "description": "Filter by event (encoded event ID)",
            "schema": { "type": "string" }
          },
          {
            "name": "subdomain",
            "in": "query",
            "description": "Filter by schedule subdomain",
            "schema": { "type": "string" }
          },
          {
            "name": "event_date",
            "in": "query",
            "description": "Filter by event date (Y-m-d)",
            "schema": { "type": "string", "format": "date" }
          },
          {
            "name": "min_rating",
            "in": "query",
            "description": "Only return ratings of at least this value",
            "schema": { "type": "integer", "minimum": 1, "maximum": 5 }
          },
          {
            "name": "from",
            "in": "query",
            "description": "Only feedback submitted on or after this date (Y-m-d)",
            "schema": { "type": "string", "format": "date" }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Only feedback submitted on or before this date (Y-m-d)",
            "schema": { "type": "string", "format": "date" }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page number (default 1)",
            "schema": { "type": "integer", "default": 1, "minimum": 1 }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "Number of results per page (default 100, max 500)",
            "schema": { "type": "integer", "default": 100, "minimum": 1, "maximum": 500 }
          }
        ],
        "responses": {
          "200": {
            "description": "List of feedback",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": { "$ref": "#/components/schemas/Feedback" }
                    },
                    "meta": { "$ref": "#/components/schemas/Pagination" }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Error" }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Error" }
              }
            }
          }
        }
      }
    },
    "/fan-content": {
      "get": {
        "operationId": "list_fan_content",
        "tags": ["Feedback"],
        "summary": "List fan content",
        "description": "Returns fan comments, photos and videos submitted on your events, newest first. Approved items only by default; pass is_approved=false to read the pending moderation queue. Submitter email addresses are never included. Each kind of submission has its own id sequence, so an id is only unique within a type - key on the pair.",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "description": "Limit to one kind of submission",
            "schema": { "type": "string", "enum": ["comment", "photo", "video"] }
          },
          {
            "name": "event_id",
            "in": "query",
            "description": "Filter by event (encoded event ID)",
            "schema": { "type": "string" }
          },
          {
            "name": "subdomain",
            "in": "query",
            "description": "Filter by schedule subdomain",
            "schema": { "type": "string" }
          },
          {
            "name": "event_date",
            "in": "query",
            "description": "Filter by event date (Y-m-d)",
            "schema": { "type": "string", "format": "date" }
          },
          {
            "name": "is_approved",
            "in": "query",
            "description": "Defaults to true. Pass false for the pending moderation queue",
            "schema": { "type": "boolean", "default": true }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page number (default 1)",
            "schema": { "type": "integer", "default": 1, "minimum": 1 }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "Number of results per page (default 100, max 500)",
            "schema": { "type": "integer", "default": 100, "minimum": 1, "maximum": 500 }
          }
        ],
        "responses": {
          "200": {
            "description": "List of fan content",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": { "$ref": "#/components/schemas/FanContent" }
                    },
                    "meta": { "$ref": "#/components/schemas/Pagination" }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Error" }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Error" }
              }
            }
          }
        }
      }
    },
    "/schedules/{subdomain}/appointment-types": {
      "get": {
        "operationId": "list_appointment_types",
        "tags": ["Appointments"],
        "summary": "List bookable appointment types",
        "description": "The appointment types a guest can book on this schedule right now, the list its /book page shows. On the hosted service, types with a price or an approval step are left out until the schedule has its own email settings, because a guest booked through the API is sent a way to pay, or told the schedule's answer, only by email. The key's account must be an owner or admin of the schedule, and the schedule must be on a Pro plan.",
        "parameters": [
          {
            "name": "subdomain",
            "in": "path",
            "required": true,
            "description": "The schedule's subdomain",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Bookable appointment types",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AppointmentType"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "schedule": {
                          "type": "string"
                        },
                        "timezone": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Not an owner or admin of the schedule, or not a Pro account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Schedule not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/appointment-types/{id}/slots": {
      "get": {
        "operationId": "list_appointment_slots",
        "tags": ["Appointments"],
        "summary": "List open times",
        "description": "The times still open for an appointment type. Each slot carries its start as a UTC instant, to send back when booking, and a label in the schedule's timezone and language, such as \"Tuesday, October 20 at 2:30 PM EDT\". When the range has nothing open, meta.next_available is the first open time after it.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The encoded ID of the appointment type",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "First day to look at (Y-m-d, in the schedule's timezone). Defaults to today.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "description": "How many days to cover. Defaults to 7.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 31
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Open times",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AppointmentSlot"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "appointment_type_id": {
                          "type": "string"
                        },
                        "timezone": {
                          "type": "string"
                        },
                        "from": {
                          "type": "string",
                          "format": "date"
                        },
                        "days": {
                          "type": "integer"
                        },
                        "next_available": {
                          "allOf": [
                            {
                              "$ref": "#/components/schemas/AppointmentSlot"
                            }
                          ],
                          "nullable": true,
                          "description": "Set only when this range has nothing open"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Not an owner or admin of the schedule, or not a Pro account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Appointment type not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation error, or the type is not taking bookings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/appointment-types/{id}/bookings": {
      "post": {
        "operationId": "create_appointment_booking",
        "tags": ["Appointments"],
        "summary": "Book an appointment",
        "description": "Book a time for a guest. The booking is the guest's: the caller does not become its buyer, and the owner's Bookings list and booking email say it was booked through the API. A booking paid online is held until pay_by, and the guest is emailed a link to pay at once. Send an Idempotency-Key header to make a retry safe: a repeat of the same request with the same key in the next 24 hours answers with the booking the first one made.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The encoded ID of the appointment type",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Up to 64 letters, digits, dots, colons, dashes or underscores",
            "schema": {
              "type": "string",
              "maxLength": 64,
              "pattern": "^[A-Za-z0-9_.:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["slot", "name", "email"],
                "properties": {
                  "slot": {
                    "type": "string",
                    "format": "date-time",
                    "description": "A slot's starts_at, exactly as the slots endpoint gave it (UTC, e.g. 2026-10-20T18:30:00Z)"
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 255,
                    "description": "The guest's name"
                  },
                  "email": {
                    "type": "string",
                    "format": "email",
                    "maxLength": 255,
                    "description": "The guest's email, where the confirmation or the payment link goes"
                  },
                  "phone": {
                    "type": "string",
                    "maxLength": 50,
                    "description": "Required when the type's requires_phone is true; ignored when it does not ask"
                  },
                  "notes": {
                    "type": "string",
                    "maxLength": 5000,
                    "description": "A note for the schedule"
                  },
                  "guest_timezone": {
                    "type": "string",
                    "maxLength": 64,
                    "description": "The guest's IANA timezone, for their emails"
                  },
                  "answers": {
                    "type": "object",
                    "description": "Answers to the type's questions, keyed by question key. Each is text or a number, or a list of them, each up to 1000 characters.",
                    "additionalProperties": {
                      "oneOf": [
                        {
                          "type": "string",
                          "maxLength": 1000
                        },
                        {
                          "type": "number"
                        },
                        {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "maxLength": 1000
                          }
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Booked",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppointmentBooking"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Not an owner or admin of the schedule, or not a Pro account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Appointment type not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The time was just taken (error slot_taken, with the three nearest open times in alternatives), the same guest already holds it (already_booked, with that booking), or a request with the same Idempotency-Key is still being handled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": ["slot_taken", "already_booked", "idempotency_key_in_use"]
                    },
                    "message": {
                      "type": "string"
                    },
                    "alternatives": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AppointmentSlot"
                      }
                    },
                    "booking": {
                      "$ref": "#/components/schemas/AppointmentBooking"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation error per field, the type is not taking bookings, the daily cap on new bookings, or an Idempotency-Key reused for a different request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/boosts": {
      "get": {
        "operationId": "list_boosts",
        "tags": ["Boosts"],
        "summary": "List boosts",
        "description": "Every boost request on the boost partner's schedules, oldest change first. Only the key of the account that is the boost partner can read these. updated_since returns every boost changed at or after that time (timestamps are whole seconds, so keep the last updated_at you saw and drop duplicates).",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "schedule",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "A schedule's subdomain"
          },
          {
            "name": "updated_since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "schema": {
              "type": "integer",
              "maximum": 500
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of boosts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Boost"
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No valid key"
          },
          "403": {
            "description": "Not a boost partner's key"
          },
          "422": {
            "description": "Validation failed"
          }
        }
      }
    },
    "/boosts/{id}": {
      "get": {
        "operationId": "get_boost",
        "tags": ["Boosts"],
        "summary": "Get a boost",
        "description": "One boost request with the exact ad, its approval, its payment and its spend.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The encoded ID of the boost",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The boost as it now stands",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Boost"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No valid key"
          },
          "403": {
            "description": "Not the boost partner's own key, or not its boost"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Wrong state, or an out-of-date version (code: stale_version)"
          },
          "422": {
            "description": "Validation failed"
          },
          "429": {
            "description": "Too many requests; see Retry-After"
          }
        }
      }
    },
    "/boosts/{id}/approve": {
      "post": {
        "operationId": "approve_boost",
        "tags": ["Boosts"],
        "summary": "Approve a version",
        "description": "Approve the version you reviewed. A version that is not the current one answers 409, so an approval of earlier wording can never launch later wording. Approved and paid launches the boost. Repeating the same approval answers the boost as it stands.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The encoded ID of the boost",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["version"],
                "properties": {
                  "version": {
                    "type": "integer"
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 1000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The boost as it now stands",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Boost"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No valid key"
          },
          "403": {
            "description": "Not the boost partner's own key, or not its boost"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Wrong state, or an out-of-date version (code: stale_version)"
          },
          "422": {
            "description": "Validation failed"
          },
          "429": {
            "description": "Too many requests; see Retry-After"
          }
        }
      }
    },
    "/boosts/{id}/decline": {
      "post": {
        "operationId": "decline_boost",
        "tags": ["Boosts"],
        "summary": "Decline a boost",
        "description": "Send the request back with a note the business sees; it can edit and send it again.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The encoded ID of the boost",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["note"],
                "properties": {
                  "note": {
                    "type": "string",
                    "maxLength": 1000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The boost as it now stands",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Boost"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No valid key"
          },
          "403": {
            "description": "Not the boost partner's own key, or not its boost"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Wrong state, or an out-of-date version (code: stale_version)"
          },
          "422": {
            "description": "Validation failed"
          },
          "429": {
            "description": "Too many requests; see Retry-After"
          }
        }
      }
    },
    "/boosts/{id}/confirm-payment": {
      "post": {
        "operationId": "confirm_boost_payment",
        "tags": ["Boosts"],
        "summary": "Confirm payment",
        "description": "Record that the business paid you for this budget: your own reference and amount, which are stored and returned on the boost and the statement. The amount is not compared with the budget. Send the budget.amount you charged for as budget: if the business has changed the budget since, the confirmation is refused (409, code stale_budget) instead of launching the new budget on this payment. A changed budget clears the confirmation.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The encoded ID of the boost",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["reference", "amount"],
                "properties": {
                  "reference": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "amount": {
                    "type": "string",
                    "example": "60.00"
                  },
                  "currency": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 3
                  },
                  "budget": {
                    "type": "string",
                    "description": "The boost's budget.amount this payment was for",
                    "example": "50.00"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The boost as it now stands",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Boost"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No valid key"
          },
          "403": {
            "description": "Not the boost partner's own key, or not its boost"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Wrong state, or an out-of-date version (code: stale_version)"
          },
          "422": {
            "description": "Validation failed"
          },
          "429": {
            "description": "Too many requests; see Retry-After"
          }
        }
      },
      "delete": {
        "operationId": "withdraw_boost_payment",
        "tags": ["Boosts"],
        "summary": "Withdraw a payment confirmation",
        "description": "Before launch only, for a refund or a dispute.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The encoded ID of the boost",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The boost as it now stands",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Boost"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No valid key"
          },
          "403": {
            "description": "Not the boost partner's own key, or not its boost"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Wrong state, or an out-of-date version (code: stale_version)"
          },
          "422": {
            "description": "Validation failed"
          },
          "429": {
            "description": "Too many requests; see Retry-After"
          }
        }
      }
    },
    "/boosts/{id}/stop": {
      "post": {
        "operationId": "stop_boost",
        "tags": ["Boosts"],
        "summary": "Stop a boost",
        "description": "Pause the campaign at Meta at once and end it. A stopped boost does not restart.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The encoded ID of the boost",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "maxLength": 500
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The boost as it now stands",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Boost"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No valid key"
          },
          "403": {
            "description": "Not the boost partner's own key, or not its boost"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Wrong state, or an out-of-date version (code: stale_version)"
          },
          "422": {
            "description": "Validation failed"
          },
          "429": {
            "description": "Too many requests; see Retry-After"
          }
        }
      }
    },
    "/boost-statements": {
      "get": {
        "operationId": "list_boost_statements",
        "tags": ["Boosts"],
        "summary": "List statements",
        "description": "The monthly statements of the fee on actual ad spend, newest first.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "The statements",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "period": {
                            "type": "string",
                            "example": "2026-11"
                          },
                          "currency": {
                            "type": "string"
                          },
                          "totals": {
                            "type": "object",
                            "properties": {
                              "spend": {
                                "type": "string"
                              },
                              "fee": {
                                "type": "string"
                              },
                              "adjustments": {
                                "type": "string"
                              },
                              "carried_in": {
                                "type": "string"
                              },
                              "charged": {
                                "type": "string"
                              }
                            }
                          },
                          "charge": {
                            "type": "object",
                            "properties": {
                              "status": {
                                "type": "string",
                                "enum": ["pending", "paid", "failed", "action_required", "carried"]
                              },
                              "charged_at": {
                                "type": "string",
                                "format": "date-time",
                                "nullable": true
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Not a boost partner's key"
          }
        }
      }
    },
    "/boost-statements/{period}": {
      "get": {
        "operationId": "get_boost_statement",
        "tags": ["Boosts"],
        "summary": "Get a statement",
        "description": "One month: each campaign's spend that month, the fee, and any adjustment for spend Meta corrected in an earlier month.",
        "parameters": [
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}$"
            }
          },
          {
            "name": "currency",
            "in": "query",
            "required": false,
            "description": "Picks one when the month has statements in two currencies",
            "schema": { "type": "string", "minLength": 3, "maxLength": 3 }
          }
        ],
        "responses": {
          "200": {
            "description": "The statement",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "period": {
                          "type": "string",
                          "example": "2026-11"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "totals": {
                          "type": "object",
                          "properties": {
                            "spend": {
                              "type": "string"
                            },
                            "fee": {
                              "type": "string"
                            },
                            "adjustments": {
                              "type": "string"
                            },
                            "carried_in": {
                              "type": "string"
                            },
                            "charged": {
                              "type": "string"
                            }
                          }
                        },
                        "charge": {
                          "type": "object",
                          "properties": {
                            "status": {
                              "type": "string",
                              "enum": ["pending", "paid", "failed", "action_required", "carried"]
                            },
                            "charged_at": {
                              "type": "string",
                              "format": "date-time",
                              "nullable": true
                            }
                          }
                        },
                        "lines": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "boost": {
                                "type": "string"
                              },
                              "schedule": {
                                "type": "string"
                              },
                              "event": {
                                "type": "string"
                              },
                              "payment_reference": {
                                "type": "string",
                                "nullable": true
                              },
                              "budget": {
                                "type": "string"
                              },
                              "month": {
                                "type": "string",
                                "description": "The month the spend was in; an adjustment names an earlier one"
                              },
                              "spend": {
                                "type": "string"
                              },
                              "fee": {
                                "type": "string"
                              },
                              "adjustment": {
                                "type": "string"
                              },
                              "note": {
                                "type": "string",
                                "nullable": true
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Not a boost partner's key"
          },
          "404": {
            "description": "No statement for that month"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "API key obtained from /login or /register. Keys expire after one year."
      }
    },
    "schemas": {
      "Schedule": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Encoded schedule ID"
          },
          "subdomain": {
            "type": "string",
            "description": "Unique subdomain identifier for the schedule"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Public URL of the schedule"
          },
          "type": {
            "type": "string",
            "enum": ["venue", "talent", "curator"],
            "description": "Type of schedule"
          },
          "name": {
            "type": "string",
            "description": "Display name of the schedule"
          },
          "email": {
            "type": "string",
            "format": "email",
            "nullable": true,
            "description": "Contact email"
          },
          "phone": {
            "type": "string",
            "nullable": true,
            "description": "Contact phone number (read only)"
          },
          "show_phone": {
            "type": "integer",
            "nullable": true,
            "description": "1 when the phone number is shown on the public page, 0 when it is not (read only)"
          },
          "website": {
            "type": "string",
            "nullable": true,
            "description": "Website URL"
          },
          "description": {
            "type": "string",
            "nullable": true,
            "description": "Schedule description (may contain markdown)"
          },
          "short_description": {
            "type": "string",
            "nullable": true,
            "description": "Short description of the schedule (plain text, max 200 characters)"
          },
          "timezone": {
            "type": "string",
            "nullable": true,
            "description": "IANA timezone identifier"
          },
          "language_code": {
            "type": "string",
            "nullable": true,
            "description": "Language code"
          },
          "profile_image_url": {
            "type": "string",
            "format": "uri",
            "nullable": true,
            "description": "URL of the schedule's profile image"
          },
          "address1": {
            "type": "string",
            "nullable": true,
            "description": "Street address"
          },
          "city": {
            "type": "string",
            "nullable": true,
            "description": "City"
          },
          "state": {
            "type": "string",
            "nullable": true,
            "description": "State or province"
          },
          "postal_code": {
            "type": "string",
            "nullable": true,
            "description": "Postal or ZIP code"
          },
          "country_code": {
            "type": "string",
            "nullable": true,
            "description": "Country code"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "ISO 8601 creation timestamp"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "ISO 8601 last update timestamp"
          },
          "groups": {
            "type": "array",
            "description": "Sub-schedules belonging to this schedule",
            "items": {
              "$ref": "#/components/schemas/Group"
            }
          }
        }
      },
      "Event": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Encoded event ID"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Public URL of the event"
          },
          "name": {
            "type": "string",
            "description": "Event name"
          },
          "short_description": {
            "type": "string",
            "nullable": true,
            "description": "Brief event description"
          },
          "description": {
            "type": "string",
            "nullable": true,
            "description": "Full event description (may contain markdown)"
          },
          "starts_at": {
            "type": "string",
            "format": "date-time",
            "description": "Event start date and time in UTC (Y-m-d H:i:s)"
          },
          "duration": {
            "type": "number",
            "nullable": true,
            "description": "Event duration in hours"
          },
          "ends_at": {
            "type": "string",
            "nullable": true,
            "example": "2026-05-09 19:30:00",
            "description": "End date and time in UTC (Y-m-d H:i:s): the start plus the duration, to the minute. Null when the event has no length. For a recurring event, the end of the first date"
          },
          "category_id": {
            "type": "integer",
            "nullable": true,
            "description": "Category ID from /categories"
          },
          "category_name": {
            "type": "string",
            "nullable": true,
            "description": "Human-readable category name"
          },
          "category_color": {
            "type": "string",
            "nullable": true,
            "description": "The category's colour as the schedule has it"
          },
          "event_url": {
            "type": "string",
            "format": "uri",
            "nullable": true,
            "description": "External URL for the event"
          },
          "registration_url": {
            "type": "string",
            "format": "uri",
            "nullable": true,
            "description": "External registration URL"
          },
          "venue_id": {
            "type": "string",
            "nullable": true,
            "description": "Encoded ID of the associated venue schedule"
          },
          "venue_name": {
            "type": "string",
            "nullable": true,
            "description": "Name of the associated venue"
          },
          "venue_address1": {
            "type": "string",
            "nullable": true,
            "description": "Street address of the associated venue"
          },
          "venue_subdomain": {
            "type": "string",
            "nullable": true,
            "description": "Subdomain of the associated venue schedule"
          },
          "flyer_image_url": {
            "type": "string",
            "format": "uri",
            "nullable": true,
            "description": "URL of the flyer image"
          },
          "is_draft": {
            "type": "boolean",
            "description": "Draft: hidden from the public page"
          },
          "is_private": {
            "type": "boolean",
            "description": "Unlisted: hidden from the calendar, only accessible via direct link"
          },
          "is_internal": {
            "type": "boolean",
            "description": "Internal: never public"
          },
          "external_id": {
            "type": "string",
            "nullable": true,
            "maxLength": 255,
            "description": "The id your own system gave the event. Unique for the schedule that owns the event, compared exactly"
          },
          "is_cancelled": {
            "type": "boolean",
            "readOnly": true,
            "description": "Whether the event is cancelled. Changed only through POST /events/{id}/cancel and /restore"
          },
          "cancelled_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "readOnly": true,
            "description": "When the event was cancelled"
          },
          "is_password_protected": {
            "type": "boolean",
            "description": "Whether the event page is protected by a password"
          },
          "schedule_type": {
            "type": "string",
            "enum": ["single", "recurring"],
            "description": "Whether this is a single or recurring event"
          },
          "recurring_frequency": {
            "type": "string",
            "nullable": true,
            "enum": ["daily", "weekly", "every_n_weeks", "monthly_date", "monthly_weekday", "yearly"],
            "description": "Recurrence frequency (only present for recurring events)"
          },
          "recurring_interval": {
            "type": "integer",
            "nullable": true,
            "description": "Interval for every_n_weeks frequency (only present for recurring events)"
          },
          "days_of_week": {
            "type": "string",
            "nullable": true,
            "description": "7-character string where each position represents a day (Sunday to Saturday), '1' means active (only present for recurring events)",
            "example": "0101010"
          },
          "recurring_end_type": {
            "type": "string",
            "nullable": true,
            "enum": ["never", "on_date", "after_events"],
            "description": "How the recurrence ends (only present for recurring events)"
          },
          "recurring_end_value": {
            "type": "string",
            "nullable": true,
            "description": "End date (Y-m-d) or number of occurrences, depending on recurring_end_type"
          },
          "rsvp_enabled": {
            "type": "boolean",
            "description": "Whether free registration is enabled"
          },
          "rsvp_limit": {
            "type": "integer",
            "nullable": true,
            "description": "Cap on registrations per date"
          },
          "tickets_enabled": {
            "type": "boolean",
            "description": "Whether ticket sales are enabled for this event"
          },
          "seating_plan_id": {
            "type": "string",
            "nullable": true,
            "description": "Encoded ID of the event's seating plan, null on a general-admission event"
          },
          "ticket_currency_code": {
            "type": "string",
            "nullable": true,
            "description": "3-letter ISO currency code for tickets"
          },
          "payment_method": {
            "type": "string",
            "nullable": true,
            "enum": ["cash", "stripe", "paypal", "invoiceninja", "payment_url", "payfast", "razorpay", null],
            "description": "Payment method for ticket sales"
          },
          "ticket_preset_id": {
            "type": "string",
            "nullable": true,
            "description": "Encoded ID of the schedule's ticket preset the event's tickets came from, null when they were set up by hand"
          },
          "terms_url": {
            "type": "string",
            "format": "uri",
            "nullable": true,
            "description": "URL to terms and conditions for ticket sales"
          },
          "tickets": {
            "type": "array",
            "description": "Ticket types for this event (only present when tickets are enabled)",
            "items": {
              "$ref": "#/components/schemas/Ticket"
            }
          },
          "addons": {
            "type": "array",
            "description": "Add-ons for this event (only present when tickets are enabled)",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "price": {
                  "type": "string",
                  "description": "Decimal string, such as \"5.000\""
                },
                "quantity": {
                  "type": "integer",
                  "nullable": true
                },
                "description": {
                  "type": "string",
                  "nullable": true
                },
                "image_url": {
                  "type": "string",
                  "nullable": true
                },
                "url": {
                  "type": "string",
                  "nullable": true
                }
              }
            }
          },
          "members": {
            "type": "object",
            "description": "Map of encoded member schedule IDs to member details",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "Member name"
                },
                "email": {
                  "type": "string",
                  "nullable": true,
                  "description": "Member email"
                },
                "youtube_url": {
                  "type": "string",
                  "nullable": true,
                  "description": "Member's YouTube URL"
                }
              }
            }
          },
          "event_parts": {
            "type": "array",
            "description": "Sub-sections or segments of the event",
            "items": {
              "$ref": "#/components/schemas/EventPart"
            }
          },
          "schedules": {
            "type": "array",
            "description": "Schedules associated with this event",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Encoded schedule ID"
                },
                "subdomain": {
                  "type": "string",
                  "description": "Schedule subdomain"
                },
                "name": {
                  "type": "string",
                  "description": "Schedule name"
                },
                "type": {
                  "type": "string",
                  "enum": ["venue", "talent", "curator"],
                  "description": "Schedule type"
                },
                "group": {
                  "type": "object",
                  "nullable": true,
                  "description": "Sub-schedule assignment for this event on this schedule",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Encoded sub-schedule ID"
                    },
                    "name": {
                      "type": "string",
                      "description": "Sub-schedule name"
                    },
                    "slug": {
                      "type": "string",
                      "description": "Sub-schedule slug"
                    }
                  }
                }
              }
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "ISO 8601 creation timestamp"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "ISO 8601 last update timestamp"
          }
        }
      },
      "EventInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "description": "Event name (required for create)"
          },
          "starts_at": {
            "type": "string",
            "description": "Start date and time in UTC (Y-m-d H:i:s format, required for create)",
            "example": "2025-06-15 19:00:00"
          },
          "duration": {
            "type": "number",
            "minimum": 0,
            "maximum": 8760,
            "description": "Event duration in hours"
          },
          "ends_at": {
            "type": "string",
            "nullable": true,
            "example": "2026-05-09 19:30:00",
            "description": "End date and time in UTC (Y-m-d H:i:s). Another way to give the length: send it instead of duration. Must be after the start and at most 8760 hours after it. Sent together with a duration that disagrees, the one that differs from the stored value wins on an update; a 422 when both were changed or the event is new. Null changes nothing"
          },
          "description": {
            "type": "string",
            "maxLength": 10000,
            "description": "Full event description (supports markdown)"
          },
          "short_description": {
            "type": "string",
            "maxLength": 500,
            "description": "Brief event description"
          },
          "event_url": {
            "type": "string",
            "format": "uri",
            "maxLength": 500,
            "description": "External URL for the event"
          },
          "event_password": {
            "type": "string",
            "maxLength": 255,
            "description": "Password to protect the event page. Kept only on an Unlisted (is_private) event"
          },
          "is_draft": {
            "type": "boolean",
            "nullable": true,
            "description": "Draft: hidden from the public page. With no visibility flag at all, a new event takes the schedule's default; on a drafts-by-default schedule send false to publish"
          },
          "is_private": {
            "type": "boolean",
            "nullable": true,
            "description": "Unlisted: kept off the calendar, reachable by direct link. Enterprise only; on a lower plan it is stripped and the event saved as a draft"
          },
          "is_internal": {
            "type": "boolean",
            "nullable": true,
            "description": "Internal: never public, and also a draft. Enterprise only, and not combined with is_private"
          },
          "rsvp_enabled": {
            "type": "boolean",
            "nullable": true,
            "description": "Free registration: collects a name and email with no payment step"
          },
          "rsvp_limit": {
            "type": "integer",
            "nullable": true,
            "minimum": 1,
            "description": "Cap on registrations per date"
          },
          "registration_url": {
            "type": "string",
            "format": "uri",
            "maxLength": 2048,
            "description": "External registration URL"
          },
          "category_id": {
            "type": "integer",
            "description": "Category ID from /categories"
          },
          "category": {
            "type": "string",
            "maxLength": 255,
            "description": "Category name (alternative to category_id)"
          },
          "tickets_enabled": {
            "type": "boolean",
            "description": "Whether to enable ticket sales"
          },
          "ticket_currency_code": {
            "type": "string",
            "description": "3-letter ISO currency code for tickets",
            "example": "USD"
          },
          "payment_method": {
            "type": "string",
            "enum": ["cash", "stripe", "paypal", "invoiceninja", "payment_url", "payfast", "razorpay", "manual"],
            "description": "Payment method for ticket sales"
          },
          "payment_instructions": {
            "type": "string",
            "maxLength": 5000,
            "description": "Instructions for manual payment"
          },
          "ticket_preset_id": {
            "type": "string",
            "nullable": true,
            "description": "Encoded ID of one of the schedule's ticket presets, or null to name none. Its tickets, payment and options replace what the request sends for them. A team member the schedule's owner has pick from presets takes their tickets from a preset whatever they send. Ignored for a caller who cannot change the event's tickets."
          },
          "ticket_preset_apply": {
            "type": "boolean",
            "description": "On an update, apply the preset named in ticket_preset_id even when it is the one the event already has, to take its current prices after it changed."
          },
          "schedule_type": {
            "type": "string",
            "enum": ["single", "recurring"],
            "description": "Whether this is a single or recurring event"
          },
          "recurring_frequency": {
            "type": "string",
            "enum": ["daily", "weekly", "every_n_weeks", "monthly_date", "monthly_weekday", "yearly"],
            "description": "Recurrence frequency (required when schedule_type is recurring)"
          },
          "recurring_interval": {
            "type": "integer",
            "minimum": 2,
            "description": "Interval for every_n_weeks frequency"
          },
          "recurring_end_type": {
            "type": "string",
            "enum": ["never", "on_date", "after_events"],
            "description": "How the recurrence should end"
          },
          "recurring_end_value": {
            "type": "string",
            "description": "End date (Y-m-d) for on_date, or number of occurrences for after_events"
          },
          "days_of_week": {
            "type": "string",
            "pattern": "^[01]{7}$",
            "description": "7-character string where each position represents a day (Sunday to Saturday), '1' means the event recurs on that day. Only used with weekly or every_n_weeks frequency.",
            "example": "0101010"
          },
          "venue_id": {
            "type": "string",
            "description": "Encoded ID of a venue schedule to associate with the event"
          },
          "venue_name": {
            "type": "string",
            "maxLength": 255,
            "description": "Venue name (used to look up an existing venue schedule)"
          },
          "venue_address1": {
            "type": "string",
            "maxLength": 255,
            "description": "Venue address (used together with venue_name to look up an existing venue schedule)"
          },
          "members": {
            "type": "array",
            "description": "Array of member objects with name and/or email to associate talent schedules with the event",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "Member name (used to look up an existing talent schedule)"
                },
                "email": {
                  "type": "string",
                  "format": "email",
                  "description": "Member email (used to look up an existing talent schedule)"
                }
              }
            }
          },
          "flyer_image_url": {
            "type": "string",
            "format": "uri",
            "nullable": true,
            "maxLength": 2048,
            "description": "The address of a picture to use as the flyer. It is fetched once, before anything is saved, and stored as our own file: a public http or https address that answers within 10 seconds with a JPEG, PNG, GIF or WebP of at most 8 MB, else a 422. On update a new address replaces the flyer, null removes it, and the address the event already reports is no change"
          },
          "external_id": {
            "type": "string",
            "nullable": true,
            "maxLength": 255,
            "description": "The id your own system knows this event by. Unique for the schedule that owns the event and compared exactly. On create, an id the schedule already has an event for is a 409. On update, a value sets or changes it and null clears it"
          },
          "upsert": {
            "type": "boolean",
            "writeOnly": true,
            "description": "POST only, with external_id: true updates the event that already has the id instead of answering 409. The update follows the rules of PUT /events/{id} and is not counted against the daily cap"
          },
          "schedule": {
            "type": "string",
            "maxLength": 255,
            "description": "Sub-schedule slug to assign this event to"
          },
          "tickets": {
            "type": "array",
            "description": "Ticket types for the event. On a create every row is new. On an update the list replaces the event's: a row with the id a read returned updates that row and keeps what it does not send, a row with no id is added, a stored row left out is retired, and an id that is not this event's is a 422",
            "items": {
              "type": "object",
              "required": ["type"],
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Update only: the encoded ID of the ticket type this row changes"
                },
                "type": {
                  "type": "string",
                  "nullable": true,
                  "maxLength": 255,
                  "description": "Ticket type name (e.g. General Admission, VIP). Required on create; may be null on an update, as a read returns it for an event with one unnamed ticket type"
                },
                "quantity": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Number of tickets available (0 or omit for unlimited)"
                },
                "price": {
                  "type": "number",
                  "minimum": 0,
                  "description": "Ticket price (0 for free)"
                },
                "description": {
                  "type": "string",
                  "maxLength": 1000,
                  "description": "Ticket description"
                },
                "sales_start_at": {
                  "type": "string",
                  "nullable": true,
                  "description": "When sales open, in UTC (Y-m-d H:i:s)"
                },
                "sales_end_at": {
                  "type": "string",
                  "nullable": true,
                  "description": "When sales close, in UTC (Y-m-d H:i:s)"
                },
                "max_per_order": {
                  "type": "integer",
                  "nullable": true,
                  "description": "Most of this ticket type one order may hold; empty for no limit"
                },
                "volume_discount": {
                  "type": "object",
                  "nullable": true,
                  "description": "A discount from a number of tickets up",
                  "properties": {
                    "min_quantity": {
                      "type": "integer",
                      "minimum": 2
                    },
                    "type": {
                      "type": "string",
                      "enum": ["percentage", "fixed"]
                    },
                    "value": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "addons": {
            "type": "array",
            "description": "Paid extras sold beside a ticket (parking, merchandise). Saved only while tickets_enabled is true. Rows on an update follow the rules of tickets",
            "items": {
              "type": "object",
              "required": ["type"],
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Update only: the encoded ID of the add-on this row changes"
                },
                "type": {
                  "type": "string",
                  "maxLength": 255
                },
                "quantity": {
                  "type": "integer",
                  "minimum": 0
                },
                "price": {
                  "type": "number",
                  "minimum": 0
                },
                "description": {
                  "type": "string",
                  "maxLength": 1000
                },
                "url": {
                  "type": "string",
                  "format": "uri",
                  "maxLength": 2000
                },
                "max_per_order": {
                  "type": "integer",
                  "nullable": true
                }
              }
            }
          },
          "event_parts": {
            "type": "array",
            "description": "Agenda parts of the event. Rows on an update follow the rules of tickets, except that a stored part left out is deleted",
            "items": {
              "type": "object",
              "required": ["name"],
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Update only: the encoded ID of the part this row changes"
                },
                "name": {
                  "type": "string",
                  "maxLength": 255,
                  "description": "Part name"
                },
                "description": {
                  "type": "string",
                  "maxLength": 1000,
                  "description": "Part description"
                },
                "start_time": {
                  "type": "string",
                  "description": "Start time for this part"
                },
                "end_time": {
                  "type": "string",
                  "description": "End time for this part"
                }
              }
            }
          }
        }
      },
      "Group": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Encoded sub-schedule ID"
          },
          "name": {
            "type": "string",
            "description": "Sub-schedule name"
          },
          "slug": {
            "type": "string",
            "description": "URL-friendly slug"
          },
          "color": {
            "type": "string",
            "nullable": true,
            "description": "Color associated with this sub-schedule"
          }
        }
      },
      "Ticket": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Encoded ticket ID"
          },
          "type": {
            "type": "string",
            "description": "Ticket type name"
          },
          "price": {
            "type": "string",
            "description": "Ticket price as a decimal string, such as \"25.000\""
          },
          "quantity": {
            "type": "integer",
            "nullable": true,
            "description": "Number of tickets available (0 or null for unlimited)"
          },
          "description": {
            "type": "string",
            "nullable": true,
            "description": "Ticket description"
          },
          "sales_start_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "When sales open (ISO 8601)"
          },
          "sales_end_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "When sales close (ISO 8601)"
          },
          "volume_discount": {
            "type": "object",
            "nullable": true,
            "description": "min_quantity, type (percentage or fixed) and value, or null"
          },
          "is_pass": {
            "type": "boolean",
            "description": "Whether this ticket type is a pass. A pass adds its pass_* settings"
          },
          "seating_band": {
            "type": "string",
            "description": "Present only on a ticket that sells a seating band, with is_allocated"
          },
          "is_allocated": {
            "type": "boolean",
            "description": "Present only beside seating_band: whether seats are picked from a map"
          }
        }
      },
      "EventPart": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Encoded part ID"
          },
          "name": {
            "type": "string",
            "description": "Part name"
          },
          "description": {
            "type": "string",
            "nullable": true,
            "description": "Part description"
          },
          "start_time": {
            "type": "string",
            "nullable": true,
            "description": "Start time for this part"
          },
          "end_time": {
            "type": "string",
            "nullable": true,
            "description": "End time for this part"
          }
        }
      },
      "Category": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Category ID"
          },
          "name": {
            "type": "string",
            "description": "Category name"
          }
        }
      },
      "Sale": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Encoded sale ID"
          },
          "event_id": {
            "type": "string",
            "description": "Encoded event ID"
          },
          "event_name": {
            "type": "string",
            "nullable": true,
            "description": "Name of the associated event"
          },
          "subdomain": {
            "type": "string",
            "nullable": true,
            "description": "Subdomain of the schedule where the sale was made"
          },
          "name": {
            "type": "string",
            "description": "Buyer name"
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "Buyer email"
          },
          "phone": {
            "type": "string",
            "nullable": true,
            "description": "Buyer phone, when one was asked for"
          },
          "event_date": {
            "type": "string",
            "format": "date",
            "description": "Date of the event occurrence, in the schedule's timezone"
          },
          "status": {
            "type": "string",
            "enum": ["unpaid", "paid", "cancelled", "refunded", "expired", "amount_mismatch"],
            "description": "Payment status. amount_mismatch is a sale whose payment arrived for a different amount, held for review"
          },
          "payment_method": {
            "type": "string",
            "nullable": true,
            "description": "The event's payment method when the sale was made, rsvp for a free registration, or import for an imported attendee"
          },
          "payment_amount": {
            "type": "number",
            "description": "What the buyer agreed to pay. On a group, the primary row holds the whole order's total and guest rows read 0"
          },
          "volume_discount_amount": {
            "type": "number",
            "nullable": true,
            "description": "What a volume discount took off"
          },
          "discount_amount": {
            "type": "number",
            "nullable": true,
            "description": "What a promo code took off"
          },
          "gift_card_amount": {
            "type": "number",
            "nullable": true,
            "description": "What a gift card paid"
          },
          "group_id": {
            "type": "string",
            "nullable": true,
            "description": "Shared by the rows of an order bought for several named guests"
          },
          "is_primary": {
            "type": "boolean",
            "description": "The row of a group that holds its totals and takes status actions"
          },
          "order_id": {
            "type": "string",
            "nullable": true,
            "description": "Shared by the rows of one purchase that covered several events"
          },
          "is_order_primary": {
            "type": "boolean",
            "description": "The anchoring row of a multi-event order"
          },
          "transaction_reference": {
            "type": "string",
            "nullable": true,
            "description": "External transaction reference"
          },
          "secret": {
            "type": "string",
            "description": "Secret key for accessing the ticket (only visible to event owner)"
          },
          "tickets": {
            "type": "array",
            "description": "Tickets included in this sale",
            "items": {
              "type": "object",
              "properties": {
                "ticket_id": {
                  "type": "string",
                  "description": "Encoded ticket ID"
                },
                "quantity": {
                  "type": "integer",
                  "description": "Number of tickets purchased"
                },
                "price": {
                  "type": "number",
                  "description": "The ticket type's price today, not what this buyer paid"
                },
                "type": {
                  "type": "string",
                  "description": "Ticket type name"
                },
                "is_addon": {
                  "type": "boolean"
                },
                "is_pass": {
                  "type": "boolean"
                },
                "seats": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "Allocated seating only: the labels of the seats this row holds"
                }
              }
            }
          },
          "total_quantity": {
            "type": "integer",
            "description": "Total number of tickets in this sale"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "ISO 8601 creation timestamp"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "ISO 8601 last update timestamp"
          }
        }
      },
      "Pagination": {
        "type": "object",
        "properties": {
          "current_page": {
            "type": "integer",
            "description": "Current page number"
          },
          "from": {
            "type": "integer",
            "nullable": true,
            "description": "First item number on this page"
          },
          "last_page": {
            "type": "integer",
            "description": "Last page number"
          },
          "per_page": {
            "type": "integer",
            "description": "Items per page"
          },
          "to": {
            "type": "integer",
            "nullable": true,
            "description": "Last item number on this page"
          },
          "total": {
            "type": "integer",
            "description": "Total number of items"
          },
          "path": {
            "type": "string",
            "format": "uri",
            "description": "Base URL for pagination"
          }
        }
      },
      "Feedback": {
        "type": "object",
        "properties": {
          "id": { "type": "string", "description": "Encoded feedback ID" },
          "event_id": { "type": "string", "description": "Encoded event ID" },
          "event_name": { "type": "string" },
          "event_date": { "type": "string", "format": "date", "nullable": true },
          "rating": { "type": "integer", "minimum": 1, "maximum": 5 },
          "comment": { "type": "string", "nullable": true },
          "attendee_name": { "type": "string", "nullable": true },
          "attendee_email": { "type": "string", "format": "email", "nullable": true },
          "created_at": { "type": "string", "format": "date-time" }
        }
      },
      "FanContent": {
        "type": "object",
        "properties": {
          "id": { "type": "string", "description": "Encoded submission ID, unique only within a given type" },
          "type": { "type": "string", "enum": ["comment", "photo", "video"] },
          "event_id": { "type": "string", "description": "Encoded event ID" },
          "event_name": { "type": "string" },
          "event_part_id": { "type": "string", "nullable": true, "description": "Encoded agenda part ID, when the submission targets one" },
          "event_date": { "type": "string", "format": "date", "nullable": true },
          "submitted_by": { "type": "string", "description": "Display name of the submitter" },
          "is_guest_submission": { "type": "boolean", "description": "True when submitted without an account" },
          "is_approved": { "type": "boolean" },
          "comment": { "type": "string", "description": "Comment text (type=comment)" },
          "photo_url": { "type": "string", "description": "Image URL (type=photo)" },
          "youtube_url": { "type": "string", "description": "Watch URL (type=video)" },
          "embed_url": { "type": "string", "description": "Embeddable URL (type=video)" },
          "created_at": { "type": "string", "format": "date-time" }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "Error message"
          },
          "errors": {
            "type": "object",
            "nullable": true,
            "description": "Field-level validation errors (keyed by field name, values are arrays of error messages)",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        },
        "required": ["error"]
      },
      "AppointmentSlot": {
        "type": "object",
        "properties": {
          "starts_at": {
            "type": "string",
            "format": "date-time",
            "description": "The start, in UTC"
          },
          "date": {
            "type": "string",
            "format": "date",
            "description": "The day, in the schedule's timezone"
          },
          "label": {
            "type": "string",
            "description": "A sentence to read to the guest, in the schedule's timezone and language"
          }
        }
      },
      "AppointmentType": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Encoded type ID"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "duration_minutes": {
            "type": "integer"
          },
          "price": {
            "type": "number"
          },
          "currency": {
            "type": "string",
            "nullable": true
          },
          "payment": {
            "type": "string",
            "enum": ["free", "cash", "online"],
            "description": "cash is paid at the appointment; online is paid from a link the guest is emailed"
          },
          "location_type": {
            "type": "string",
            "enum": ["in_person", "online", "phone"]
          },
          "location": {
            "type": "string",
            "nullable": true,
            "description": "The address or phone number. A meeting link is sent with the confirmation."
          },
          "host_name": {
            "type": "string",
            "nullable": true,
            "description": "The team member the appointment is with"
          },
          "timezone": {
            "type": "string"
          },
          "requires_approval": {
            "type": "boolean"
          },
          "asks_phone": {
            "type": "boolean"
          },
          "requires_phone": {
            "type": "boolean"
          },
          "questions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "required": {
                  "type": "boolean"
                },
                "options": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "next_available": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AppointmentSlot"
              }
            ],
            "nullable": true
          },
          "booking_url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "AppointmentBooking": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Encoded sale ID"
          },
          "status": {
            "type": "string",
            "enum": ["confirmed", "pending_approval", "awaiting_payment"]
          },
          "appointment_type_id": {
            "type": "string"
          },
          "appointment_type": {
            "type": "string"
          },
          "host_name": {
            "type": "string",
            "nullable": true
          },
          "starts_at": {
            "type": "string",
            "format": "date-time"
          },
          "ends_at": {
            "type": "string",
            "format": "date-time"
          },
          "label": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "price": {
            "type": "number"
          },
          "currency": {
            "type": "string",
            "nullable": true
          },
          "pay_by": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "When an unpaid hold is released (awaiting_payment only)"
          },
          "emails_sent": {
            "type": "boolean",
            "description": "Whether the guest was emailed"
          },
          "manage_url": {
            "type": "string",
            "format": "uri",
            "description": "The guest's page for the booking, where they pay, change the time or cancel"
          },
          "summary": {
            "type": "string",
            "description": "A sentence for an agent to read back to the guest"
          }
        }
      },
      "Boost": {
        "type": "object",
        "description": "A boost request on one of a boost partner's schedules. It launches under the partner's own Facebook Page and ad account only when the current version is approved AND the current budget is paid.",
        "properties": {
          "id": {
            "type": "string"
          },
          "schedule": {
            "type": "string",
            "description": "The schedule's subdomain"
          },
          "event": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "nullable": true
              },
              "name": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "nullable": true
              }
            }
          },
          "status": {
            "type": "string",
            "enum": ["pending_approval", "awaiting_payment", "ready", "in_review", "active", "completed", "declined", "rejected", "stopped"],
            "description": "ready: approved and paid, waiting only for the partner's account to be confirmed"
          },
          "version": {
            "type": "integer",
            "description": "Raised by every change to what the ad says or shows"
          },
          "ad": {
            "type": "object",
            "properties": {
              "headline": {
                "type": "string"
              },
              "text": {
                "type": "string"
              },
              "description": {
                "type": "string",
                "nullable": true
              },
              "call_to_action": {
                "type": "string"
              },
              "image_url": {
                "type": "string",
                "nullable": true
              },
              "destination_url": {
                "type": "string"
              }
            }
          },
          "audience": {
            "type": "object",
            "properties": {
              "summary": {
                "type": "string"
              }
            }
          },
          "budget": {
            "type": "object",
            "properties": {
              "amount": {
                "type": "string",
                "example": "50.00"
              },
              "currency": {
                "type": "string",
                "example": "USD"
              }
            }
          },
          "starts_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "ends_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "approval": {
            "type": "object",
            "properties": {
              "approved_version": {
                "type": "integer",
                "nullable": true
              },
              "decided_at": {
                "type": "string",
                "format": "date-time",
                "nullable": true
              },
              "note": {
                "type": "string",
                "nullable": true
              },
              "decline_reason": {
                "type": "string",
                "nullable": true,
                "enum": ["partner", "ownership_changed", "end_passed", null]
              }
            }
          },
          "payment": {
            "type": "object",
            "properties": {
              "confirmed": {
                "type": "boolean",
                "description": "True only when the confirmed payment is for the current budget"
              },
              "reference": {
                "type": "string",
                "nullable": true
              },
              "amount": {
                "type": "string",
                "nullable": true
              },
              "currency": {
                "type": "string",
                "nullable": true
              },
              "confirmed_at": {
                "type": "string",
                "format": "date-time",
                "nullable": true
              }
            }
          },
          "spend": {
            "type": "object",
            "properties": {
              "amount": {
                "type": "string"
              },
              "currency": {
                "type": "string"
              },
              "as_of": {
                "type": "string",
                "format": "date-time",
                "nullable": true
              },
              "final": {
                "type": "boolean",
                "description": "True once Meta's figures for an ended boost have stopped moving"
              }
            }
          },
          "meta_review": {
            "type": "string",
            "nullable": true,
            "description": "Meta's reason, when it refused the ad"
          },
          "stopped_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "stop_reason": {
            "type": "string",
            "nullable": true,
            "description": "The note given, or a code: partner, business, withdrawn, access_withdrawn, event_removed"
          },
          "stop_code": {
            "type": "string",
            "nullable": true
          },
          "submitted_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Authentication",
      "description": "Register, login, and manage API keys. Authentication endpoints have their own rate limits: registration is limited to 3 per IP per hour, login to 5 per IP per 15 minutes, and verification codes to 5 per email per hour."
    },
    {
      "name": "Schedules",
      "description": "Manage schedules. A schedule represents a venue, talent, or curator that hosts events. Create a schedule before adding events."
    },
    {
      "name": "Sub-schedules",
      "description": "Manage sub-schedules within a schedule. Sub-schedules allow you to organize events into categories within a schedule. Requires a Pro or Enterprise plan for reads and writes on the hosted service."
    },
    {
      "name": "Events",
      "description": "Manage events. Events belong to schedules and can have tickets, recurring configurations, and associated members. Reads and writes require a Pro or Enterprise plan on the hosted service. Rate limits, per account: GET requests are limited to 300 per minute, POST/PUT/DELETE requests to 30 per minute."
    },
    {
      "name": "Categories",
      "description": "List available event categories."
    },
    {
      "name": "Sales",
      "description": "Manage ticket sales for events. Supports creating, listing, viewing, updating status (mark as paid, refund, cancel), and deleting sales. Events must have tickets enabled and belong to a Pro schedule."
    },
    {
      "name": "Feedback",
      "description": "Read post-event ratings and fan submissions (comments, photos, videos) for your own schedules. Feedback requires a Pro plan; fan content is available on all plans."
    },
    {
      "name": "Appointments",
      "description": "List an appointment type's open times and book them, for an agent that talks to the guest (a voice agent on a phone line, for example). Requires a Pro plan."
    },
    {
      "name": "Boosts",
      "description": "For a boost partner: a network whose schedules boost under its own Facebook Page and Meta ad account. Approve or decline each version, record payment, stop campaigns, and read the monthly statements. Only the partner account's own key can use these."
    }
  ]
}
