Roles & Permissions

Assign Role To User

Assign a role to a user (multi-role supported)

User can have multiple roles - scopes are merged

Security: Users can only assign roles with scopes they themselves possess. This prevents privilege escalation attacks.

🔐 Required Scopes: team:update

post/api/v1/permissions/users/{user_id}/roles

Request

  • Base URL: https://api.sendseven.com
  • URL: https://api.sendseven.com/api/v1/permissions/users/{user_id}/roles
  • Auth: HTTP bearer

Path parameters

user_idstring required

Request body

role_idstring required
expires_atstring date-time nullable

Example request

{
  "role_id": "uuid-of-role"
}

Response

Successful Response

messagestring required

Success message

assignment_idstring required

ID of the created role assignment

Example response

{
  "assignment_id": "uuid-of-assignment",
  "message": "Role 'Admin' assigned to user"
}

Changes

No recorded changes to this operation across all 3 revisions of this API.