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

# Pipedrive: Convert Deal To Lead

> Convert a deal to a lead. Includes SDK V2 and CLI requests, input constraints, response fields, and Deepline credit cost.

Convert a deal to a lead.

<Info>
  Tool ID: `pipedrive_convert_deal_to_lead`
</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(
  'pipedrive_convert_deal_to_lead',
  {
    "id": 123
  },
);

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

### CLI

```bash theme={null}
deepline tools execute pipedrive_convert_deal_to_lead --input '{
  "id": 123
}' --json
```

## Example response

The SDK exposes this shape at `result.toolResponse.raw`. Values below are representative.

```json theme={null}
{
  "data": {
    "success": true,
    "data": {
      "conversion_id": "123e4567-e89b-42d3-a456-426614174000"
    },
    "additional_data": {}
  }
}
```

Use `deepline tools get pipedrive_convert_deal_to_lead --json` for the latest machine-readable contract.

## Input reference

Initiates a conversion of a deal to a lead. The return value is an ID of a job that was assigned to perform the conversion. Related entities (notes, files, emails, activities, ...) are transferred during the process to the target entity. There are exceptions for entities like invoices or history that are not transferred and remain linked to the original deal. If the conversion is successful, the deal is marked as deleted. To retrieve the created entity ID and the result of the conversion, call the /api/v2/deals/\{deal\_id}/convert/status/\{conversion\_id} endpoint.

| Name         | Type      | Required | Default | Details                       |
| ------------ | --------- | -------- | ------- | ----------------------------- |
| `payload.id` | `integer` | Yes      | —       | The ID of the deal to convert |

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

  ### Input JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Initiates a conversion of a deal to a lead. The return value is an ID of a job that was assigned to perform the conversion. Related entities (notes, files, emails, activities, ...) are transferred during the process to the target entity. There are exceptions for entities like invoices or history that are not transferred and remain linked to the original deal. If the conversion is successful, the deal is marked as deleted. To retrieve the created entity ID and the result of the conversion, call the /api/v2/deals/{deal_id}/convert/status/{conversion_id} endpoint.",
    "properties": {
      "id": {
        "type": "integer",
        "description": "The ID of the deal to convert"
      }
    },
    "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.success`            | `boolean`        | No       | —       | —                                                                                                                                |
| `result.data.data`               | `object`         | No       | —       | An object containing conversion job id that performs the conversion                                                              |
| `result.data.data.conversion_id` | `string`         | Yes      | —       | The ID of the conversion job that can be used to retrieve conversion status and details. The ID has UUID format. Format: `uuid`. |
| `result.data.additional_data`    | `object \| null` | No       | —       | —                                                                                                                                |
| `result.meta`                    | `object`         | No       | —       | Additional response metadata (status, paging).                                                                                   |

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

  ### Output JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Standard tool result payload.",
    "properties": {
      "data": {
        "type": "object",
        "description": "Provider response payload.",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": "object",
            "description": "An object containing conversion job id that performs the conversion",
            "properties": {
              "conversion_id": {
                "type": "string",
                "description": "The ID of the conversion job that can be used to retrieve conversion status and details. The ID has UUID format.",
                "format": "uuid"
              }
            },
            "required": [
              "conversion_id"
            ],
            "additionalProperties": false
          },
          "additional_data": {
            "type": [
              "object",
              "null"
            ]
          }
        },
        "additionalProperties": false
      },
      "meta": {
        "type": "object",
        "description": "Additional response metadata (status, paging).",
        "additionalProperties": true
      }
    },
    "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

* [Pipedrive provider guide](/docs/providers/pipedrive/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)
