> ## 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 Lead To Deal

> Convert a Pipedrive lead into a deal in a chosen pipeline and stage. Includes SDK V2 guidance, input constraints, response fields, and Deepline credit cost.

Convert a Pipedrive lead into a deal in a chosen pipeline and stage.

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

## 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(
  'pipedrive_convert_lead_to_deal',
  {
    "id": "123e4567-e89b-42d3-a456-426614174000"
  },
);

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

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline tools execute pipedrive_convert_lead_to_deal --input '{
  "id": "123e4567-e89b-42d3-a456-426614174000"
}' --json
```

## 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": {
    "success": true,
    "data": {
      "conversion_id": "123e4567-e89b-42d3-a456-426614174000"
    },
    "additional_data": {}
  }
}
```

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

## Input reference

Initiates a conversion of a lead to a deal. 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. If the conversion is successful, the lead is marked as deleted. To retrieve the created entity ID and the result of the conversion, call the /api/v2/leads/\{lead\_id}/convert/status/\{conversion\_id} endpoint.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.id` | `string` | Yes | — | The ID of the lead to convert Format: `uuid`. |
| `payload.stage_id` | `integer` | No | — | The ID of a stage the created deal will be added to. Please note that a pipeline will be assigned automatically based on the `stage_id`. If omitted, the deal will be placed in the first stage of the default pipeline. |
| `payload.pipeline_id` | `integer` | No | — | The ID of a pipeline the created deal will be added to. By default, the deal will be added to the first stage of the specified pipeline. Please note that `pipeline_id` and `stage_id` should not be used together as `pipeline_id` will be ignored. |

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

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Initiates a conversion of a lead to a deal. 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. If the conversion is successful, the lead is marked as deleted. To retrieve the created entity ID and the result of the conversion, call the /api/v2/leads/{lead_id}/convert/status/{conversion_id} endpoint.",
    "properties": {
      "id": {
        "type": "string",
        "description": "The ID of the lead to convert",
        "format": "uuid"
      },
      "stage_id": {
        "type": "integer",
        "description": "The ID of a stage the created deal will be added to. Please note that a pipeline will be assigned automatically based on the `stage_id`. If omitted, the deal will be placed in the first stage of the default pipeline."
      },
      "pipeline_id": {
        "type": "integer",
        "description": "The ID of a pipeline the created deal will be added to. By default, the deal will be added to the first stage of the specified pipeline. Please note that `pipeline_id` and `stage_id` should not be used together as `pipeline_id` will be ignored."
      }
    },
    "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={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "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](https://deepline.com/docs/providers/pipedrive/guide.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.