{
  "components": {
    "schemas": {
      "Actor": {
        "properties": {
          "id": {
            "maxLength": 255,
            "minLength": 1,
            "type": "string"
          },
          "name": {
            "maxLength": 255,
            "type": "string"
          },
          "summary": {
            "maxLength": 1000,
            "type": "string"
          }
        },
        "required": ["id", "name", "summary"],
        "type": "object"
      },
      "Api": {
        "properties": {
          "actorHeader": {
            "maxLength": 200,
            "type": "string"
          },
          "actorVariable": {
            "maxLength": 200,
            "type": "string"
          },
          "apiVersions": {
            "items": {
              "maxLength": 32,
              "type": "string"
            },
            "maxItems": 200,
            "type": "array"
          },
          "id": {
            "maxLength": 64,
            "minLength": 1,
            "type": "string"
          },
          "interactive": {
            "type": "boolean"
          },
          "limitations": {
            "items": {
              "maxLength": 500,
              "type": "string"
            },
            "maxItems": 50,
            "type": "array"
          },
          "name": {
            "maxLength": 120,
            "minLength": 1,
            "type": "string"
          },
          "pathTemplate": {
            "maxLength": 500,
            "type": "string"
          },
          "requestContentType": {
            "maxLength": 200,
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "apiVersions",
          "pathTemplate",
          "requestContentType",
          "actorHeader",
          "actorVariable",
          "limitations",
          "interactive"
        ],
        "type": "object"
      },
      "App": {
        "properties": {
          "defaultVersionId": {
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
            "type": ["string", "null"]
          },
          "description": {
            "type": "string"
          },
          "id": {
            "pattern": "^[a-z][a-z0-9-]{1,39}$",
            "type": "string"
          },
          "logoPath": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "enum": ["replica"],
            "type": "string"
          },
          "vendor": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "type",
          "name",
          "vendor",
          "description",
          "logoPath",
          "defaultVersionId"
        ],
        "type": "object"
      },
      "AuditEvent": {
        "properties": {
          "data": {
            "additionalProperties": {},
            "type": "object"
          },
          "environmentId": {
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
            "type": ["string", "null"]
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "occurredAt": {
            "format": "date-time",
            "type": "string"
          },
          "principal": {
            "$ref": "#/components/schemas/Principal"
          },
          "requestId": {
            "type": ["string", "null"]
          },
          "subjectId": {
            "type": "string"
          },
          "workspaceId": {
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
            "type": ["string", "null"]
          }
        },
        "required": [
          "id",
          "name",
          "principal",
          "workspaceId",
          "environmentId",
          "subjectId",
          "requestId",
          "data",
          "occurredAt"
        ],
        "type": "object"
      },
      "BodyPreview": {
        "properties": {
          "bytes": {
            "type": ["integer", "null"]
          },
          "contentType": {
            "type": ["string", "null"]
          },
          "coverage": {
            "enum": ["recorded", "redacted", "omitted"],
            "type": "string"
          },
          "encoding": {
            "enum": ["utf8", "binary"],
            "type": "string"
          },
          "preview": {
            "type": ["string", "null"]
          },
          "previewTruncated": {
            "type": "boolean"
          },
          "reason": {
            "type": ["string", "null"]
          }
        },
        "required": [
          "coverage",
          "reason",
          "contentType",
          "bytes",
          "encoding",
          "preview",
          "previewTruncated"
        ],
        "type": "object"
      },
      "CreateEnvironment": {
        "properties": {
          "apps": {
            "items": {
              "anyOf": [
                {
                  "pattern": "^[a-z][a-z0-9-]{1,39}$",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "properties": {
                    "app": {
                      "pattern": "^[a-z][a-z0-9-]{1,39}$",
                      "type": "string"
                    },
                    "name": {
                      "pattern": "^[a-z][a-z0-9-]{0,39}$",
                      "type": "string"
                    },
                    "settings": {
                      "additionalProperties": {},
                      "type": "object"
                    }
                  },
                  "required": ["app"],
                  "type": "object"
                }
              ]
            },
            "maxItems": 10,
            "minItems": 1,
            "type": "array"
          },
          "labels": {
            "additionalProperties": {
              "maxLength": 256,
              "type": "string"
            },
            "default": {},
            "type": "object"
          },
          "name": {
            "maxLength": 120,
            "minLength": 1,
            "type": ["string", "null"]
          },
          "snapshotId": {
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
            "type": "string"
          },
          "timeLimitMinutes": {
            "maximum": 1440,
            "minimum": 1,
            "type": "integer"
          },
          "tokenInUrl": {
            "default": false,
            "type": "boolean"
          },
          "workspaceId": {
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Credentials": {
        "properties": {
          "actorId": {
            "type": "string"
          },
          "app": {
            "pattern": "^[a-z][a-z0-9-]{0,39}$",
            "type": "string"
          },
          "environmentId": {
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
            "type": "string"
          },
          "expiresAt": {
            "format": "date-time",
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "login": {
            "properties": {
              "authentication": {
                "type": "string"
              },
              "parameters": {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              "secrets": {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              "url": {
                "type": "string"
              }
            },
            "required": ["authentication", "url", "parameters", "secrets"],
            "type": ["object", "null"]
          },
          "token": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "environmentId",
          "app",
          "actorId",
          "url",
          "headers",
          "token",
          "expiresAt",
          "login"
        ],
        "type": "object"
      },
      "Environment": {
        "properties": {
          "apps": {
            "items": {
              "properties": {
                "appId": {
                  "type": "string"
                },
                "name": {
                  "pattern": "^[a-z][a-z0-9-]{0,39}$",
                  "type": "string"
                },
                "settings": {
                  "additionalProperties": {},
                  "type": "object"
                },
                "url": {
                  "type": "string"
                },
                "version": {
                  "type": "string"
                },
                "versionId": {
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "type": "string"
                }
              },
              "required": [
                "name",
                "appId",
                "versionId",
                "version",
                "settings",
                "url"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "createdBy": {
            "$ref": "#/components/schemas/Principal"
          },
          "deletedAt": {
            "format": "date-time",
            "type": ["string", "null"]
          },
          "expiresAt": {
            "format": "date-time",
            "type": ["string", "null"]
          },
          "failure": {
            "$ref": "#/components/schemas/EnvironmentFailure"
          },
          "id": {
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
            "type": "string"
          },
          "labels": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "name": {
            "type": ["string", "null"]
          },
          "pausedAt": {
            "format": "date-time",
            "type": ["string", "null"]
          },
          "reason": {
            "enum": ["cancelled", "expired", "failed", null],
            "type": ["string", "null"]
          },
          "snapshotId": {
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
            "type": ["string", "null"]
          },
          "startedAt": {
            "format": "date-time",
            "type": ["string", "null"]
          },
          "status": {
            "$ref": "#/components/schemas/EnvironmentStatus"
          },
          "timeLimitMinutes": {
            "type": "integer"
          },
          "tokenInUrl": {
            "type": "boolean"
          },
          "workspaceId": {
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
            "type": "string"
          }
        },
        "required": [
          "id",
          "workspaceId",
          "name",
          "labels",
          "status",
          "reason",
          "failure",
          "timeLimitMinutes",
          "tokenInUrl",
          "snapshotId",
          "apps",
          "createdBy",
          "createdAt",
          "startedAt",
          "pausedAt",
          "deletedAt",
          "expiresAt"
        ],
        "type": "object"
      },
      "EnvironmentFailure": {
        "properties": {
          "app": {
            "type": "string"
          },
          "code": {
            "enum": [
              "start_failed",
              "restart_failed",
              "resume_failed",
              "version_unavailable",
              "invalid_settings"
            ],
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": ["app", "code", "message"],
        "type": ["object", "null"]
      },
      "EnvironmentStatus": {
        "enum": ["starting", "running", "paused", "failed", "deleted"],
        "type": "string"
      },
      "Error": {
        "properties": {
          "error": {
            "properties": {
              "code": {
                "enum": [
                  "invalid_request",
                  "unauthenticated",
                  "forbidden",
                  "not_found",
                  "invalid_status",
                  "snapshot_in_progress",
                  "idempotency_key_reused",
                  "name_taken",
                  "last_owner",
                  "last_workspace",
                  "workspace_archived",
                  "version_in_use",
                  "body_too_large",
                  "version_unavailable",
                  "environment_limit_reached",
                  "internal_error",
                  "unavailable"
                ],
                "type": "string"
              },
              "fields": {
                "additionalProperties": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "type": "object"
              },
              "message": {
                "type": "string"
              },
              "requestId": {
                "type": "string"
              },
              "status": {
                "type": "string"
              }
            },
            "required": ["code", "message", "requestId"],
            "type": "object"
          }
        },
        "required": ["error"],
        "type": "object"
      },
      "Me": {
        "properties": {
          "limits": {
            "properties": {
              "concurrentEnvironments": {
                "type": "integer"
              },
              "timeLimitMinutes": {
                "properties": {
                  "default": {
                    "type": "integer"
                  },
                  "maximum": {
                    "type": "integer"
                  }
                },
                "required": ["default", "maximum"],
                "type": "object"
              }
            },
            "required": ["concurrentEnvironments", "timeLimitMinutes"],
            "type": ["object", "null"]
          },
          "organization": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Organization"
              },
              {
                "properties": {
                  "role": {
                    "enum": ["owner", "admin", "member", null],
                    "type": ["string", "null"]
                  }
                },
                "required": ["role"],
                "type": ["object", "null"]
              }
            ]
          },
          "organizations": {
            "items": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Organization"
                },
                {
                  "properties": {
                    "role": {
                      "type": ["string", "null"]
                    }
                  },
                  "required": ["role"],
                  "type": "object"
                }
              ]
            },
            "type": "array"
          },
          "permissions": {
            "items": {
              "$ref": "#/components/schemas/Permission"
            },
            "type": "array"
          },
          "principal": {
            "$ref": "#/components/schemas/Principal"
          },
          "user": {
            "properties": {
              "email": {
                "type": ["string", "null"]
              },
              "id": {
                "type": "string"
              },
              "name": {
                "type": ["string", "null"]
              }
            },
            "required": ["id", "email", "name"],
            "type": ["object", "null"]
          },
          "workspaceId": {
            "type": ["string", "null"]
          }
        },
        "required": [
          "principal",
          "user",
          "organization",
          "organizations",
          "workspaceId",
          "permissions",
          "limits"
        ],
        "type": "object"
      },
      "Organization": {
        "properties": {
          "domain": {
            "type": ["string", "null"]
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": ["id", "name", "domain"],
        "type": "object"
      },
      "Permission": {
        "enum": [
          "environments:read",
          "environments:write",
          "environments:connect",
          "snapshots:read",
          "snapshots:write",
          "workspaces:write",
          "api_keys:read",
          "api_keys:write",
          "members:read",
          "members:write"
        ],
        "type": "string"
      },
      "Principal": {
        "properties": {
          "id": {
            "type": ["string", "null"]
          },
          "name": {
            "type": ["string", "null"]
          },
          "type": {
            "enum": ["member", "api_key", "system"],
            "type": "string"
          }
        },
        "required": ["type", "id", "name"],
        "type": "object"
      },
      "Request": {
        "properties": {
          "app": {
            "type": "string"
          },
          "completedAt": {
            "format": "date-time",
            "type": "string"
          },
          "durationMs": {
            "minimum": 0,
            "type": "integer"
          },
          "environmentId": {
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
            "type": "string"
          },
          "errorCode": {
            "type": ["string", "null"]
          },
          "id": {
            "type": "string"
          },
          "method": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "query": {
            "type": "string"
          },
          "receivedAt": {
            "format": "date-time",
            "type": "string"
          },
          "requestBytes": {
            "type": ["integer", "null"]
          },
          "respondedBy": {
            "enum": ["app", "gateway"],
            "type": "string"
          },
          "responseBytes": {
            "type": ["integer", "null"]
          },
          "responseStatus": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "environmentId",
          "app",
          "method",
          "path",
          "query",
          "responseStatus",
          "respondedBy",
          "errorCode",
          "durationMs",
          "requestBytes",
          "responseBytes",
          "receivedAt",
          "completedAt"
        ],
        "type": "object"
      },
      "RequestDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Request"
          },
          {
            "properties": {
              "requestBody": {
                "$ref": "#/components/schemas/BodyPreview"
              },
              "requestHeaders": {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              "responseBody": {
                "$ref": "#/components/schemas/BodyPreview"
              },
              "responseHeaders": {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              }
            },
            "required": [
              "requestHeaders",
              "responseHeaders",
              "requestBody",
              "responseBody"
            ],
            "type": "object"
          }
        ]
      },
      "RequestStats": {
        "properties": {
          "buckets": {
            "items": {
              "properties": {
                "clientError": {
                  "minimum": 0,
                  "type": "integer"
                },
                "from": {
                  "format": "date-time",
                  "type": "string"
                },
                "serverError": {
                  "minimum": 0,
                  "type": "integer"
                },
                "success": {
                  "minimum": 0,
                  "type": "integer"
                }
              },
              "required": ["from", "success", "clientError", "serverError"],
              "type": "object"
            },
            "type": "array"
          },
          "clientErrorCount": {
            "minimum": 0,
            "type": "integer"
          },
          "count": {
            "minimum": 0,
            "type": "integer"
          },
          "from": {
            "format": "date-time",
            "type": "string"
          },
          "p50Ms": {
            "minimum": 0,
            "type": ["number", "null"]
          },
          "p95Ms": {
            "minimum": 0,
            "type": ["number", "null"]
          },
          "serverErrorCount": {
            "minimum": 0,
            "type": "integer"
          },
          "successCount": {
            "minimum": 0,
            "type": "integer"
          },
          "to": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "from",
          "to",
          "count",
          "successCount",
          "clientErrorCount",
          "serverErrorCount",
          "p50Ms",
          "p95Ms",
          "buckets"
        ],
        "type": "object"
      },
      "Snapshot": {
        "properties": {
          "apps": {
            "items": {
              "properties": {
                "appId": {
                  "type": "string"
                },
                "name": {
                  "pattern": "^[a-z][a-z0-9-]{0,39}$",
                  "type": "string"
                },
                "sizeBytes": {
                  "type": ["integer", "null"]
                },
                "version": {
                  "type": "string"
                },
                "versionId": {
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "type": "string"
                }
              },
              "required": [
                "name",
                "appId",
                "versionId",
                "version",
                "sizeBytes"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "createdBy": {
            "$ref": "#/components/schemas/Principal"
          },
          "deletedAt": {
            "format": "date-time",
            "type": ["string", "null"]
          },
          "environmentId": {
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
            "type": "string"
          },
          "failure": {
            "properties": {
              "code": {
                "enum": ["interrupted", "internal_error"],
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": ["code", "message"],
            "type": ["object", "null"]
          },
          "id": {
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
            "type": "string"
          },
          "name": {
            "type": ["string", "null"]
          },
          "readyAt": {
            "format": "date-time",
            "type": ["string", "null"]
          },
          "sizeBytes": {
            "type": ["integer", "null"]
          },
          "status": {
            "$ref": "#/components/schemas/SnapshotStatus"
          },
          "workspaceId": {
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
            "type": "string"
          }
        },
        "required": [
          "id",
          "workspaceId",
          "environmentId",
          "name",
          "status",
          "failure",
          "sizeBytes",
          "apps",
          "createdBy",
          "createdAt",
          "readyAt",
          "deletedAt"
        ],
        "type": "object"
      },
      "SnapshotStatus": {
        "enum": ["saving", "ready", "failed", "deleted"],
        "type": "string"
      },
      "Version": {
        "properties": {
          "actors": {
            "items": {
              "$ref": "#/components/schemas/Actor"
            },
            "type": "array"
          },
          "apis": {
            "items": {
              "$ref": "#/components/schemas/Api"
            },
            "type": "array"
          },
          "appId": {
            "pattern": "^[a-z][a-z0-9-]{1,39}$",
            "type": "string"
          },
          "id": {
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
            "type": "string"
          },
          "isDefault": {
            "type": "boolean"
          },
          "publishedAt": {
            "format": "date-time",
            "type": "string"
          },
          "retiredAt": {
            "format": "date-time",
            "type": ["string", "null"]
          },
          "status": {
            "enum": ["published", "retired"],
            "type": "string"
          },
          "version": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "appId",
          "version",
          "status",
          "isDefault",
          "apis",
          "actors",
          "publishedAt",
          "retiredAt"
        ],
        "type": "object"
      },
      "Workspace": {
        "properties": {
          "archivedAt": {
            "format": "date-time",
            "type": ["string", "null"]
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "createdBy": {
            "$ref": "#/components/schemas/Principal"
          },
          "id": {
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": ["id", "name", "createdBy", "createdAt", "archivedAt"],
        "type": "object"
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "description": "WorkOS session access token or workspace API key",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "title": "State Machines API",
    "version": "1.0.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/v1/apps": {
      "get": {
        "operationId": "listApps",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "maxLength": 2048,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/App"
                      },
                      "type": "array"
                    },
                    "nextCursor": {
                      "type": ["string", "null"]
                    }
                  },
                  "required": ["data", "nextCursor"],
                  "type": "object"
                }
              }
            },
            "description": "The apps an environment can run"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Invalid request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Conflicting request"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Request body too large"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Version unavailable"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Limit reached"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Unexpected failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Dependency unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/apps/{appId}/versions": {
      "get": {
        "operationId": "listVersions",
        "parameters": [
          {
            "in": "path",
            "name": "appId",
            "required": true,
            "schema": {
              "pattern": "^[a-z][a-z0-9-]{1,39}$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "maxLength": 2048,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Version"
                      },
                      "type": "array"
                    },
                    "nextCursor": {
                      "type": ["string", "null"]
                    }
                  },
                  "required": ["data", "nextCursor"],
                  "type": "object"
                }
              }
            },
            "description": "The app's published versions, newest first"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Invalid request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Conflicting request"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Request body too large"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Version unavailable"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Limit reached"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Unexpected failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Dependency unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/audit-events": {
      "get": {
        "operationId": "listAuditEvents",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "maxLength": 2048,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspaceId",
            "required": false,
            "schema": {
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "environmentId",
            "required": false,
            "schema": {
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/AuditEvent"
                      },
                      "type": "array"
                    },
                    "nextCursor": {
                      "type": ["string", "null"]
                    }
                  },
                  "required": ["data", "nextCursor"],
                  "type": "object"
                }
              }
            },
            "description": "A workspace's or an environment's audit events, newest first"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Invalid request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Conflicting request"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Request body too large"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Version unavailable"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Limit reached"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Unexpected failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Dependency unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/environments": {
      "get": {
        "operationId": "listEnvironments",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "maxLength": 2048,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspaceId",
            "required": false,
            "schema": {
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "items": {
                "$ref": "#/components/schemas/EnvironmentStatus"
              },
              "maxItems": 5,
              "type": "array"
            }
          },
          {
            "in": "query",
            "name": "snapshotId",
            "required": false,
            "schema": {
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "maxLength": 120,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "label",
            "required": false,
            "schema": {
              "items": {
                "pattern": "^[^=]+=.*$",
                "type": "string"
              },
              "maxItems": 32,
              "type": "array"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Environment"
                      },
                      "type": "array"
                    },
                    "nextCursor": {
                      "type": ["string", "null"]
                    }
                  },
                  "required": ["data", "nextCursor"],
                  "type": "object"
                }
              }
            },
            "description": "The workspace's environments, newest first"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Invalid request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Conflicting request"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Request body too large"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Version unavailable"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Limit reached"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Unexpected failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Dependency unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "createEnvironment",
        "parameters": [
          {
            "in": "header",
            "name": "idempotency-key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 8,
              "pattern": "^[A-Za-z0-9._:-]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEnvironment"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Environment"
                }
              }
            },
            "description": "The environment an earlier request with this Idempotency-Key created, as it is now"
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Environment"
                }
              }
            },
            "description": "Environment starting"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Invalid request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Conflicting request"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Request body too large"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Version unavailable"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Limit reached"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Unexpected failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Dependency unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/environments/{environmentId}": {
      "delete": {
        "operationId": "deleteEnvironment",
        "parameters": [
          {
            "in": "path",
            "name": "environmentId",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 8,
              "pattern": "^[A-Za-z0-9._:-]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Environment"
                }
              }
            },
            "description": "Environment deleted; compute and data are released after the response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Invalid request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Conflicting request"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Request body too large"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Version unavailable"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Limit reached"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Unexpected failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Dependency unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "get": {
        "operationId": "getEnvironment",
        "parameters": [
          {
            "in": "path",
            "name": "environmentId",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Environment"
                }
              }
            },
            "description": "Environment"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Invalid request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Conflicting request"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Request body too large"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Version unavailable"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Limit reached"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Unexpected failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Dependency unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "updateEnvironment",
        "parameters": [
          {
            "in": "path",
            "name": "environmentId",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "labels": {
                    "additionalProperties": {
                      "maxLength": 256,
                      "type": "string"
                    },
                    "type": "object"
                  },
                  "name": {
                    "maxLength": 120,
                    "minLength": 1,
                    "type": ["string", "null"]
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Environment"
                }
              }
            },
            "description": "Environment updated"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Invalid request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Conflicting request"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Request body too large"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Version unavailable"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Limit reached"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Unexpected failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Dependency unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/environments/{environmentId}/apps/{appName}/credentials": {
      "post": {
        "operationId": "createCredentials",
        "parameters": [
          {
            "in": "path",
            "name": "environmentId",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "appName",
            "required": true,
            "schema": {
              "pattern": "^[a-z][a-z0-9-]{0,39}$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "actorId": {
                    "maxLength": 255,
                    "minLength": 1,
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Credentials"
                }
              }
            },
            "description": "How to call one app as one actor; the same tokens each time"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Invalid request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Conflicting request"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Request body too large"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Version unavailable"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Limit reached"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Unexpected failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Dependency unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/environments/{environmentId}/pause": {
      "post": {
        "operationId": "pauseEnvironment",
        "parameters": [
          {
            "in": "path",
            "name": "environmentId",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 8,
              "pattern": "^[A-Za-z0-9._:-]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Environment"
                }
              }
            },
            "description": "Environment paused; the gateway refuses calls from now on"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Invalid request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Conflicting request"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Request body too large"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Version unavailable"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Limit reached"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Unexpected failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Dependency unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/environments/{environmentId}/resume": {
      "post": {
        "operationId": "resumeEnvironment",
        "parameters": [
          {
            "in": "path",
            "name": "environmentId",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 8,
              "pattern": "^[A-Za-z0-9._:-]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Environment"
                }
              }
            },
            "description": "Environment starting again"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Invalid request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Conflicting request"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Request body too large"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Version unavailable"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Limit reached"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Unexpected failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Dependency unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/me": {
      "get": {
        "operationId": "getMe",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                }
              }
            },
            "description": "The caller, its organization, permissions and limits"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Invalid request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Conflicting request"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Request body too large"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Version unavailable"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Limit reached"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Unexpected failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Dependency unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/requests": {
      "get": {
        "operationId": "listRequests",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "maxLength": 2048,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "environmentId",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "app",
            "required": false,
            "schema": {
              "pattern": "^[a-z][a-z0-9-]{0,39}$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "method",
            "required": false,
            "schema": {
              "enum": [
                "GET",
                "HEAD",
                "POST",
                "PUT",
                "PATCH",
                "DELETE",
                "OPTIONS",
                "CONNECT",
                "TRACE"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "responseStatus",
            "required": false,
            "schema": {
              "maximum": 599,
              "minimum": 100,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "statusClass",
            "required": false,
            "schema": {
              "enum": ["2xx", "3xx", "4xx", "5xx"],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "writesOnly",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "maxLength": 200,
              "pattern": "^[^\\0]*$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Request"
                      },
                      "type": "array"
                    },
                    "nextCursor": {
                      "type": ["string", "null"]
                    }
                  },
                  "required": ["data", "nextCursor"],
                  "type": "object"
                }
              }
            },
            "description": "Calls the gateway recorded for an environment, newest first; recording is best effort"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Invalid request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Conflicting request"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Request body too large"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Version unavailable"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Limit reached"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Unexpected failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Dependency unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/requests/stats": {
      "get": {
        "operationId": "getRequestStats",
        "parameters": [
          {
            "in": "query",
            "name": "environmentId",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "app",
            "required": false,
            "schema": {
              "pattern": "^[a-z][a-z0-9-]{0,39}$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "method",
            "required": false,
            "schema": {
              "enum": [
                "GET",
                "HEAD",
                "POST",
                "PUT",
                "PATCH",
                "DELETE",
                "OPTIONS",
                "CONNECT",
                "TRACE"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "responseStatus",
            "required": false,
            "schema": {
              "maximum": 599,
              "minimum": 100,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "statusClass",
            "required": false,
            "schema": {
              "enum": ["2xx", "3xx", "4xx", "5xx"],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "writesOnly",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "maxLength": 200,
              "pattern": "^[^\\0]*$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "to",
            "required": true,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestStats"
                }
              }
            },
            "description": "Counts and latency of the recorded calls in a window"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Invalid request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Conflicting request"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Request body too large"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Version unavailable"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Limit reached"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Unexpected failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Dependency unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/requests/{requestId}": {
      "get": {
        "operationId": "getRequest",
        "parameters": [
          {
            "in": "path",
            "name": "requestId",
            "required": true,
            "schema": {
              "pattern": "^req_[0-9a-z]{16}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestDetail"
                }
              }
            },
            "description": "A recorded call with its headers and body previews"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Invalid request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Conflicting request"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Request body too large"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Version unavailable"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Limit reached"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Unexpected failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Dependency unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/requests/{requestId}/body/{direction}": {
      "get": {
        "operationId": "getRequestBody",
        "parameters": [
          {
            "in": "path",
            "name": "requestId",
            "required": true,
            "schema": {
              "pattern": "^req_[0-9a-z]{16}$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "direction",
            "required": true,
            "schema": {
              "enum": ["request", "response"],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/octet-stream": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "The recorded body as an attachment"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Invalid request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Conflicting request"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Request body too large"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Version unavailable"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Limit reached"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Unexpected failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Dependency unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/snapshots": {
      "get": {
        "operationId": "listSnapshots",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "maxLength": 2048,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "workspaceId",
            "required": false,
            "schema": {
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "environmentId",
            "required": false,
            "schema": {
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "items": {
                "$ref": "#/components/schemas/SnapshotStatus"
              },
              "maxItems": 4,
              "type": "array"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Snapshot"
                      },
                      "type": "array"
                    },
                    "nextCursor": {
                      "type": ["string", "null"]
                    }
                  },
                  "required": ["data", "nextCursor"],
                  "type": "object"
                }
              }
            },
            "description": "The workspace's snapshots, newest first"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Invalid request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Conflicting request"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Request body too large"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Version unavailable"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Limit reached"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Unexpected failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Dependency unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "createSnapshot",
        "parameters": [
          {
            "in": "header",
            "name": "idempotency-key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 8,
              "pattern": "^[A-Za-z0-9._:-]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "environmentId": {
                    "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                    "type": "string"
                  },
                  "name": {
                    "maxLength": 120,
                    "minLength": 1,
                    "type": ["string", "null"]
                  }
                },
                "required": ["environmentId"],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Snapshot"
                }
              }
            },
            "description": "The snapshot an earlier request with this Idempotency-Key created, as it is now"
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Snapshot"
                }
              }
            },
            "description": "Snapshot created; its status is `saving` until the data is saved"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Invalid request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Conflicting request"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Request body too large"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Version unavailable"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Limit reached"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Unexpected failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Dependency unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/snapshots/{snapshotId}": {
      "delete": {
        "operationId": "deleteSnapshot",
        "parameters": [
          {
            "in": "path",
            "name": "snapshotId",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Snapshot"
                }
              }
            },
            "description": "Snapshot deleted; its files are removed afterwards"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Invalid request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Conflicting request"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Request body too large"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Version unavailable"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Limit reached"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Unexpected failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Dependency unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "get": {
        "operationId": "getSnapshot",
        "parameters": [
          {
            "in": "path",
            "name": "snapshotId",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Snapshot"
                }
              }
            },
            "description": "Snapshot"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Invalid request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Conflicting request"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Request body too large"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Version unavailable"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Limit reached"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Unexpected failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Dependency unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "updateSnapshot",
        "parameters": [
          {
            "in": "path",
            "name": "snapshotId",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "name": {
                    "maxLength": 120,
                    "minLength": 1,
                    "type": ["string", "null"]
                  }
                },
                "required": ["name"],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Snapshot"
                }
              }
            },
            "description": "Snapshot renamed"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Invalid request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Conflicting request"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Request body too large"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Version unavailable"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Limit reached"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Unexpected failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Dependency unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces": {
      "get": {
        "operationId": "listWorkspaces",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "maxLength": 2048,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "archived",
            "required": false,
            "schema": {
              "default": "false",
              "enum": ["true", "false"],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Workspace"
                      },
                      "type": "array"
                    },
                    "nextCursor": {
                      "type": ["string", "null"]
                    }
                  },
                  "required": ["data", "nextCursor"],
                  "type": "object"
                }
              }
            },
            "description": "The organization's workspaces; an API key sees its own"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Invalid request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Conflicting request"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Request body too large"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Version unavailable"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Limit reached"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Unexpected failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Dependency unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspaceId}": {
      "get": {
        "operationId": "getWorkspace",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceId",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Workspace"
                }
              }
            },
            "description": "Workspace"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Invalid request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Conflicting request"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Request body too large"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Version unavailable"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Limit reached"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Unexpected failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Dependency unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "servers": [
    {
      "url": "https://api.usestatemachines.com"
    }
  ],
  "webhooks": {}
}
