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

# Update Lead Revenue

> Update the revenue value associated with a lead for ROI tracking

<Note>
  Track deal values and revenue per lead. Essential for calculating campaign ROI and measuring sales performance.
</Note>

## Overview

Updates the revenue value for a lead. Critical for ROI calculations, performance tracking, and determining high-value leads.

## Query Parameters

<ParamField query="api_key" type="string" required>
  Your SmartLead API key
</ParamField>

## Request Body

<ParamField body="email_lead_map_id" type="number" required>
  Lead-campaign mapping ID
</ParamField>

<ParamField body="revenue" type="number" required>
  Revenue amount (must be non-negative). Currency based on account settings.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X PATCH "https://server.smartlead.ai/api/v1/master-inbox/update-revenue?api_key=YOUR_KEY" \
    -H "Content-Type: application/json" \
    -d '{"email_lead_map_id": 2433664091, "revenue": 50000}'
  ```

  ```python Python theme={null}
  import requests

  API_KEY = "YOUR_API_KEY"

  def update_lead_revenue(lead_map_id, revenue_amount):
      """Update revenue for a lead"""
      payload = {
          "email_lead_map_id": lead_map_id,
          "revenue": revenue_amount
      }
      
      response = requests.patch(
          "https://server.smartlead.ai/api/v1/master-inbox/update-revenue",
          params={"api_key": API_KEY},
          json=payload
      )
      
      if response.status_code == 200:
          print(f"✅ Revenue updated: ${revenue_amount:,.2f}")
      
      return response.json()

  # Record $50k deal
  update_lead_revenue(2433664091, 50000)
  ```

  ```javascript JavaScript theme={null}
  const API_KEY = 'YOUR_API_KEY';

  async function updateRevenue(leadMapId, revenue) {
    const response = await fetch(
      `https://server.smartlead.ai/api/v1/master-inbox/update-revenue?api_key=${API_KEY}`,
      {
        method: 'PATCH',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({
          email_lead_map_id: leadMapId,
          revenue: revenue
        })
      }
    );
    
    return response.json();
  }

  // Update to $50k
  await updateRevenue(2433664091, 50000);
  ```
</RequestExample>

## Response Example

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "success": true,
    "message": "Revenue updated successfully",
    "data": {
      "email_lead_map_id": 2433664091,
      "revenue": 50000,
      "updated_at": "2025-01-20T15:30:00Z"
    }
  }
  ```

  ```json 422 - Validation Error theme={null}
  {
    "error": "revenue must be non-negative",
    "field": "revenue",
    "provided_value": -1000
  }
  ```
</ResponseExample>

## Related Endpoints

* [Get Inbox Messages](/api-reference/inbox/get-messages)
* [Update Category](/api-reference/inbox/update-category)
