{
  "openapi": "3.1.0",
  "info": {
    "title": "TaskHawk Opaque Event Interface",
    "version": "1.0.0",
    "description": "A private enrolled interface that accepts one versioned opaque envelope. The public contract intentionally discloses no internal record, model, provider, key, or routing vocabulary."
  },
  "servers": [],
  "paths": {
    "/v1/events": {
      "post": {
        "summary": "Submit an opaque event",
        "operationId": "submitOpaqueEvent",
        "security": [
          {
            "enrolledBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpaqueEnvelope"
              },
              "examples": {
                "synthetic": {
                  "value": {
                    "body": "VEFTS0hBV0tfT1BBUVVFX0VYQU1QTEU",
                    "schema": "taskhawk.opaque-envelope.v1"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The opaque envelope was admitted to the enrolled private path."
          },
          "400": {
            "description": "The request was rejected."
          },
          "404": {
            "description": "Not found."
          },
          "503": {
            "description": "The service is unavailable."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "enrolledBearer": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "OpaqueEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "body",
          "schema"
        ],
        "properties": {
          "body": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]+$",
            "minLength": 2,
            "maxLength": 6144
          },
          "schema": {
            "type": "string",
            "const": "taskhawk.opaque-envelope.v1"
          }
        }
      }
    }
  }
}
