{
  "openapi": "3.1.0",
  "info": {
    "title": "Find@ Public API",
    "version": "1.0.0",
    "description": "Public API for the Find@ platform. This specification covers non-admin endpoints and API key based access only. OAuth, plans, and admin user management endpoints are intentionally excluded.\n"
  },
  "servers": [
    {
      "url": "https://find.at",
      "description": "Production server"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "api-key"
      }
    },
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "description": "Error flag (0 or 1). In some responses it is returned as string.",
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": true
      },
      "Account": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "username": {
            "type": "string"
          },
          "avatar": {
            "type": "string",
            "format": "uri"
          },
          "status": {
            "type": "string",
            "description": "Account plan status, e.g. free, pro"
          },
          "planid": {
            "type": "integer",
            "nullable": true
          },
          "expires": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "registered": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "email",
          "username",
          "status",
          "registered"
        ]
      },
      "AccountGetResponse": {
        "type": "object",
        "properties": {
          "error": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "data": {
            "$ref": "#/components/schemas/Account"
          }
        },
        "required": [
          "error",
          "data"
        ]
      },
      "AccountUpdateRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email"
          },
          "password": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "AccountUpdateResponse": {
        "type": "object",
        "properties": {
          "error": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "error",
          "message"
        ]
      },
      "PaginatedMeta": {
        "type": "object",
        "properties": {
          "result": {
            "type": "integer"
          },
          "perpage": {
            "type": "integer"
          },
          "currentpage": {
            "type": "integer"
          },
          "nextpage": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "maxpage": {
            "type": "integer"
          }
        },
        "required": [
          "result",
          "perpage",
          "currentpage",
          "maxpage"
        ]
      },
      "Domain": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "nullable": true
          },
          "domain": {
            "type": "string"
          },
          "redirectroot": {
            "type": "string",
            "nullable": true
          },
          "redirect404": {
            "type": "string",
            "nullable": true
          },
          "connection_method": {
            "type": "string",
            "enum": ["legacy", "cname_saas", "managed_ns"],
            "description": "How this domain is connected. \"legacy\" domains point DNS directly at Find@; \"cname_saas\" and \"managed_ns\" use the guided, Cloudflare-verified flow."
          },
          "connection_status": {
            "type": "string",
            "description": "Lifecycle status, e.g. active, pending_dns, pending_ssl, awaiting_nameservers, failed."
          },
          "active": {
            "type": "boolean"
          },
          "capabilities": {
            "$ref": "#/components/schemas/DomainCapabilities"
          }
        },
        "required": [
          "id",
          "domain"
        ]
      },
      "DomainsListResponse": {
        "type": "object",
        "properties": {
          "error": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              }
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "result": {
                "type": "integer"
              },
              "perpage": {
                "type": "integer"
              },
              "currentpage": {
                "type": "integer"
              },
              "nextpage": {
                "oneOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "maxpage": {
                "type": "integer"
              },
              "domains": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Domain"
                }
              }
            },
            "required": [
              "result",
              "perpage",
              "currentpage",
              "maxpage",
              "domains"
            ]
          }
        },
        "required": [
          "error",
          "data"
        ]
      },
      "DomainCreateRequest": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string",
            "description": "Branded domain including http or https. When connection_method is set, send a bare hostname instead (no scheme)."
          },
          "redirectroot": {
            "type": "string",
            "description": "Optional root redirect. Ignored when connection_method is set."
          },
          "redirect404": {
            "type": "string",
            "description": "Optional custom 404 redirect. Ignored when connection_method is set."
          },
          "connection_method": {
            "type": "string",
            "enum": ["cname_saas", "managed_ns"],
            "description": "Optional. Starts the guided, Cloudflare-verified connection flow instead of the legacy flow: cname_saas for a subdomain (add a CNAME), managed_ns for a root domain (delegate nameservers). The domain is not active until its ownership TXT record is verified with POST /domain/{id}/verify."
          }
        },
        "required": [
          "domain"
        ],
        "additionalProperties": false
      },
      "DomainCreateResponse": {
        "type": "object",
        "properties": {
          "error": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "id": {
            "type": "integer"
          },
          "connection_method": {
            "type": "string",
            "enum": ["cname_saas", "managed_ns"],
            "description": "Present only when connection_method was sent in the request."
          },
          "connection_status": {
            "type": "string",
            "description": "Present only when connection_method was sent in the request."
          }
        },
        "required": [
          "error",
          "id"
        ]
      },
      "DomainUpdateRequest": {
        "type": "object",
        "properties": {
          "redirectroot": {
            "type": "string"
          },
          "redirect404": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "SimpleMessageResponse": {
        "type": "object",
        "properties": {
          "error": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "error",
          "message"
        ]
      },
      "CTAOverlay": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "type": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CTAOverlayListResponse": {
        "type": "object",
        "properties": {
          "error": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "result": {
                "type": "integer"
              },
              "perpage": {
                "type": "integer"
              },
              "currentpage": {
                "type": "integer"
              },
              "nextpage": {
                "oneOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "maxpage": {
                "type": "integer"
              },
              "cta": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CTAOverlay"
                }
              }
            },
            "required": [
              "result",
              "perpage",
              "currentpage",
              "maxpage",
              "cta"
            ]
          }
        },
        "required": [
          "error",
          "data"
        ]
      },
      "Campaign": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "public": {
            "type": "boolean"
          },
          "rotator": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "list": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "boolean"
              }
            ]
          },
          "views": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "name",
          "public"
        ]
      },
      "CampaignsListResponse": {
        "type": "object",
        "properties": {
          "error": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "result": {
                "type": "integer"
              },
              "perpage": {
                "type": "integer"
              },
              "currentpage": {
                "type": "integer"
              },
              "nextpage": {
                "oneOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "maxpage": {
                "type": "integer"
              },
              "campaigns": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Campaign"
                }
              }
            },
            "required": [
              "result",
              "perpage",
              "currentpage",
              "maxpage",
              "campaigns"
            ]
          }
        },
        "required": [
          "error",
          "data"
        ]
      },
      "CampaignCreateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "public": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "CampaignCreateResponse": {
        "type": "object",
        "properties": {
          "error": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "id": {
            "type": "integer"
          },
          "campaign": {
            "type": "string",
            "description": "Campaign name"
          },
          "public": {
            "type": "boolean"
          },
          "rotator": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "boolean"
              }
            ]
          },
          "list": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "boolean"
              }
            ]
          }
        },
        "required": [
          "error",
          "id"
        ]
      },
      "Channel": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "color": {
            "type": "string"
          },
          "starred": {
            "type": "boolean"
          }
        }
      },
      "ChannelsListResponse": {
        "type": "object",
        "properties": {
          "error": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "result": {
                "type": "integer"
              },
              "perpage": {
                "type": "integer"
              },
              "currentpage": {
                "type": "integer"
              },
              "nextpage": {
                "oneOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "maxpage": {
                "type": "integer"
              },
              "channels": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Channel"
                }
              }
            },
            "required": [
              "result",
              "perpage",
              "currentpage",
              "maxpage",
              "channels"
            ]
          }
        },
        "required": [
          "error",
          "data"
        ]
      },
      "ChannelItem": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "links",
              "bio",
              "qr"
            ]
          },
          "id": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "preview": {
            "type": "string"
          },
          "link": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "ChannelItemsListResponse": {
        "type": "object",
        "properties": {
          "error": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "result": {
                "type": "integer"
              },
              "perpage": {
                "type": "integer"
              },
              "currentpage": {
                "type": "integer"
              },
              "nextpage": {
                "oneOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "maxpage": {
                "type": "integer"
              },
              "items": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ChannelItem"
                }
              }
            },
            "required": [
              "result",
              "perpage",
              "currentpage",
              "maxpage",
              "items"
            ]
          }
        },
        "required": [
          "error",
          "data"
        ]
      },
      "ChannelCreateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "color": {
            "type": "string",
            "description": "HEX color"
          },
          "starred": {
            "type": "boolean"
          }
        },
        "required": [
          "name"
        ]
      },
      "ChannelAssignRequestParams": {
        "type": "object",
        "properties": {
          "channelid": {
            "type": "integer"
          },
          "type": {
            "type": "string",
            "enum": [
              "links",
              "bio",
              "qr"
            ]
          },
          "itemid": {
            "type": "integer"
          }
        }
      },
      "Splash": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SplashListResponse": {
        "type": "object",
        "properties": {
          "error": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "result": {
                "type": "integer"
              },
              "perpage": {
                "type": "integer"
              },
              "currentpage": {
                "type": "integer"
              },
              "nextpage": {
                "oneOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "maxpage": {
                "type": "integer"
              },
              "splash": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Splash"
                }
              }
            },
            "required": [
              "result",
              "perpage",
              "currentpage",
              "maxpage",
              "splash"
            ]
          }
        },
        "required": [
          "error",
          "data"
        ]
      },
      "LinkSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "alias": {
            "type": "string"
          },
          "shorturl": {
            "type": "string"
          },
          "longurl": {
            "type": "string"
          },
          "clicks": {
            "type": "integer"
          },
          "uniqueclicks": {
            "type": "integer"
          },
          "domain": {
            "type": "string",
            "nullable": true
          },
          "campaign": {
            "nullable": true
          },
          "channel": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "date": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "LinksListResponse": {
        "type": "object",
        "properties": {
          "error": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "result": {
                "type": "integer"
              },
              "perpage": {
                "type": "integer"
              },
              "currentpage": {
                "type": "integer"
              },
              "nextpage": {
                "oneOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "maxpage": {
                "type": "integer"
              },
              "urls": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/LinkSummary"
                }
              }
            },
            "required": [
              "result",
              "perpage",
              "currentpage",
              "maxpage",
              "urls"
            ]
          }
        },
        "required": [
          "error",
          "data"
        ]
      },
      "LinkLocationTarget": {
        "type": "object",
        "properties": {
          "location": {
            "type": "string"
          },
          "link": {
            "type": "string"
          }
        }
      },
      "LinkDeviceTarget": {
        "type": "object",
        "properties": {
          "device": {
            "type": "string"
          },
          "link": {
            "type": "string"
          }
        }
      },
      "LinkLanguageTarget": {
        "type": "object",
        "properties": {
          "language": {
            "type": "string"
          },
          "link": {
            "type": "string"
          }
        }
      },
      "LinkParameter": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "LinkDeeplink": {
        "type": "object",
        "properties": {
          "auto": {
            "type": "boolean"
          },
          "apple": {
            "type": "string"
          },
          "google": {
            "type": "string"
          }
        }
      },
      "LinkDetails": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "alias": {
            "type": "string"
          },
          "shorturl": {
            "type": "string"
          },
          "longurl": {
            "type": "string"
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "location": {
            "nullable": true
          },
          "device": {
            "nullable": true
          },
          "expiry": {
            "nullable": true
          },
          "date": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "LinkAnalytics": {
        "type": "object",
        "properties": {
          "clicks": {
            "type": "integer"
          },
          "uniqueClicks": {
            "type": "integer"
          },
          "topCountries": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "object"
              }
            ]
          },
          "topReferrers": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "object"
              }
            ]
          },
          "topBrowsers": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "object"
              }
            ]
          },
          "topOs": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "object"
              }
            ]
          },
          "socialCount": {
            "type": "object",
            "properties": {
              "facebook": {
                "type": "integer"
              },
              "twitter": {
                "type": "integer"
              },
              "instagram": {
                "type": "integer"
              },
              "linkedin": {
                "type": "integer"
              }
            },
            "additionalProperties": true
          }
        }
      },
      "LinkGetResponse": {
        "type": "object",
        "properties": {
          "error": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "id": {
            "type": "integer"
          },
          "details": {
            "$ref": "#/components/schemas/LinkDetails"
          },
          "data": {
            "$ref": "#/components/schemas/LinkAnalytics"
          }
        },
        "required": [
          "error",
          "id",
          "details",
          "data"
        ]
      },
      "LinkCreateRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "custom": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "description": "Redirection type [direct, frame, splash] or id/overlay-id for advanced modes."
          },
          "password": {
            "type": "string"
          },
          "domain": {
            "type": "string"
          },
          "expiry": {
            "type": "string"
          },
          "geotarget": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LinkLocationTarget"
            }
          },
          "devicetarget": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LinkDeviceTarget"
            }
          },
          "languagetarget": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LinkLanguageTarget"
            }
          },
          "metatitle": {
            "type": "string"
          },
          "metadescription": {
            "type": "string"
          },
          "metaimage": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "pixels": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "channel": {
            "type": "integer"
          },
          "campaign": {
            "type": "integer"
          },
          "deeplink": {
            "$ref": "#/components/schemas/LinkDeeplink"
          },
          "status": {
            "type": "string"
          },
          "parameters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LinkParameter"
            }
          }
        },
        "required": [
          "url"
        ]
      },
      "LinkCreateResponse": {
        "type": "object",
        "properties": {
          "error": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "id": {
            "type": "integer"
          },
          "shorturl": {
            "type": "string"
          }
        },
        "required": [
          "error",
          "id",
          "shorturl"
        ]
      },
      "LinkUpdateRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/LinkCreateRequest"
          }
        ]
      },
      "Pixel": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "type": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "tag": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PixelsListResponse": {
        "type": "object",
        "properties": {
          "error": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "result": {
                "type": "integer"
              },
              "perpage": {
                "type": "integer"
              },
              "currentpage": {
                "type": "integer"
              },
              "nextpage": {
                "oneOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "maxpage": {
                "type": "integer"
              },
              "pixels": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Pixel"
                }
              }
            },
            "required": [
              "result",
              "perpage",
              "currentpage",
              "maxpage",
              "pixels"
            ]
          }
        },
        "required": [
          "error",
          "data"
        ]
      },
      "PixelCreateRequest": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "gtmpixel",
              "gapixel",
              "fbpixel",
              "adwordspixel",
              "linkedinpixel",
              "twitterpixel",
              "adrollpixel",
              "quorapixel",
              "pinterest",
              "bing",
              "snapchat",
              "reddit",
              "tiktok"
            ]
          },
          "name": {
            "type": "string"
          },
          "tag": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "name",
          "tag"
        ]
      },
      "PixelUpdateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "tag": {
            "type": "string"
          }
        },
        "required": [
          "tag"
        ]
      },
      "QRCodeSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "link": {
            "type": "string"
          },
          "scans": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "QRListResponse": {
        "type": "object",
        "properties": {
          "error": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "result": {
                "type": "integer"
              },
              "perpage": {
                "type": "integer"
              },
              "currentpage": {
                "type": "integer"
              },
              "nextpage": {
                "oneOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "maxpage": {
                "type": "integer"
              },
              "qrs": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/QRCodeSummary"
                }
              }
            },
            "required": [
              "result",
              "perpage",
              "currentpage",
              "maxpage",
              "qrs"
            ]
          }
        },
        "required": [
          "error",
          "data"
        ]
      },
      "QRDetails": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "link": {
            "type": "string"
          },
          "scans": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "QRAnalytics": {
        "type": "object",
        "properties": {
          "clicks": {
            "type": "integer"
          },
          "uniqueClicks": {
            "type": "integer"
          },
          "topCountries": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "topReferrers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "topBrowsers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "topOs": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "socialCount": {
            "type": "object",
            "properties": {
              "facebook": {
                "type": "integer"
              },
              "twitter": {
                "type": "integer"
              },
              "instagram": {
                "type": "integer"
              },
              "linkedin": {
                "type": "integer"
              }
            },
            "additionalProperties": true
          }
        }
      },
      "QRGetResponse": {
        "type": "object",
        "properties": {
          "error": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "details": {
            "$ref": "#/components/schemas/QRDetails"
          },
          "data": {
            "$ref": "#/components/schemas/QRAnalytics"
          }
        },
        "required": [
          "error",
          "details",
          "data"
        ]
      },
      "QRCreateRequest": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "text",
              "vcard",
              "staticvcard",
              "link",
              "email",
              "phone",
              "sms",
              "wifi"
            ]
          },
          "data": {
            "description": "Data to be embedded. Type varies by QR type."
          },
          "background": {
            "type": "string",
            "description": "RGB color e.g. rgb(255,255,255)"
          },
          "foreground": {
            "type": "string",
            "description": "RGB color e.g. rgb(0,0,0)"
          },
          "logo": {
            "type": "string",
            "description": "Path to logo (png or jpg)"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "data"
        ]
      },
      "BulkCreateResult": {
        "type": "object",
        "properties": {
          "index": { "type": "integer" },
          "status": { "type": "string", "enum": ["created", "error"] },
          "id": { "type": "integer", "description": "Present when status is created." },
          "shorturl": { "type": "string", "description": "Present when status is created." },
          "message": { "type": "string", "description": "Present when status is error." },
          "reason": { "type": "string", "enum": ["conflict", "validation", "forbidden", "error"], "description": "Present when status is error." }
        }
      },
      "BulkCreateResponse": {
        "type": "object",
        "properties": {
          "error": { "oneOf": [{ "type": "integer" }, { "type": "string" }] },
          "created": { "type": "integer" },
          "failed": { "type": "integer" },
          "results": { "type": "array", "items": { "$ref": "#/components/schemas/BulkCreateResult" } }
        },
        "required": ["error", "created", "failed", "results"]
      },
      "QRCreateResponse": {
        "type": "object",
        "properties": {
          "error": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "id": {
            "type": "integer"
          },
          "link": {
            "type": "string"
          }
        },
        "required": [
          "error",
          "id",
          "link"
        ]
      },
      "QRUpdateRequest": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "data": {
            "description": "Data to be embedded."
          },
          "background": {
            "type": "string"
          },
          "foreground": {
            "type": "string"
          },
          "logo": {
            "type": "string"
          }
        },
        "required": [
          "data"
        ]
      },
      "DomainCapabilities": {
        "type": "object",
        "properties": {
          "links": {
            "type": "boolean"
          },
          "bio": {
            "type": "boolean"
          },
          "sites": {
            "type": "boolean"
          },
          "mail": {
            "type": "boolean"
          }
        }
      },
      "DomainOwnershipChallenge": {
        "type": "object",
        "description": "Ownership TXT record to publish while a cname_saas/managed_ns domain has not yet verified.",
        "properties": {
          "hostname": {
            "type": "string"
          },
          "txt_record_name": {
            "type": "string"
          },
          "txt_record_value": {
            "type": "string"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "DomainDetails": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "domain": {
            "type": "string"
          },
          "redirectroot": {
            "type": "string",
            "nullable": true
          },
          "redirect404": {
            "type": "string",
            "nullable": true
          },
          "connection_method": {
            "type": "string",
            "enum": ["legacy", "cname_saas", "managed_ns"]
          },
          "connection_status": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          },
          "capabilities": {
            "$ref": "#/components/schemas/DomainCapabilities"
          },
          "ownership": {
            "$ref": "#/components/schemas/DomainOwnershipChallenge"
          },
          "cname_target": {
            "type": "string",
            "description": "Present only for a verified cname_saas domain."
          },
          "nameservers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Present only for a verified managed_ns domain."
          }
        },
        "required": [
          "id",
          "domain"
        ]
      },
      "DomainGetResponse": {
        "type": "object",
        "properties": {
          "error": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "domain": {
            "$ref": "#/components/schemas/DomainDetails"
          }
        },
        "required": [
          "error",
          "domain"
        ]
      },
      "BookingService": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "duration_min": {
            "type": "integer"
          },
          "buffer_after_min": {
            "type": "integer"
          },
          "price": {
            "type": "string"
          },
          "status": {
            "type": "integer",
            "description": "1 active, 0 disabled"
          }
        },
        "required": [
          "id",
          "name",
          "duration_min"
        ]
      },
      "BookingServicesListResponse": {
        "type": "object",
        "properties": {
          "error": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "result": {
                "type": "integer"
              },
              "perpage": {
                "type": "integer"
              },
              "currentpage": {
                "type": "integer"
              },
              "nextpage": {
                "oneOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "maxpage": {
                "type": "integer"
              },
              "services": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/BookingService"
                }
              }
            },
            "required": [
              "result",
              "perpage",
              "currentpage",
              "maxpage",
              "services"
            ]
          }
        },
        "required": [
          "error",
          "data"
        ]
      },
      "BookingServiceCreateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Required. 1-160 characters."
          },
          "duration_min": {
            "type": "integer",
            "description": "Required. Between 5 and 1440."
          },
          "buffer_after_min": {
            "type": "integer",
            "description": "Optional. Between 0 and 480."
          },
          "price": {
            "type": "string",
            "description": "Optional display price."
          }
        },
        "required": [
          "name",
          "duration_min"
        ],
        "additionalProperties": false
      },
      "BookingServiceCreateResponse": {
        "type": "object",
        "properties": {
          "error": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "id": {
            "type": "integer"
          }
        },
        "required": [
          "error",
          "id"
        ]
      },
      "BookingResource": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "integer",
            "description": "1 active, 0 disabled"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "BookingResourcesListResponse": {
        "type": "object",
        "properties": {
          "error": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "result": {
                "type": "integer"
              },
              "perpage": {
                "type": "integer"
              },
              "currentpage": {
                "type": "integer"
              },
              "nextpage": {
                "oneOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "maxpage": {
                "type": "integer"
              },
              "resources": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/BookingResource"
                }
              }
            },
            "required": [
              "result",
              "perpage",
              "currentpage",
              "maxpage",
              "resources"
            ]
          }
        },
        "required": [
          "error",
          "data"
        ]
      },
      "BookingResourceCreateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Required. 1-120 characters."
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false
      },
      "BookingResourceCreateResponse": {
        "type": "object",
        "properties": {
          "error": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "id": {
            "type": "integer"
          }
        },
        "required": [
          "error",
          "id"
        ]
      },
      "BookingTimeoff": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "resource_id": {
            "type": "integer",
            "description": "0 blocks every resource."
          },
          "start": {
            "type": "string",
            "format": "date-time"
          },
          "end": {
            "type": "string",
            "format": "date-time"
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "resource_id",
          "start",
          "end"
        ]
      },
      "BookingTimeoffListResponse": {
        "type": "object",
        "properties": {
          "error": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "result": {
                "type": "integer"
              },
              "perpage": {
                "type": "integer"
              },
              "currentpage": {
                "type": "integer"
              },
              "nextpage": {
                "oneOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "maxpage": {
                "type": "integer"
              },
              "timeoff": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/BookingTimeoff"
                }
              }
            },
            "required": [
              "result",
              "perpage",
              "currentpage",
              "maxpage",
              "timeoff"
            ]
          }
        },
        "required": [
          "error",
          "data"
        ]
      },
      "BookingTimeoffCreateRequest": {
        "type": "object",
        "properties": {
          "start": {
            "type": "string",
            "description": "Required start date/time, e.g. 2026-08-10 09:00:00."
          },
          "end": {
            "type": "string",
            "description": "Required end date/time, must be after start."
          },
          "resource_id": {
            "type": "integer",
            "description": "Optional. 0 (default) blocks every resource."
          },
          "reason": {
            "type": "string",
            "description": "Optional internal note."
          }
        },
        "required": [
          "start",
          "end"
        ],
        "additionalProperties": false
      },
      "BookingTimeoffCreateResponse": {
        "type": "object",
        "properties": {
          "error": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "id": {
            "type": "integer"
          }
        },
        "required": [
          "error",
          "id"
        ]
      },
      "Booking": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "resource_id": {
            "type": "integer"
          },
          "service_id": {
            "type": "integer"
          },
          "start": {
            "type": "string",
            "format": "date-time"
          },
          "end": {
            "type": "string",
            "format": "date-time"
          },
          "duration_min": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": ["pending", "confirmed", "cancelled", "completed", "noshow"]
          },
          "customer_name": {
            "type": "string"
          },
          "customer_email": {
            "type": "string"
          },
          "customer_phone": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "resource_id",
          "service_id",
          "start",
          "end",
          "status"
        ]
      },
      "BookingsListResponse": {
        "type": "object",
        "properties": {
          "error": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "result": {
                "type": "integer"
              },
              "perpage": {
                "type": "integer"
              },
              "currentpage": {
                "type": "integer"
              },
              "nextpage": {
                "oneOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "maxpage": {
                "type": "integer"
              },
              "bookings": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Booking"
                }
              }
            },
            "required": [
              "result",
              "perpage",
              "currentpage",
              "maxpage",
              "bookings"
            ]
          }
        },
        "required": [
          "error",
          "data"
        ]
      },
      "BookingGetResponse": {
        "type": "object",
        "properties": {
          "error": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "booking": {
            "$ref": "#/components/schemas/Booking"
          }
        },
        "required": [
          "error",
          "booking"
        ]
      },
      "BookingStatusUpdateRequest": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string",
            "enum": ["confirm", "cancel", "complete", "noshow"]
          }
        },
        "required": [
          "action"
        ],
        "additionalProperties": false
      },
      "Site": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "alias": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "domain": {
            "type": "string",
            "nullable": true,
            "description": "Connected custom domain, if any."
          },
          "url": {
            "type": "string",
            "nullable": true,
            "description": "Live URL, present only once the connected domain is active."
          },
          "files": {
            "type": "integer"
          },
          "bytes": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "title",
          "alias",
          "status"
        ]
      },
      "SitesListResponse": {
        "type": "object",
        "properties": {
          "error": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "result": {
                "type": "integer"
              },
              "perpage": {
                "type": "integer"
              },
              "currentpage": {
                "type": "integer"
              },
              "nextpage": {
                "oneOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "maxpage": {
                "type": "integer"
              },
              "sites": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Site"
                }
              }
            },
            "required": [
              "result",
              "perpage",
              "currentpage",
              "maxpage",
              "sites"
            ]
          }
        },
        "required": [
          "error",
          "data"
        ]
      },
      "Mailbox": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "UUID."
          },
          "local_part": {
            "type": "string"
          },
          "full_address": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "provider_status": {
            "type": "string"
          },
          "quota_gb": {
            "type": "integer"
          },
          "quota_mb": {
            "type": "integer"
          },
          "usage_bytes": {
            "type": "integer",
            "nullable": true
          },
          "usage_checked_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "is_catchall": {
            "type": "boolean"
          },
          "signature_enabled": {
            "type": "boolean"
          },
          "domain_id": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "local_part",
          "full_address",
          "status"
        ]
      },
      "MailboxesListResponse": {
        "type": "object",
        "properties": {
          "error": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "result": {
                "type": "integer"
              },
              "perpage": {
                "type": "integer"
              },
              "currentpage": {
                "type": "integer"
              },
              "nextpage": {
                "oneOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "maxpage": {
                "type": "integer"
              },
              "mailboxes": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Mailbox"
                }
              }
            },
            "required": [
              "result",
              "perpage",
              "currentpage",
              "maxpage",
              "mailboxes"
            ]
          }
        },
        "required": [
          "error",
          "data"
        ]
      }
    }
  },
  "paths": {
    "/api/account": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Get account information",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Account information",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountGetResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/account/update": {
      "put": {
        "tags": [
          "Account"
        ],
        "summary": "Update account information",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Account updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountUpdateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/domains": {
      "get": {
        "tags": [
          "Branded Domains"
        ],
        "summary": "List branded domains",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "required": false,
            "description": "Per page data result"
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "required": false,
            "description": "Current page request"
          }
        ],
        "responses": {
          "200": {
            "description": "List of branded domains",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainsListResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/domain/add": {
      "post": {
        "tags": [
          "Branded Domains"
        ],
        "summary": "Create a branded domain",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DomainCreateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Domain created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainCreateResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/domain/{id}/update": {
      "put": {
        "tags": [
          "Branded Domains"
        ],
        "summary": "Update a branded domain",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DomainUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Domain updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleMessageResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/domain/{id}/delete": {
      "delete": {
        "tags": [
          "Branded Domains"
        ],
        "summary": "Delete a branded domain",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Domain deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleMessageResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/domain/{id}": {
      "get": {
        "tags": [
          "Branded Domains"
        ],
        "summary": "Get a branded domain",
        "description": "Returns the full connection details of one domain, including its ownership TXT record, or its assigned CNAME target or nameservers once verified.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Domain details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainGetResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/domain/{id}/verify": {
      "post": {
        "tags": [
          "Branded Domains"
        ],
        "summary": "Verify domain ownership",
        "description": "Checks the ownership TXT record for a connecting (cname_saas/managed_ns) domain. Once verified, this begins provisioning the CNAME target or the assigned nameservers.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Domain details after the verification attempt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainGetResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/domain/{id}/ownership/regenerate": {
      "post": {
        "tags": [
          "Branded Domains"
        ],
        "summary": "Regenerate the ownership challenge",
        "description": "Issues a new ownership TXT record for a domain that has not verified yet, for example after the previous challenge expired.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Domain details with the new ownership challenge",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainGetResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/overlay": {
      "get": {
        "tags": [
          "CTA Overlays"
        ],
        "summary": "List CTA overlays",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of CTA overlays",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CTAOverlayListResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/campaigns": {
      "get": {
        "tags": [
          "Campaigns"
        ],
        "summary": "List campaigns",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of campaigns",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignsListResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/campaign/add": {
      "post": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Create a campaign",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignCreateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Campaign created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignCreateResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/campaign/{campaignid}/assign/{linkid}": {
      "post": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Assign a link to a campaign",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "campaignid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "linkid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Link successfully assigned",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleMessageResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/campaign/{id}/update": {
      "put": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Update a campaign",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignCreateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Campaign updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignCreateResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/campaign/{id}/delete": {
      "delete": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Delete a campaign",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Campaign deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleMessageResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/channels": {
      "get": {
        "tags": [
          "Channels"
        ],
        "summary": "List channels",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of channels",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChannelsListResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/channel/{id}": {
      "get": {
        "tags": [
          "Channels"
        ],
        "summary": "List items in a channel",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of items in channel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChannelItemsListResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/channel/add": {
      "post": {
        "tags": [
          "Channels"
        ],
        "summary": "Create a channel",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChannelCreateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Channel created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "oneOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "string"
                        }
                      ]
                    },
                    "id": {
                      "type": "integer"
                    },
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "color": {
                      "type": "string"
                    },
                    "starred": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "error",
                    "id"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/channel/{channelid}/assign/{type}/{itemid}": {
      "post": {
        "tags": [
          "Channels"
        ],
        "summary": "Assign an item to a channel",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "channelid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "type",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "links",
                "bio",
                "qr"
              ]
            }
          },
          {
            "name": "itemid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Item successfully added to channel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleMessageResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/channel/{id}/update": {
      "put": {
        "tags": [
          "Channels"
        ],
        "summary": "Update a channel",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChannelCreateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Channel updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "oneOf": [
                        { "type": "integer" },
                        { "type": "string" }
                      ]
                    },
                    "id": { "type": "integer" },
                    "name": { "type": "string" },
                    "description": { "type": "string" },
                    "color": { "type": "string" },
                    "starred": { "type": "boolean" }
                  },
                  "required": ["error", "id"]
                }
              }
            }
          }
        }
      }
    },
    "/api/channel/{id}/delete": {
      "delete": {
        "tags": [
          "Channels"
        ],
        "summary": "Delete a channel",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Channel deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleMessageResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/splash": {
      "get": {
        "tags": [
          "Custom Splash"
        ],
        "summary": "List custom splash pages",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of splash pages",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SplashListResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/urls": {
      "get": {
        "tags": [
          "Links"
        ],
        "summary": "List links",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "date",
                "click"
              ]
            }
          },
          {
            "name": "short",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Search using short URL. If present, other filters are ignored."
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Search by keyword."
          }
        ],
        "responses": {
          "200": {
            "description": "List of links or single link if `short` is used and matches",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/LinksListResponse"
                    },
                    {
                      "$ref": "#/components/schemas/LinkGetResponse"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/url/validate": {
      "get": {
        "tags": ["Links"],
        "summary": "Check alias availability before creating a link",
        "security": [{ "ApiKeyAuth": [] }],
        "parameters": [
          { "name": "alias", "in": "query", "required": true, "schema": { "type": "string" }, "description": "The alias to check." },
          { "name": "domain", "in": "query", "required": false, "schema": { "type": "string" }, "description": "Optional branded domain to check against." }
        ],
        "responses": {
          "200": {
            "description": "Validation result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": { "oneOf": [{ "type": "integer" }, { "type": "string" }] },
                    "available": { "type": "boolean" },
                    "alias": { "type": "string" },
                    "reason": { "type": "string", "enum": ["taken", "moderated", "reserved", "premium", "too_short"] },
                    "message": { "type": "string" }
                  },
                  "required": ["error", "available", "alias"]
                }
              }
            }
          }
        }
      }
    },
    "/api/url/{id}": {
      "get": {
        "tags": [
          "Links"
        ],
        "summary": "Get a single link",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Full link details and analytics",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LinkGetResponse"
                }
              }
            }
          },
          "404": {
            "description": "Link not found",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ErrorResponse" }
              }
            }
          }
        }
      }
    },
    "/api/url/add": {
      "post": {
        "tags": [
          "Links"
        ],
        "summary": "Shorten a link",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LinkCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Link created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LinkCreateResponse"
                }
              }
            }
          },
          "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } },
          "409": { "description": "Alias already taken or reserved", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } },
          "422": { "description": "Validation error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }
        }
      }
    },
    "/api/urls/bulk": {
      "post": {
        "tags": ["Links"],
        "summary": "Bulk create links (max 50 per request)",
        "security": [{ "ApiKeyAuth": [] }],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "urls": { "type": "array", "maxItems": 50, "items": { "$ref": "#/components/schemas/LinkCreateRequest" } }
                },
                "required": ["urls"]
              }
            }
          }
        },
        "responses": {
          "201": { "description": "All links created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BulkCreateResponse" } } } },
          "207": { "description": "Partial success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BulkCreateResponse" } } } },
          "422": { "description": "All links failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BulkCreateResponse" } } } }
        }
      }
    },
    "/api/url/{id}/update": {
      "put": {
        "tags": [
          "Links"
        ],
        "summary": "Update a link",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LinkUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Link updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LinkCreateResponse"
                }
              }
            }
          },
          "404": { "description": "Link not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } },
          "409": { "description": "Alias conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } },
          "422": { "description": "Validation error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }
        }
      }
    },
    "/api/url/{id}/delete": {
      "delete": {
        "tags": [
          "Links"
        ],
        "summary": "Delete a link",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Link deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleMessageResponse"
                }
              }
            }
          },
          "404": { "description": "Link not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }
        }
      }
    },
    "/api/pixels": {
      "get": {
        "tags": [
          "Pixels"
        ],
        "summary": "List pixels",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of pixels",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PixelsListResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/pixel/add": {
      "post": {
        "tags": [
          "Pixels"
        ],
        "summary": "Create a pixel",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PixelCreateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Pixel created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "oneOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "string"
                        }
                      ]
                    },
                    "id": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "error",
                    "id"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/pixel/{id}/update": {
      "put": {
        "tags": [
          "Pixels"
        ],
        "summary": "Update a pixel",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PixelUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Pixel updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleMessageResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/pixel/{id}/delete": {
      "delete": {
        "tags": [
          "Pixels"
        ],
        "summary": "Delete a pixel",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pixel deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleMessageResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/qr": {
      "get": {
        "tags": [
          "QR Codes"
        ],
        "summary": "List QR codes",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of QR codes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QRListResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/qr/{id}": {
      "get": {
        "tags": [
          "QR Codes"
        ],
        "summary": "Get a single QR code",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "QR details and analytics",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QRGetResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/qr/add": {
      "post": {
        "tags": [
          "QR Codes"
        ],
        "summary": "Create a QR code",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QRCreateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "QR code created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QRCreateResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/qr/{id}/update": {
      "put": {
        "tags": [
          "QR Codes"
        ],
        "summary": "Update a QR code",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QRUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "QR code updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleMessageResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/qr/{id}/delete": {
      "delete": {
        "tags": [
          "QR Codes"
        ],
        "summary": "Delete a QR code",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "QR code deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleMessageResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/booking/services": {
      "get": {
        "tags": [
          "Booking"
        ],
        "summary": "List booking services",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "required": false,
            "description": "Per page data result"
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "required": false,
            "description": "Current page request"
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "required": false,
            "description": "Filter by status, 1 for active, 0 for disabled"
          }
        ],
        "responses": {
          "200": {
            "description": "List of booking services",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingServicesListResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/booking/service/add": {
      "post": {
        "tags": [
          "Booking"
        ],
        "summary": "Create a booking service",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BookingServiceCreateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Service created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingServiceCreateResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/booking/service/{id}/update": {
      "put": {
        "tags": [
          "Booking"
        ],
        "summary": "Update a booking service",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BookingServiceCreateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Service updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleMessageResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/booking/service/{id}/delete": {
      "delete": {
        "tags": [
          "Booking"
        ],
        "summary": "Delete a booking service",
        "description": "Disables the service; historic bookings keep their reference to it.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Service removed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleMessageResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/booking/resources": {
      "get": {
        "tags": [
          "Booking"
        ],
        "summary": "List booking resources",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "required": false,
            "description": "Per page data result"
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "required": false,
            "description": "Current page request"
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "required": false,
            "description": "Filter by status, 1 for active, 0 for disabled"
          }
        ],
        "responses": {
          "200": {
            "description": "List of booking resources (staff or stations)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingResourcesListResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/booking/resource/add": {
      "post": {
        "tags": [
          "Booking"
        ],
        "summary": "Create a booking resource",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BookingResourceCreateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Resource created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingResourceCreateResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/booking/resource/{id}/delete": {
      "delete": {
        "tags": [
          "Booking"
        ],
        "summary": "Delete a booking resource",
        "description": "Resources with upcoming bookings cannot be removed.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Resource removed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleMessageResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/booking/timeoff": {
      "get": {
        "tags": [
          "Booking"
        ],
        "summary": "List upcoming blocked time",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "required": false,
            "description": "Per page data result"
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "required": false,
            "description": "Current page request"
          }
        ],
        "responses": {
          "200": {
            "description": "List of upcoming blocked time",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingTimeoffListResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/booking/timeoff/add": {
      "post": {
        "tags": [
          "Booking"
        ],
        "summary": "Create blocked time",
        "description": "Blocks a time range so it cannot be booked. Use resource_id 0 to block the entire business.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BookingTimeoffCreateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Blocked time created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingTimeoffCreateResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/booking/timeoff/{id}/delete": {
      "delete": {
        "tags": [
          "Booking"
        ],
        "summary": "Delete blocked time",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Blocked time removed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleMessageResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/booking/bookings": {
      "get": {
        "tags": [
          "Booking"
        ],
        "summary": "List bookings",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "required": false,
            "description": "Per page data result"
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "required": false,
            "description": "Current page request"
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": ["pending", "confirmed", "cancelled", "completed", "noshow"]
            },
            "required": false,
            "description": "Filter by status"
          },
          {
            "name": "resource_id",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "required": false,
            "description": "Filter by resource id"
          },
          {
            "name": "service_id",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "required": false,
            "description": "Filter by service id"
          }
        ],
        "responses": {
          "200": {
            "description": "List of bookings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingsListResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/booking/{id}": {
      "get": {
        "tags": [
          "Booking"
        ],
        "summary": "Get a single booking",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Booking details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingGetResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/booking/{id}/status": {
      "post": {
        "tags": [
          "Booking"
        ],
        "summary": "Change a booking's status",
        "description": "Confirm, cancel, complete, or mark a booking as a no-show.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BookingStatusUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Booking updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleMessageResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/sites": {
      "get": {
        "tags": [
          "Sites"
        ],
        "summary": "List Sites",
        "description": "Read-only. Creating, uploading, and publishing a Site is a dashboard-only flow with no API endpoint.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "required": false,
            "description": "Per page data result"
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "required": false,
            "description": "Current page request"
          }
        ],
        "responses": {
          "200": {
            "description": "List of Sites",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SitesListResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/mailboxes": {
      "get": {
        "tags": [
          "Business Email"
        ],
        "summary": "List Mailboxes",
        "description": "Read-only. Creating a mailbox is a dashboard-only flow with no API endpoint. The mailbox password is never returned.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "required": false,
            "description": "Per page data result"
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "required": false,
            "description": "Current page request"
          }
        ],
        "responses": {
          "200": {
            "description": "List of business email mailboxes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MailboxesListResponse"
                }
              }
            }
          }
        }
      }
    }
  }
}