# Create leads in Pipedrive

> Formspree Docs · Using the CLI · Updated July 14, 2023

The **create lead** action creates leads and contacts to Pipedrive. Under the hood, this action calls the [add a lead](https://developers.pipedrive.com/docs/api/v1/Leads#addLead) API endpoint.

Adding the **create lead** action in the `formspree.json` file has the same effect as adding the Pipedrive plugin in the Formspree dashboard. See the [Pipedrive plugin help article](/articles/plugins/use-pipedrive-to-create-leads-and-contacts/) for more information. 

## Formspree.json configuration

| Key | Type | Description |
| --- | --- | --- |
| `app` |  String | Must be `pipedrive`  |
| `apiKey` |  String | Your Pipedrive API key found [here](https://app.pipedrive.com/settings/personal/api) (must be an $ env variable reference, required) |
| `type` |  String | Must be `createLead` |
| `overwriteContact` |  Boolean | Optional field. If true, overwrite contact information if the contact email or name already exists in Pipedrive. Default is false |
| `variableLeadValue` |  Boolean | Optional field. If true, the lead value is set by the field **value** sent by your form. Default is false |
| `value` |  Numeric | Optional field. The lead value. This only affects your leads if the `variableLeadValue` is false. |
| `currency` |  String | Options field. The currency code used to create leads. Must be one of your [available currencies code](https://support.pipedrive.com/en/article/how-can-i-create-a-custom-currency). Default is your Pipedrive account default currency. |

**Example**

```javascript
{
  "forms": {
    "salesForm": {
      "name": "Sales Form",
      "actions": [
        {
          "app": "pipedrive",
          "type": "createLead",
          "apiKey": "$apiKey",
          "overwriteContact": true
          "variableLeadValue": false,
          "value": 100,
          "currency": "EUR"
        }
      ]
    }
  }
}
```

## Validation rules

The **create support ticket** action adds the following validation rules implicitly:

| Field | Validation Rule |
| --- | --- |
| `email` | Required |
| `email` | Type is `email` |
| `name` or `fname` or `lname` | Required |
