{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dependency-track/json-schema/dependency-track-get-service-account-response-schema.json",
  "title": "get-service-account-response",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dependency-track-service-accounts-api-openapi.yml#/components/schemas/get-service-account-response",
  "required": [
    "permissions",
    "teams"
  ],
  "type": "object",
  "properties": {
    "teams": {
      "type": "array",
      "description": "The teams the service account is a member of, ordered by name.",
      "items": {
        "$ref": "#/$defs/service-account-team"
      }
    },
    "permissions": {
      "type": "array",
      "description": "The permissions granted to the service account directly, ordered by name. Permissions it inherits from its teams are not included.",
      "items": {
        "maxLength": 255,
        "type": "string"
      }
    }
  },
  "allOf": [
    {
      "$ref": "#/$defs/service-account"
    }
  ],
  "$defs": {
    "service-account": {
      "required": [
        "name",
        "suspended",
        "username"
      ],
      "type": "object",
      "properties": {
        "name": {
          "$ref": "#/$defs/service-account-name"
        },
        "username": {
          "maxLength": 63,
          "type": "string",
          "description": "The full username of the service account, i.e. the name with the reserved `svc:` prefix."
        },
        "email": {
          "maxLength": 255,
          "type": "string"
        },
        "suspended": {
          "type": "boolean",
          "description": "Whether the service account is suspended."
        }
      }
    },
    "service-account-name": {
      "maxLength": 59,
      "pattern": "^(?![sS][vV][cC]:)[a-zA-Z0-9][a-zA-Z0-9+=,.:@_-]*$",
      "type": "string",
      "description": "The name of the service account, without the reserved `svc:` prefix."
    },
    "service-account-team": {
      "required": [
        "name",
        "uuid"
      ],
      "type": "object",
      "properties": {
        "uuid": {
          "type": "string",
          "format": "uuid"
        },
        "name": {
          "maxLength": 255,
          "type": "string"
        }
      }
    }
  }
}