{
  "openapi": "3.1.0",
  "info": {
    "title": "Logmast customer and collection API",
    "version": "1.7.0",
    "description": "API-first failure evidence, compact application-owned checks, human onboarding, and separate agent authority. No installed host agent; SDK optional. Read the target catalog for capability and purchase gates."
  },
  "servers": [
    {
      "url": "https://app.logmast.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "management": {
        "type": "http",
        "scheme": "bearer"
      },
      "ingest": {
        "type": "http",
        "scheme": "bearer"
      },
      "humanSession": {
        "type": "apiKey",
        "in": "cookie",
        "name": "__Host-logmast_session",
        "description": "Human session; cookie mutations also require exact Origin. Agent credentials do not substitute for this. The cookie is named __Host-logmast_session over https; a loopback http development server uses logmast_session."
      },
      "sentryAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Sentry-Auth",
        "description": "Sentry SDK authentication: `Sentry sentry_key=<DSN key>, sentry_version=7, …`. The DSN key is the first 32 hex of HMAC-SHA256(ingest token, \"logmast/sentry-dsn/1\") and authenticates only this endpoint."
      },
      "sentryKey": {
        "type": "apiKey",
        "in": "query",
        "name": "sentry_key",
        "description": "The same DSN key in the query string, as the Node SDK sends it. X-Sentry-Auth takes precedence."
      }
    },
    "schemas": {
      "Enrollment": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "workspace",
          "project",
          "service",
          "bootstrap_secret",
          "ingest_secret"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "workspace": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "project": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "service": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "bootstrap_secret": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$",
            "writeOnly": true
          },
          "ingest_secret": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$",
            "writeOnly": true
          }
        }
      },
      "Claim": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "email"
        ],
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          }
        }
      },
      "ClaimCompletion": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "challenge_id",
          "proof"
        ],
        "properties": {
          "challenge_id": {
            "type": "string",
            "format": "uuid"
          },
          "proof": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$",
            "writeOnly": true
          },
          "password": {
            "type": "string",
            "minLength": 12,
            "maxLength": 1024,
            "writeOnly": true
          },
          "totp_secret": {
            "type": "string",
            "writeOnly": true
          },
          "totp_code": {
            "type": "string",
            "pattern": "^[0-9]{6}$",
            "writeOnly": true
          }
        }
      },
      "Problem": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "message",
          "errors"
        ],
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "AgentGrant": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "secret",
          "scopes",
          "expires_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "secret": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$",
            "writeOnly": true
          },
          "scopes": {
            "type": "array",
            "minItems": 1,
            "maxItems": 3,
            "items": {
              "enum": [
                "read",
                "manage",
                "billing"
              ]
            },
            "description": "read required; billing scope alone cannot purchase"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "In the future, at most 360 days from grant creation"
          }
        }
      },
      "Checkout": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "usd"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "usd": {
            "type": "integer",
            "minimum": 10,
            "maximum": 5000,
            "description": "Whole US dollars of credit to buy"
          }
        }
      },
      "Login": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "email",
          "password"
        ],
        "description": "Send exactly one of totp and recovery_code.",
        "properties": {
          "email": {
            "type": "string",
            "format": "email"
          },
          "password": {
            "type": "string",
            "writeOnly": true
          },
          "totp": {
            "type": "string",
            "pattern": "^[0-9]{6}$",
            "writeOnly": true
          },
          "recovery_code": {
            "type": "string",
            "maxLength": 64,
            "writeOnly": true,
            "description": "Single-use. Case, hyphens and spaces are ignored."
          }
        }
      },
      "Scope": {
        "type": "object",
        "additionalProperties": false,
        "required": [],
        "properties": {
          "project_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "service_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "group_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "environment": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "code_prefix": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "severity": {
            "anyOf": [
              {
                "enum": [
                  "debug",
                  "info",
                  "warning",
                  "error",
                  "fatal"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "fingerprint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "attributes": {
            "anyOf": [
              {
                "type": "object",
                "maxProperties": 8,
                "additionalProperties": {
                  "type": [
                    "string",
                    "number",
                    "boolean",
                    "null"
                  ]
                }
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "Exception": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "message"
        ],
        "properties": {
          "kind": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "Event": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "occurrence_id",
          "timestamp",
          "environment",
          "severity",
          "message"
        ],
        "properties": {
          "occurrence_id": {
            "type": "string",
            "format": "uuid"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "environment": {
            "type": "string"
          },
          "severity": {
            "enum": [
              "debug",
              "info",
              "warning",
              "error",
              "fatal"
            ]
          },
          "message": {
            "type": "string"
          },
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "cause_discriminator": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "fingerprint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "outcome": {
            "anyOf": [
              {
                "enum": [
                  "rejected",
                  "retrying",
                  "recovered",
                  "failed"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "exception_chain": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Exception"
            }
          },
          "stack": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "operation": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "correlation_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "release": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "breadcrumbs": {
            "type": "array",
            "maxItems": 32,
            "items": {}
          },
          "attributes": {
            "type": "object",
            "maxProperties": 32
          }
        }
      },
      "Batch": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "batch_id",
          "service_id",
          "events"
        ],
        "properties": {
          "batch_id": {
            "type": "string",
            "format": "uuid"
          },
          "service_id": {
            "type": "string",
            "format": "uuid"
          },
          "events": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/Event"
            }
          }
        }
      },
      "Acceptance": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "receipt_id",
          "new_events",
          "duplicates"
        ],
        "properties": {
          "receipt_id": {
            "type": "string",
            "format": "uuid"
          },
          "new_events": {
            "type": "integer",
            "minimum": 0
          },
          "duplicates": {
            "type": "integer",
            "minimum": 0
          },
          "stored_events": {
            "type": "integer",
            "minimum": 0,
            "description": "New events that kept their payload; the rest of new_events were counted only, because the balance ran out"
          }
        }
      },
      "Control": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "scope"
            ],
            "properties": {
              "action": {
                "const": "preview"
              },
              "scope": {
                "$ref": "#/components/schemas/Scope"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "scope",
              "reason"
            ],
            "properties": {
              "action": {
                "const": "mute"
              },
              "scope": {
                "$ref": "#/components/schemas/Scope"
              },
              "reason": {
                "type": "string"
              },
              "expires_at": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "preview_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "id"
            ],
            "properties": {
              "action": {
                "const": "end_mute"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "id"
            ],
            "properties": {
              "action": {
                "const": "acknowledge"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "scope",
              "fingerprint",
              "preview_id"
            ],
            "properties": {
              "action": {
                "const": "grouping_rule"
              },
              "scope": {
                "$ref": "#/components/schemas/Scope"
              },
              "fingerprint": {
                "type": "string"
              },
              "preview_id": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "id"
            ],
            "properties": {
              "action": {
                "const": "disable_grouping_rule"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "scope",
              "recipient",
              "preview_id"
            ],
            "properties": {
              "action": {
                "const": "notification_rule"
              },
              "scope": {
                "$ref": "#/components/schemas/Scope"
              },
              "recipient": {
                "type": "string",
                "format": "email"
              },
              "preview_id": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "id"
            ],
            "properties": {
              "action": {
                "const": "disable_notification_rule"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "name"
            ],
            "properties": {
              "action": {
                "const": "create_project"
              },
              "name": {
                "type": "string"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "id",
              "name"
            ],
            "description": "Renames a live project. Writer role.",
            "properties": {
              "action": {
                "const": "rename_project"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "name": {
                "type": "string"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "id",
              "name"
            ],
            "description": "Deletes a project and all its services: their ingest credentials are revoked at once, every read hides them, and maintenance removes their evidence, checks and rules. Usage records are kept. Owner signed in at the console only; name must equal the project's current name (otherwise 422). 404 for an unknown or already deleted project.",
            "properties": {
              "action": {
                "const": "delete_project"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "name": {
                "type": "string"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "project_id",
              "name"
            ],
            "properties": {
              "action": {
                "const": "create_service"
              },
              "project_id": {
                "type": "string",
                "format": "uuid"
              },
              "name": {
                "type": "string"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "id",
              "name"
            ],
            "description": "Deletes one service, as delete_project does for each of its services. Owner signed in at the console only; name must equal the service's current name (otherwise 422). 404 for an unknown or already deleted service.",
            "properties": {
              "action": {
                "const": "delete_service"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "name": {
                "type": "string"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "id",
              "name",
              "project_id"
            ],
            "properties": {
              "action": {
                "const": "rename_service"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "name": {
                "type": "string"
              },
              "project_id": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "service_id"
            ],
            "properties": {
              "action": {
                "const": "rotate_credential"
              },
              "service_id": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "id"
            ],
            "properties": {
              "action": {
                "const": "revoke_credential"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "account_id"
            ],
            "properties": {
              "action": {
                "const": "membership"
              },
              "account_id": {
                "type": "string",
                "format": "uuid"
              },
              "role": {
                "anyOf": [
                  {
                    "enum": [
                      "owner",
                      "member",
                      "viewer"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "daily_event_limit",
              "daily_byte_limit",
              "redacted_fields"
            ],
            "properties": {
              "action": {
                "const": "limits"
              },
              "daily_event_limit": {
                "type": "integer",
                "format": "int64"
              },
              "daily_byte_limit": {
                "type": "integer",
                "format": "int64"
              },
              "redacted_fields": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "read_only",
              "expires_at"
            ],
            "properties": {
              "action": {
                "const": "create_token"
              },
              "read_only": {
                "type": "boolean"
              },
              "expires_at": {
                "type": "string",
                "format": "date-time"
              },
              "id": {
                "type": "string",
                "format": "uuid",
                "description": "With secret: a retry of the same request replays and creates no second token."
              },
              "label": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "secret": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$",
                "description": "Generated and kept by the caller; never returned or audited. Required with id."
              },
              "project_id": {
                "type": "string",
                "format": "uuid",
                "description": "Limits the token to one live project."
              }
            },
            "description": "Human session at the console only. Without id and secret the response carries a new token once; with them it is {id, replayed} and the caller already holds the secret. A different request under the same id answers 409."
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "id"
            ],
            "properties": {
              "action": {
                "const": "revoke_token"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "recipient"
            ],
            "properties": {
              "action": {
                "const": "test_email"
              },
              "recipient": {
                "type": "string",
                "format": "email"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "change"
            ],
            "properties": {
              "action": {
                "const": "check"
              },
              "change": {
                "$ref": "#/components/schemas/CheckChange"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "email",
              "role"
            ],
            "properties": {
              "action": {
                "const": "invite"
              },
              "email": {
                "type": "string",
                "format": "email"
              },
              "role": {
                "enum": [
                  "owner",
                  "member",
                  "viewer"
                ]
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "id"
            ],
            "properties": {
              "action": {
                "const": "revoke_invitation"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              }
            }
          }
        ]
      },
      "CheckDefinition": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "service_id",
          "name",
          "environment",
          "kind",
          "interval_seconds",
          "grace_seconds"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "service_id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "environment": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "kind": {
            "enum": [
              "heartbeat",
              "job",
              "verification"
            ]
          },
          "interval_seconds": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 60,
                "maximum": 604800
              },
              {
                "type": "null"
              }
            ]
          },
          "grace_seconds": {
            "type": "integer",
            "minimum": 0,
            "maximum": 604800
          }
        },
        "description": "A service/environment expectation. Only verification may have a null interval (ad hoc). Limits on strings are UTF-8 bytes."
      },
      "CheckIn": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "check_id",
          "run_id",
          "observed_at",
          "outcome"
        ],
        "properties": {
          "check_id": {
            "type": "string",
            "format": "uuid"
          },
          "run_id": {
            "type": "string",
            "format": "uuid"
          },
          "observed_at": {
            "type": "string",
            "format": "date-time"
          },
          "outcome": {
            "enum": [
              "pass",
              "fail"
            ]
          },
          "release": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 256
              },
              {
                "type": "null"
              }
            ]
          },
          "duration_ms": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 604800000
              },
              {
                "type": "null"
              }
            ]
          },
          "correlation_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 128
              },
              {
                "type": "null"
              }
            ]
          },
          "occurrence_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "description": "New observations: past 24 hours through 60 seconds ahead. Persist immutable content and non-nil IDs before sending. Optional occurrence must be retained in the same service/environment."
      },
      "CheckAcceptance": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "receipt_id",
          "duplicate",
          "applied"
        ],
        "properties": {
          "receipt_id": {
            "type": "string",
            "format": "uuid"
          },
          "duplicate": {
            "type": "boolean"
          },
          "applied": {
            "type": "boolean"
          }
        },
        "description": "Synchronous WAL acknowledgment. A duplicate returns the original receipt and applied decision. applied=false does not establish current liveness."
      },
      "CheckStatus": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "definition",
          "revision",
          "state",
          "due_at",
          "last_received_at",
          "last_pass_at",
          "last_result"
        ],
        "properties": {
          "definition": {
            "$ref": "#/components/schemas/CheckDefinition"
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "state": {
            "enum": [
              "never_received",
              "current",
              "failed",
              "overdue",
              "paused",
              "monitoring_unavailable",
              "evidence_expired"
            ]
          },
          "due_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_received_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_pass_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_result": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CheckIn"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "CheckAllowance": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "available",
          "reason",
          "check_limit",
          "daily_limit",
          "accepted_today",
          "evaluated_at"
        ],
        "properties": {
          "available": {
            "type": "boolean"
          },
          "reason": {
            "anyOf": [
              {
                "enum": [
                  "coverage_expired",
                  "check_allowance_exhausted"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "check_limit": {
            "type": "integer"
          },
          "daily_limit": {
            "type": "integer"
          },
          "accepted_today": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Null for a project-limited credential."
          },
          "evaluated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "CheckList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "checks",
          "allowance"
        ],
        "properties": {
          "checks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CheckStatus"
            }
          },
          "allowance": {
            "$ref": "#/components/schemas/CheckAllowance"
          }
        }
      },
      "CheckChange": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "operation",
              "definition"
            ],
            "properties": {
              "operation": {
                "const": "create"
              },
              "definition": {
                "$ref": "#/components/schemas/CheckDefinition"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "operation",
              "id",
              "revision",
              "name",
              "interval_seconds",
              "grace_seconds"
            ],
            "properties": {
              "operation": {
                "const": "update"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "revision": {
                "type": "integer",
                "minimum": 1
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "interval_seconds": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 60,
                    "maximum": 604800
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "grace_seconds": {
                "type": "integer",
                "minimum": 0,
                "maximum": 604800
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "operation",
              "id",
              "revision",
              "paused"
            ],
            "properties": {
              "operation": {
                "const": "pause"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "revision": {
                "type": "integer",
                "minimum": 1
              },
              "paused": {
                "type": "boolean"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "operation",
              "id",
              "revision"
            ],
            "properties": {
              "operation": {
                "const": "archive"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "revision": {
                "type": "integer",
                "minimum": 1
              }
            }
          }
        ],
        "description": "Member management authority required. Persist creation intent; reconcile after uncertainty. Update/pause/archive require the current revision. Reconfiguration closes an episode without proving recovery."
      },
      "CheckDetail": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "check_id",
          "transitions",
          "attention"
        ],
        "properties": {
          "check_id": {
            "type": "string",
            "format": "uuid"
          },
          "transitions": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "created_at",
                "previous_state",
                "state"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "previous_state": {
                  "type": "string"
                },
                "state": {
                  "type": "string"
                }
              }
            }
          },
          "attention": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "condition",
                "created_at",
                "recovered_at",
                "closed_at",
                "acknowledged_at",
                "suppression_reason"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "condition": {
                  "enum": [
                    "check_failed",
                    "check_overdue"
                  ]
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "recovered_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "closed_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "acknowledged_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "suppression_reason": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "ReceiptStatus": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "receipt_id",
          "received_at",
          "processed_at",
          "processing_gap",
          "new_events",
          "duplicates",
          "retained_events",
          "attention",
          "notifications"
        ],
        "properties": {
          "receipt_id": {
            "type": "string",
            "format": "uuid"
          },
          "received_at": {
            "type": "string",
            "format": "date-time"
          },
          "processed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "processing_gap": {
            "type": "boolean"
          },
          "new_events": {
            "type": "integer"
          },
          "duplicates": {
            "type": "integer"
          },
          "retained_events": {
            "type": "integer"
          },
          "attention": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "suppression_reason"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "suppression_reason": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          },
          "notifications": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "status",
                "attempts",
                "smtp_accepted_at"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "status": {
                  "enum": [
                    "pending",
                    "sending",
                    "sent",
                    "exhausted"
                  ]
                },
                "attempts": {
                  "type": "integer"
                },
                "smtp_accepted_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          },
          "stored_events": {
            "type": "integer",
            "minimum": 0
          },
          "charge_micro_usd": {
            "type": "integer",
            "minimum": 0
          }
        },
        "description": "Retained receipt status. sent / smtp_accepted_at mean SMTP acceptance, not inbox arrival. No matching notification is not delivery proof."
      },
      "PasswordChange": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "current_password",
          "new_password",
          "totp"
        ],
        "properties": {
          "current_password": {
            "type": "string",
            "writeOnly": true
          },
          "new_password": {
            "type": "string",
            "minLength": 12,
            "maxLength": 1024,
            "writeOnly": true
          },
          "totp": {
            "type": "string",
            "pattern": "^[0-9]{6}$",
            "writeOnly": true
          }
        }
      },
      "AuthenticatorReset": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "password",
          "new_totp_secret",
          "new_totp_code"
        ],
        "properties": {
          "password": {
            "type": "string",
            "writeOnly": true
          },
          "current_totp": {
            "type": "string",
            "pattern": "^[0-9]{6}$",
            "writeOnly": true,
            "description": "Omit only in a session opened with a recovery code."
          },
          "new_totp_secret": {
            "type": "string",
            "writeOnly": true
          },
          "new_totp_code": {
            "type": "string",
            "pattern": "^[0-9]{6}$",
            "writeOnly": true
          }
        }
      },
      "RecoveryCodesRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "password",
          "totp"
        ],
        "properties": {
          "password": {
            "type": "string",
            "writeOnly": true
          },
          "totp": {
            "type": "string",
            "pattern": "^[0-9]{6}$",
            "writeOnly": true
          }
        }
      },
      "InvitationProof": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "invitation_id",
          "proof"
        ],
        "properties": {
          "invitation_id": {
            "type": "string",
            "format": "uuid"
          },
          "proof": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$",
            "writeOnly": true
          }
        }
      },
      "InvitationCompletion": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "invitation_id",
          "proof"
        ],
        "properties": {
          "invitation_id": {
            "type": "string",
            "format": "uuid"
          },
          "proof": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$",
            "writeOnly": true
          },
          "password": {
            "type": "string",
            "minLength": 12,
            "maxLength": 1024,
            "writeOnly": true
          },
          "totp_secret": {
            "type": "string",
            "writeOnly": true
          },
          "totp_code": {
            "type": "string",
            "pattern": "^[0-9]{6}$",
            "writeOnly": true
          }
        }
      },
      "WorkspaceDeletion": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "password",
          "totp"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "The workspace's exact name."
          },
          "password": {
            "type": "string",
            "writeOnly": true
          },
          "totp": {
            "type": "string",
            "pattern": "^[0-9]{6}$",
            "writeOnly": true
          }
        }
      },
      "DeviceStart": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "device_code_hash",
          "token_hash",
          "scope",
          "days",
          "client"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "device_code_hash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "token_hash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "workspace": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "project": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "scope": {
            "type": "string",
            "enum": [
              "read",
              "manage"
            ]
          },
          "days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 360
          },
          "client": {
            "type": "object",
            "required": [
              "version",
              "hostname"
            ],
            "properties": {
              "version": {
                "type": "string",
                "pattern": "^[A-Za-z0-9.+-]{1,32}$"
              },
              "hostname": {
                "type": "string",
                "pattern": "^[A-Za-z0-9.-]{1,64}$"
              },
              "directory": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 200
              }
            }
          }
        }
      },
      "DeviceDecision": {
        "type": "object",
        "required": [
          "approve"
        ],
        "properties": {
          "approve": {
            "type": "boolean"
          },
          "workspace": {
            "type": "string",
            "format": "uuid"
          },
          "project": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "scope": {
            "type": "string",
            "enum": [
              "read",
              "manage"
            ]
          },
          "days": {
            "type": "integer",
            "minimum": 1
          },
          "totp": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9]{6}$"
          }
        }
      }
    }
  },
  "paths": {
    "/api/v1/catalog": {
      "get": {
        "summary": "Discover catalog and availability",
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "description": "Discover the trial, published pricing bands and capability gates, ingestion.content_encodings, the sentry ingest contract, and capabilities.checks. checks describes the included definition/signal allowance, body and interval limits; live workspace usage comes from the checks list. provisional gives the events and bytes a workspace accepts before its owner's email is verified (unverified_allowance repeats it with what the claim unlocks); past it ingestion answers 402 VERIFICATION_REQUIRED until the claim completes."
      }
    },
    "/api/v1/enrollments": {
      "post": {
        "summary": "Idempotently create a provisional trial",
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Enrollment"
              }
            }
          }
        },
        "description": "Creates a workspace with the catalog's provisional allowance. Replaying an enrollment returns the same result and is not a new trial. Ten new trials per client address and one hundred per installation per hour; more than thirty requests in quick succession from one address answer 429 ATTEMPT_LIMIT before the request is examined."
      }
    },
    "/api/v1/workspaces": {
      "get": {
        "summary": "List authorized workspaces",
        "security": [
          {
            "management": []
          },
          {
            "humanSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspace}/enrollment": {
      "get": {
        "summary": "Read trial and service receipt status",
        "security": [
          {
            "management": []
          },
          {
            "humanSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "description": "projects lists the workspace's live projects, including those without services."
      }
    },
    "/api/v1/workspaces/{workspace}/navigation": {
      "get": {
        "summary": "List live projects and services",
        "security": [
          {
            "management": []
          },
          {
            "humanSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "description": "Projects ({id,name}) and services ({id,name,project_id}) that are not deleted. Reads no evidence, so it is cheap enough for every page."
      }
    },
    "/api/v1/workspaces/{workspace}/claim": {
      "post": {
        "summary": "Queue email ownership proof",
        "security": [
          {
            "management": []
          },
          {
            "humanSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Claim"
              }
            }
          }
        },
        "description": "Sends the verification email. 409 when the workspace is already claimed. 429 ATTEMPT_LIMIT when a limit is reached: three an hour and six a day per workspace, six a day per recipient, ten a day across the workspaces one client address enrolled, sixty an hour per installation."
      }
    },
    "/api/v1/claims/complete": {
      "post": {
        "summary": "Verify email and claim; existing accounts require their session",
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClaimCompletion"
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspace}/agents": {
      "get": {
        "summary": "List agent grants",
        "description": "Owner only; never returns secrets. Includes an enrollment's bootstrap token as \"Enrollment agent (bootstrap)\".",
        "security": [
          {
            "management": []
          },
          {
            "humanSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "post": {
        "summary": "Grant a distinct agent identity",
        "description": "Human owner only. Persist the ID, random secret and entire intent before calling. Replays must be identical. Expiry must be in the future, at most 360 days away. The console defaults to 180 days. Optional project_id limits the grant to one live project; at most 100 active grants per workspace.",
        "security": [
          {
            "humanSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentGrant"
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspace}/agents/{agent}/revoke": {
      "post": {
        "summary": "Revoke an agent grant",
        "description": "Owner only. The agent path parameter is the grant id, or the bootstrap token id for an enrollment agent, not agent_id. Repeating succeeds without duplicate audit.",
        "security": [
          {
            "management": []
          },
          {
            "humanSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "agent",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/workspaces/{workspace}/billing": {
      "get": {
        "summary": "Read coverage and purchase operations",
        "description": "Read scope. Does not initiate payment.",
        "security": [
          {
            "management": []
          },
          {
            "humanSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/workspaces/{workspace}/billing/checkout": {
      "post": {
        "summary": "Create or resume human checkout",
        "description": "Human owner only and catalog capabilities.human_checkout=true. Buys whole US dollars of prepaid credit. Persist ID and exact intent before calling. Reconcile after uncertain responses; do not create a new charge. A workspace with no contract (provisioned by the operator, unbilled by arrangement) answers 409 NOT_BILLED.",
        "security": [
          {
            "humanSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Checkout"
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspace}/billing/operations/{operation}/reconcile": {
      "post": {
        "summary": "Reconcile a purchase against Stripe",
        "description": "Human owner only. A return URL is not proof of payment.",
        "security": [
          {
            "humanSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "operation",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/workspaces/{workspace}/control": {
      "post": {
        "summary": "Manage service configuration and policies",
        "description": "Manage scope/member role. Membership and limits require owner. Credential creation requires a human session. Not generally idempotent: read current state before retrying an uncertain write. Results can contain secrets; save privately. revoke_credential and revoke_token succeed again on an already revoked item and keep its first revocation time; they and rename_service answer 404 for an ID the caller cannot see in this workspace. Removing a membership also revokes that account's tokens for the workspace. membership changes or removes existing members only; a role for an account that is not a member answers 404. invite, revoke_invitation, delete_project and delete_service need an owner signed in at the console. Commands that name a deleted project or service answer 404.",
        "security": [
          {
            "management": []
          },
          {
            "humanSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Control"
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspace}/policies": {
      "get": {
        "summary": "Read configuration and policy state",
        "description": "Workspace-scoped inventory; use to reconcile uncertain control writes. tokens lists API tokens issued through create_token or by the operator, usable ones first, at most 200: all of them for an owner using a session or a write-capable token, otherwise the caller's own. members lists the workspace's accounts with role and, for people, email; it is empty for any other caller. Agent grants and enrollment tokens are listed by the agents endpoint. invitations lists open invitations to the same audience as members. limits holds daily_event_limit, daily_byte_limit and redacted_fields for the same audience as members, and is null otherwise; the limits command replaces all three, so send back what was read.",
        "security": [
          {
            "management": []
          },
          {
            "humanSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/workspaces/{workspace}/investigation": {
      "get": {
        "summary": "Read retained failure evidence",
        "description": "Same paginated investigation response. Retention enforced at read time. Default window 24 hours, page size 50 plus lookahead.",
        "security": [
          {
            "management": []
          },
          {
            "humanSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "project",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "service",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "group",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "occurrence",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "environment",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "code",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "severity",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "correlation",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "text",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "until",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "view",
            "in": "query",
            "schema": {
              "enum": [
                "all",
                "attention"
              ]
            }
          },
          {
            "name": "release",
            "in": "query",
            "description": "Exact release filter; counts and histograms use the same retained evidence.",
            "schema": {
              "type": "string",
              "maxLength": 256
            }
          }
        ]
      }
    },
    "/api/v1/workspaces/{workspace}/groups": {
      "get": {
        "summary": "Read retained failure evidence",
        "description": "Same paginated investigation response. Retention enforced at read time. Default window 24 hours, page size 50 plus lookahead.",
        "security": [
          {
            "management": []
          },
          {
            "humanSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "project",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "service",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "group",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "occurrence",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "environment",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "code",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "severity",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "correlation",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "text",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "until",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "view",
            "in": "query",
            "schema": {
              "enum": [
                "all",
                "attention"
              ]
            }
          },
          {
            "name": "release",
            "in": "query",
            "description": "Exact release filter; counts and histograms use the same retained evidence.",
            "schema": {
              "type": "string",
              "maxLength": 256
            }
          }
        ]
      }
    },
    "/api/v1/workspaces/{workspace}/occurrences": {
      "get": {
        "summary": "Read retained failure evidence",
        "description": "Same paginated investigation response. Retention enforced at read time. Default window 24 hours, page size 50 plus lookahead.",
        "security": [
          {
            "management": []
          },
          {
            "humanSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "project",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "service",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "group",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "occurrence",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "environment",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "code",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "severity",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "correlation",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "text",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "until",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "view",
            "in": "query",
            "schema": {
              "enum": [
                "all",
                "attention"
              ]
            }
          },
          {
            "name": "release",
            "in": "query",
            "description": "Exact release filter; counts and histograms use the same retained evidence.",
            "schema": {
              "type": "string",
              "maxLength": 256
            }
          }
        ]
      }
    },
    "/api/v1/workspaces/{workspace}/services/{service}/occurrences/{occurrence}": {
      "get": {
        "summary": "Read one occurrence",
        "description": "Read scope; retention enforced independently of physical cleanup.",
        "security": [
          {
            "management": []
          },
          {
            "humanSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "service",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "occurrence",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/ingest/batches": {
      "post": {
        "summary": "Durably accept a batch",
        "description": "Ingest credential only. Maximum 100 events, 1 MiB wire and decoded JSON, 64 KiB per event. Plain JSON and advertised gzip. Authentication precedes decoding. Replay identical batch and occurrence identities after uncertainty. Success follows synchronous WAL commit; require non-nil receipt and matching counts. Canonical uncompressed bytes determine allowance.",
        "security": [
          {
            "ingest": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Acceptance"
                }
              }
            }
          },
          "413": {
            "description": "Wire or decoded body exceeds limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported content encoding",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Batch"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Content-Encoding",
            "in": "header",
            "schema": {
              "enum": [
                "identity",
                "gzip"
              ]
            },
            "description": "Optional. Unsupported encodings return 415; expansion overflow returns 413."
          }
        ]
      }
    },
    "/api/v1/auth/login": {
      "post": {
        "summary": "Sign in as a human",
        "description": "Password and either a current TOTP code or a single-use recovery code; establishes Secure HttpOnly session. Agents use delegated credentials instead.",
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Login"
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/logout": {
      "post": {
        "summary": "Revoke current session",
        "description": "Cookie mutation requires exact Origin.",
        "security": [
          {
            "humanSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/ingest/check-ins": {
      "post": {
        "summary": "Durably accept an application-owned check result",
        "description": "Service ingest token. Identity or gzip; maximum 8 KiB wire and decoded. Twenty new signals/second/workspace; default separate allowance 50,000/day. Duplicates are free for 90 days; changed content conflicts. Paused, stale, reordered, and late reports do not advance state. Does not execute tests or establish availability.",
        "security": [
          {
            "ingest": []
          }
        ],
        "parameters": [
          {
            "name": "Content-Encoding",
            "in": "header",
            "schema": {
              "enum": [
                "identity",
                "gzip"
              ]
            },
            "description": "Optional. Unsupported encodings return 415; expansion overflow returns 413."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckAcceptance"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspace}/checks": {
      "get": {
        "summary": "List checks and separate collection allowance",
        "description": "Read authority within this workspace. Retention applies before physical cleanup. Unknown or expired receipt/check returns 404. Ingest credentials cannot read.",
        "security": [
          {
            "management": []
          },
          {
            "humanSession": []
          }
        ],
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckList"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspace}/checks/{check}": {
      "get": {
        "summary": "Read retained check transitions and attention",
        "description": "Read authority within this workspace. Retention applies before physical cleanup. Unknown or expired receipt/check returns 404. Ingest credentials cannot read.",
        "security": [
          {
            "management": []
          },
          {
            "humanSession": []
          }
        ],
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "check",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckDetail"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspace}/receipts/{receipt}": {
      "get": {
        "summary": "Read retained receipt processing and delivery stages",
        "description": "Read authority within this workspace. Retention applies before physical cleanup. Unknown or expired receipt/check returns 404. Ingest credentials cannot read.",
        "security": [
          {
            "management": []
          },
          {
            "humanSession": []
          }
        ],
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "receipt",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReceiptStatus"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/{project}/envelope/": {
      "post": {
        "summary": "Accept a Sentry SDK envelope",
        "description": "For unmodified Sentry server SDKs configured with a Logmast DSN. The first `event` item is mapped to one Logmast event and accepted exactly like a one-event batch (same receipts, limits, billing, redaction and retention); its identity comes from the event's `event_id`, so a retry is a free duplicate. Every other item is acknowledged and discarded without charge, and `X-Sentry-Rate-Limits` tells the SDK to stop sending those categories. Requests carrying Origin are refused (403). Concurrent envelopes wait up to 5 seconds for their workspace's share, then 429. A 402 or daily-quota 429 carries `X-Sentry-Rate-Limits: 60::organization:quota_exceeded`. See docs/public/sentry.md.",
        "security": [
          {
            "sentryAuth": []
          },
          {
            "sentryKey": []
          }
        ],
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Ignored: the DSN key selects the service. Published DSNs use 1."
          },
          {
            "name": "Content-Encoding",
            "in": "header",
            "schema": {
              "enum": [
                "identity",
                "gzip",
                "deflate",
                "br"
              ]
            },
            "description": "Optional. Unsupported encodings return 415; at most 8 MiB on the wire, 32 MiB expanded and 1 MiB per event item, else 413."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-sentry-envelope": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted or discarded. `id` is present when the envelope held an event.",
            "headers": {
              "X-Sentry-Rate-Limits": {
                "schema": {
                  "type": "string"
                },
                "description": "Categories Logmast discards, for an hour; never error or default."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[0-9a-f]{32}$"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/account": {
      "get": {
        "summary": "Read the signed-in person's account",
        "description": "Browser sessions only; API tokens are refused.",
        "security": [
          {
            "humanSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/account/password": {
      "post": {
        "summary": "Change the password",
        "description": "A wrong password or code answers 422, not 401; a locked client answers 429. Ends the account's other sessions; API tokens are unaffected.",
        "security": [
          {
            "humanSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordChange"
              }
            }
          }
        }
      }
    },
    "/api/v1/account/authenticator": {
      "post": {
        "summary": "Replace the authenticator",
        "description": "A wrong password or code answers 422, not 401; a locked client answers 429. The proof is a current code, or a session opened with a recovery code. Ends the account's other sessions.",
        "security": [
          {
            "humanSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuthenticatorReset"
              }
            }
          }
        }
      }
    },
    "/api/v1/account/recovery-codes": {
      "post": {
        "summary": "Generate ten recovery codes",
        "description": "A wrong password or code answers 422, not 401; a locked client answers 429. Shown once; replaces all earlier codes.",
        "security": [
          {
            "humanSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecoveryCodesRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/account/sessions/end-all": {
      "post": {
        "summary": "End every session of this account",
        "description": "Includes the current session. API tokens are unaffected.",
        "security": [
          {
            "humanSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/invitations/preview": {
      "post": {
        "summary": "Read an invitation from its email link",
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvitationProof"
              }
            }
          }
        }
      }
    },
    "/api/v1/invitations/complete": {
      "post": {
        "summary": "Accept an invitation; existing accounts require their session",
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvitationCompletion"
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspace}/audit": {
      "get": {
        "summary": "Read the audit log, newest first",
        "description": "For an owner using a session or a write-capable token. Pass next_before as before for the next page.",
        "security": [
          {
            "management": []
          },
          {
            "humanSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ]
      }
    },
    "/api/v1/workspaces/{workspace}/delete": {
      "post": {
        "summary": "Delete a workspace",
        "description": "Owner's browser session only. All access ends at once and the next hourly maintenance run removes its data; billing records are kept. Cannot be undone. 409 while a checkout or subscription is open.",
        "security": [
          {
            "humanSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspaceDeletion"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "workspace",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/device/authorizations": {
      "post": {
        "summary": "Start a device login",
        "description": "Anonymous. The CLI generates its token and device code and sends only their SHA-256 hashes. Retrying with the same id and hashes returns the same user code; the same id with other hashes answers 409. Limited per client address.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeviceStart"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A code for a person to type at verification_uri within ten minutes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user_code": {
                      "type": "string",
                      "pattern": "^[BCDFGHJKLMNPQRSTVWXZ]{8}$"
                    },
                    "verification_uri": {
                      "type": "string",
                      "format": "uri"
                    },
                    "expires_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "interval": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/device/authorizations/{id}/poll": {
      "post": {
        "summary": "Poll a device login",
        "description": "Anonymous; proves possession with the device code. Every state answers 200. Approved returns the grant's workspace, project, scopes and expiry, never the token.",
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "device_code"
                ],
                "properties": {
                  "device_code": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The decision so far",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "slow_down",
                        "approved",
                        "denied",
                        "expired"
                      ]
                    },
                    "workspace_id": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uuid"
                    },
                    "workspace_name": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "project_id": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uuid"
                    },
                    "project_name": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "scopes": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {
                        "type": "string"
                      }
                    },
                    "expires_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "agent_id": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uuid"
                    },
                    "interval": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/device/lookup": {
      "post": {
        "summary": "Find a pending device login by its code",
        "description": "Console session only (bearer tokens refused). A request naming a workspace is found only by its members. Five wrong codes in ten minutes per person or per client address (an IPv6 /64) answer 429. Shows what the client reported and the requester's /24 or /64 network.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "code"
                ],
                "properties": {
                  "code": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The pending request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/device/authorizations/{id}/decision": {
      "post": {
        "summary": "Approve or deny a device login",
        "description": "Console session of a workspace owner, from the exact public Origin. An approval cannot change the requested workspace or project or widen the scope or days; management needs a fresh authenticator code. Creates an agent grant with the CLI's token hash and emails the other owners. A denial needs membership of the named workspace and is audited there.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeviceDecision"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Decided",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/token": {
      "get": {
        "summary": "Describe the bearer token",
        "description": "What the presented token reaches: workspace, project, scopes, expiry and agent name. Never returns the token.",
        "responses": {
          "200": {
            "description": "Token metadata",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/token/revoke": {
      "post": {
        "summary": "Revoke the bearer token",
        "description": "A token revokes itself, as `logmastctl logout` does; an agent's membership ends with it.",
        "responses": {
          "200": {
            "description": "Revoked",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "default": {
            "description": "Stable error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    }
  }
}
