Skip to content

Team Memberships

List of valid attributes:

Attribute Description Specifics
team_id ID of the team to add users to Must be provided
user_id ID of the user to add to the team Must be provided
role_ids List of roles the user should have in team Parameter must be provided, Can be empty

Example request:

{
"data": {
"type": "team_membership",
"attributes": {
"team_id": "de9c0396-3ac7-4965-9c14-7f0e15af47d9",
"user_id": "412cc746-4ace-484a-95f3-f49951ab182f",
"role_ids": []
}
}
}

Example response:

{
"data": [
{
"id": "412cc746-4ace-484a-95f3-f49951ab182f",
"type": "user",
"attributes": {
...
}
}
]
}

This endpoint connects a user and a team through roles.

A successful request creates one account_audit_log per role added (resource_type: team_membership, action_type: created) and one per role removed (action_type: deleted). Roles that stay unchanged are not logged.

When the user joins the team, the first membership is also logged as resource_type: team_member and action_type: created. When the user leaves the team, the last membership removed is also logged as resource_type: team_member and action_type: deleted.

The acting user is stored as actor_id. A team_membership entry records role_id, role_name, team_id, team_name, user_id, user_name and user_email. A team_member entry records team_id, team_name, user_id, user_name and user_email. Failed requests do not create audit entries.

POST /api/v1/team_memberships