{
  "openapi": "3.1.0",
  "info": {
    "title": "BotBoots API",
    "version": "2026-08-06",
    "description": "Private-beta API for verified physical execution. The first action is mobile equipment verification."
  },
  "servers": [{ "url": "https://getbotboots.com/api/v1" }],
  "paths": {
    "/capabilities": {
      "get": {
        "summary": "List available physical-action capabilities",
        "responses": { "200": { "description": "Current capabilities and assurance levels" } }
      }
    },
    "/jobs": {
      "post": {
        "summary": "Create a private-beta physical job",
        "security": [{ "bearerAuth": [] }],
        "parameters": [{
          "name": "Idempotency-Key",
          "in": "header",
          "required": false,
          "schema": { "type": "string", "maxLength": 120 }
        }],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/CreateJob" }
            }
          }
        },
        "responses": {
          "201": { "description": "Job created" },
          "400": { "description": "Invalid request" },
          "401": { "description": "Invalid API key" },
          "503": { "description": "Private-beta intake unavailable" }
        }
      }
    },
    "/jobs/{job_id}": {
      "get": {
        "summary": "Get current job state",
        "security": [{ "bearerAuth": [] }],
        "parameters": [{
          "name": "job_id",
          "in": "path",
          "required": true,
          "schema": { "type": "string", "pattern": "^job_[A-Za-z0-9_-]+$" }
        }],
        "responses": {
          "200": { "description": "Current job state" },
          "401": { "description": "Invalid API key" },
          "404": { "description": "Job not found" }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": { "type": "http", "scheme": "bearer" }
    },
    "schemas": {
      "CreateJob": {
        "type": "object",
        "additionalProperties": false,
        "required": ["action", "asset", "location", "assurance", "sla_hours"],
        "properties": {
          "action": { "type": "string", "const": "equipment.verify" },
          "asset": {
            "type": "object",
            "required": ["type"],
            "properties": {
              "type": { "type": "string", "minLength": 2, "maxLength": 80 },
              "manufacturer": { "type": "string", "maxLength": 100 },
              "model": { "type": "string", "maxLength": 100 },
              "serial_number": { "type": ["string", "null"], "maxLength": 160 }
            }
          },
          "location": {
            "type": "object",
            "required": ["country", "city"],
            "properties": {
              "country": { "type": "string", "pattern": "^[A-Z]{2}$" },
              "postal_code": { "type": "string", "maxLength": 20 },
              "city": { "type": "string", "maxLength": 120 }
            }
          },
          "assurance": {
            "type": "object",
            "required": ["level", "jurisdiction"],
            "properties": {
              "level": { "enum": ["verified_operator", "qualified_technician", "authorised_expert"] },
              "jurisdiction": { "type": "string", "minLength": 2, "maxLength": 20 }
            }
          },
          "sla_hours": { "type": "integer", "minimum": 24, "maximum": 120 },
          "customer_reference": { "type": "string", "maxLength": 160 },
          "instructions": { "type": "string", "maxLength": 3000 }
        }
      }
    }
  }
}
