Skip to content

members

← All modules

6 endpoints.

GET /api/v1/tenants/{tenant_id}/members

List Members

200 — Successful Response

json
{
  "items": {
    "properties": {
      "id": {
        "type": "string",
        "title": "Id"
      },
      "user_id": {
        "type": "string",
        "title": "User Id"
      },
      "email": {
        "type": "string",
        "title": "Email"
      },
      "full_name": {
        "type": "string",
        "title": "Full Name"
      },
      "role": {
        "type": "string",
        "title": "Role"
      },
      "roles": {
        "items": {
          "type": "string"
        },
        "type": "array",
        "title": "Roles"
      },
      "status": {
        "type": "string",
        "title": "Status"
      },
      "joined_at": {
        "type": "string",
        "format": "date-time",
        "title": "Joined At"
      },
      "extension": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "title": "Extension"
      }
    },
    "type": "object",
    "required": [
      "id",
      "user_id",
      "email",
      "full_name",
      "role",
      "status",
      "joined_at"
    ],
    "title": "MemberResponse",
    "description": "A user's membership(s) in the tenant — one row in the org's Members table\nper user, even when they hold several roles (see ``roles``)."
  },
  "type": "array",
  "title": "Response List Members Api V1 Tenants  Tenant Id  Members Get"
}

PATCH /api/v1/tenants/{tenant_id}/members/{membership_id}

Update Member Role

Parameters

NameInRequiredTypeDescription
membership_idpathyesinteger

Request body

json
{
  "properties": {
    "role": {
      "type": "string",
      "title": "Role",
      "description": "one of ('viewer', 'sales', 'debt_collector', 'admin', 'owner')"
    }
  },
  "type": "object",
  "required": [
    "role"
  ],
  "title": "MemberRoleUpdate"
}

200 — Successful Response

json
{
  "properties": {
    "id": {
      "type": "string",
      "title": "Id"
    },
    "user_id": {
      "type": "string",
      "title": "User Id"
    },
    "email": {
      "type": "string",
      "title": "Email"
    },
    "full_name": {
      "type": "string",
      "title": "Full Name"
    },
    "role": {
      "type": "string",
      "title": "Role"
    },
    "roles": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Roles"
    },
    "status": {
      "type": "string",
      "title": "Status"
    },
    "joined_at": {
      "type": "string",
      "format": "date-time",
      "title": "Joined At"
    },
    "extension": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Extension"
    }
  },
  "type": "object",
  "required": [
    "id",
    "user_id",
    "email",
    "full_name",
    "role",
    "status",
    "joined_at"
  ],
  "title": "MemberResponse",
  "description": "A user's membership(s) in the tenant — one row in the org's Members table\nper user, even when they hold several roles (see ``roles``)."
}

422 — Validation Error

json
{
  "properties": {
    "detail": {
      "items": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "type": "array",
      "title": "Detail"
    }
  },
  "type": "object",
  "title": "HTTPValidationError"
}

DELETE /api/v1/tenants/{tenant_id}/members/{membership_id}

Remove Member

Parameters

NameInRequiredTypeDescription
membership_idpathyesinteger

200 — Successful Response

json
{
  "properties": {
    "detail": {
      "type": "string",
      "title": "Detail"
    }
  },
  "type": "object",
  "required": [
    "detail"
  ],
  "title": "MessageResponse"
}

422 — Validation Error

json
{
  "properties": {
    "detail": {
      "items": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "type": "array",
      "title": "Detail"
    }
  },
  "type": "object",
  "title": "HTTPValidationError"
}

POST /api/v1/tenants/{tenant_id}/members/{membership_id}/roles

Add Member Role

Grant an ADDITIONAL role to the user behind membership_id, on top of whichever they already hold — a new Membership row, not a replacement (see update_member_role for "replace the primary role" instead).

Parameters

NameInRequiredTypeDescription
membership_idpathyesinteger

Request body

json
{
  "properties": {
    "role": {
      "type": "string",
      "title": "Role",
      "description": "one of ('viewer', 'sales', 'debt_collector', 'admin', 'owner')"
    }
  },
  "type": "object",
  "required": [
    "role"
  ],
  "title": "MemberRoleAdd",
  "description": "Grant an additional role to a user in the tenant — a second (or third)\nMembership row alongside whichever they already hold, not a replacement."
}

200 — Successful Response

