{
  "openapi": "3.1.0",
  "info": {
    "title": "DaytoNah API",
    "version": "0.1.0",
    "description": "Sandbox cloud for AI agents — Cloud Hypervisor microVMs on bare metal. E2B-SDK drop-in compatible.\n\nSee `/llms.txt` for an LLM-friendly summary and `research/{daytona,e2b}-features.md` for the parity matrix."
  },
  "servers": [
    { "url": "http://51.159.202.231:3000", "description": "Live trial deployment" },
    { "url": "http://127.0.0.1:3000",      "description": "Local" }
  ],
  "security": [{ "bearerAuth": [] }],
  "components": {
    "securitySchemes": {
      "bearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "opaque" }
    },
    "schemas": {
      "Sandbox": {
        "type": "object",
        "properties": {
          "id":        { "type": "string", "example": "sbx_01KRE..." },
          "orgId":     { "type": "string" },
          "templateId":{ "type": "string" },
          "hostId":    { "type": "string" },
          "state":     { "type": "string", "enum": ["provisioning","running","stopping","stopped","starting","resuming","archiving","archived","unarchiving","deleted","failed-start"] },
          "cpu":       { "type": "integer" },
          "ramMb":     { "type": "integer" },
          "diskGb":    { "type": "integer" },
          "gpus":      { "type": "integer" },
          "internalIp":{ "type": ["string","null"] },
          "language":  { "type": ["string","null"], "enum": ["python","bash","node","sh", null] },
          "envVars":   { "type": "object", "additionalProperties": { "type": "string" } },
          "autoStopMinutes":  { "type": "integer" },
          "autoArchiveDays":  { "type": "integer" },
          "autoDeleteDays":   { "type": "integer" },
          "forkedFromId":     { "type": ["string","null"] },
          "exposedPorts":     { "type": "array", "items": { "type": "integer" } },
          "createdAt": { "type": "string", "format": "date-time" },
          "startedAt": { "type": ["string","null"], "format": "date-time" },
          "stoppedAt": { "type": ["string","null"], "format": "date-time" }
        }
      },
      "CreateSandboxBody": {
        "type": "object",
        "properties": {
          "template":          { "type": "string", "default": "dnah-base" },
          "templateID":        { "type": "string", "description": "E2B SDK alias for `template`." },
          "cpu":               { "type": "integer", "minimum": 1, "maximum": 16, "default": 1 },
          "ram_mb":            { "type": "integer", "minimum": 128, "maximum": 32768, "default": 512 },
          "disk_gb":           { "type": "integer", "minimum": 1, "maximum": 100, "default": 2 },
          "gpus":              { "type": "integer", "minimum": 0, "maximum": 8, "default": 0 },
          "env":               { "type": "object", "additionalProperties": { "type": "string" } },
          "envVars":           { "type": "object", "additionalProperties": { "type": "string" } },
          "language":          { "type": "string", "enum": ["python","bash","node","sh"] },
          "auto_stop_minutes": { "type": "integer", "default": 0 },
          "auto_archive_days": { "type": "integer", "default": 0 },
          "auto_delete_days":  { "type": "integer", "default": 0 },
          "ssh_keys":          { "type": "array", "items": { "type": "string" } },
          "volume_ids":        { "type": "array", "items": { "type": "string" } }
        }
      },
      "ExecResult": {
        "type": "object",
        "properties": {
          "result": {
            "type": "object",
            "properties": {
              "ok":        { "type": "boolean" },
              "stdout":    { "type": "string" },
              "stderr":    { "type": "string" },
              "exit_code": { "type": "integer" }
            }
          }
        }
      },
      "Template": {
        "type": "object",
        "properties": {
          "id":            { "type": "string" },
          "name":          { "type": "string" },
          "version":       { "type": "string" },
          "state":         { "type": "string", "enum": ["building","ready","failed","deprecated"] },
          "image":         { "type": ["string","null"] },
          "entrypoint":    { "type": ["string","null"] },
          "contentHash":   { "type": ["string","null"], "description": "SHA-256 of rootfs.ext4" },
          "buildLogs":     { "type": ["string","null"] },
          "defaultCpu":    { "type": "integer" },
          "defaultRamMb":  { "type": "integer" },
          "defaultDiskGb": { "type": "integer" },
          "kernelPath":    { "type": "string" },
          "rootfsPath":    { "type": "string" }
        }
      },
      "Session": {
        "type": "object",
        "properties": { "id": { "type": "string" }, "sandboxId": { "type": "string" }, "cwd": { "type": "string" } }
      },
      "SessionExecResult": {
        "type": "object",
        "properties": {
          "command_id": { "type": "string" },
          "stdout":     { "type": "string" },
          "stderr":     { "type": "string" },
          "exit_code":  { "type": "integer" },
          "cwd":        { "type": "string", "description": "Updated cwd after the exec — `cd` inside the cmd survives." }
        }
      },
      "Webhook": {
        "type": "object",
        "properties": {
          "id":      { "type": "string" },
          "url":     { "type": "string", "format": "uri" },
          "events":  { "type": "array", "items": { "type": "string" }, "description": "Empty array == all events. Example: ['sandbox.state_updated']" },
          "enabled": { "type": "string", "enum": ["true","false"] }
        }
      },
      "Volume": {
        "type": "object",
        "properties": {
          "id":          { "type": "string" },
          "orgId":       { "type": "string" },
          "name":        { "type": "string" },
          "sizeGb":      { "type": "integer" },
          "state":       { "type": "string", "enum": ["pending","available","attached"] },
          "attachedTo":  { "type": ["string","null"] },
          "mountPath":   { "type": "string" },
          "backingPath": { "type": ["string","null"] },
          "hostId":      { "type": ["string","null"] }
        }
      },
      "Metrics": {
        "type": "object",
        "properties": {
          "ts":               { "type": "string", "format": "date-time" },
          "state":            { "type": "string" },
          "cpu_count":        { "type": "integer" },
          "mem_total_mb":     { "type": "integer" },
          "mem_used_mb":      { "type": "integer" },
          "mem_guest_total_mb": { "type": "integer" },
          "load_1m":          { "type": "number" },
          "disk_total_gb":    { "type": "integer" },
          "disk_used_mb":     { "type": "integer" },
          "gpus":             { "type": "integer" },
          "age_seconds":      { "type": "integer" }
        }
      }
    }
  },
  "paths": {
    "/health":                { "get": { "tags": ["ops"], "summary": "Liveness probe", "security": [], "responses": { "200": { "description": "ok" } } } },
    "/metrics":               { "get": { "tags": ["ops"], "summary": "Prometheus metrics (cluster-wide)", "security": [], "responses": { "200": { "description": "exposition format" } } } },
    "/llms.txt":              { "get": { "tags": ["ops"], "summary": "LLM-friendly API summary", "security": [], "responses": { "200": { "description": "text/plain" } } } },
    "/openapi.json":          { "get": { "tags": ["ops"], "summary": "This document", "security": [], "responses": { "200": { "description": "OpenAPI 3.1 spec" } } } },

    "/v1/sandboxes": {
      "get":  { "tags": ["sandboxes"], "summary": "List sandboxes (org-scoped)", "parameters": [
                  { "name":"state",   "in":"query", "schema":{"type":"string"} },
                  { "name":"limit",   "in":"query", "schema":{"type":"integer","default":100} },
                  { "name":"org_id",  "in":"query", "schema":{"type":"string"}, "description":"admin only" }],
              "responses": { "200": { "description": "ok", "content": { "application/json": { "schema": { "type":"array","items":{ "$ref":"#/components/schemas/Sandbox" } } } } } } },
      "post": { "tags": ["sandboxes"], "summary": "Create a sandbox (native or E2B body shape)",
                "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateSandboxBody" } } } },
                "responses":   { "201": { "description":"created", "content":{ "application/json":{ "schema":{ "$ref":"#/components/schemas/Sandbox" } } } } } } },
    "/v1/sandboxes/{id}": {
      "parameters": [ { "name":"id", "in":"path", "required": true, "schema":{ "type":"string" } } ],
      "get":    { "tags":["sandboxes"], "responses": { "200": { "description":"ok" } } },
      "delete": { "tags":["sandboxes"], "responses": { "200": { "description":"deleted" } } } },
    "/v1/sandboxes/{id}/exec":      { "parameters":[{ "name":"id","in":"path","required":true,"schema":{"type":"string"} }], "post": { "tags":["sandboxes"], "summary":"Direct TCP exec (~8 ms p50)", "requestBody":{ "required":true,"content":{"application/json":{"schema":{ "type":"object","required":["cmd"], "properties":{ "cmd":{"type":"array","items":{"type":"string"}}, "timeout_ms":{"type":"integer","default":30000} } } } } }, "responses":{ "200":{ "description":"ok","content":{"application/json":{"schema":{ "$ref":"#/components/schemas/ExecResult" } } } } } } },
    "/v1/sandboxes/{id}/run-code":  { "parameters":[{ "name":"id","in":"path","required":true,"schema":{"type":"string"} }], "post": { "tags":["sandboxes"], "summary":"Code interpreter — python/bash/node. `lang` falls back to sandbox.language.", "requestBody":{ "required":true,"content":{"application/json":{"schema":{ "type":"object","required":["code"], "properties":{ "code":{"type":"string"}, "lang":{"type":"string","enum":["python","bash","node","sh"]}, "timeout_ms":{"type":"integer","default":30000} } } } } }, "responses":{ "200":{ "description":"ok" } } } },
    "/v1/sandboxes/{id}/stop":      { "parameters":[{ "name":"id","in":"path","required":true,"schema":{"type":"string"} }], "post":{ "tags":["sandboxes"], "summary":"Freeze to disk (alias of /pause)", "responses":{ "200":{ "description":"stopping" } } } },
    "/v1/sandboxes/{id}/pause":     { "parameters":[{ "name":"id","in":"path","required":true,"schema":{"type":"string"} }], "post":{ "tags":["sandboxes"], "summary":"E2B SDK alias for /stop", "responses":{ "200":{ "description":"stopping" } } } },
    "/v1/sandboxes/{id}/start":     { "parameters":[{ "name":"id","in":"path","required":true,"schema":{"type":"string"} }], "post":{ "tags":["sandboxes"], "summary":"Restore (auto-unarchives)", "responses":{ "200":{ "description":"starting" } } } },
    "/v1/sandboxes/{id}/resume":    { "parameters":[{ "name":"id","in":"path","required":true,"schema":{"type":"string"} }], "post":{ "tags":["sandboxes"], "summary":"E2B SDK alias for /start", "responses":{ "200":{ "description":"starting" } } } },
    "/v1/sandboxes/{id}/archive":   { "parameters":[{ "name":"id","in":"path","required":true,"schema":{"type":"string"} }], "post":{ "tags":["sandboxes"], "summary":"tar+zstd cold storage", "responses":{ "200":{ "description":"archiving" } } } },
    "/v1/sandboxes/{id}/migrate":   { "parameters":[{ "name":"id","in":"path","required":true,"schema":{"type":"string"} }], "post":{ "tags":["sandboxes"], "summary":"Cross-host move", "requestBody":{ "content":{"application/json":{"schema":{ "type":"object", "properties":{ "target_host_id":{"type":"string"} } } } } }, "responses":{ "200":{ "description":"migrating" } } } },
    "/v1/sandboxes/{id}/snapshot":  { "parameters":[{ "name":"id","in":"path","required":true,"schema":{"type":"string"} }], "post":{ "tags":["sandboxes"], "summary":"Live snapshot (~25 ms)", "responses":{ "200":{ "description":"ok" } } } },
    "/v1/sandboxes/{id}/restore":   { "parameters":[{ "name":"id","in":"path","required":true,"schema":{"type":"string"} }], "post":{ "tags":["sandboxes"], "summary":"Restore from a snapshot", "responses":{ "200":{ "description":"ok" } } } },
    "/v1/sandboxes/{id}/clone":     { "parameters":[{ "name":"id","in":"path","required":true,"schema":{"type":"string"} }], "post":{ "tags":["sandboxes"], "summary":"New sandbox from existing snapshot", "responses":{ "201":{ "description":"created" } } } },
    "/v1/sandboxes/{id}/fork":      { "parameters":[{ "name":"id","in":"path","required":true,"schema":{"type":"string"} }], "post":{ "tags":["sandboxes"], "summary":"Snapshot + clone in one call (66 ms total)", "responses":{ "201":{ "description":"created" } } } },
    "/v1/sandboxes/{id}/expose":    { "parameters":[{ "name":"id","in":"path","required":true,"schema":{"type":"string"} }], "post":{ "tags":["sandboxes"], "summary":"Expose a port behind HMAC-token URL", "requestBody":{ "required":true,"content":{"application/json":{"schema":{ "type":"object","required":["port"], "properties":{ "port":{"type":"integer"}, "public":{"type":"boolean","default":false}, "ttl_seconds":{"type":"integer"} } } } } }, "responses":{ "200":{ "description":"ok" } } } },
    "/v1/sandboxes/{id}/expose/{port}": { "parameters":[{ "name":"id","in":"path","required":true,"schema":{"type":"string"} }, { "name":"port","in":"path","required":true,"schema":{"type":"integer"} }], "delete":{ "tags":["sandboxes"], "summary":"Revoke a port exposure", "responses":{ "200":{ "description":"ok" } } } },
    "/v1/sandboxes/{id}/egress-policy": { "parameters":[{ "name":"id","in":"path","required":true,"schema":{"type":"string"} }], "post":{ "tags":["sandboxes"], "summary":"Per-sandbox nftables firewall", "requestBody":{ "required":true,"content":{"application/json":{"schema":{ "type":"object","required":["mode"], "properties":{ "mode":{"type":"string","enum":["allow","deny"]}, "cidrs":{"type":"array","items":{"type":"string"}} } } } } }, "responses":{ "200":{ "description":"ok" } } } },
    "/v1/sandboxes/{id}/metrics":   { "parameters":[{ "name":"id","in":"path","required":true,"schema":{"type":"string"} }], "get":{ "tags":["sandboxes"], "summary":"Per-sandbox CPU / RAM / disk / load", "responses":{ "200":{ "description":"ok","content":{"application/json":{"schema":{ "$ref":"#/components/schemas/Metrics" } } } } } } },
    "/v1/sandboxes/{id}/terminal":  { "parameters":[{ "name":"id","in":"path","required":true,"schema":{"type":"string"} }], "get":{ "tags":["sandboxes"], "summary":"WebSocket → in-VM PTY (xterm.js compatible)", "responses":{ "101":{ "description":"upgraded to ws" } } } },

    "/v1/sandboxes/{id}/files":         { "parameters":[{ "name":"id","in":"path","required":true,"schema":{"type":"string"} }], "get":{ "tags":["files"], "parameters":[{"name":"path","in":"query","required":true,"schema":{"type":"string"}}], "responses":{ "200":{"description":"file bytes"} } }, "put":{ "tags":["files"], "summary":"Upload file body", "parameters":[{"name":"path","in":"query","required":true,"schema":{"type":"string"}}, {"name":"mode","in":"query","schema":{"type":"string"}}], "responses":{ "200":{"description":"ok"} } }, "delete":{ "tags":["files"], "parameters":[{"name":"path","in":"query","required":true,"schema":{"type":"string"}},{"name":"recurse","in":"query","schema":{"type":"boolean"}}], "responses":{ "200":{"description":"ok"} } } },
    "/v1/sandboxes/{id}/files/stat":    { "parameters":[{ "name":"id","in":"path","required":true,"schema":{"type":"string"} }], "get":{ "tags":["files"], "parameters":[{"name":"path","in":"query","required":true,"schema":{"type":"string"}}], "responses":{"200":{"description":"ok"}} } },
    "/v1/sandboxes/{id}/files/list":    { "parameters":[{ "name":"id","in":"path","required":true,"schema":{"type":"string"} }], "get":{ "tags":["files"], "parameters":[{"name":"path","in":"query","schema":{"type":"string"}}], "responses":{"200":{"description":"ok"}} } },
    "/v1/sandboxes/{id}/files/mkdir":   { "parameters":[{ "name":"id","in":"path","required":true,"schema":{"type":"string"} }], "post":{ "tags":["files"], "parameters":[{"name":"path","in":"query","required":true,"schema":{"type":"string"}},{"name":"mode","in":"query","schema":{"type":"string"}}], "responses":{"200":{"description":"ok"}} } },
    "/v1/sandboxes/{id}/files/find":    { "parameters":[{ "name":"id","in":"path","required":true,"schema":{"type":"string"} }], "get":{ "tags":["files"], "summary":"Find by glob pattern", "parameters":[{"name":"path","in":"query","schema":{"type":"string"}},{"name":"pattern","in":"query","schema":{"type":"string"}},{"name":"max","in":"query","schema":{"type":"integer","default":500}}], "responses":{"200":{"description":"ok"}} } },
    "/v1/sandboxes/{id}/files/grep":    { "parameters":[{ "name":"id","in":"path","required":true,"schema":{"type":"string"} }], "get":{ "tags":["files"], "summary":"Recursive grep", "parameters":[{"name":"path","in":"query","schema":{"type":"string"}},{"name":"pattern","in":"query","required":true,"schema":{"type":"string"}},{"name":"max","in":"query","schema":{"type":"integer","default":500}}], "responses":{"200":{"description":"ok"}} } },
    "/v1/sandboxes/{id}/files/replace": { "parameters":[{ "name":"id","in":"path","required":true,"schema":{"type":"string"} }], "post":{ "tags":["files"], "summary":"sed -i across files", "requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["path","find","replace"],"properties":{"path":{"type":"string"},"find":{"type":"string"},"replace":{"type":"string"},"glob":{"type":"string","default":"*"}}}}}}, "responses":{"200":{"description":"ok"}} } },

    "/v1/sandboxes/{id}/sessions":           { "parameters":[{ "name":"id","in":"path","required":true,"schema":{"type":"string"} }], "post":{ "tags":["sessions"], "summary":"Create a persistent shell session", "requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"cwd":{"type":"string","default":"/root"}}}}}}, "responses":{ "201":{ "description":"created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Session"}}}} } }, "get":{ "tags":["sessions"], "responses":{"200":{"description":"ok"}} } },
    "/v1/sandboxes/{id}/sessions/{sid}":     { "parameters":[{ "name":"id","in":"path","required":true,"schema":{"type":"string"} },{ "name":"sid","in":"path","required":true,"schema":{"type":"string"} }], "get":{ "tags":["sessions"], "responses":{"200":{"description":"ok"}} }, "delete":{ "tags":["sessions"], "responses":{"200":{"description":"ok"}} } },
    "/v1/sandboxes/{id}/sessions/{sid}/exec":     { "parameters":[{ "name":"id","in":"path","required":true,"schema":{"type":"string"} },{ "name":"sid","in":"path","required":true,"schema":{"type":"string"} }], "post":{ "tags":["sessions"], "summary":"Run cmd in session; cwd persists.", "requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["cmd"],"properties":{"cmd":{"type":"string"},"timeout_ms":{"type":"integer","default":60000}}}}}}, "responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionExecResult"}}}}} } },
    "/v1/sandboxes/{id}/sessions/{sid}/commands": { "parameters":[{ "name":"id","in":"path","required":true,"schema":{"type":"string"} },{ "name":"sid","in":"path","required":true,"schema":{"type":"string"} }], "get":{ "tags":["sessions"], "responses":{"200":{"description":"ok"}} } },

    "/v1/sandboxes/{id}/git/clone":    { "parameters":[{ "name":"id","in":"path","required":true,"schema":{"type":"string"} }], "post":{ "tags":["git"], "requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url","path"],"properties":{"url":{"type":"string"},"path":{"type":"string"},"branch":{"type":"string"},"depth":{"type":"integer"},"username":{"type":"string"},"password":{"type":"string"}}}}}}, "responses":{"200":{"description":"ok"}} } },
    "/v1/sandboxes/{id}/git/status":   { "parameters":[{ "name":"id","in":"path","required":true,"schema":{"type":"string"} }], "get":{ "tags":["git"], "parameters":[{"name":"path","in":"query","schema":{"type":"string"}}], "responses":{"200":{"description":"ok"}} } },
    "/v1/sandboxes/{id}/git/add":      { "parameters":[{ "name":"id","in":"path","required":true,"schema":{"type":"string"} }], "post":{ "tags":["git"], "requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["path"],"properties":{"path":{"type":"string"},"files":{"type":"array","items":{"type":"string"}}}}}}}, "responses":{"200":{"description":"ok"}} } },
    "/v1/sandboxes/{id}/git/commit":   { "parameters":[{ "name":"id","in":"path","required":true,"schema":{"type":"string"} }], "post":{ "tags":["git"], "requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["path","message"],"properties":{"path":{"type":"string"},"message":{"type":"string"},"author_name":{"type":"string"},"author_email":{"type":"string"}}}}}}, "responses":{"200":{"description":"ok"}} } },
    "/v1/sandboxes/{id}/git/push":     { "parameters":[{ "name":"id","in":"path","required":true,"schema":{"type":"string"} }], "post":{ "tags":["git"], "requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["path"],"properties":{"path":{"type":"string"},"remote":{"type":"string"},"branch":{"type":"string"},"username":{"type":"string"},"password":{"type":"string"}}}}}}, "responses":{"200":{"description":"ok"}} } },
    "/v1/sandboxes/{id}/git/pull":     { "parameters":[{ "name":"id","in":"path","required":true,"schema":{"type":"string"} }], "post":{ "tags":["git"], "requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["path"],"properties":{"path":{"type":"string"},"remote":{"type":"string"},"branch":{"type":"string"},"username":{"type":"string"},"password":{"type":"string"}}}}}}, "responses":{"200":{"description":"ok"}} } },
    "/v1/sandboxes/{id}/git/branches": { "parameters":[{ "name":"id","in":"path","required":true,"schema":{"type":"string"} }], "get":{ "tags":["git"], "parameters":[{"name":"path","in":"query","schema":{"type":"string"}}], "responses":{"200":{"description":"ok"}} } },
    "/v1/sandboxes/{id}/git/checkout": { "parameters":[{ "name":"id","in":"path","required":true,"schema":{"type":"string"} }], "post":{ "tags":["git"], "requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["path","ref"],"properties":{"path":{"type":"string"},"ref":{"type":"string"}}}}}}, "responses":{"200":{"description":"ok"}} } },
    "/v1/sandboxes/{id}/git/log":      { "parameters":[{ "name":"id","in":"path","required":true,"schema":{"type":"string"} }], "get":{ "tags":["git"], "parameters":[{"name":"path","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","default":20}}], "responses":{"200":{"description":"ok"}} } },

    "/v1/templates":            { "get":  { "tags":["templates"], "responses":{ "200":{"description":"ok","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Template"}}}}}} }, "post": { "tags":["templates"], "summary":"Register an existing rootfs path (admin)", "responses":{"201":{"description":"created"}} } },
    "/v1/templates/from-image": { "post": { "tags":["templates"], "summary":"Build a template from a Docker / OCI image", "requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","image"],"properties":{"name":{"type":"string"},"image":{"type":"string","example":"ubuntu:22.04"},"entrypoint":{"type":"string"},"version":{"type":"string","default":"1.0.0"},"default_cpu":{"type":"integer","default":1},"default_ram_mb":{"type":"integer","default":512},"default_disk_gb":{"type":"integer","default":2},"size_mb":{"type":"integer","default":1024}}}}}}, "responses":{"202":{"description":"build queued"}} } },
    "/v1/templates/from-snapshot": { "post": { "tags":["templates"], "summary":"Promote a snapshot to a template (admin)", "responses":{"201":{"description":"created"}} } },

    "/v1/volumes":      { "get": { "tags":["volumes"], "responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Volume"}}}}}} }, "post":{ "tags":["volumes"], "responses":{"201":{"description":"created"}} } },
    "/v1/volumes/{id}": { "parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}], "delete":{ "tags":["volumes"], "responses":{"200":{"description":"deleted"}} } },

    "/v1/webhooks":      { "get": { "tags":["webhooks"], "responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Webhook"}}}}}} }, "post":{ "tags":["webhooks"], "summary":"Register an HMAC-signed lifecycle subscription", "requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"},"description":"empty == all"},"secret":{"type":"string","minLength":16}}}}}}, "responses":{"201":{"description":"created"}} } },
    "/v1/webhooks/{id}": { "parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}], "delete":{ "tags":["webhooks"], "responses":{"200":{"description":"deleted"}} } },

    "/v1/billing/usage": { "get": { "tags":["ops"], "summary":"Per-org usage roll-up", "parameters":[{"name":"since_ms","in":"query","schema":{"type":"integer"}},{"name":"org_id","in":"query","schema":{"type":"string"},"description":"admin only"}], "responses":{"200":{"description":"ok"}} } }
  }
}
