openapi: 3.1.0
info:
  title: Blasts Partner API
  version: 1.0.0
  description: |
    Headless REST API for enterprise partners (FedEx, CRMs, SaaS) to deliver
    opt-in messages to Free B2B Leads extension inboxes.
servers:
  - url: https://b2b-leads-licenses.netlify.app/api/v1/partner
  - url: https://api.blasts.app/v1/partner
    description: Future vanity host
security:
  - BearerAuth: []
    HmacSignature: []
paths:
  /me:
    get:
      summary: Verify credentials and return partner quota
      responses:
        '200':
          description: Partner profile
  /messages/send:
    post:
      summary: Send one message to an enrolled recipient
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [to_email, body_plain]
              properties:
                to_email:
                  type: string
                  format: email
                body_plain:
                  type: string
                body_html:
                  type: string
                priority:
                  type: string
                  enum: [normal, urgent]
                request_read_ack:
                  type: boolean
                metadata:
                  type: object
      responses:
        '200':
          description: Message queued
  /enrollment/links:
    post:
      summary: Create hosted opt-in URL
  /enrollment/confirm:
    post:
      summary: Confirm opt-in for authenticated partner customer
  /enrollment/status:
    get:
      summary: Check enrollment by email
      parameters:
        - name: email
          in: query
          required: true
          schema:
            type: string
  /templates/validate:
    post:
      summary: Sanitize HTML without sending
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
    HmacSignature:
      type: apiKey
      in: header
      name: X-Blasts-Signature
