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

Path Parameters

org_id
string
required
The unique identifier of the organization

Request Body

source_role_id
string
required
The role ID to migrate users from. Must be an organization-level role (role_type=“org”). All users in this organization with this role will be updated.
target_role_id
string
required
The role ID to migrate users to. Must be an organization-level role (role_type=“org”). 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/organizations/org_123/members/migrate-roles" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "source_role_id": "org_member",
    "target_role_id": "org_admin"
  }'
{
  "status": "success"
}

Error Responses

400
error
Bad Request - One or both of the specified role IDs are not organization-level roles
403
error
Forbidden - User not associated with an enterprise or lacks permission to manage organization membership
404
error
Not Found - Organization not found in the enterprise