{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Member",
  "description": "A member is user within specific resource identified by resource id, resource type, and associated roles.",
  "type": "object",
  "properties": {
    "id": {
      "description": "ID of the member.",
      "type": "string",
      "example": "mem_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP"
    },
    "roles": {
      "description": "User's roles.",
      "type": "array",
      "items": {
        "type": "string"
      },
      "example": [
        "role_admin"
      ]
    },
    "permissions": {
      "description": "User's permissions.",
      "type": "array",
      "items": {
        "type": "string"
      },
      "example": [
        "members_read",
        "members_write",
        "create_moto_payments",
        "full_transaction_history_view",
        "refund_transactions",
        "create_referral",
        "developer_settings_edit",
        "developer_settings_access"
      ],
      "deprecated": true,
      "x-deprecation-notice": "Permissions include only legacy permissions, please use roles instead. Member access is based on roles within a given resource and the permissions these roles grant."
    },
    "created_at": {
      "description": "The timestamp of when the member was created.",
      "type": "string",
      "format": "date-time",
      "example": "2023-01-20T15:16:17+00:00"
    },
    "updated_at": {
      "description": "The timestamp of when the member was last updated.",
      "type": "string",
      "format": "date-time",
      "example": "2023-01-20T15:16:17+00:00"
    },
    "user": {
      "$ref": "#/components/schemas/MembershipUser"
    },
    "invite": {
      "$ref": "#/components/schemas/Invite"
    },
    "status": {
      "$ref": "#/components/schemas/MembershipStatus"
    },
    "metadata": {
      "$ref": "#/components/schemas/Metadata"
    },
    "attributes": {
      "$ref": "#/components/schemas/Attributes"
    }
  },
  "example": {
    "id": "mem_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP",
    "roles": [
      "role_admin",
      "role_owner"
    ],
    "permissions": [
      "members_read",
      "members_write",
      "create_moto_payments",
      "full_transaction_history_view",
      "refund_transactions",
      "create_referral",
      "developer_settings_edit",
      "developer_settings_access"
    ],
    "created_at": "2023-01-20T15:16:17+00:00",
    "updated_at": "2023-02-20T15:16:17+00:00",
    "user": {
      "id": "44ca0f5b-813b-46e1-aee7-e6242010662e",
      "email": "example@sumup.com",
      "mfa_on_login_enabled": true,
      "virtual_user": false,
      "service_account_user": false
    },
    "status": "accepted"
  },
  "required": [
    "id",
    "roles",
    "permissions",
    "created_at",
    "updated_at",
    "status"
  ]
}