{
  "openapi": "3.0.0",
  "info": {
    "version": "0.1.0",
    "title": "Limrun API"
  },
  "paths": {
    "/readyz": {
      "get": {
        "summary": "Readiness check",
        "operationId": "readinessCheck",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/livez": {
      "get": {
        "summary": "Liveness check",
        "operationId": "livenessCheck",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/regions": {
      "get": {
        "summary": "Get enabled regions",
        "operationId": "listRegions",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Region"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/plans/{planTid}": {
      "get": {
        "summary": "Get a plan by TID",
        "operationId": "getPlan",
        "parameters": [
          {
            "name": "planTid",
            "description": "Plan TID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Plan"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/feedback": {
      "post": {
        "summary": "Send feedback",
        "operationId": "sendFeedback",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "message": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  }
                },
                "required": [
                  "message"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/github_revoke": {
      "post": {
        "summary": "Public endpoint for GitHub to notify us about leaked tokens.",
        "operationId": "gitHubRevoke",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RawJSON"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "token_raw": {
                        "type": "string"
                      },
                      "token_type": {
                        "type": "string"
                      },
                      "label": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "token_raw",
                      "token_type",
                      "label"
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/stripe/webhook": {
      "post": {
        "summary": "Stripe webhook",
        "operationId": "stripeWebhook",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RawJSON"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/whoami": {
      "get": {
        "summary": "Get information about the client, i.e. owner of the provided token.",
        "operationId": "getWhoAmI",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhoAmI"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/users/{userName}": {
      "get": {
        "summary": "Get user with given user name",
        "operationId": "getUser",
        "parameters": [
          {
            "name": "userName",
            "description": "User name",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Update user",
        "operationId": "patchUser",
        "parameters": [
          {
            "name": "userName",
            "description": "User name",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserMutable"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/users/{userName}/memberships": {
      "get": {
        "summary": "Get organizations that user is member of",
        "operationId": "getUserMemberships",
        "parameters": [
          {
            "name": "userName",
            "description": "User name",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Organization"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/organizations": {
      "post": {
        "summary": "Create organization",
        "operationId": "createOrganization",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrganizationCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Organization"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/organizations/{organizationId}": {
      "get": {
        "summary": "Get organization with given name",
        "operationId": "getOrganization",
        "parameters": [
          {
            "name": "organizationId",
            "description": "Organization ID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Organization"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Update organization",
        "operationId": "patchOrganization",
        "parameters": [
          {
            "name": "organizationId",
            "description": "Organization ID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrganizationMutable"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Organization"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete organization",
        "operationId": "deleteOrganization",
        "parameters": [
          {
            "name": "organizationId",
            "description": "Organization ID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Organization"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/organizations/{organizationId}/oidcConnection": {
      "get": {
        "summary": "Get OIDC SSO connection for the organization",
        "operationId": "getOIDCConnection",
        "parameters": [
          {
            "name": "organizationId",
            "description": "Organization ID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OIDCConnection"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      },
      "put": {
        "summary": "Create or update OIDC SSO connection for the organization",
        "operationId": "putOIDCConnection",
        "parameters": [
          {
            "name": "organizationId",
            "description": "Organization ID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OIDCConnectionMutable"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OIDCConnection"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete OIDC SSO connection for the organization",
        "operationId": "deleteOIDCConnection",
        "parameters": [
          {
            "name": "organizationId",
            "description": "Organization ID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/organizations/{organizationId}/domains": {
      "get": {
        "summary": "List verified and pending domains for the organization",
        "operationId": "getOrganizationDomains",
        "parameters": [
          {
            "name": "organizationId",
            "description": "Organization ID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OrganizationDomain"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      },
      "put": {
        "summary": "Replace the organization's domain verification list",
        "operationId": "putOrganizationDomains",
        "parameters": [
          {
            "name": "organizationId",
            "description": "Organization ID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrganizationDomainsMutable"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OrganizationDomain"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/organizations/{organizationId}/domains/{domain}/verify": {
      "post": {
        "summary": "Verify an organization email domain via DNS",
        "operationId": "verifyOrganizationDomain",
        "parameters": [
          {
            "name": "organizationId",
            "description": "Organization ID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "domain",
            "description": "Email domain to verify",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationDomain"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/organizations/{organizationId}/invoices": {
      "get": {
        "summary": "Get Stripe invoices for the given organization",
        "description": "Returns up to the last 6 Stripe invoices with Limrun Credits usage and graduated tier breakdowns.",
        "operationId": "getOrganizationInvoices",
        "parameters": [
          {
            "name": "organizationId",
            "description": "Organization ID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "description": "Start of the invoice range (inclusive, RFC3339)",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "description": "End of the invoice range (exclusive, RFC3339)",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "timezone",
            "description": "Optional IANA timezone used for formatting invoice period boundaries. Defaults to America/Los_Angeles when omitted.",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string",
              "default": "America/Los_Angeles"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceBillingBreakdownResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/organizations/{organizationId}/subscriptions": {
      "get": {
        "summary": "Get subscriptions of the given organization",
        "operationId": "getSubscriptions",
        "parameters": [
          {
            "name": "organizationId",
            "description": "Organization ID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Subscription"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/organizations/{organizationId}/billing-details": {
      "get": {
        "summary": "Get payment method and upcoming invoice for the organization",
        "description": "Returns the default payment method on file at Stripe and a preview of the next invoice. Both fields are optional and may be omitted when no card or upcoming invoice is available.",
        "operationId": "getOrganizationBillingDetails",
        "parameters": [
          {
            "name": "organizationId",
            "description": "Organization ID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationBillingDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/organizations/{organizationId}/billing": {
      "get": {
        "summary": "Go to billing portal of given organization. Redirects to Stripe.",
        "operationId": "getBillingPortalSession",
        "parameters": [
          {
            "name": "organizationId",
            "description": "Organization ID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "emailAddress",
            "description": "Optional email address to use in Stripe during the first enabling of billing.",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/organizations/{organizationId}/checkout": {
      "get": {
        "summary": "Get a checkout session for given price. Redirects to Stripe.",
        "operationId": "getCheckoutSession",
        "parameters": [
          {
            "name": "organizationId",
            "description": "Organization ID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "priceId",
            "description": "Stripe price ID for the checkout session.",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/organizations/{organizationId}/plans": {
      "get": {
        "summary": "Get the plan catalog with the actions available to this organization.",
        "operationId": "getPlanOptions",
        "parameters": [
          {
            "name": "organizationId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Available plan actions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PlanOption"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/organizations/{organizationId}/plan/schedule": {
      "get": {
        "summary": "Read the scheduled plan change.",
        "operationId": "getScheduledPlanChange",
        "parameters": [
          {
            "name": "organizationId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Scheduled change, if any",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduledPlanChangeResult"
                }
              }
            }
          },
          "400": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Keep the current plan by releasing its scheduled change.",
        "operationId": "cancelScheduledPlanChange",
        "parameters": [
          {
            "name": "organizationId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Scheduled change, if any",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduledPlanChangeResult"
                }
              }
            }
          },
          "400": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/organizations/{organizationId}/plan": {
      "post": {
        "summary": "Open Stripe to review and confirm a plan change.",
        "operationId": "changeSubscriptionPlan",
        "parameters": [
          {
            "name": "organizationId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "priceId": {
                    "type": "string"
                  }
                },
                "required": [
                  "priceId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stripe confirmation page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/organizations/{organizationId}/support": {
      "post": {
        "summary": "Create a support ticket",
        "operationId": "createSupportTicket",
        "parameters": [
          {
            "name": "organizationId",
            "description": "Organization ID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SupportMessage"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/organizations/{organizationId}/invitations": {
      "get": {
        "summary": "List the organization's open invitations",
        "operationId": "listOrganizationInvitations",
        "parameters": [
          {
            "name": "organizationId",
            "description": "Organization ID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Invitation"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Invite a user to the given organization",
        "operationId": "inviteUser",
        "parameters": [
          {
            "name": "organizationId",
            "description": "Organization ID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvitationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/organizations/{organizationId}/invitations/{invitationId}": {
      "delete": {
        "summary": "Revoke an open invitation",
        "operationId": "revokeInvitation",
        "parameters": [
          {
            "name": "organizationId",
            "description": "Organization ID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "invitationId",
            "description": "Invitation ID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/organizations/{organizationId}/invitations/accept": {
      "post": {
        "summary": "Join an organization if you have been invited",
        "operationId": "acceptInvitation",
        "parameters": [
          {
            "name": "organizationId",
            "description": "Organization ID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/organizations/{organizationId}/invitations/decline": {
      "post": {
        "summary": "Decline an invitation to join an organization",
        "operationId": "declineInvitation",
        "parameters": [
          {
            "name": "organizationId",
            "description": "Organization ID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/organizations/{organizationId}/members": {
      "get": {
        "summary": "Get members of given organization",
        "operationId": "getOrganizationMembers",
        "parameters": [
          {
            "name": "organizationId",
            "description": "Organization ID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OrganizationMember"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Remove a member from given organization",
        "operationId": "removeOrganizationMember",
        "parameters": [
          {
            "name": "organizationId",
            "description": "Organization ID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "emailAddress": {
                    "type": "string"
                  }
                },
                "required": [
                  "emailAddress"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      },
      "put": {
        "summary": "Add member to given organization, if not already a member.",
        "operationId": "putOrganizationMember",
        "parameters": [
          {
            "name": "organizationId",
            "description": "Organization ID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "emailAddress": {
                    "type": "string"
                  },
                  "role": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/Role"
                      }
                    ],
                    "description": "For a new seat, the role it gets; defaults to member. For an\nexisting member, the role to move them to; omit it to leave\nthe seat as it is. An organization always keeps an admin."
                  }
                },
                "required": [
                  "emailAddress"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/events": {
      "put": {
        "summary": "Register an event. Internal API to be used by regions.",
        "operationId": "putEvent",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/organizations/{organizationId}/tokens": {
      "get": {
        "summary": "List organization API tokens",
        "operationId": "listOrganizationTokens",
        "parameters": [
          {
            "name": "organizationId",
            "description": "Organization ID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Token"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create organization API token",
        "operationId": "createOrganizationToken",
        "parameters": [
          {
            "name": "organizationId",
            "description": "Organization ID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TokenCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenWithValue"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/organizations/{organizationId}/tokens/{tokenId}": {
      "delete": {
        "summary": "Delete organization API token",
        "operationId": "deleteOrganizationToken",
        "parameters": [
          {
            "name": "organizationId",
            "description": "Organization ID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tokenId",
            "description": "Token ID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/whoami": {
      "get": {
        "summary": "Get information about the client, i.e. owner of the provided token.",
        "operationId": "getWhoAmIV1",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhoAmI"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/secrets": {
      "get": {
        "summary": "List an organization's secrets without their data.",
        "description": "Returns metadata only, newest first; the sensitive data map is never\nincluded. Fetch a single secret to read its material back.",
        "operationId": "listOrganizationSecrets",
        "parameters": [
          {
            "name": "organizationId",
            "description": "Organization TID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "description": "Only return secrets of this type.",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "androidSigningKey",
                "appleCertificate",
                "appleProvisioningProfile",
                "appStoreConnectApiKey"
              ]
            }
          },
          {
            "name": "limit",
            "description": "Maximum number of secrets to return. Out-of-range values are rejected with 400, never clamped.\n",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 500
            }
          },
          {
            "name": "offset",
            "description": "Rows to skip in the newest-first ordering, for paging. Out-of-range values are rejected with 400, never clamped.\n",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 0,
              "minimum": 0,
              "maximum": 10000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecretList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid filter or paging parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Organization not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "default": {
            "description": "Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/secrets/{secretType}/{secretName}": {
      "get": {
        "summary": "Fetch a typed secret of an organization including its data.",
        "operationId": "getOrganizationSecret",
        "parameters": [
          {
            "name": "organizationId",
            "description": "Organization TID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "secretType",
            "description": "Secret type; the registered types are enumerated below.",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string",
              "enum": [
                "androidSigningKey",
                "appleCertificate",
                "appleProvisioningProfile",
                "appStoreConnectApiKey"
              ]
            }
          },
          {
            "name": "secretName",
            "description": "Secret name, a natural key of the type (Android application ID, Apple certificate serial number, provisioning profile identifier). It travels as a path segment and must be URL-encoded.\n",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Secret"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Organization or secret not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "default": {
            "description": "Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete a typed secret of an organization.",
        "operationId": "deleteOrganizationSecret",
        "parameters": [
          {
            "name": "organizationId",
            "description": "Organization TID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "secretType",
            "description": "Secret type; the registered types are enumerated below.",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string",
              "enum": [
                "androidSigningKey",
                "appleCertificate",
                "appleProvisioningProfile",
                "appStoreConnectApiKey"
              ]
            }
          },
          {
            "name": "secretName",
            "description": "Secret name, a natural key of the type (Android application ID, Apple certificate serial number, provisioning profile identifier). It travels as a path segment and must be URL-encoded.\n",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Secret deleted."
          },
          "403": {
            "description": "Forbidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Organization or secret not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "default": {
            "description": "Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      },
      "put": {
        "summary": "Create or fetch a typed secret for an organization.",
        "description": "Get-or-create semantics: an existing secret with the same type and\nname is returned as is unless replace is set, so concurrent first\nwriters converge on one secret. A 201 means this call created the\nsecret; a 200 without replace means it already existed and **the\nsubmitted data was NOT stored**. In every case the response data is\nauthoritative and callers MUST adopt it. The type drives\ntype-specific validation of data. Setting replace overwrites the\nstored material irrecoverably; for androidSigningKey that destroys\nthe escrowed upload keystore.",
        "operationId": "putOrganizationSecret",
        "parameters": [
          {
            "name": "organizationId",
            "description": "Organization TID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "secretType",
            "description": "Secret type; the registered types are enumerated below.",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string",
              "enum": [
                "androidSigningKey",
                "appleCertificate",
                "appleProvisioningProfile",
                "appStoreConnectApiKey"
              ]
            }
          },
          {
            "name": "secretName",
            "description": "Secret name, a natural key of the type (Android application ID, Apple certificate serial number, provisioning profile identifier). It travels as a path segment and must be URL-encoded.\n",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SecretPut"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The secret already existed (returned as stored; the submitted data was discarded) or was replaced. Callers must use the returned data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Secret"
                }
              }
            }
          },
          "201": {
            "description": "Secret created from the submitted data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Secret"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or secret data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Organization not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "default": {
            "description": "Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/assets": {
      "post": {
        "summary": "Internal API used by regions",
        "operationId": "createAsset",
        "parameters": [
          {
            "name": "organizationId",
            "description": "Organization ID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssetCreationResult"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/assets/{assetId}": {
      "delete": {
        "summary": "Internal API used by regions",
        "operationId": "deleteAsset",
        "parameters": [
          {
            "name": "organizationId",
            "description": "Organization ID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "assetId",
            "description": "Asset ID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Internal API used by regions",
        "operationId": "updateAsset",
        "parameters": [
          {
            "name": "organizationId",
            "description": "Organization ID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "assetId",
            "description": "Asset ID",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/scoped_tokens": {
      "post": {
        "summary": "Mint a short-lived scoped token whose scopes limit what the holder\ncan do, e.g. install a specific asset on a device through the\nregistry. It is bound to the authenticated caller's organization, and\nkeeping the returned id lets you revoke the token before it expires.",
        "operationId": "createScopedToken",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScopedTokenCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScopedToken"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/scoped_tokens/{tokenId}": {
      "delete": {
        "summary": "Revoke a scoped token by the id returned when it was minted, so the\ntoken stops working even though it has not expired. Repeating the call\nis a no-op, and an id that was never minted is accepted: nothing\nrecords the tokens we mint, so an unknown id simply never matches one.",
        "operationId": "revokeScopedToken",
        "parameters": [
          {
            "name": "tokenId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/mcp/{mcpSessionId}": {
      "get": {
        "summary": "Internal API used by regions",
        "operationId": "getMcpSession",
        "parameters": [
          {
            "name": "mcpSessionId",
            "description": "MCP Session Id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "instanceId": {
                      "type": "string"
                    },
                    "clientInitializationJSON": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "clientInitializationJSON"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      },
      "put": {
        "summary": "Internal API used by regions",
        "operationId": "createMcpSession",
        "parameters": [
          {
            "name": "mcpSessionId",
            "description": "MCP Session Id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "instanceId": {
                    "type": "string",
                    "description": "The instance the session drives; it binds the session to the instance's region."
                  },
                  "clientInitializationJSON": {
                    "type": "string"
                  }
                },
                "required": [
                  "instanceId",
                  "clientInitializationJSON"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Internal API used by regions",
        "operationId": "deleteMcpSession",
        "parameters": [
          {
            "name": "mcpSessionId",
            "description": "MCP Session Id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/organizations/{organizationId}/scim": {
      "get": {
        "operationId": "getSCIMConfiguration",
        "summary": "getSCIMConfiguration",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMConfiguration"
                }
              }
            }
          },
          "403": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "default": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "putSCIMConfiguration",
        "summary": "putSCIMConfiguration",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SCIMPolicy"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMPolicyResult"
                }
              }
            }
          },
          "403": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "default": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/organizations/{organizationId}/scim/credential": {
      "post": {
        "operationId": "createSCIMCredential",
        "summary": "createSCIMCredential",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMCredential"
                }
              }
            }
          },
          "403": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "default": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteSCIMCredential",
        "summary": "deleteSCIMCredential",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMConfiguration"
                }
              }
            }
          },
          "403": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "default": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/organizations/{organizationId}/scim/users": {
      "get": {
        "operationId": "listSCIMUsers",
        "summary": "listSCIMUsers",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "startIndex",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "count",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMUsersPage"
                }
              }
            }
          },
          "403": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "default": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/organizations/{organizationId}/scim/events": {
      "get": {
        "operationId": "listSCIMEvents",
        "summary": "listSCIMEvents",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "startIndex",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "count",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMEventsPage"
                }
              }
            }
          },
          "403": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "default": {
            "description": "Request failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/scim/v2/Users": {
      "get": {
        "operationId": "SCIMGetUsers",
        "security": [
          {
            "SCIMBearer": []
          }
        ],
        "parameters": [
          {
            "name": "filter",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "startIndex",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "count",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 100,
              "maximum": 1000
            }
          },
          {
            "name": "attributes",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "excludedAttributes",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SCIM operation",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMListResponse"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/SCIMErrorResponse"
          }
        }
      },
      "post": {
        "operationId": "SCIMPostUsers",
        "security": [
          {
            "SCIMBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/scim+json": {
              "schema": {
                "$ref": "#/components/schemas/SCIMUserRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                },
                "description": "URL of the created SCIM resource"
              }
            },
            "description": "Successful SCIM operation",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMResourceDocument"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/SCIMErrorResponse"
          }
        }
      }
    },
    "/scim/v2/Users/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "parameters": [
          {
            "name": "attributes",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "excludedAttributes",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "operationId": "SCIMGetUsersById",
        "security": [
          {
            "SCIMBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SCIM operation",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMResourceDocument"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/SCIMErrorResponse"
          }
        }
      },
      "put": {
        "operationId": "SCIMPutUsersById",
        "security": [
          {
            "SCIMBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/scim+json": {
              "schema": {
                "$ref": "#/components/schemas/SCIMUserRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful SCIM operation",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMResourceDocument"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/SCIMErrorResponse"
          }
        }
      },
      "patch": {
        "operationId": "SCIMPatchUsersById",
        "security": [
          {
            "SCIMBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/scim+json": {
              "schema": {
                "$ref": "#/components/schemas/SCIMPatchDocument"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful SCIM operation",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMResourceDocument"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/SCIMErrorResponse"
          }
        }
      },
      "delete": {
        "operationId": "SCIMDeleteUsersById",
        "security": [
          {
            "SCIMBearer": []
          }
        ],
        "responses": {
          "204": {
            "description": "Successful SCIM operation"
          },
          "default": {
            "$ref": "#/components/responses/SCIMErrorResponse"
          }
        }
      }
    },
    "/scim/v2/Groups": {
      "get": {
        "operationId": "SCIMGetGroups",
        "security": [
          {
            "SCIMBearer": []
          }
        ],
        "parameters": [
          {
            "name": "filter",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "startIndex",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "count",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 100,
              "maximum": 1000
            }
          },
          {
            "name": "attributes",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "excludedAttributes",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SCIM operation",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMListResponse"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/SCIMErrorResponse"
          }
        }
      },
      "post": {
        "operationId": "SCIMPostGroups",
        "security": [
          {
            "SCIMBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/scim+json": {
              "schema": {
                "$ref": "#/components/schemas/SCIMGroupRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                },
                "description": "URL of the created SCIM resource"
              }
            },
            "description": "Successful SCIM operation",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMResourceDocument"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/SCIMErrorResponse"
          }
        }
      }
    },
    "/scim/v2/Groups/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "parameters": [
          {
            "name": "attributes",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "excludedAttributes",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "operationId": "SCIMGetGroupsById",
        "security": [
          {
            "SCIMBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SCIM operation",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMResourceDocument"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/SCIMErrorResponse"
          }
        }
      },
      "put": {
        "operationId": "SCIMPutGroupsById",
        "security": [
          {
            "SCIMBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/scim+json": {
              "schema": {
                "$ref": "#/components/schemas/SCIMGroupRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful SCIM operation",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMResourceDocument"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/SCIMErrorResponse"
          }
        }
      },
      "patch": {
        "operationId": "SCIMPatchGroupsById",
        "security": [
          {
            "SCIMBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/scim+json": {
              "schema": {
                "$ref": "#/components/schemas/SCIMPatchDocument"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful SCIM operation",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMResourceDocument"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/SCIMErrorResponse"
          }
        }
      },
      "delete": {
        "operationId": "SCIMDeleteGroupsById",
        "security": [
          {
            "SCIMBearer": []
          }
        ],
        "responses": {
          "204": {
            "description": "Successful SCIM operation"
          },
          "default": {
            "$ref": "#/components/responses/SCIMErrorResponse"
          }
        }
      }
    },
    "/scim/v2/ServiceProviderConfig": {
      "get": {
        "operationId": "SCIMGetServiceProviderConfig",
        "security": [
          {
            "SCIMBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "SCIM discovery document",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMDiscoveryDocument"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/SCIMErrorResponse"
          }
        }
      }
    },
    "/scim/v2/ResourceTypes": {
      "get": {
        "operationId": "SCIMGetResourceTypes",
        "security": [
          {
            "SCIMBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "SCIM discovery document",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMDiscoveryDocument"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/SCIMErrorResponse"
          }
        }
      }
    },
    "/scim/v2/ResourceTypes/{name}": {
      "parameters": [
        {
          "name": "name",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "operationId": "SCIMGetResourceTypesByName",
        "security": [
          {
            "SCIMBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "SCIM discovery document",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMDiscoveryDocument"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/SCIMErrorResponse"
          }
        }
      }
    },
    "/scim/v2/Schemas": {
      "get": {
        "operationId": "SCIMGetSchemas",
        "security": [
          {
            "SCIMBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "SCIM discovery document",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMDiscoveryDocument"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/SCIMErrorResponse"
          }
        }
      }
    },
    "/scim/v2/Schemas/{name}": {
      "parameters": [
        {
          "name": "name",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "operationId": "SCIMGetSchemasByName",
        "security": [
          {
            "SCIMBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "SCIM discovery document",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/SCIMDiscoveryDocument"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/SCIMErrorResponse"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "SCIMBearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "Organization-scoped SCIM provisioning credential. Limrun API keys and sessions are not accepted."
      }
    },
    "responses": {
      "SCIMErrorResponse": {
        "description": "SCIM validation, credential, resource, or server error.",
        "content": {
          "application/scim+json": {
            "schema": {
              "$ref": "#/components/schemas/SCIMError"
            }
          }
        }
      }
    },
    "schemas": {
      "SCIMUserRequest": {
        "x-go-type": "scimwire.User",
        "x-go-type-import": {
          "path": "github.com/limrun/limrun/pkg/scimwire",
          "name": "scimwire"
        },
        "type": "object",
        "required": [
          "schemas",
          "userName"
        ],
        "properties": {
          "schemas": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "userName": {
            "type": "string"
          },
          "externalId": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          },
          "name": {
            "type": "object",
            "properties": {
              "formatted": {
                "type": "string"
              },
              "familyName": {
                "type": "string"
              },
              "givenName": {
                "type": "string"
              },
              "middleName": {
                "type": "string"
              },
              "honorificPrefix": {
                "type": "string"
              },
              "honorificSuffix": {
                "type": "string"
              }
            }
          },
          "emails": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "value": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "primary": {
                  "type": "boolean"
                }
              }
            }
          },
          "nickName": {
            "type": "string"
          },
          "profileUrl": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "userType": {
            "type": "string"
          },
          "preferredLanguage": {
            "type": "string"
          },
          "locale": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          }
        }
      },
      "SCIMGroupRequest": {
        "x-go-type": "scimwire.Group",
        "x-go-type-import": {
          "path": "github.com/limrun/limrun/pkg/scimwire",
          "name": "scimwire"
        },
        "type": "object",
        "required": [
          "schemas",
          "displayName"
        ],
        "properties": {
          "schemas": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "displayName": {
            "type": "string"
          },
          "externalId": {
            "type": "string"
          },
          "members": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "value"
              ],
              "properties": {
                "value": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "User"
                  ]
                }
              }
            }
          }
        }
      },
      "SCIMDiscoveryDocument": {
        "x-go-type": "scimwire.Document",
        "x-go-type-import": {
          "path": "github.com/limrun/limrun/pkg/scimwire",
          "name": "scimwire"
        },
        "type": "object",
        "additionalProperties": true,
        "description": "SCIM ServiceProviderConfig, ResourceType, Schema, or discovery list response."
      },
      "SCIMResourceDocument": {
        "x-go-type": "scimwire.Document",
        "x-go-type-import": {
          "path": "github.com/limrun/limrun/pkg/scimwire",
          "name": "scimwire"
        },
        "type": "object",
        "required": [
          "schemas"
        ],
        "additionalProperties": true,
        "description": "Core User or Group resource. Discover supported attributes through /Schemas.",
        "properties": {
          "schemas": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "id": {
            "type": "string",
            "readOnly": true
          },
          "externalId": {
            "type": "string"
          },
          "userName": {
            "type": "string",
            "description": "Required work email for Users."
          },
          "active": {
            "type": "boolean"
          },
          "displayName": {
            "type": "string",
            "description": "Required for Groups."
          },
          "members": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "value"
              ],
              "properties": {
                "value": {
                  "type": "string",
                  "description": "SCIM user ID in this organization."
                }
              }
            }
          }
        }
      },
      "SCIMPatchDocument": {
        "x-go-type": "scimwire.Patch",
        "x-go-type-import": {
          "path": "github.com/limrun/limrun/pkg/scimwire",
          "name": "scimwire"
        },
        "type": "object",
        "required": [
          "schemas",
          "Operations"
        ],
        "properties": {
          "schemas": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "Operations": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "type": "object",
              "required": [
                "op"
              ],
              "properties": {
                "op": {
                  "type": "string",
                  "enum": [
                    "add",
                    "replace",
                    "remove"
                  ]
                },
                "path": {
                  "type": "string"
                },
                "value": {}
              }
            }
          }
        }
      },
      "SCIMListResponse": {
        "x-go-type": "scimwire.Document",
        "x-go-type-import": {
          "path": "github.com/limrun/limrun/pkg/scimwire",
          "name": "scimwire"
        },
        "type": "object",
        "required": [
          "schemas",
          "totalResults",
          "startIndex",
          "itemsPerPage",
          "Resources"
        ],
        "properties": {
          "schemas": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "totalResults": {
            "type": "integer"
          },
          "startIndex": {
            "type": "integer"
          },
          "itemsPerPage": {
            "type": "integer"
          },
          "Resources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SCIMResourceDocument"
            }
          }
        }
      },
      "SCIMError": {
        "type": "object",
        "required": [
          "schemas",
          "status",
          "detail"
        ],
        "properties": {
          "schemas": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "type": "string"
          },
          "scimType": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          }
        }
      },
      "SCIMConfiguration": {
        "type": "object",
        "required": [
          "configured",
          "baseUrl",
          "credentialConfigured",
          "revision",
          "groups"
        ],
        "properties": {
          "configured": {
            "type": "boolean"
          },
          "activatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "baseUrl": {
            "type": "string"
          },
          "credentialConfigured": {
            "type": "boolean"
          },
          "credentialCreatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "groups": {
            "$ref": "#/components/schemas/SCIMGroups"
          },
          "revision": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "SCIMMapping": {
        "type": "object",
        "required": [
          "groupId",
          "role"
        ],
        "properties": {
          "groupId": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "description": "admin, member, viewer, or an empty string for no access"
          }
        }
      },
      "SCIMPolicy": {
        "type": "object",
        "required": [
          "mappings",
          "revision"
        ],
        "properties": {
          "activate": {
            "type": "boolean",
            "description": "Activate SCIM permanently after setup. Omitting this field preserves the current activation state."
          },
          "mappings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SCIMMapping"
            }
          },
          "revision": {
            "type": "integer",
            "format": "int64",
            "description": "Mapping revision returned with the configuration. Refresh if mappings or activation changed concurrently."
          }
        }
      },
      "SCIMPolicyResult": {
        "type": "object",
        "required": [
          "configuration",
          "currentUserRole"
        ],
        "properties": {
          "configuration": {
            "$ref": "#/components/schemas/SCIMConfiguration"
          },
          "currentUserRole": {
            "type": "string",
            "description": "The caller's organization role after applying the change; empty when access was removed."
          }
        }
      },
      "SCIMCredential": {
        "type": "object",
        "required": [
          "token",
          "configuration"
        ],
        "properties": {
          "token": {
            "type": "string",
            "description": "Shown only once. Rotating invalidates the previous credential."
          },
          "configuration": {
            "$ref": "#/components/schemas/SCIMConfiguration"
          }
        }
      },
      "SCIMGroup": {
        "type": "object",
        "required": [
          "id",
          "displayName",
          "role",
          "memberCount"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "memberCount": {
            "type": "integer"
          }
        }
      },
      "SCIMGroups": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/SCIMGroup"
        }
      },
      "SCIMUser": {
        "type": "object",
        "required": [
          "id",
          "email",
          "displayName",
          "active",
          "role",
          "groups"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          },
          "role": {
            "type": "string"
          },
          "groups": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "SCIMEvent": {
        "type": "object",
        "required": [
          "id",
          "createdAt",
          "actor",
          "operation",
          "resource",
          "status",
          "detail"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "actor": {
            "type": "string"
          },
          "operation": {
            "type": "string"
          },
          "resource": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          }
        }
      },
      "SCIMUsersPage": {
        "type": "object",
        "required": [
          "items",
          "total",
          "startIndex"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SCIMUser"
            }
          },
          "total": {
            "type": "integer"
          },
          "startIndex": {
            "type": "integer"
          }
        }
      },
      "SCIMEventsPage": {
        "type": "object",
        "required": [
          "items",
          "total",
          "startIndex"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SCIMEvent"
            }
          },
          "total": {
            "type": "integer"
          },
          "startIndex": {
            "type": "integer"
          }
        }
      },
      "User": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "emailAddress": {
            "type": "string"
          },
          "defaultOrganization": {
            "$ref": "#/components/schemas/Organization"
          },
          "displayName": {
            "type": "string"
          },
          "organizations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Organization"
            }
          },
          "invitedOrganizations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Organization"
            }
          },
          "autoJoinDomainEligible": {
            "type": "boolean",
            "description": "Whether this user may configure auto-join email domains for an organization (false for common/free/burner email providers)."
          }
        },
        "required": [
          "id",
          "name",
          "emailAddress",
          "defaultOrganization"
        ]
      },
      "UserMutable": {
        "type": "object",
        "properties": {
          "displayName": {
            "type": "string"
          },
          "defaultOrganizationId": {
            "type": "string"
          }
        }
      },
      "Subscription": {
        "type": "object",
        "properties": {
          "planName": {
            "type": "string"
          },
          "planType": {
            "type": "string"
          },
          "monthlyMinutes": {
            "type": "integer",
            "format": "int64"
          },
          "nextCreditRefillAt": {
            "type": "string",
            "format": "date-time"
          },
          "id": {
            "type": "string"
          },
          "cancelAt": {
            "type": "string",
            "format": "date-time"
          },
          "stripeSubscriptionId": {
            "type": "string"
          },
          "stripePriceId": {
            "type": "string"
          },
          "stripeProductId": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "Active",
              "Inactive"
            ]
          },
          "remainingMinutes": {
            "type": "integer",
            "format": "int64"
          },
          "planTid": {
            "type": "string"
          },
          "lastRenewalAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "stripeSubscriptionId",
          "stripePriceId",
          "stripeProductId",
          "status",
          "planTid"
        ]
      },
      "InvoiceBillingBreakdownResponse": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "asOf": {
            "type": "string",
            "format": "date-time"
          },
          "timezone": {
            "type": "string",
            "description": "IANA timezone used for invoice period formatting"
          },
          "invoices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceBillingBreakdown"
            }
          }
        },
        "required": [
          "from",
          "to",
          "asOf",
          "timezone",
          "invoices"
        ]
      },
      "ScheduledPlanChangeResult": {
        "type": "object",
        "properties": {
          "change": {
            "$ref": "#/components/schemas/ScheduledPlanChange"
          }
        }
      },
      "ScheduledPlanChange": {
        "type": "object",
        "properties": {
          "plan": {
            "$ref": "#/components/schemas/Plan"
          },
          "effectiveAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "plan",
          "effectiveAt"
        ]
      },
      "InvoiceBillingBreakdown": {
        "type": "object",
        "description": "Billing details for a single Stripe invoice.",
        "properties": {
          "invoiceId": {
            "type": "string"
          },
          "invoiceNumber": {
            "type": "string"
          },
          "periodStart": {
            "type": "string",
            "format": "date-time"
          },
          "periodEnd": {
            "type": "string",
            "format": "date-time"
          },
          "description": {
            "type": "string",
            "description": "Stripe invoice line description, for example Limrun Credits"
          },
          "credits": {
            "type": "integer",
            "format": "int64",
            "description": "Metered usage credits, excluding subscription quantities and prorations"
          },
          "amount": {
            "type": "number",
            "format": "double",
            "description": "Total credit product charges in dollars after discounts, excluding taxes and credit grants"
          },
          "usageAmount": {
            "type": "number",
            "format": "double",
            "description": "Metered usage charges in dollars after discounts, excluding subscription charges, prorations, taxes, and credit grants"
          },
          "currency": {
            "type": "string"
          },
          "hostedInvoiceUrl": {
            "type": "string"
          },
          "tiers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceBillingTierBreakdown"
            }
          }
        },
        "required": [
          "invoiceId",
          "periodStart",
          "periodEnd",
          "description",
          "credits",
          "amount",
          "currency",
          "tiers"
        ]
      },
      "InvoiceBillingTierBreakdown": {
        "type": "object",
        "description": "Stripe invoice line item for a graduated credit tier",
        "properties": {
          "lineItemId": {
            "type": "string",
            "description": "Stripe invoice line item ID"
          },
          "label": {
            "type": "string",
            "description": "Display label such as First 50,000 or 5,000,001 and above"
          },
          "fromCredit": {
            "type": "integer",
            "format": "int64",
            "description": "First credit included in this tier, inclusive"
          },
          "toCredit": {
            "type": "integer",
            "format": "int64",
            "nullable": true,
            "description": "Last credit included in this tier, inclusive. Null means and above."
          },
          "credits": {
            "type": "integer",
            "format": "int64",
            "description": "Credits allocated to this tier"
          },
          "unitAmount": {
            "type": "number",
            "format": "double",
            "description": "Price per credit in dollars"
          },
          "amount": {
            "type": "number",
            "format": "double",
            "description": "Amount charged for this tier in dollars"
          },
          "currency": {
            "type": "string"
          }
        },
        "required": [
          "lineItemId",
          "label",
          "fromCredit",
          "credits",
          "unitAmount",
          "amount",
          "currency"
        ]
      },
      "OrganizationBillingDetails": {
        "type": "object",
        "description": "Snapshot of the organization's billing state at Stripe.",
        "properties": {
          "paymentMethod": {
            "$ref": "#/components/schemas/PaymentMethod"
          },
          "upcomingInvoice": {
            "$ref": "#/components/schemas/UpcomingInvoice"
          }
        }
      },
      "PaymentMethod": {
        "type": "object",
        "description": "Default payment method on file at Stripe.",
        "properties": {
          "kind": {
            "type": "string",
            "description": "Stripe payment method type. Currently only \"card\" is surfaced.",
            "example": "card"
          },
          "brand": {
            "type": "string",
            "description": "Card brand (visa, mastercard, amex, ...). Present for card payment methods.",
            "example": "visa"
          },
          "last4": {
            "type": "string",
            "description": "Last 4 digits of the card. Present for card payment methods.",
            "example": "4242"
          },
          "expMonth": {
            "type": "integer",
            "format": "int32",
            "description": "Card expiration month (1-12). Present for card payment methods."
          },
          "expYear": {
            "type": "integer",
            "format": "int32",
            "description": "Card expiration year. Present for card payment methods."
          }
        },
        "required": [
          "kind"
        ]
      },
      "UpcomingInvoice": {
        "type": "object",
        "description": "Preview of the next Stripe invoice for the organization's active subscription.",
        "properties": {
          "nextChargeAt": {
            "type": "string",
            "format": "date-time",
            "description": "When Stripe will next attempt to charge this invoice. Omitted when no charge is scheduled."
          },
          "amount": {
            "type": "number",
            "format": "double",
            "description": "Estimated total amount in dollars, including any usage and discounts."
          },
          "currency": {
            "type": "string"
          }
        },
        "required": [
          "amount",
          "currency"
        ]
      },
      "Organization": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "tid": {
            "type": "string"
          },
          "concurrencyLimit": {
            "type": "integer"
          },
          "maxConcurrencyLimit": {
            "type": "integer"
          },
          "displayName": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "creditMinutes": {
            "type": "integer",
            "format": "int64"
          },
          "stripeCustomerId": {
            "type": "string"
          },
          "defaultInactivityTimeoutMinutes": {
            "type": "integer",
            "deprecated": true,
            "description": "Deprecated shared default. Use the platform-specific defaults instead."
          },
          "defaultAndroidInactivityTimeoutMinutes": {
            "type": "integer"
          },
          "defaultIosInactivityTimeoutMinutes": {
            "type": "integer"
          },
          "defaultXcodeInactivityTimeoutMinutes": {
            "type": "integer"
          },
          "defaultJoinRole": {
            "$ref": "#/components/schemas/JoinRole"
          }
        },
        "required": [
          "id",
          "tid",
          "concurrencyLimit",
          "displayName",
          "creditMinutes",
          "maxConcurrencyLimit",
          "defaultInactivityTimeoutMinutes",
          "defaultAndroidInactivityTimeoutMinutes",
          "defaultIosInactivityTimeoutMinutes",
          "defaultXcodeInactivityTimeoutMinutes",
          "defaultJoinRole"
        ]
      },
      "OrganizationMutable": {
        "type": "object",
        "properties": {
          "concurrencyLimit": {
            "type": "integer"
          },
          "displayName": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "defaultInactivityTimeoutMinutes": {
            "type": "integer",
            "deprecated": true,
            "description": "Deprecated shared default. Setting it updates all three platform-specific defaults."
          },
          "defaultAndroidInactivityTimeoutMinutes": {
            "type": "integer"
          },
          "defaultIosInactivityTimeoutMinutes": {
            "type": "integer"
          },
          "defaultXcodeInactivityTimeoutMinutes": {
            "type": "integer"
          },
          "defaultJoinRole": {
            "$ref": "#/components/schemas/JoinRole"
          }
        }
      },
      "OrganizationCreate": {
        "type": "object",
        "properties": {
          "displayName": {
            "type": "string"
          },
          "description": {
            "type": "string"
          }
        },
        "required": [
          "displayName"
        ]
      },
      "OIDCConnection": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "tid": {
            "type": "string"
          },
          "issuerUrl": {
            "type": "string"
          },
          "clientId": {
            "type": "string"
          },
          "clientSecretConfigured": {
            "type": "boolean"
          },
          "redirectUrl": {
            "type": "string"
          },
          "postLogoutRedirectUrl": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "tid",
          "issuerUrl",
          "clientId",
          "clientSecretConfigured",
          "redirectUrl",
          "postLogoutRedirectUrl"
        ]
      },
      "OrganizationDomain": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string"
          },
          "verifiedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "verificationMethod": {
            "type": "string",
            "nullable": true,
            "enum": [
              "dns",
              "manual"
            ]
          },
          "verificationTxtName": {
            "type": "string"
          },
          "verificationTxtValue": {
            "type": "string"
          },
          "autoJoinEnabled": {
            "type": "boolean"
          }
        },
        "required": [
          "domain",
          "verificationTxtName",
          "verificationTxtValue",
          "autoJoinEnabled"
        ]
      },
      "OrganizationDomainMutable": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string"
          },
          "autoJoinEnabled": {
            "type": "boolean",
            "description": "Defaults to true for new domains. When omitted for an existing domain, preserves its current setting. Auto-join requires domain verification."
          }
        },
        "required": [
          "domain"
        ]
      },
      "OrganizationDomainsMutable": {
        "type": "object",
        "properties": {
          "domains": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrganizationDomainMutable"
            }
          }
        },
        "required": [
          "domains"
        ]
      },
      "OIDCConnectionMutable": {
        "type": "object",
        "properties": {
          "issuerUrl": {
            "type": "string"
          },
          "clientId": {
            "type": "string"
          },
          "clientSecret": {
            "type": "string"
          }
        }
      },
      "AndroidInstanceState": {
        "type": "string",
        "enum": [
          "unknown",
          "creating",
          "assigned",
          "ready",
          "terminated"
        ]
      },
      "IOSInstanceState": {
        "type": "string",
        "enum": [
          "unknown",
          "creating",
          "assigned",
          "ready",
          "terminated"
        ]
      },
      "SandboxInstanceState": {
        "type": "string",
        "enum": [
          "unknown",
          "creating",
          "assigned",
          "ready",
          "terminated"
        ]
      },
      "GradleInstanceState": {
        "type": "string",
        "enum": [
          "unknown",
          "creating",
          "assigned",
          "ready",
          "terminated"
        ]
      },
      "APIError": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          },
          "reason": {
            "type": "string",
            "enum": [
              "NoSubscription",
              "NoRemainingMinutes",
              "ConcurrencyLimitReached"
            ]
          }
        },
        "required": [
          "message"
        ]
      },
      "SuccessResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          }
        },
        "required": [
          "status"
        ]
      },
      "AndroidInstance": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "region": {
            "type": "string"
          },
          "state": {
            "$ref": "#/components/schemas/AndroidInstanceState"
          },
          "terminationReason": {
            "type": "string",
            "nullable": true
          },
          "startedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "lastHeartbeatAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "stoppedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "deletedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "connectionUrl": {
            "type": "string",
            "nullable": true
          },
          "webrtcUrl": {
            "type": "string",
            "nullable": true
          },
          "stripeMeterEventId": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "id",
          "name",
          "region",
          "state",
          "createdAt",
          "updatedAt"
        ]
      },
      "AndroidInstanceEvent": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "CREATED",
              "READY",
              "TERMINATED"
            ]
          },
          "message": {
            "type": "string"
          },
          "happenedAt": {
            "type": "string",
            "format": "date-time"
          },
          "connectionUrl": {
            "type": "string"
          },
          "webrtcUrl": {
            "type": "string"
          },
          "labels": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        },
        "required": [
          "action",
          "message",
          "happenedAt"
        ]
      },
      "PlanOption": {
        "type": "object",
        "properties": {
          "custom": {
            "type": "boolean",
            "description": "Whether this plan is a customer-specific offer."
          },
          "plan": {
            "$ref": "#/components/schemas/Plan"
          },
          "action": {
            "type": "string",
            "enum": [
              "subscribe",
              "change",
              "current",
              "unavailable"
            ]
          },
          "reason": {
            "type": "string"
          },
          "overageRate": {
            "type": "number",
            "format": "double",
            "description": "Per-credit overage price; absent when the plan has no overage."
          }
        },
        "required": [
          "plan",
          "action",
          "custom"
        ]
      },
      "Plan": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "tid": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "planType": {
            "type": "string"
          },
          "stripePriceId": {
            "type": "string"
          },
          "stripeProductId": {
            "type": "string"
          },
          "minutePrice": {
            "type": "number",
            "format": "double"
          },
          "monthlyPrice": {
            "type": "number",
            "format": "double"
          },
          "yearlyPrice": {
            "type": "number",
            "format": "double"
          },
          "monthlyMinutes": {
            "type": "integer",
            "format": "int64"
          }
        },
        "required": [
          "id",
          "tid",
          "name",
          "planType",
          "stripePriceId",
          "stripeProductId"
        ]
      },
      "Region": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "endpoint": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "endpoint"
        ]
      },
      "SupportMessage": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          }
        },
        "required": [
          "message"
        ]
      },
      "RawJSON": {
        "type": "object",
        "additionalProperties": {},
        "x-go-type": "json.RawMessage"
      },
      "WhoAmI": {
        "type": "object",
        "description": "Who the credential belongs to and what it can do.",
        "properties": {
          "type": {
            "type": "string"
          },
          "user": {
            "$ref": "#/components/schemas/User"
          },
          "organization": {
            "$ref": "#/components/schemas/Organization"
          },
          "instance": {
            "$ref": "#/components/schemas/AndroidInstance"
          },
          "memberships": {
            "type": "array",
            "description": "For a signed-in person, one entry per organization they\nbelong to, with the role there and what that role may do.",
            "items": {
              "$ref": "#/components/schemas/Membership"
            }
          },
          "scopes": {
            "type": "array",
            "description": "For an API key, what it may do.",
            "items": {
              "type": "string"
            }
          },
          "features": {
            "$ref": "#/components/schemas/Features"
          }
        },
        "required": [
          "type"
        ]
      },
      "JoinRole": {
        "type": "string",
        "description": "The role an account gets when it joins uninvited, through a verified\nauto-join domain or an SSO connection. Never admin: admins are invited\nor added by name.",
        "enum": [
          "member",
          "viewer"
        ]
      },
      "Role": {
        "type": "string",
        "description": "A seat's power in an organization. admin holds everything; member\nworks with instances, assets, secrets and keys and reads the rest;\nviewer only reads. Nobody but admin reaches billing.",
        "enum": [
          "admin",
          "member",
          "viewer"
        ]
      },
      "OrganizationMember": {
        "type": "object",
        "description": "A person's seat in the organization, as its admins see it.",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "emailAddress": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "role": {
            "$ref": "#/components/schemas/Role"
          }
        },
        "required": [
          "id",
          "name",
          "emailAddress",
          "role"
        ]
      },
      "Membership": {
        "type": "object",
        "description": "A person's seat in one organization.",
        "properties": {
          "organizationId": {
            "type": "string",
            "description": "The organization, in the id form this endpoint uses."
          },
          "role": {
            "$ref": "#/components/schemas/Role"
          },
          "scopes": {
            "type": "array",
            "description": "What the role may do, as `<resource>:<id|*>:<action>` scopes.",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "organizationId",
          "role",
          "scopes"
        ]
      },
      "Features": {
        "type": "object",
        "description": "Which optional capabilities this deployment has turned on.",
        "properties": {
          "apiKeyScopes": {
            "type": "boolean",
            "description": "API key creation accepts a scopes list."
          },
          "roles": {
            "type": "boolean",
            "description": "Seats carry a chosen role; invitations, direct adds and role changes accept one."
          }
        },
        "required": [
          "apiKeyScopes",
          "roles"
        ]
      },
      "Token": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "revokedAt": {
            "type": "string",
            "format": "date-time"
          },
          "scopes": {
            "type": "array",
            "description": "What the key may do, as <resource>:<id|*>:<action> scopes.",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "id",
          "expiresAt",
          "createdAt"
        ]
      },
      "TokenCreate": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string"
          },
          "expirationMonths": {
            "type": "integer"
          },
          "scopes": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string"
            },
            "description": "What the key may do, as `<resource>:*:<action>` scopes, e.g.\n`[\"*:*:read\"]` for a read-only key. Omit it for everything your\nrole holds. Every scope must already be covered by your role.\nPer-instance IDs and `stream` belong to instance tokens, and\norganization management is never available to a key."
          }
        },
        "required": [
          "expirationMonths"
        ]
      },
      "TokenWithValue": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "revokedAt": {
            "type": "string",
            "format": "date-time"
          },
          "scopes": {
            "type": "array",
            "description": "What the key may do, as <resource>:<id|*>:<action> scopes.",
            "items": {
              "type": "string"
            }
          },
          "token": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "expiresAt",
          "createdAt",
          "token"
        ]
      },
      "Invitation": {
        "type": "object",
        "description": "An open invitation to the organization: unaccepted and unexpired.",
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "role": {
            "$ref": "#/components/schemas/Role"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "email",
          "role",
          "expiresAt",
          "createdAt"
        ]
      },
      "InvitationRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "role": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Role"
              }
            ],
            "description": "The role the invitee receives on accept. Defaults to member."
          }
        },
        "required": [
          "email"
        ]
      },
      "SecretPut": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Type-specific key-value pairs; unknown keys are rejected. The per-type shapes are AndroidSigningKeyData, AppleCertificateData, AppleProvisioningProfileData and AppStoreConnectApiKeyData.\n"
          },
          "replace": {
            "type": "boolean",
            "description": "Overwrite an existing secret's data instead of returning it. The previous material is destroyed irrecoverably; for androidSigningKey that is the escrowed upload keystore.\n"
          }
        }
      },
      "SecretMetadata": {
        "type": "object",
        "required": [
          "id",
          "type",
          "name",
          "organizationId",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Secret": {
        "type": "object",
        "required": [
          "id",
          "type",
          "name",
          "organizationId",
          "data",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Type-specific key-value pairs; see SecretPut for the shapes."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SecretList": {
        "type": "object",
        "required": [
          "secrets"
        ],
        "properties": {
          "secrets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SecretMetadata"
            }
          }
        }
      },
      "AndroidSigningKeyData": {
        "type": "object",
        "description": "Data keys of an androidSigningKey secret. The upload keystore for signing Android release builds; the name is the application ID.\n",
        "required": [
          "keystoreBase64",
          "keystorePassword",
          "keyAlias",
          "keyPassword"
        ],
        "properties": {
          "keystoreBase64": {
            "type": "string",
            "description": "Base64-encoded PKCS12 or JKS keystore; must decode non-empty."
          },
          "keystorePassword": {
            "type": "string",
            "description": "ISO-8859-1 characters only."
          },
          "keyAlias": {
            "type": "string",
            "description": "ISO-8859-1 characters only."
          },
          "keyPassword": {
            "type": "string",
            "description": "ISO-8859-1 characters only."
          }
        }
      },
      "AppleCertificateData": {
        "type": "object",
        "description": "Data keys of an appleCertificate secret; the name is the certificate's Apple serial number.\n",
        "required": [
          "certificateP12Base64",
          "certificateType"
        ],
        "properties": {
          "certificateP12Base64": {
            "type": "string"
          },
          "certificateType": {
            "type": "string",
            "description": "An App Store Connect certificate type such as DEVELOPMENT or DISTRIBUTION."
          },
          "certificatePassword": {
            "type": "string",
            "description": "Optional; browser-minted p12 bundles legitimately use an empty password."
          },
          "teamID": {
            "type": "string"
          },
          "certificateID": {
            "type": "string"
          },
          "serialNumber": {
            "type": "string"
          },
          "expirationDate": {
            "type": "string"
          }
        }
      },
      "AppleProvisioningProfileData": {
        "type": "object",
        "description": "Data keys of an appleProvisioningProfile secret; the name is the profile identifier. The list fields are comma-separated and mirror what the signed profile binds, so consumers can filter without parsing every profile; certificates are referenced by their Apple serial number.\n",
        "required": [
          "provisioningProfileBase64"
        ],
        "properties": {
          "provisioningProfileBase64": {
            "type": "string"
          },
          "certificateSerialNumbers": {
            "type": "string"
          },
          "bundleIDs": {
            "type": "string"
          },
          "deviceIDs": {
            "type": "string"
          },
          "teamID": {
            "type": "string"
          },
          "profileName": {
            "type": "string"
          },
          "uuid": {
            "type": "string"
          },
          "expirationDate": {
            "type": "string"
          }
        }
      },
      "AppStoreConnectApiKeyData": {
        "type": "object",
        "description": "Data keys of an appStoreConnectApiKey secret; the name is the key ID. Apple serves the private key exactly once, so this is the only durable copy.\n",
        "required": [
          "privateKeyP8Base64",
          "keyId"
        ],
        "properties": {
          "privateKeyP8Base64": {
            "type": "string",
            "description": "Base64 of the .p8 PEM private key."
          },
          "keyId": {
            "type": "string"
          },
          "issuerId": {
            "type": "string",
            "description": "Optional; individual API keys have none."
          },
          "nickname": {
            "type": "string"
          },
          "teamID": {
            "type": "string"
          },
          "expirationDate": {
            "type": "string"
          }
        }
      },
      "AssetCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/AssetKind"
          },
          "platform": {
            "$ref": "#/components/schemas/AssetPlatform"
          },
          "bucketName": {
            "type": "string"
          },
          "objectKey": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "description": "Absolute time after which the asset is swept. Omit for no expiry."
          }
        },
        "required": [
          "name",
          "bucketName",
          "objectKey"
        ]
      },
      "AssetKind": {
        "type": "string",
        "enum": [
          "App",
          "Keychain"
        ],
        "default": "App"
      },
      "AssetPlatform": {
        "type": "string",
        "enum": [
          "ios",
          "android",
          "xcode"
        ]
      },
      "AssetCreationResult": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/AssetKind"
          },
          "platform": {
            "$ref": "#/components/schemas/AssetPlatform"
          },
          "bucketName": {
            "type": "string"
          },
          "objectKey": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "kind",
          "bucketName",
          "objectKey"
        ]
      },
      "AssetUpdate": {
        "type": "object",
        "properties": {
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "description": "Absolute time after which the asset is swept. Omit to leave unchanged."
          },
          "displayName": {
            "type": "string",
            "description": "Human-readable title of the app in the bundle, e.g. CFBundleDisplayName.\nOmit to leave unchanged."
          },
          "bundleIdentifier": {
            "type": "string",
            "description": "CFBundleIdentifier of the app bundle. Omit to leave unchanged."
          },
          "shortVersion": {
            "type": "string",
            "description": "CFBundleShortVersionString of the app bundle, e.g. 1.2.3. Omit to leave unchanged."
          },
          "buildVersion": {
            "type": "string",
            "description": "CFBundleVersion of the app bundle, e.g. 42. Omit to leave unchanged."
          },
          "deeplink": {
            "type": "string",
            "description": "The app's primary URL scheme from CFBundleURLTypes, e.g. \"myapp\" for\nmyapp:// deep links. Omit to leave unchanged."
          },
          "iconObjectKey": {
            "type": "string",
            "description": "Object key of the app icon PNG extracted from the bundle, in the same\nbucket as the asset itself. Omit to leave unchanged."
          },
          "targetSdk": {
            "type": "string",
            "description": "The xcodebuild SDK the artifact was built against, e.g. \"iphoneos\"\nor \"iphonesimulator\". Omit to leave unchanged."
          }
        }
      },
      "ScopedTokenCreate": {
        "type": "object",
        "properties": {
          "scopes": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string"
            },
            "description": "Scopes in the form `<resource>:<id|*>:<action>`, e.g.\n`device:*:install`, `asset:asset_01h455vb4pex5vsknk084sn02q:read`\nor `applerelay:*:connect`. Resource IDs are the customer-visible\nIDs returned by the API."
          },
          "ttlSeconds": {
            "type": "integer",
            "minimum": 1,
            "maximum": 14400,
            "default": 3600,
            "description": "How long the token stays valid. Defaults to 3600 (1 hour), maximum is 14400 (4 hours)."
          }
        },
        "required": [
          "scopes"
        ]
      },
      "ScopedToken": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Identifies this token for revocation. Keep it if you may need to\nwithdraw the token before it expires; it cannot be recovered from\nthe API later."
          },
          "token": {
            "type": "string",
            "description": "The scoped token, to be sent as a Bearer token or the token query parameter."
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "token",
          "scopes",
          "expiresAt"
        ]
      },
      "IOSInstance": {
        "type": "object",
        "properties": {
          "metadata": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "displayName": {
                "type": "string"
              },
              "organizationId": {
                "type": "string"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "terminatedAt": {
                "type": "string",
                "format": "date-time"
              },
              "labels": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              }
            },
            "required": [
              "id",
              "organizationId",
              "createdAt"
            ]
          },
          "spec": {
            "type": "object",
            "properties": {
              "region": {
                "type": "string",
                "description": "The region where the instance will be created. If not given, will be decided based on scheduling clues\nand availability."
              },
              "pool": {
                "type": "string",
                "description": "Resolved pool selected for this iOS instance."
              },
              "inactivityTimeout": {
                "type": "string",
                "format": "duration",
                "description": "After how many minutes of inactivity should the instance be terminated.\nThe timer starts once the instance becomes ready.\nExample values 1m, 10m, 3h.\nDefault is 3m.\nProviding \"0\" disables inactivity checks altogether.",
                "default": "3m"
              },
              "hardTimeout": {
                "type": "string",
                "format": "duration",
                "description": "After how many minutes should the instance be terminated.\nExample values 1m, 10m, 3h.\nDefault is \"0\" which means no hard timeout.",
                "default": "0"
              }
            },
            "required": [
              "pool",
              "region",
              "inactivityTimeout"
            ]
          },
          "status": {
            "type": "object",
            "properties": {
              "state": {
                "$ref": "#/components/schemas/IOSInstanceState"
              },
              "endpointWebSocketUrl": {
                "type": "string"
              },
              "signedStreamUrl": {
                "type": "string"
              },
              "apiUrl": {
                "type": "string"
              },
              "targetHttpPortUrlPrefix": {
                "type": "string"
              },
              "mcpUrl": {
                "type": "string"
              },
              "token": {
                "type": "string"
              },
              "errorMessage": {
                "type": "string"
              },
              "nodeName": {
                "type": "string",
                "description": "Kubernetes node the instance pod was scheduled on. Internal, for operator debugging."
              },
              "podName": {
                "type": "string",
                "description": "Pool pod that served the instance. Internal, for operator debugging."
              }
            },
            "required": [
              "state",
              "token"
            ]
          }
        },
        "required": [
          "metadata",
          "spec",
          "status"
        ]
      },
      "Event": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/AndroidInstanceReadyEvent"
          },
          {
            "$ref": "#/components/schemas/AndroidInstanceAssignedEvent"
          },
          {
            "$ref": "#/components/schemas/AndroidInstanceTerminatedEvent"
          },
          {
            "$ref": "#/components/schemas/IOSInstanceReadyEvent"
          },
          {
            "$ref": "#/components/schemas/IOSInstanceAssignedEvent"
          },
          {
            "$ref": "#/components/schemas/IOSInstanceTerminatedEvent"
          },
          {
            "$ref": "#/components/schemas/SandboxInstanceReadyEvent"
          },
          {
            "$ref": "#/components/schemas/SandboxInstanceAssignedEvent"
          },
          {
            "$ref": "#/components/schemas/SandboxInstanceTerminatedEvent"
          },
          {
            "$ref": "#/components/schemas/GradleInstanceReadyEvent"
          },
          {
            "$ref": "#/components/schemas/GradleInstanceAssignedEvent"
          },
          {
            "$ref": "#/components/schemas/GradleInstanceTerminatedEvent"
          },
          {
            "$ref": "#/components/schemas/XcodeBuildCachePublishedEvent"
          }
        ],
        "discriminator": {
          "propertyName": "kind",
          "mapping": {
            "AndroidInstanceReady": "#/components/schemas/AndroidInstanceReadyEvent",
            "AndroidInstanceAssigned": "#/components/schemas/AndroidInstanceAssignedEvent",
            "AndroidInstanceTerminated": "#/components/schemas/AndroidInstanceTerminatedEvent",
            "IOSInstanceReady": "#/components/schemas/IOSInstanceReadyEvent",
            "IOSInstanceAssigned": "#/components/schemas/IOSInstanceAssignedEvent",
            "IOSInstanceTerminated": "#/components/schemas/IOSInstanceTerminatedEvent",
            "SandboxInstanceReady": "#/components/schemas/SandboxInstanceReadyEvent",
            "SandboxInstanceAssigned": "#/components/schemas/SandboxInstanceAssignedEvent",
            "SandboxInstanceTerminated": "#/components/schemas/SandboxInstanceTerminatedEvent",
            "GradleInstanceReady": "#/components/schemas/GradleInstanceReadyEvent",
            "GradleInstanceAssigned": "#/components/schemas/GradleInstanceAssignedEvent",
            "GradleInstanceTerminated": "#/components/schemas/GradleInstanceTerminatedEvent",
            "XcodeBuildCachePublished": "#/components/schemas/XcodeBuildCachePublishedEvent"
          }
        }
      },
      "AndroidInstanceAssignedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "happenedAt": {
            "type": "string",
            "format": "date-time"
          },
          "kind": {
            "type": "string",
            "enum": [
              "AndroidInstanceAssigned"
            ]
          },
          "androidInstanceAssigned": {
            "$ref": "#/components/schemas/AndroidInstanceInternal"
          }
        },
        "required": [
          "id",
          "happenedAt",
          "kind",
          "androidInstanceAssigned"
        ]
      },
      "AndroidInstanceReadyEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "happenedAt": {
            "type": "string",
            "format": "date-time"
          },
          "kind": {
            "type": "string",
            "enum": [
              "AndroidInstanceReady"
            ]
          },
          "androidInstanceReady": {
            "$ref": "#/components/schemas/AndroidInstanceInternal"
          }
        },
        "required": [
          "id",
          "happenedAt",
          "kind",
          "androidInstanceReady"
        ]
      },
      "AndroidInstanceTerminatedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "happenedAt": {
            "type": "string",
            "format": "date-time"
          },
          "kind": {
            "type": "string",
            "enum": [
              "AndroidInstanceTerminated"
            ]
          },
          "androidInstanceTerminated": {
            "$ref": "#/components/schemas/GenericInstanceTerminatedEvent"
          }
        },
        "required": [
          "id",
          "happenedAt",
          "kind",
          "androidInstanceTerminated"
        ]
      },
      "IOSInstanceAssignedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "happenedAt": {
            "type": "string",
            "format": "date-time"
          },
          "kind": {
            "type": "string",
            "enum": [
              "IOSInstanceAssigned"
            ]
          },
          "iosInstanceAssigned": {
            "$ref": "#/components/schemas/IOSInstance"
          }
        },
        "required": [
          "id",
          "happenedAt",
          "kind",
          "iosInstanceAssigned"
        ]
      },
      "IOSInstanceReadyEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "happenedAt": {
            "type": "string",
            "format": "date-time"
          },
          "kind": {
            "type": "string",
            "enum": [
              "IOSInstanceReady"
            ]
          },
          "iosInstanceReady": {
            "$ref": "#/components/schemas/IOSInstance"
          }
        },
        "required": [
          "id",
          "happenedAt",
          "kind",
          "iosInstanceReady"
        ]
      },
      "IOSInstanceTerminatedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "happenedAt": {
            "type": "string",
            "format": "date-time"
          },
          "kind": {
            "type": "string",
            "enum": [
              "IOSInstanceTerminated"
            ]
          },
          "iosInstanceTerminated": {
            "$ref": "#/components/schemas/GenericInstanceTerminatedEvent"
          }
        },
        "required": [
          "id",
          "happenedAt",
          "kind",
          "iosInstanceTerminated"
        ]
      },
      "SandboxInstanceAssignedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "happenedAt": {
            "type": "string",
            "format": "date-time"
          },
          "kind": {
            "type": "string",
            "enum": [
              "SandboxInstanceAssigned"
            ]
          },
          "sandboxInstanceAssigned": {
            "$ref": "#/components/schemas/SandboxInstance"
          }
        },
        "required": [
          "id",
          "happenedAt",
          "kind",
          "sandboxInstanceAssigned"
        ]
      },
      "SandboxInstanceReadyEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "happenedAt": {
            "type": "string",
            "format": "date-time"
          },
          "kind": {
            "type": "string",
            "enum": [
              "SandboxInstanceReady"
            ]
          },
          "sandboxInstanceReady": {
            "$ref": "#/components/schemas/SandboxInstance"
          }
        },
        "required": [
          "id",
          "happenedAt",
          "kind",
          "sandboxInstanceReady"
        ]
      },
      "SandboxInstanceTerminatedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "happenedAt": {
            "type": "string",
            "format": "date-time"
          },
          "kind": {
            "type": "string",
            "enum": [
              "SandboxInstanceTerminated"
            ]
          },
          "sandboxInstanceTerminated": {
            "$ref": "#/components/schemas/GenericInstanceTerminatedEvent"
          }
        },
        "required": [
          "id",
          "happenedAt",
          "kind",
          "sandboxInstanceTerminated"
        ]
      },
      "GradleInstanceAssignedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "happenedAt": {
            "type": "string",
            "format": "date-time"
          },
          "kind": {
            "type": "string",
            "enum": [
              "GradleInstanceAssigned"
            ]
          },
          "gradleInstanceAssigned": {
            "$ref": "#/components/schemas/GradleInstance"
          }
        },
        "required": [
          "id",
          "happenedAt",
          "kind",
          "gradleInstanceAssigned"
        ]
      },
      "GradleInstanceReadyEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "happenedAt": {
            "type": "string",
            "format": "date-time"
          },
          "kind": {
            "type": "string",
            "enum": [
              "GradleInstanceReady"
            ]
          },
          "gradleInstanceReady": {
            "$ref": "#/components/schemas/GradleInstance"
          }
        },
        "required": [
          "id",
          "happenedAt",
          "kind",
          "gradleInstanceReady"
        ]
      },
      "GradleInstanceTerminatedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "happenedAt": {
            "type": "string",
            "format": "date-time"
          },
          "kind": {
            "type": "string",
            "enum": [
              "GradleInstanceTerminated"
            ]
          },
          "gradleInstanceTerminated": {
            "$ref": "#/components/schemas/GenericInstanceTerminatedEvent"
          }
        },
        "required": [
          "id",
          "happenedAt",
          "kind",
          "gradleInstanceTerminated"
        ]
      },
      "XcodeBuildCachePublishedEvent": {
        "type": "object",
        "description": "Reports that an Xcode build cache archive finished uploading, so backend can upsert the\nindex row that advertises it. Sent by controller-manager at instance termination, on the\nsame event path every other instance transition uses.\n\nThe upload is the publication; this row only says where the object is. A lost event\ntherefore leaves a newer object that still validates against its own metadata, and the\nworst outcome is one cold build.\n",
        "properties": {
          "id": {
            "type": "string"
          },
          "happenedAt": {
            "type": "string",
            "format": "date-time"
          },
          "kind": {
            "type": "string",
            "enum": [
              "XcodeBuildCachePublished"
            ]
          },
          "xcodeBuildCachePublished": {
            "$ref": "#/components/schemas/XcodeBuildCachePublication"
          }
        },
        "required": [
          "id",
          "happenedAt",
          "kind",
          "xcodeBuildCachePublished"
        ]
      },
      "XcodeBuildCachePublication": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string"
          },
          "instanceId": {
            "type": "string",
            "description": "Instance that produced the archive. It must exist in the organization and in the caller's region."
          },
          "cacheKey": {
            "type": "string",
            "description": "Destination key the archive was published under. Unique per organization, overwritten in place on reuse."
          },
          "directoryKey": {
            "type": "string",
            "description": "Stable local build root the archive was produced at and must be restored to, since\nXcode's incremental state is keyed by absolute path. Inherited when the workspace was\nitself restored, so several keys can share one directory.\n"
          },
          "bucketName": {
            "type": "string"
          },
          "objectKey": {
            "type": "string"
          },
          "rootName": {
            "type": "string",
            "description": "limsync top-level synced directory name inside the archive."
          },
          "cachePaths": {
            "type": "array",
            "description": "Normalized workspace-relative path set stored. Omitted means the whole deterministic workspace.",
            "items": {
              "type": "string"
            }
          },
          "pathSetHash": {
            "type": "string",
            "description": "What a later restore's compatibility is judged against. A key whose stored set differs is skipped rather than materialized into the wrong shape."
          },
          "xcodeVersionKey": {
            "type": "string"
          },
          "archiveFormat": {
            "type": "string"
          },
          "archiveSizeBytes": {
            "type": "integer",
            "format": "int64"
          },
          "sha256": {
            "type": "string"
          }
        },
        "required": [
          "organizationId",
          "instanceId",
          "cacheKey",
          "directoryKey",
          "bucketName",
          "objectKey",
          "rootName",
          "pathSetHash",
          "xcodeVersionKey",
          "archiveFormat",
          "archiveSizeBytes",
          "sha256"
        ]
      },
      "SandboxInstance": {
        "type": "object",
        "properties": {
          "metadata": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "displayName": {
                "type": "string"
              },
              "organizationId": {
                "type": "string"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "terminatedAt": {
                "type": "string",
                "format": "date-time"
              },
              "labels": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              }
            },
            "required": [
              "id",
              "organizationId",
              "createdAt"
            ]
          },
          "spec": {
            "type": "object",
            "properties": {
              "region": {
                "type": "string",
                "description": "The region where the instance will be created. If not given, will be decided based on scheduling clues\nand availability."
              },
              "inactivityTimeout": {
                "type": "string",
                "format": "duration",
                "description": "After how many minutes of inactivity should the instance be terminated.\nThe timer starts once the instance becomes ready.\nExample values 1m, 10m, 3h.\nDefault is 5m.\nProviding \"0\" disables inactivity checks altogether.",
                "default": "5m"
              },
              "hardTimeout": {
                "type": "string",
                "format": "duration",
                "description": "After how many minutes should the instance be terminated.\nExample values 1m, 10m, 3h.\nDefault is \"0\" which means no hard timeout.",
                "default": "0"
              }
            },
            "required": [
              "region",
              "inactivityTimeout"
            ]
          },
          "status": {
            "type": "object",
            "properties": {
              "state": {
                "$ref": "#/components/schemas/SandboxInstanceState"
              },
              "apiUrl": {
                "type": "string"
              },
              "token": {
                "type": "string"
              },
              "errorMessage": {
                "type": "string"
              },
              "nodeName": {
                "type": "string",
                "description": "Kubernetes node the instance pod was scheduled on. Internal, for operator debugging."
              },
              "podName": {
                "type": "string",
                "description": "Pool pod that served the instance. Internal, for operator debugging."
              }
            },
            "required": [
              "state",
              "token"
            ]
          }
        },
        "required": [
          "metadata",
          "spec",
          "status"
        ]
      },
      "GradleInstance": {
        "type": "object",
        "properties": {
          "metadata": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "displayName": {
                "type": "string"
              },
              "organizationId": {
                "type": "string"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "terminatedAt": {
                "type": "string",
                "format": "date-time"
              },
              "labels": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              }
            },
            "required": [
              "id",
              "organizationId",
              "createdAt"
            ]
          },
          "spec": {
            "type": "object",
            "properties": {
              "region": {
                "type": "string",
                "description": "The region where the instance will be created. If not given, will be decided based on scheduling clues\nand availability."
              },
              "inactivityTimeout": {
                "type": "string",
                "format": "duration",
                "description": "After how many minutes of inactivity should the instance be terminated.\nThe timer starts once the instance becomes ready.\nExample values 1m, 10m, 3h.\nDefault is 5m.\nProviding \"0\" disables inactivity checks altogether.",
                "default": "5m"
              },
              "hardTimeout": {
                "type": "string",
                "format": "duration",
                "description": "After how many minutes should the instance be terminated.\nExample values 1m, 10m, 3h.\nDefault is \"0\" which means no hard timeout.",
                "default": "0"
              }
            },
            "required": [
              "region",
              "inactivityTimeout"
            ]
          },
          "status": {
            "type": "object",
            "properties": {
              "state": {
                "$ref": "#/components/schemas/GradleInstanceState"
              },
              "apiUrl": {
                "type": "string"
              },
              "token": {
                "type": "string"
              },
              "errorMessage": {
                "type": "string"
              },
              "nodeName": {
                "type": "string",
                "description": "Kubernetes node the instance pod was scheduled on. Internal, for operator debugging."
              },
              "podName": {
                "type": "string",
                "description": "Pool pod that served the instance. Internal, for operator debugging."
              }
            },
            "required": [
              "state",
              "token"
            ]
          }
        },
        "required": [
          "metadata",
          "spec",
          "status"
        ]
      },
      "AndroidInstanceInternal": {
        "type": "object",
        "properties": {
          "metadata": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "displayName": {
                "type": "string"
              },
              "organizationId": {
                "type": "string"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "terminatedAt": {
                "type": "string",
                "format": "date-time"
              },
              "labels": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              }
            },
            "required": [
              "id",
              "organizationId",
              "createdAt"
            ]
          },
          "spec": {
            "type": "object",
            "properties": {
              "region": {
                "type": "string",
                "description": "The region where the instance will be created. If not given, will be decided based on scheduling clues\nand availability."
              },
              "inactivityTimeout": {
                "type": "string",
                "format": "duration",
                "description": "After how many minutes of inactivity should the instance be terminated.\nThe timer starts once the instance becomes ready.\nExample values 1m, 10m, 3h.\nDefault is 3m.\nProviding \"0\" disables inactivity checks altogether.",
                "default": "3m"
              },
              "hardTimeout": {
                "type": "string",
                "format": "duration",
                "description": "After how many minutes should the instance be terminated.\nExample values 1m, 10m, 3h.\nDefault is \"0\" which means no hard timeout.",
                "default": "0"
              }
            },
            "required": [
              "region",
              "inactivityTimeout"
            ]
          },
          "status": {
            "type": "object",
            "properties": {
              "state": {
                "$ref": "#/components/schemas/AndroidInstanceState"
              },
              "apiUrl": {
                "type": "string"
              },
              "adbWebSocketUrl": {
                "type": "string"
              },
              "endpointWebSocketUrl": {
                "type": "string"
              },
              "signedStreamUrl": {
                "type": "string"
              },
              "mcpUrl": {
                "type": "string"
              },
              "targetHttpPortUrlPrefix": {
                "type": "string"
              },
              "token": {
                "type": "string"
              },
              "errorMessage": {
                "type": "string"
              },
              "nodeName": {
                "type": "string",
                "description": "Kubernetes node the instance pod was scheduled on. Internal, for operator debugging."
              },
              "podName": {
                "type": "string",
                "description": "Pool pod that served the instance. Internal, for operator debugging."
              }
            },
            "required": [
              "state",
              "token"
            ]
          }
        },
        "required": [
          "metadata",
          "spec",
          "status"
        ]
      },
      "GenericInstanceTerminatedEvent": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string"
          },
          "instanceId": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "phaseSeconds": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "format": "int64"
            },
            "description": "Cumulative seconds the instance's build daemon attributed to each\nphase (build, cache, sync, apiWork, idle), reported at teardown.\nThe sum over all phases is the daemon's uptime. Backend stores the\nmap raw; the cashier prices each phase. The phase set is open so a\nnewer daemon can report phases the reader does not know yet. Only\nbuild instances (Sandbox, Gradle) report it; absent means no report\nwas read, whether the daemon predates the usage meter or the read\nfailed, and the instance is billed on wall-clock, today's behavior."
          },
          "recentPhases": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PhaseInterval"
            },
            "description": "The daemon's timeline of its latest phase runs, newest last, from\nthe same GET /usage read as phaseSeconds. Bounded by the daemon\n(oldest runs fall off) and not persisted across daemon restarts,\nso it explains the map rather than replacing it: billing reads\nphaseSeconds, this says when and in what order those seconds\nhappened. Backend stores it raw beside the map."
          }
        },
        "required": [
          "organizationId",
          "instanceId",
          "message"
        ]
      },
      "PhaseInterval": {
        "type": "object",
        "description": "One run of a single phase in a build daemon's usage timeline.",
        "properties": {
          "phase": {
            "type": "string"
          },
          "startedAt": {
            "type": "string",
            "format": "date-time"
          },
          "endedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "phase",
          "startedAt",
          "endedAt"
        ]
      }
    }
  },
  "servers": [
    {
      "url": "https://api.limrun.com"
    }
  ]
}
