Update Status

​

Update a deal's status and related information.

This endpoint updates the deal's status (active, closed_won, closed_lost) along with associated metadata such as close date, reason for loss, and final deal value.

Args: deal_id: Unique identifier of the deal to update deal_status_info: Status update information including: - status: New deal status (active, closed_won, closed_lost) - closed_at: Date when deal was closed (if applicable) - closed_lost_reason: Reason for loss (if status is closed_lost) - final_amount: Final negotiated amount user: Authenticated user information

Returns: Complete updated deal data with new status information

Status Values: - active: Deal is still in progress - closed_won: Deal was successfully closed - closed_lost: Deal was lost to competitor or cancelled

Raises: HTTPException: - 400: Invalid status or missing required fields - 401: Authentication required - 403: Insufficient permissions to update this deal - 404: Deal not found - 422: Validation error (e.g., missing close reason for lost deals) - 500: Internal server error during update

Path Parameters

Body·

required
application/json
  • The new stage to set

    values
    1245
  • AE owner user ID

  • Deal closed lost reason

  • Deal closed lost reason description

  • Company ID for the resulting contract

  • Contract name (defaults derived on the frontend)

  • Contract sign date

  • CSM owner user ID

  • Currency code (ISO 4217)

  • Product ID for the resulting contract

Responses

  • application/json
  • application/json
Request Example for put/{deal_id}/status/
curl 'https://crm.dreamhub.ai/api/v1/deals/{deal_id}/status/' \
  --request PUT \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "newStatus": 1,
  "closedLostReason": 1,
  "closedLostReasonText": "",
  "contractName": "",
  "companyId": "",
  "productId": "",
  "currency": "",
  "contractSignDate": "",
  "aeOwner": "",
  "csmOwner": "",
  "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": 75,
  "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-09-29T00:01:38.500Z",
  "lastActivity": "2026-09-29T00:01:38.500Z",
  "openForDays": 1,
  "allDealPeople": [
    "string"
  ],
  "allDealPartnerContacts": [
    "string"
  ],
  "percentageOfMappedContacts": 1,
  "percentageFromOwnerPipelineArr": 1,
  "percentageFromOwnerPipelineMrr": 1,
  "daysInStage": 1,
  "committedArr": 1,
  "committedMrr": 1,
  "keyStakeholdersMappingScore": 1,
  "keyStakeholdersMappingText": "string",
  "championsMappingScore": 1,
  "championsMappingText": "string",
  "qualificationText": "string",
  "stakeholdersApprovalText": "string",
  "closedLostReasonName": "string",
  "companyName": "string",
  "productName": "string",
  "alerts": [
    {
      "additionalProperty": "anything"
    }
  ],
  "hasNextSteps": true,
  "serviceCount": 1,
  "closingQuarter": "string",
  "additionalProperty": "anything"
}