Skip to content

Team

Change a role

Sets the member’s role to admin or agent. The owner’s role cannot be changed, and only owners can promote to admin or change an admin’s role.

PATCH/api/v1/members/{id}
  • Console only: owner or admin
  • Workspace: X-Tenant-ID

Path parameters

  • iduuidrequired

    Membership id (id from the members list, not user_id).

    Example
    92a3b4c5-d6e7-4f80-91a2-b3c4d5e6f708

Headers

  • Cookiestringrequired

    The whatsappx_session cookie the app sets when you sign in. Browsers send it automatically; API keys are not accepted on this endpoint.

    Example
    whatsappx_session=…
  • X-Tenant-IDuuidrequired

    Workspace id. Required for session requests. You can pass ?tenant=<id> instead.

    Example
    8d0f6c2e-3b1a-4c55-9a7e-2f4b6d1e9c30

Body

application/json
  • roleenumrequired

    admin or agent.

    Example
    admin

Response

200 OKapplication/json

  • iduuid

    Membership id. Use it in /api/v1/members/{id}.

  • user_iduuid

    User id. Use this one as assignee_id when assigning conversations.

  • emailstring

    Email address.

  • namestring

    Display name.

  • roleenum

    owner, admin or agent.

Status codes

  • 200OK. The updated member.
  • 400Bad request. role must be admin or agent, invalid member id or invalid request.
  • 401Unauthorized. No signed-in session (unauthorized).
  • 403Forbidden. API keys and non-admins are rejected (see Console only). Role rules: only owners can promote admins, only owners can change admin roles, the workspace owner role cannot be changed.
  • 404Not found. No member with this id in the workspace.