{
  "openapi": "3.1.0",
  "info": {
    "title": "Le Scribe Audio — Public REST API & Webhooks",
    "version": "1.0.0",
    "description": "Asynchronous French 2-pass AI audio & video transcription API (up to 10h / 10 GB) with speaker diarization, modifiable Microsoft Word (.docx) export, RGAA 4.1 .SRT/.VTT subtitles, and executive + chrono-thematic summary. Storage hosted in France (OVHcloud AES-256) with 1-click deletion; AI inference via Google Cloud Vertex AI (Europe region, Zero Data Retention).",
    "contact": {
      "name": "Le Scribe Audio",
      "url": "https://lescribeaudio.com/integrations-mcp",
      "email": "info@lescribeaudio.com"
    },
    "license": {
      "name": "Commercial API / MIT SDKs",
      "url": "https://lescribeaudio.com/cgu"
    }
  },
  "servers": [
    {
      "url": "https://lescribeaudio.com",
      "description": "Production API (France / OVHcloud)"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "lsa_api_v1",
        "description": "Personal API Key minted via POST /api/v1/public/tokens or https://lescribeaudio.com/integrations-mcp (paying accounts)."
      }
    },
    "schemas": {
      "TranscriptionSubmitJson": {
        "type": "object",
        "required": ["source_url"],
        "properties": {
          "source_url": { "type": "string", "format": "uri", "description": "Public HTTPS media URL (.mp3, .m4a, .wav, .mp4, .ds2, .dss)." },
          "filename": { "type": "string", "maxLength": 200 },
          "verbatim_mode": { "type": "string", "enum": ["clean", "full"], "default": "clean" },
          "generate_summary": { "type": "boolean", "default": false },
          "context_hints": { "type": "string", "maxLength": 400 },
          "webhook_url": { "type": "string", "format": "uri" },
          "webhook_secret": { "type": "string", "maxLength": 128 }
        }
      },
      "CreateWebhookRequest": {
        "type": "object",
        "required": ["url"],
        "properties": {
          "url": { "type": "string", "format": "uri", "description": "Public HTTPS webhook endpoint (SSRF-validated)." },
          "events": {
            "type": "array",
            "items": { "type": "string", "enum": ["transcription.completed", "transcription.failed", "webhook.test"] }
          }
        }
      }
    }
  },
  "paths": {
    "/api/v1/public": {
      "get": {
        "operationId": "getPublicApiInfo",
        "summary": "Public API discovery metadata",
        "security": [],
        "responses": { "200": { "description": "API capabilities and endpoint map" } }
      }
    },
    "/api/v1/public/transcriptions": {
      "get": {
        "operationId": "listTranscriptions",
        "summary": "List authenticated user transcriptions",
        "parameters": [
          { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 25 } }
        ],
        "responses": { "200": { "description": "List of transcription jobs" } }
      },
      "post": {
        "operationId": "submitTranscription",
        "summary": "Submit an audio/video file (multipart) or public HTTPS URL (JSON) for 2-pass transcription",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": { "schema": { "$ref": "#/components/schemas/TranscriptionSubmitJson" } },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": ["file"],
                "properties": {
                  "file": { "type": "string", "format": "binary" },
                  "verbatim_mode": { "type": "string", "enum": ["clean", "full"] },
                  "generate_summary": { "type": "boolean" },
                  "context_hints": { "type": "string" },
                  "webhook_url": { "type": "string", "format": "uri" }
                }
              }
            }
          }
        },
        "responses": { "202": { "description": "Transcription queued" } }
      }
    },
    "/api/v1/public/transcriptions/{file_id}": {
      "get": {
        "operationId": "getTranscription",
        "summary": "Inspect status, segments, full text, and executive/chrono-thematic summary",
        "parameters": [
          { "name": "file_id", "in": "path", "required": true, "schema": { "type": "string" } }
        ],
        "responses": { "200": { "description": "Transcription detail payload" } }
      }
    },
    "/api/v1/public/transcriptions/{file_id}/export": {
      "get": {
        "operationId": "exportTranscription",
        "summary": "Download modifiable Word (.docx), SRT, VTT, TXT, or JSON deliverable",
        "parameters": [
          { "name": "file_id", "in": "path", "required": true, "schema": { "type": "string" } },
          { "name": "format", "in": "query", "schema": { "type": "string", "enum": ["docx", "srt", "vtt", "txt", "json"], "default": "docx" } }
        ],
        "responses": { "200": { "description": "Deliverable file stream or JSON payload" } }
      }
    },
    "/api/v1/public/webhooks": {
      "get": {
        "operationId": "listWebhooks",
        "summary": "List configured outbound webhooks",
        "responses": { "200": { "description": "Webhook list" } }
      },
      "post": {
        "operationId": "createWebhook",
        "summary": "Register an HTTPS outbound webhook signed with HMAC-SHA256 (X-LeScribe-Signature)",
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateWebhookRequest" } } }
        },
        "responses": { "201": { "description": "Webhook registered with signing secret" } }
      }
    },
    "/api/v1/public/webhooks/{webhook_id}": {
      "delete": {
        "operationId": "deleteWebhook",
        "summary": "Delete an outbound webhook",
        "parameters": [
          { "name": "webhook_id", "in": "path", "required": true, "schema": { "type": "string" } }
        ],
        "responses": { "200": { "description": "Webhook deleted" } }
      }
    },
    "/api/v1/public/webhooks/{webhook_id}/test": {
      "post": {
        "operationId": "testWebhook",
        "summary": "Send a signed webhook.test ping",
        "parameters": [
          { "name": "webhook_id", "in": "path", "required": true, "schema": { "type": "string" } }
        ],
        "responses": { "200": { "description": "Delivery attempt status" } }
      }
    }
  }
}
