{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/clarifymedical/json-schema/clarifymedical-public-user-response-schema.json",
  "title": "PublicUserResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/clarifymedical-users-api-openapi.yml#/components/schemas/PublicUserResponse",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "user"
          ],
          "description": "The resource type; matches the `object` path parameter."
        },
        "id": {
          "type": "string",
          "description": "The unique ID of the resource."
        },
        "attributes": {
          "type": "object",
          "properties": {
            "_id": {
              "type": "string",
              "description": "The unique ID of the user."
            },
            "name": {
              "type": "object",
              "properties": {
                "first_name": {
                  "type": "string",
                  "description": "The user’s first name."
                },
                "last_name": {
                  "type": "string",
                  "description": "The user’s last name."
                },
                "full_name": {
                  "type": "string",
                  "description": "The user’s full name (first and last combined)."
                }
              },
              "required": [
                "first_name",
                "last_name"
              ],
              "description": "The user’s name."
            },
            "roles": {
              "type": "object",
              "properties": {
                "items": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "super_admin",
                      "admin",
                      "member"
                    ]
                  },
                  "minItems": 1,
                  "maxItems": 1,
                  "description": "The user’s role, as a single-element array."
                }
              },
              "required": [
                "items"
              ],
              "description": "The user’s workspace role, as a single-element array. Humans are `admin` or `member`; `super_admin` is reserved for the seeded system service account."
            },
            "email": {
              "type": [
                "string",
                "null"
              ],
              "description": "The user’s email address."
            },
            "profile_picture": {
              "type": "string",
              "description": "A URL to the user’s profile picture."
            },
            "is_service_account": {
              "type": "boolean",
              "description": "Server-derived. True for a non-human service account (an account with no identity provider). Read-only; not a stored column."
            },
            "_created_at": {
              "oneOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "string"
                },
                {
                  "type": "object",
                  "properties": {}
                }
              ],
              "description": "The time the user was added to the workspace."
            },
            "_updated_at": {
              "oneOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "string"
                },
                {
                  "type": "object",
                  "properties": {}
                }
              ],
              "description": "The time the user record was last updated."
            },
            "last_active_at": {
              "oneOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "string"
                },
                {
                  "type": "object",
                  "properties": {}
                }
              ],
              "nullable": true,
              "description": "The time the user was last active, derived from the later of their most recent sign-in or API key usage."
            }
          },
          "required": [
            "_id",
            "name",
            "roles",
            "_created_at",
            "_updated_at"
          ],
          "description": "Field values keyed by field name; available fields depend on the object’s schema."
        },
        "relationships": {
          "type": "object",
          "properties": {},
          "description": "Related resources keyed by relationship name, present when requested via `include`."
        }
      },
      "required": [
        "type",
        "id",
        "attributes"
      ],
      "description": "The resource."
    }
  },
  "required": [
    "data"
  ]
}