openapi: 3.1.0
info:
  title: Ladill Meet API
  version: 0.2.0
  description: REST API for Ladill Meet — video meetings, ecosystem integrations, and webhooks.
servers:
  - url: https://meet.ladill.com/api/v1
  - url: https://meet.ladill.com/api/service/v1
paths:
  /rooms:
    get:
      summary: List meetings (user token)
      security:
        - sanctum: []
    post:
      summary: Create a meeting (user token)
      security:
        - sanctum: []
  /rooms/{uuid}:
    get:
      summary: Get meeting details
      security:
        - sanctum: []
  /rooms/{uuid}/start:
    post:
      summary: Start a meeting session
      security:
        - sanctum: []
  /service/v1/rooms:
    post:
      summary: Create meeting from sibling Ladill app
      description: Requires service API key (Bearer MEET_API_KEY_*). Include source.app and source.entity_id.
      security:
        - serviceKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [owner_ref, organization_id, host_user_ref, title, source]
              properties:
                owner_ref: { type: string }
                organization_id: { type: integer }
                host_user_ref: { type: string }
                title: { type: string }
                scheduled_at: { type: string, format: date-time }
                source:
                  type: object
                  required: [app]
                  properties:
                    app: { type: string, example: care }
                    entity_type: { type: string, example: appointment }
                    entity_id: { type: string }
                invite_emails:
                  type: array
                  items: { type: string, format: email }
      responses:
        '201':
          description: Room created with join_url and embed_url
  /service/v1/rooms/{uuid}:
    get:
      summary: Get meeting by UUID (service key)
      security:
        - serviceKey: []
  /service/v1/rooms/{uuid}/start:
    post:
      summary: Start session (service key)
      security:
        - serviceKey: []
components:
  securitySchemes:
    sanctum:
      type: http
      scheme: bearer
    serviceKey:
      type: http
      scheme: bearer
      description: Per-app key from MEET_API_KEY_CARE, MEET_API_KEY_CRM, etc.
