{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/observeinc/json-schema/observeinc-service-account-update-request-schema.json",
  "title": "ServiceAccountUpdateRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/observeinc-service-accounts-api-openapi.yml#/components/schemas/ServiceAccount-UpdateRequest",
  "type": "object",
  "properties": {
    "label": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "disabled": {
      "type": "boolean",
      "description": "Whether the service account is disabled. Disabling a service account will delete all of its API tokens."
    },
    "externalOAuth": {
      "description": "The external OAuth binding for this service account. Set to null to clear the binding.",
      "anyOf": [
        {
          "$ref": "#/$defs/ServiceAccount-ExternalOAuth"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "$defs": {
    "OAuthExternalIntegrationRef": {
      "title": "OAuthExternalIntegrationRef",
      "type": "object",
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "$ref": "#/$defs/ObjectId"
        }
      }
    },
    "ObjectId": {
      "type": "string",
      "format": "ObjectId"
    },
    "ServiceAccount-ExternalOAuth": {
      "title": "ServiceAccountExternalOAuth",
      "type": "object",
      "required": [
        "integration",
        "subject"
      ],
      "properties": {
        "integration": {
          "$ref": "#/$defs/OAuthExternalIntegrationRef"
        },
        "subject": {
          "type": "string",
          "description": "The external identity subject (JWT sub/oid claim) this service account is bound to."
        }
      }
    }
  }
}