PATCH
/
v2
/
enterprise
/
members
/
migrate-roles
curl -X PATCH "https://api.devin.ai/v2/enterprise/members/migrate-roles" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "source_role_id": "account_member",
    "target_role_id": "account_admin"
  }'
{
  "status": "success"
}
Migrates all enterprise members from a source account role to a target account role. This is useful for bulk role updates when restructuring permissions across your enterprise. This operation does not affect group memberships.

Request Body

source_role_id
string
required
The role ID to migrate users from. Must be an account-level role (role_type=“account”). All users with this role will be updated.
target_role_id
string
required
The role ID to migrate users to. Must be an account-level role (role_type=“account”). Use the List available roles endpoint to get valid role IDs.

Response

status
string
required
Status of the operation. Returns “success” when the migration is completed successfully.
curl -X PATCH "https://api.devin.ai/v2/enterprise/members/migrate-roles" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "source_role_id": "account_member",
    "target_role_id": "account_admin"
  }'
{
  "status": "success"
}

Error Responses

400
error
Bad Request - One or both of the specified role IDs are not account-level roles
403
error
Forbidden - User not associated with an enterprise or lacks permission to manage account membership