Update Entity

​

Update an existing entity (PUT).

The body is validated against the full input schema, so every field the schema marks as required must be present, even when its value does not change; a body missing one is rejected with 422. Optional fields that are omitted keep their stored values, and a field sent as null is cleared. To change only some fields without resending the required ones, use PATCH /{entity_id}.

Args: entity_id: Unique identifier of the entity to update entity_info: Entity data validated against the full input schema: - All required fields must be present - Omitted optional fields retain their current values - 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 including: - All entity fields with updated values - Updated timestamp information - Computed fields and relationships

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 or validation errors - 401: Authentication required - 403: Insufficient permissions to update this entity - 404: Entity not found - 409: Update conflict (entity modified by another user) - 422: Validation error in request data, including a missing required 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
  • Deal name - A descriptive name for the deal (e.g., 'Acme Corp - Enterprise License')

  • 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

Responses

  • application/json
  • application/json
Request Example for put/{entity_id}
curl 'https://crm.dreamhub.ai/api/v1/deals/{entity_id}?include_additionals=false' \
  --request PUT \
  --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.154Z",
  "lastActivity": "2026-11-12T20:58:44.154Z",
  "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"
}