openapi: 3.1.0
info:
  title: Cancel Hansel API
  version: 0.1.0
  description: >
    Evidence and protection API for online reservation, event booking, venue booking,
    hospitality booking, marketplace booking, and talent booking platforms.
  contact:
    name: Cancel Hansel Developer Support
    email: access@hanselboyd.com
    url: https://cancelhansel.com/developers
  license:
    name: Proprietary
    url: https://cancelhansel.com
servers:
  - url: https://api.cancelhansel.com
    description: Production API
paths:
  /v1/health:
    get:
      summary: Health check
      description: Check the health and readiness of the Cancel Hansel API.
      operationId: getHealth
      tags:
        - Health
      responses:
        '200':
          description: API is healthy
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum: [ok, healthy]
                  timestamp:
                    type: string
                    format: date-time
  /v1/partners/register:
    post:
      summary: Register a partner
      description: Create a new partner account and receive initial API credentials.
      operationId: registerPartner
      tags:
        - Partners
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [name, businessType, contactEmail]
              properties:
                name:
                  type: string
                businessType:
                  type: string
                contactEmail:
                  type: string
                  format: email
                website:
                  type: string
                  format: uri
      responses:
        '201':
          description: Partner registered successfully
  /v1/api-keys:
    post:
      summary: Create API key
      description: Generate a new scoped API key for partner integration.
      operationId: createApiKey
      tags:
        - Authentication
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                scopes:
                  type: array
                  items:
                    type: string
      responses:
        '201':
          description: API key created
  /oauth/token:
    post:
      summary: OAuth token endpoint
      description: Request an OAuth client credentials token if supported by the service.
      operationId: postOAuthToken
      tags:
        - Authentication
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required: [grant_type, client_id, client_secret]
              properties:
                grant_type:
                  type: string
                  default: client_credentials
                client_id:
                  type: string
                client_secret:
                  type: string
      responses:
        '501':
          description: OAuth client credentials not yet enabled
  /v1/auth-capabilities:
    get:
      summary: Get auth capabilities
      description: Discover API authentication options and OAuth metadata.
      operationId: getAuthCapabilities
      tags:
        - Authentication
      responses:
        '200':
          description: Auth capability information
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