json
{
  "properties": {
    "id": {
      "type": "string",
      "title": "Id"
    },
    "user_id": {
      "type": "string",
      "title": "User Id"
    },
    "email": {
      "type": "string",
      "title": "Email"
    },
    "full_name": {
      "type": "string",
      "title": "Full Name"
    },
    "role": {
      "type": "string",
      "title": "Role"
    },
    "roles": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Roles"
    },
    "status": {
      "type": "string",
      "title": "Status"
    },
    "joined_at": {
      "type": "string",
      "format": "date-time",
      "title": "Joined At"
    },
    "extension": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Extension"
    }
  },
  "type": "object",
  "required": [
    "id",
    "user_id",
    "email",
    "full_name",
    "role",
    "status",
    "joined_at"
  ],
  "title": "MemberResponse",
  "description": "A user's membership(s) in the tenant — one row in the org's Members table\nper user, even when they hold several roles (see ``roles``)."
}

422 — Validation Error

json
{
  "properties": {
    "detail": {
      "items": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "type": "array",
      "title": "Detail"
    }
  },
  "type": "object",
  "title": "HTTPValidationError"
}

DELETE /api/v1/tenants/{tenant_id}/members/{membership_id}/roles/{role}

Remove Member Role

Revoke ONE role from the user behind membership_id, leaving any other roles they hold untouched. Use DELETE /members/{membership_id} instead to remove the user from the tenant entirely (all roles).

Parameters

NameInRequiredTypeDescription
membership_idpathyesinteger
rolepathyesstring

200 — Successful Response

json
{
  "properties": {
    "id": {
      "type": "string",
      "title": "Id"
    },
    "user_id": {
      "type": "string",
      "title": "User Id"
    },
    "email": {
      "type": "string",
      "title": "Email"
    },
    "full_name": {
      "type": "string",
      "title": "Full Name"
    },
    "role": {
      "type": "string",
      "title": "Role"
    },
    "roles": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Roles"
    },
    "status": {
      "type": "string",
      "title": "Status"
    },
    "joined_at": {
      "type": "string",
      "format": "date-time",
      "title": "Joined At"
    },
    "extension": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Extension"
    }
  },
  "type": "object",
  "required": [
    "id",
    "user_id",
    "email",
    "full_name",
    "role",
    "status",
    "joined_at"
  ],
  "title": "MemberResponse",
  "description": "A user's membership(s) in the tenant — one row in the org's Members table\nper user, even when they hold several roles (see ``roles``)."
}

422 — Validation Error

json
{
  "properties": {
    "detail": {
      "items": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "type": "array",
      "title": "Detail"
    }
  },
  "type": "object",
  "title": "HTTPValidationError"
}

PATCH /api/v1/tenants/{tenant_id}/members/{membership_id}/credentials

Update Member Credentials

Edit a member's login email, password, and/or PBX extension. The User row is global (not tenant-scoped), so this affects every tenant the user belongs to — but an admin can only reach members of their OWN tenant here, via the Membership join, so this can't be used to target an arbitrary user platform-wide.

Parameters

NameInRequiredTypeDescription
membership_idpathyesinteger

Request body

json
{
  "properties": {
    "email": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 255,
          "minLength": 3
        },
        {
          "type": "null"
        }
      ],
      "title": "Email"
    },
    "password": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 128,
          "minLength": 8
        },
        {
          "type": "null"
        }
      ],
      "title": "Password"
    },
    "extension": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 16
        },
        {
          "type": "null"
        }
      ],
      "title": "Extension"
    }
  },
  "type": "object",
  "title": "MemberCredentialsUpdate",
  "description": "Edit a member's login email, password, and/or PBX extension (admin\naction). All fields are optional — send only what's changing; password is\nhashed server-side, never stored or echoed back in plaintext."
}

200 — Successful Response

json
{
  "properties": {
    "id": {
      "type": "string",
      "title": "Id"
    },
    "user_id": {
      "type": "string",
      "title": "User Id"
    },
    "email": {
      "type": "string",
      "title": "Email"
    },
    "full_name": {
      "type": "string",
      "title": "Full Name"
    },
    "role": {
      "type": "string",
      "title": "Role"
    },
    "roles": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Roles"
    },
    "status": {
      "type": "string",
      "title": "Status"
    },
    "joined_at": {
      "type": "string",
      "format": "date-time",
      "title": "Joined At"
    },
    "extension": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Extension"
    }
  },
  "type": "object",
  "required": [
    "id",
    "user_id",
    "email",
    "full_name",
    "role",
    "status",
    "joined_at"
  ],
  "title": "MemberResponse",
  "description": "A user's membership(s) in the tenant — one row in the org's Members table\nper user, even when they hold several roles (see ``roles``)."
}

422 — Validation Error

json
{
  "properties": {
    "detail": {
      "items": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "type": "array",
      "title": "Detail"
    }
  },
  "type": "object",
  "title": "HTTPValidationError"
}

Lubb ERP Documentation