> ## Documentation Index
> Fetch the complete documentation index at: https://docs.journeybee.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Deal

> Update deal information, stage, value, and custom fields with automatic commission recalculation

## Authentication

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PATCH "https://app.journeybee.io/api/v1/lead-deals/{dealId}" \
    -H "Authorization: Bearer your-api-key-uuid" \
    -H "Content-Type: application/json" \
    -d '{"deal_value": 300000, "stage_uuid": "new-stage-uuid"}'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://app.journeybee.io/api/v1/lead-deals/{dealId}', {
    method: 'PATCH',
    headers: {
      'Authorization': 'Bearer your-api-key-uuid',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      deal_value: 300000,
      stage_uuid: "new-stage-uuid"
    })
  });
  ```
</CodeGroup>

## Path Parameters

<ParamField path="dealId" type="number" required>
  The unique identifier of the deal to update
</ParamField>

## Request Body Schema

<ParamField body="label" type="string">
  Deal name/title
</ParamField>

<ParamField body="deal_value" type="number">
  Deal value (triggers commission recalculation)
</ParamField>

<ParamField body="stage_uuid" type="string">
  UUID of the stage to move this deal to
</ParamField>

<ParamField body="payment_stage_uuid" type="string">
  UUID of the payment stage for commission tracking
</ParamField>

<ParamField body="tags" type="array">
  Array of tag IDs to assign (replaces existing tags)
</ParamField>

<ParamField body="customFields" type="array">
  Array of custom field values to update
</ParamField>

## Response Schema

<ResponseField name="id" type="number">
  The updated deal ID
</ResponseField>

<ResponseField name="uuid" type="string">
  The deal UUID
</ResponseField>

<ResponseField name="updated_at" type="string">
  Timestamp of when the deal was last updated
</ResponseField>

## Example Response

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "id": 456,
    "uuid": "deal-uuid-456",
    "updated_at": "2024-01-15T16:30:00Z"
  }
  ```
</ResponseExample>

## Notes

* Requires API key with `write_access` permission
* Deal value changes trigger automatic commission recalculation
* Stage changes may trigger business rule validations and notifications
* Partnership deals sync changes to partner companies
