Patch Entity

​

Partially update an existing entity (PATCH).

Send only the fields to change. Every field is optional; a field that is omitted is not written and keeps its stored value. Values that are sent are validated the same way PUT validates them, so a field sent as null is cleared only where PUT also accepts null for it.

Args: entity_id: Unique identifier of the entity to update entity_info: The fields to change, plus custom field updates if applicable user: Authenticated user information (used for audit trails) response: HTTP response object for status code modification

Returns: Complete updated entity data, as PUT returns it

Note: - Returns HTTP 200 on successful update - Returns HTTP 206 (Partial Content) if entity is updated but some custom fields failed to update - Automatically updates modification timestamp and user information

Raises: HTTPException: - 400: Invalid input data - 401: Authentication required - 403: Insufficient permissions to update this entity - 404: Entity not found - 405: This service replaced the generic PUT with its own update handler, so the generic PATCH would bypass that handler's rules - 409: Update conflict - 422: Validation error in a sent field - 500: Internal server error during update

Path Parameters

Query Parameters

  • Whether to include additional fields from the additional fields tab.

Body·

required
application/json
  • Area of Responsibility ID - The functional area this user is responsible for. References the area_of_responsibility lookup table

  • Avatar URL - URL to the user's profile picture or avatar image

  • Department ID - The department this user belongs to. References the departments lookup table

  • Display Name - Friendly name shown in the UI. If not provided, defaults to 'First Last'

  • Email Address - User's primary email address. Must be unique across the account. Used for authentication and notifications

  • First Name - User's given name or first name (required)

  • Group IDs - List of group IDs this user belongs to. Can be provided as comma-separated string or array

  • Job Title - User's position or title within the organization

  • Last Name - User's family name or surname

  • Manager ID - User ID of this user's direct manager. Must start with 'u-'. Used for organizational hierarchy

  • Quota Plan ID - The quota/target plan assigned to this user. Determines performance metrics and goals

  • Role ID - User's role determining permissions and access levels. References the roles lookup table

Responses

  • application/json
  • application/json
  • application/json
Request Example for patch/{entity_id}
curl 'https://crm.dreamhub.ai/api/v1/users/{entity_id}?include_additionals=false' \
  --request PATCH \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "lastName": "Smith",
  "displayName": "John Smith",
  "department": 1,
  "areaOfResponsibility": 1,
  "email": "john.smith@company.com",
  "role": 1,
  "jobTitle": "Account Executive",
  "userLanguage": "en",
  "avatarUrl": "https://example.com/avatars/user123.jpg",
  "groupIds": [
    "g-sales",
    "g-enterprise"
  ],
  "quotaPlan": 1,
  "managerId": "u-manager123",
  "timezone": "America/New_York",
  "firstName": "John",
  "additionalProperty": "anything"
}'
{
  "lastName": "Smith",
  "displayName": "John Smith",
  "department": 1,
  "areaOfResponsibility": 1,
  "email": "john.smith@company.com",
  "role": 1,
  "jobTitle": "Account Executive",
  "userLanguage": "en",
  "avatarUrl": "https://example.com/avatars/user123.jpg",
  "groupIds": [
    "g-sales",
    "g-enterprise"
  ],
  "quotaPlan": 1,
  "managerId": "u-manager123",
  "timezone": "America/New_York",
  "firstName": "John",
  "status": 1,
  "lastLoginAt": "2024-01-15T10:30:00Z",
  "id": "u-johs-f47ac10b",
  "createdAt": "2026-11-12T20:59:20.419Z",
  "directReports": [
    "string"
  ],
  "roleName": "string",
  "departmentName": "string",
  "areaOfResponsibilityName": "string",
  "additionalProperty": "anything"
}