> ## 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.

# Close CRM: Close Update Opportunity

> Update an existing Close opportunity by id: change the amount, move the sales deal to a new stage, or edit owner, confidence and notes.

Update an existing Close opportunity by id: change the amount, move the sales deal to a new stage, or edit owner, confidence and notes.

> [!NOTE]
>
> Tool ID: `close_update_opportunity`

## Run this action

Use the TypeScript SDK for one call. Use `ctx.tools.execute(...)` inside a Play for durable calls, scheduled calls, or CSV processing.

```ts theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'close_update_opportunity',
  {
    "id": "id_123"
  },
);

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

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline run close_update_opportunity --input '{
  "id": "id_123"
}'
```

## Example response

The SDK returns this shape at `result.toolResponse.raw`. The example values illustrate the response.

```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
{
  "data": {
    "annualized_expected_value": 1,
    "annualized_value": 1,
    "attachments": [
      {
        "content_type": "example",
        "filename": "example",
        "size": 1,
        "url": "https://example.com"
      }
    ]
  }
}
```

Use `deepline describe close_update_opportunity --json` for the latest machine-readable contract.

## Input reference

Change an existing Close CRM sales opportunity by id. Send only fields to change. omitted fields remain unchanged. Monetary value is in cents. Setting a won status can populate date\_won. changing away from won does not clear it automatically. This writes CRM data and may change pipeline reporting. Recover an uncertain execution before repeating it.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.id` | `string` | Yes | — | — |
| `payload.attachments` | `array` | No | — | — |
| `payload.confidence` | `integer` | No | — | — |
| `payload.contact_id` | `string` | No | — | — |
| `payload.date_won` | `string` | No | — | If not set on the resource or in the request, `date_won` will be set automatically to today's date when setting `status_id` to a status with type `won`. The `x-tz-offset` header, used to pass your timezone's UTC offset, will be taken into account. |
| `payload.note` | `string` | No | — | Plaintext/markdown version of the note. If `note_html` is also provided in the same request, this value is ignored and `note` is derived from the HTML instead. |
| `payload.note_html` | `string` | No | — | Rich-text HTML version of the note. When set, `note` is automatically populated with the plaintext version (tags become markdown), overriding any `note` value passed in the same request. Pass `null` to clear `note_html`. `note` is cleared as well. |
| `payload.status` | `string` | No | — | — |
| `payload.status_id` | `string` | No | — | Setting the `status_id` to a status with a type of `won` will automatically set the `date_won` field if it is not already set or provided in the request. Reverting it from a `won` status to an `active` or `lost` will not automatically change `date_won`. |
| `payload.user_id` | `string` | No | — | — |
| `payload.value` | `integer` | No | — | Monetary value of the opportunity in cents, e.g. `340000` for \$3,400.00. The currency is the organization's currency. |
| `payload.value_period` | `"one_time" \| "monthly" \| "annual"` | No | — | Allowed: `one_time`, `monthly`, `annual`. |
| `payload.custom_fields` | `record` | No | — | Map Close custom field ids (cf\_...) to values. null clears a value. Add .add or .remove to a field id to modify a multi-value field. |

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

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Change an existing Close CRM sales opportunity by id. Send only fields to change; omitted fields remain unchanged. Monetary value is in cents. Setting a won status can populate date_won; changing away from won does not clear it automatically. This writes CRM data and may change pipeline reporting. Recover an uncertain execution before repeating it.",
    "properties": {
      "id": {
        "type": "string"
      },
      "attachments": {
        "type": "array",
        "items": {
          "type": "object",
          "required": [
            "filename",
            "url"
          ],
          "properties": {
            "content_type": {
              "type": "string",
              "default": ""
            },
            "filename": {
              "type": "string"
            },
            "url": {
              "type": "string"
            }
          },
          "additionalProperties": false
        }
      },
      "confidence": {
        "type": "integer"
      },
      "contact_id": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "date_won": {
        "description": "If not set on the resource or in the request, `date_won` will be set automatically to today's date when setting `status_id` to a status with type `won`. The `x-tz-offset` header, used to pass your timezone's UTC offset, will be taken into account.",
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "note": {
        "type": "string",
        "description": "Plaintext/markdown version of the note. If `note_html` is also provided in the same request, this value is ignored and `note` is derived from the HTML instead."
      },
      "note_html": {
        "description": "Rich-text HTML version of the note. When set, `note` is automatically populated with the plaintext version (tags become markdown), overriding any `note` value passed in the same request. Pass `null` to clear `note_html`; `note` is cleared as well.",
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "status": {
        "type": "string"
      },
      "status_id": {
        "type": "string",
        "description": "Setting the `status_id` to a status with a type of `won` will automatically set the `date_won` field if it is not already set or provided in the request. Reverting it from a `won` status to an `active` or `lost` will not automatically change `date_won`."
      },
      "user_id": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "value": {
        "type": "integer",
        "description": "Monetary value of the opportunity in cents, e.g. `340000` for $3,400.00. The currency is the organization's currency."
      },
      "value_period": {
        "type": "string",
        "enum": [
          "one_time",
          "monthly",
          "annual"
        ]
      },
      "custom_fields": {
        "type": "object",
        "description": "Map Close custom field ids (cf_...) to values; null clears a value. Add .add or .remove to a field id to modify a multi-value field.",
        "propertyNames": {
          "pattern": "^cf_[A-Za-z0-9]+(?:\\.(?:add|remove))?$"
        },
        "additionalProperties": {
          "not": {
            "type": "object"
          }
        }
      }
    },
    "required": [
      "id"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Standard tool result payload.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `object` | Yes | — | Provider response payload. |
| `result.data.annualized_expected_value` | `integer \| null` | No | — | Annualized expected value in cents. |
| `result.data.annualized_value` | `integer \| null` | No | — | Annualized value in cents. |
| `result.data.attachments` | `array` | No | — | — |
| `result.data.attachments[].content_type` | `string \| null` | Yes | — | — |
| `result.data.attachments[].filename` | `string \| null` | Yes | — | — |
| `result.data.attachments[].size` | `integer \| null` | Yes | — | — |
| `result.data.attachments[].thumbnail_url` | `string \| null` | No | — | — |
| `result.data.attachments[].url` | `string` | Yes | — | — |
| `result.data.comment_summary` | `object \| null` | No | — | — |
| `result.data.comment_summary.comment_count` | `integer` | Yes | — | — |
| `result.data.comment_summary.thread_id` | `string` | Yes | — | — |
| `result.data.confidence` | `integer` | No | — | — |
| `result.data.contact_id` | `string \| null` | No | — | — |
| `result.data.contact_name` | `string \| null` | No | — | — |
| `result.data.created_by` | `string \| null` | No | — | — |
| `result.data.created_by_name` | `string \| null` | No | — | — |
| `result.data.date_created` | `string` | No | — | Format: `date-time`. |
| `result.data.date_lost` | `string \| null` | No | — | Format: `date-time`. |
| `result.data.date_updated` | `string` | No | — | Format: `date-time`. |
| `result.data.date_won` | `string \| null` | No | — | Format: `date`. |
| `result.data.expected_value` | `integer \| null` | No | — | Value multiplied by confidence, in cents. |
| `result.data.id` | `string` | No | — | — |
| `result.data.integration_links` | `array` | No | — | — |
| `result.data.integration_links[].name` | `string` | Yes | — | — |
| `result.data.integration_links[].url` | `string` | Yes | — | — |
| `result.data.is_stalled` | `boolean` | No | — | — |
| `result.data.lead_id` | `string` | No | — | — |
| `result.data.lead_name` | `string \| null` | No | — | — |
| `result.data.lead_primary_email` | `object \| null` | No | — | — |
| `result.data.lead_primary_email.email` | `string` | Yes | — | — |
| `result.data.lead_primary_email.is_unsubscribed` | `boolean` | Yes | — | — |
| `result.data.lead_primary_email.type` | `string` | Yes | — | — |
| `result.data.lead_primary_phone` | `array \| null` | No | — | — |
| `result.data.lead_primary_phone[].country` | `string \| null` | No | — | — |
| `result.data.lead_primary_phone[].outbound_sms_blocked` | `boolean` | No | — | — |
| `result.data.lead_primary_phone[].phone` | `string` | Yes | — | — |
| `result.data.lead_primary_phone[].phone_formatted` | `string` | No | — | — |
| `result.data.lead_primary_phone[].type` | `string` | Yes | — | — |
| `result.data.lead_primary_phone[].tz_ids` | `array` | No | — | — |
| `result.data.note` | `string \| null` | No | — | — |
| `result.data.note_html` | `string \| null` | No | — | — |
| `result.data.organization_id` | `string` | No | — | — |
| `result.data.pipeline_id` | `string \| null` | No | — | — |
| `result.data.pipeline_name` | `string \| null` | No | — | — |
| `result.data.stall_status` | `object \| null` | No | — | — |
| `result.data.stall_status.communication_issue` | `"no_issue" \| "cant_get_in_touch" \| "no_communication_attempts"` | Yes | — | Allowed: `no_issue`, `cant_get_in_touch`, `no_communication_attempts`. |
| `result.data.stall_status.next_action` | `object` | Yes | — | — |
| `result.data.stall_status.next_action.action` | `"mark_as_lost" \| "change_status" \| "follow_up" \| "adjust_close_date" \| "ask_someone_else_to_reach_out" \| "change_communication_method"` | Yes | — | Allowed: `mark_as_lost`, `change_status`, `follow_up`, `adjust_close_date`, `ask_someone_else_to_reach_out`, `change_communication_method`. |
| `result.data.stall_status.next_action.justification` | `string` | Yes | — | A short justification for the recommended action in the sales pipeline. Maximum 2 sentences. |

The table shows the first 50 fields. Expand the raw schema below for every field.

> [!NOTE]
>
> This output schema is too large for an inline display. Read the complete live contract with `deepline describe close_update_opportunity --json`.

## 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

* [Connect integrations](https://deepline.com/docs/integrations.md)
* [SDK V2 quickstart](https://deepline.com/docs/sdk-v2/quickstart.md)
* [SDK reference](https://deepline.com/docs/sdk-v2/sdk-reference.md)
* [Run tools across a CSV](https://deepline.com/docs/sdk-v2/batch-csv.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.