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
  • AE Confidence - Account Executive's confidence level in closing this deal

    values
    1234
  • AI Probability - Machine learning calculated probability of deal success (0-100%)

  • Payment Schedule - Breakdown of payments by time period (monthly, quarterly, annually)

    Payment Schedule - Breakdown of payments by time period (monthly, quarterly, annually)

  • Annual Contract Value (ACV) - Normalized annual value of the contract

  • Annual Recurring Revenue - Expected annual recurring revenue from this deal

  • Annual Recurring Revenue (Local) - ARR in account's system currency

  • Auto-renewal - Whether the contract automatically renews

  • Actual Close Date - Date when the deal was actually closed (for closed deals only)

  • Loss Reason ID - Identifier for the reason why the deal was lost (required if status is closed_lost)

  • Loss Reason Details - Additional details about why the deal was lost

  • Company - Unique identifier of the company this deal is associated with

  • Primary Contact - Main point of contact person for this deal

Responses

  • application/json
  • application/json
  • application/json
Request Example for patch/{entity_id}
curl 'https://crm.dreamhub.ai/api/v1/deals/{entity_id}?include_additionals=false' \
  --request PATCH \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "name": "Acme Corp - Enterprise License Q1 2024",
  "managedBy": "550e8400-e29b-41d4-a716-446655440000",
  "companyId": "550e8400-e29b-41d4-a716-446655440001",
  "contactId": "550e8400-e29b-41d4-a716-446655440002",
  "leadId": "550e8400-e29b-41d4-a716-446655440003",
  "status": "active",
  "stage": 3,
  "movedToStageAt": "2024-01-15T10:30:00Z",
  "expectedCloseAt": "2024-03-31T23:59:59Z",
  "closedAt": "2024-03-28T14:30:00Z",
  "dealValueAmount": 125000,
  "arr": 50000,
  "mrr": 4166.67,
  "arrLocal": 50000,
  "mrrLocal": 4166.67,
  "probability": 0.4,
  "techEvaluationStatus": 1,
  "qualificationScore": 85.5,
  "aeConfidenceLevel": 1,
  "aiAssignedProbability": 78.3,
  "closedLostReason": 3,
  "closedLostReasonText": "Customer chose competitor due to lower pricing",
  "manuallyAddedPeople": [
    "550e8400-e29b-41d4-a716-446655440004",
    "550e8400-e29b-41d4-a716-446655440005"
  ],
  "manuallyAddedPartnerContacts": [
    "ptc-abc123",
    "ptc-def456"
  ],
  "contractStartDate": "2024-04-01T00:00:00Z",
  "contractEndDate": "2025-03-31T23:59:59Z",
  "optOutDate": "2024-06-30T23:59:59Z",
  "contractTotalAmount": 150000,
  "amountBreakdownByPeriod": [
    {
      "amount": 37500,
      "period": "2024-Q1"
    },
    {
      "amount": 37500,
      "period": "2024-Q2"
    }
  ],
  "autoRenewal": true,
  "licenseId": "ENT-2024-001",
  "productId": "PROD-ENTERPRISE",
  "licensesInDeal": 50,
  "potentialLicensesInCompany": 200,
  "implementationCost": 15000,
  "trainingCost": 5000,
  "uploadContracts": {
    "contract_v1.pdf": {
      "size": 1024000,
      "uploaded_at": "2024-01-15T10:00:00Z"
    }
  },
  "annualContractValue": 125000,
  "totalContractValue": 375000,
  "currency": "USD",
  "contractId": "CONTRACT-2024-001",
  "partnerId": "ptn-acme-550e8400",
  "partnerContactId": "ptc-jane-550e8400",
  "additionalProperty": "anything"
}'
{
  "name": "Acme Corp - Enterprise License Q1 2024",
  "managedBy": "550e8400-e29b-41d4-a716-446655440000",
  "companyId": "550e8400-e29b-41d4-a716-446655440001",
  "contactId": "550e8400-e29b-41d4-a716-446655440002",
  "leadId": "550e8400-e29b-41d4-a716-446655440003",
  "status": "active",
  "stage": 3,
  "movedToStageAt": "2024-01-15T10:30:00Z",
  "expectedCloseAt": "2024-03-31T23:59:59Z",
  "closedAt": "2024-03-28T14:30:00Z",
  "dealValueAmount": 125000,
  "arr": 50000,
  "mrr": 4166.67,
  "arrLocal": 50000,
  "mrrLocal": 4166.67,
  "probability": 0.4,
  "techEvaluationStatus": 1,
  "qualificationScore": 85.5,
  "aeConfidenceLevel": 1,
  "aiAssignedProbability": 78.3,
  "closedLostReason": 3,
  "closedLostReasonText": "Customer chose competitor due to lower pricing",
  "manuallyAddedPeople": [
    "550e8400-e29b-41d4-a716-446655440004",
    "550e8400-e29b-41d4-a716-446655440005"
  ],
  "manuallyAddedPartnerContacts": [
    "ptc-abc123",
    "ptc-def456"
  ],
  "contractStartDate": "2024-04-01T00:00:00Z",
  "contractEndDate": "2025-03-31T23:59:59Z",
  "optOutDate": "2024-06-30T23:59:59Z",
  "contractTotalAmount": 150000,
  "amountBreakdownByPeriod": [
    {
      "amount": 37500,
      "period": "2024-Q1"
    },
    {
      "amount": 37500,
      "period": "2024-Q2"
    }
  ],
  "autoRenewal": true,
  "licenseId": "ENT-2024-001",
  "productId": "PROD-ENTERPRISE",
  "licensesInDeal": 50,
  "potentialLicensesInCompany": 200,
  "implementationCost": 15000,
  "trainingCost": 5000,
  "uploadContracts": {
    "contract_v1.pdf": {
      "size": 1024000,
      "uploaded_at": "2024-01-15T10:00:00Z"
    }
  },
  "annualContractValue": 125000,
  "totalContractValue": 375000,
  "currency": "USD",
  "contractId": "CONTRACT-2024-001",
  "partnerId": "ptn-acme-550e8400",
  "partnerContactId": "ptc-jane-550e8400",
  "automaticallyAddedPeople": [
    "string"
  ],
  "automaticallyAddedPartnerContacts": [
    "string"
  ],
  "lastModifiedBy": "string",
  "id": "d-log-f47ac10b",
  "createdAt": "2026-11-12T20:58:44.209Z",
  "lastActivity": "2026-11-12T20:58:44.209Z",
  "openForDays": 1,
  "allDealPeople": [
    "string"
  ],
  "allDealPartnerContacts": [
    "string"
  ],
  "percentageOfMappedContacts": 1,
  "percentageFromOwnerPipelineArr": 1,
  "percentageFromOwnerPipelineMrr": 1,
  "daysInStage": 1,
  "committedArr": 1,
  "committedMrr": 1,
  "weightedArr": 1,
  "weightedMrr": 1,
  "weightedAcv": 1,
  "weightedTcv": 1,
  "keyStakeholdersMappingScore": 1,
  "keyStakeholdersMappingText": "string",
  "championsMappingScore": 1,
  "championsMappingText": "string",
  "qualificationText": "string",
  "stakeholdersApprovalText": "string",
  "pocText": "string",
  "closedLostReasonName": "string",
  "companyName": "string",
  "productName": "string",
  "alerts": [
    {
      "additionalProperty": "anything"
    }
  ],
  "hasNextSteps": true,
  "nextStepText": "string",
  "serviceCount": 1,
  "closingQuarter": "string",
  "additionalProperty": "anything"
}