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

# Apollo: Update Deal

> ## Endpoint essentials **API key access:** `deals/api/v1/opportunities/update` or `Master API key` **OAuth scopes:** `opportunity_update` **Credit usage:** `0.

## Endpoint essentials **API key access:** `deals/api/v1/opportunities/update` or `Master API key` **OAuth scopes:** `opportunity_update` **Credit usage:** \`0.

<Info>
  Tool ID: `apollo_update_deal`
</Info>

## Run this action

Use the TypeScript SDK for a single call. Put `ctx.tools.execute(...)` inside a Play when the call should be durable, scheduled, or run across a CSV.

```ts theme={null}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'apollo_update_deal',
  {
    "opportunity_id": "opportunity_123"
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={null}
deepline tools execute apollo_update_deal --input '{
  "opportunity_id": "opportunity_123"
}' --json
```

## Example response

The static output schema is not detailed enough to generate a reliable example. Use `deepline tools get apollo_update_deal --json` for the complete live contract.

## Input reference

Update an existing deal (opportunity) in Apollo CRM. At least one mutable field must be provided. Requires master API key.

| Name                           | Type     | Required | Default | Details                                                                    |
| ------------------------------ | -------- | -------- | ------- | -------------------------------------------------------------------------- |
| `payload.opportunity_id`       | `string` | Yes      | —       | The Apollo opportunity (deal) ID to update.                                |
| `payload.name`                 | `string` | No       | —       | Updated name of the deal.                                                  |
| `payload.amount`               | `number` | No       | —       | Updated monetary value of the deal.                                        |
| `payload.opportunity_stage_id` | `string` | No       | —       | Updated deal stage ID. Retrieve stage IDs with apollo\_list\_deal\_stages. |
| `payload.account_id`           | `string` | No       | —       | Updated Apollo account (company) ID.                                       |
| `payload.owner_id`             | `string` | No       | —       | Updated Apollo user ID who owns this deal.                                 |
| `payload.close_date`           | `string` | No       | —       | Updated close date (ISO 8601 date string).                                 |
| `payload.source`               | `string` | No       | —       | Updated source of the deal.                                                |
| `payload.status`               | `string` | No       | —       | Updated status of the deal.                                                |
| `payload.priority`             | `string` | No       | —       | Updated priority level of the deal.                                        |
| `payload.notes`                | `string` | No       | —       | Updated notes about the deal.                                              |
| `payload.custom_fields`        | `record` | No       | —       | Updated custom field key-value pairs.                                      |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Update an existing deal (opportunity) in Apollo CRM. At least one mutable field must be provided. Requires master API key.",
    "properties": {
      "opportunity_id": {
        "type": "string",
        "description": "The Apollo opportunity (deal) ID to update."
      },
      "name": {
        "type": "string",
        "description": "Updated name of the deal."
      },
      "amount": {
        "type": "number",
        "description": "Updated monetary value of the deal."
      },
      "opportunity_stage_id": {
        "type": "string",
        "description": "Updated deal stage ID. Retrieve stage IDs with apollo_list_deal_stages."
      },
      "account_id": {
        "type": "string",
        "description": "Updated Apollo account (company) ID."
      },
      "owner_id": {
        "type": "string",
        "description": "Updated Apollo user ID who owns this deal."
      },
      "close_date": {
        "type": "string",
        "description": "Updated close date (ISO 8601 date string)."
      },
      "source": {
        "type": "string",
        "description": "Updated source of the deal."
      },
      "status": {
        "type": "string",
        "description": "Updated status of the deal."
      },
      "priority": {
        "type": "string",
        "description": "Updated priority level of the deal."
      },
      "notes": {
        "type": "string",
        "description": "Updated notes about the deal."
      },
      "custom_fields": {
        "type": "object",
        "description": "Updated custom field key-value pairs.",
        "additionalProperties": {}
      }
    },
    "required": [
      "opportunity_id"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Apollo update deal result.

| Name          | Type     | Required | Default | Details                                        |
| ------------- | -------- | -------- | ------- | ---------------------------------------------- |
| `result.data` | `record` | Yes      | —       | Payload with the updated `opportunity` object. |
| `result.meta` | `record` | No       | —       | Additional response metadata (status, paging). |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Apollo update deal result.",
    "properties": {
      "data": {
        "type": [
          "object",
          "null"
        ],
        "description": "Payload with the updated `opportunity` object.",
        "additionalProperties": {}
      },
      "meta": {
        "type": "object",
        "description": "Additional response metadata (status, paging).",
        "additionalProperties": {}
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0` per pricing unit.
* Provider-native pricing may still exist outside Deepline credit billing.

## Related documentation

* [Apollo provider guide](/docs/providers/apollo/guide)
* [SDK V2 quickstart](/docs/sdk-v2/quickstart)
* [SDK reference](/docs/sdk-v2/sdk-reference)
* [Run tools across a CSV](/docs/sdk-v2/batch-csv)
