{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/adobe-captivate/json-schema/adobe-captivate-user-response-schema.json",
  "title": "UserResponse",
  "description": "Single user response",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/adobe-captivate-users-api-openapi.yml#/components/schemas/UserResponse",
  "type": "object",
  "properties": {
    "data": {
      "$ref": "#/$defs/User"
    }
  },
  "$defs": {
    "Relationship": {
      "type": "object",
      "description": "A JSON:API relationship object",
      "properties": {
        "data": {
          "oneOf": [
            {
              "$ref": "#/$defs/ResourceIdentifier"
            },
            {
              "type": "array",
              "items": {
                "$ref": "#/$defs/ResourceIdentifier"
              }
            }
          ]
        },
        "links": {
          "type": "object",
          "properties": {
            "related": {
              "type": "string",
              "format": "uri",
              "description": "URL to fetch the related resource"
            }
          }
        }
      }
    },
    "ResourceIdentifier": {
      "type": "object",
      "description": "JSON:API resource identifier",
      "required": [
        "id",
        "type"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Resource identifier"
        },
        "type": {
          "type": "string",
          "description": "Resource type name"
        }
      }
    },
    "User": {
      "type": "object",
      "description": "A user in the Learning Manager system",
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique user identifier"
        },
        "type": {
          "type": "string",
          "const": "user"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "avatarUrl": {
              "type": "string",
              "format": "uri",
              "description": "URL of the user's avatar image"
            },
            "email": {
              "type": "string",
              "format": "email",
              "description": "User's email address"
            },
            "name": {
              "type": "string",
              "description": "User's full name"
            },
            "pointsEarned": {
              "type": "integer",
              "description": "Total gamification points earned"
            },
            "profile": {
              "type": "string",
              "description": "Profile bio text"
            },
            "roles": {
              "type": "array",
              "description": "List of roles assigned to the user",
              "items": {
                "type": "string",
                "enum": [
                  "learner",
                  "manager",
                  "author",
                  "admin",
                  "integrationAdmin"
                ]
              }
            },
            "state": {
              "type": "string",
              "description": "User account state",
              "enum": [
                "ACTIVE",
                "DELETED",
                "SUSPENDED"
              ]
            },
            "userType": {
              "type": "string",
              "description": "User type classification",
              "enum": [
                "Internal",
                "External"
              ]
            }
          }
        },
        "relationships": {
          "type": "object",
          "properties": {
            "manager": {
              "$ref": "#/$defs/Relationship"
            },
            "userGroups": {
              "$ref": "#/$defs/Relationship"
            },
            "account": {
              "$ref": "#/$defs/Relationship"
            }
          }
        }
      }
    }
  }
}