Bulk Update Entities

​

Bulk update multiple entities in a single request.

This endpoint is a generic bulk update API for any entity that uses GeneralizedEntityAPIRouter. It delegates to the shared accountsession bulk infrastructure:

Behavior:

  • Each entity is updated independently based on its id.
  • Some updates can succeed while others fail (partial success).
  • Custom fields and linked fields are updated using the same logic as single-entity updates.

Args: entities_info: List of entity payloads to update. Each item: - Must include id (see the entity schema for the expected ID format). - May include only the fields to change (per-entity partial update). override: Maps to BulkUpdateMode: - True → REPLACE: every input field is written, including nulls (clears the stored value). Use when the payload is the authoritative source of truth and you want explicit null inputs to erase existing data. - False → SYNC: null input fields are skipped; non-null inputs overwrite existing values regardless of whether they are already set. Safe default for partial updates. user: Authenticated user performing the bulk operation. response: FastAPI response object, used to set HTTP status to 206 when needed.

Returns: JSON object with: - successfulCount (int): number of entities updated successfully - failedCount (int): number of entities that failed to update - successfulIds (List[str]): IDs of updated entities - failedIds (List[str]): IDs of entities that failed (when available) - errors (Dict[str,str]): mapping of ID → error description

Query Parameters

  • When true, all provided fields override existing values. When false, only non-null fields are applied.

Body·Entities Info

required
application/json
  • Properties: 17

Responses

  • application/json
  • application/json
Request Example for put/bulk/update
curl 'https://crm.dreamhub.ai/api/v1/people/bulk/update?override=true' \
  --request PUT \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '[
  {
    "firstName": "John",
    "lastName": "Smith",
    "companyId": "c-acme123",
    "jobTitle": "VP of Engineering",
    "phone": "+1-555-123-4567",
    "email": "john.smith@acme.com",
    "jobFunction": 1,
    "deskPhone": "+1-555-123-4567 ext. 123",
    "reportsTo": "p-manager123",
    "notes": "Prefers email communication",
    "address": "123 Main St, San Francisco, CA 94105",
    "referenceability": 1,
    "status": 1,
    "statusReasonText": "Left company",
    "statusChangedBy": "u-user123",
    "statusChangedAt": "2024-01-15T10:30:00Z",
    "additionalProperty": "anything"
  }
]'
{
  "additionalProperty": "anything"
}