{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/permitio/json-schema/permitio-org-member-read-with-grants-schema.json",
  "title": "OrgMemberReadWithGrants",
  "x-generated": "2026-11-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/permitio-openapi.json#/components/schemas/OrgMemberReadWithGrants",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id",
      "description": "Unique id of the account member"
    },
    "email": {
      "type": "string",
      "format": "email",
      "title": "Email",
      "description": "Email of the user controlling this account"
    },
    "email_verified": {
      "type": "boolean",
      "title": "Email Verified",
      "description": "Whether this email address is verified or not. For social providers like 'Login with Google' this is done automatically, otherwise we will send the user a verification link in email."
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Name",
      "description": "Name of this user"
    },
    "given_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Given Name",
      "description": "First name of the user"
    },
    "family_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Family Name",
      "description": "Last name of the user"
    },
    "picture": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Picture",
      "description": "URL to picture, photo, or avatar of the user that controls this account."
    },
    "is_superuser": {
      "type": "boolean",
      "title": "Is Superuser",
      "description": "Whether or not this user has special access to permit.io organizations"
    },
    "is_onboarding": {
      "type": "boolean",
      "title": "Is Onboarding",
      "description": "Whether or not this user is currently onboarding, needs to be replaced by a user journey object"
    },
    "onboarding_step": {
      "$ref": "#/$defs/OnboardingStep",
      "description": "the step the user is currently going through in onboarding"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At",
      "description": "Date and time when the account member was created (ISO_8601 format)."
    },
    "last_login": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Last Login",
      "description": "Last date and time this user logged in (ISO_8601 format)."
    },
    "last_ip": {
      "type": "string",
      "title": "Last Ip",
      "description": "Last IP address from which this user logged in.",
      "default": "0.0.0.0"
    },
    "logins_count": {
      "type": "integer",
      "title": "Logins Count",
      "description": "Total number of logins this user has performed.",
      "default": 0
    },
    "identities": {
      "items": {
        "$ref": "#/$defs/IdentityRead"
      },
      "type": "array",
      "title": "Identities"
    },
    "invite": {
      "anyOf": [
        {
          "$ref": "#/$defs/InviteRead"
        },
        {
          "type": "null"
        }
      ]
    },
    "settings": {
      "additionalProperties": true,
      "type": "object",
      "title": "Settings",
      "description": "Custom permit.io dashboard settings, such as preferred theme, etc."
    },
    "grants": {
      "items": {
        "$ref": "#/$defs/Permission"
      },
      "type": "array",
      "title": "Grants"
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "id",
    "email",
    "email_verified",
    "is_superuser",
    "is_onboarding",
    "onboarding_step",
    "created_at",
    "identities",
    "settings",
    "grants"
  ],
  "$defs": {
    "IdentityRead": {
      "properties": {
        "user_id": {
          "type": "string",
          "title": "User Id",
          "description": "Unique User Id of this identity in the identity provider (including the provider type)"
        },
        "provider": {
          "type": "string",
          "title": "Provider",
          "description": "The identity provider type this identity came from"
        },
        "sub": {
          "type": "string",
          "title": "Sub",
          "description": "Unique User Id of this identity in the identity provider (NOT including the provider type)"
        },
        "email": {
          "type": "string",
          "format": "email",
          "title": "Email",
          "description": "Email connected to this account identity"
        },
        "email_verified": {
          "type": "boolean",
          "title": "Email Verified",
          "description": "Whether this email address connected to this account identity is verified or not. For social providers like 'Login with Google' this is done automatically, otherwise we will send the user a verification link in email."
        },
        "auth0_info": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Auth0 Info",
          "description": "Raw user info json coming from our identity provider and matching a specific account identity"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "user_id",
        "provider",
        "sub",
        "email",
        "email_verified",
        "auth0_info"
      ],
      "title": "IdentityRead"
    },
    "InviteRead": {
      "properties": {
        "member_id": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "title": "Member Id",
          "description": "Unique id of the invite"
        },
        "email": {
          "type": "string",
          "format": "email",
          "title": "Email",
          "description": "The invited member's email address"
        },
        "role": {
          "$ref": "#/$defs/MemberAccessLevel",
          "description": "The role the member will be assigned with",
          "default": "admin"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id",
          "description": "Unique id of the invite"
        },
        "organization_id": {
          "type": "string",
          "format": "uuid",
          "title": "Organization Id",
          "description": "Unique id of the organization that the invite belongs to."
        },
        "invite_code": {
          "type": "string",
          "format": "uuid",
          "title": "Invite Code",
          "description": "The invite code that is sent to the member's email"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At",
          "description": "Date and time when the invite was created (ISO_8601 format)."
        },
        "status": {
          "$ref": "#/$defs/InviteStatus",
          "description": "The status of the invite (pending, failed, etc)"
        },
        "failed_reason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Failed Reason",
          "description": "if failed, the reason the invitation failed"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "email",
        "id",
        "organization_id",
        "invite_code",
        "created_at",
        "status"
      ],
      "title": "InviteRead"
    },
    "InviteStatus": {
      "type": "string",
      "enum": [
        "pending",
        "accepted",
        "failed",
        "canceled"
      ],
      "title": "InviteStatus"
    },
    "MemberAccessLevel": {
      "type": "string",
      "enum": [
        "admin",
        "write",
        "read",
        "no_access"
      ],
      "title": "MemberAccessLevel"
    },
    "MemberAccessObj": {
      "type": "string",
      "enum": [
        "org",
        "project",
        "env"
      ],
      "title": "MemberAccessObj"
    },
    "OnboardingStep": {
      "type": "string",
      "enum": [
        "create_organization",
        "create_project",
        "create_resource",
        "create_actions",
        "assign_permissions",
        "assign_user_roles",
        "connect_sdk",
        "done"
      ],
      "title": "OnboardingStep"
    },
    "Permission": {
      "properties": {
        "organization_id": {
          "type": "string",
          "format": "uuid",
          "title": "Organization Id"
        },
        "project_id": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "title": "Project Id"
        },
        "environment_id": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "title": "Environment Id"
        },
        "object_type": {
          "$ref": "#/$defs/MemberAccessObj"
        },
        "access_level": {
          "$ref": "#/$defs/MemberAccessLevel"
        },
        "organization_key": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Organization Key"
        },
        "project_key": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Project Key"
        },
        "environment_key": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Environment Key"
        },
        "organization_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Organization Name"
        },
        "project_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Project Name"
        },
        "environment_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Environment Name"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "organization_id",
        "object_type",
        "access_level"
      ],
      "title": "Permission"
    }
  }
}