How to add a custrom Field to a Lead

Hello Pipedrive Community,

I’m integrating with the Pipedrive API to automatically create new Leads, and I’ve run into a snag with custom fields.

  1. Creating the Lead

    • The V2 API doesn’t support Lead creation, so I’m falling back to V1.
    • When I POST to /leads, I receive a UUID for the new Lead’s id in the response payload.
  2. Adding a Custom Field

    • I understand that custom fields live under the Deals API.
    • However, the Deals API endpoint for updating a deal’s custom fields only accepts a numeric ID as the resource identifier—there’s no way to pass a UUID.
  3. The Core Issue

    • How can I associate or update a custom field on a Lead (or converted Deal) when the only ID I have is a UUID, but the API insists on a numeric ID?

Has anyone successfully handled custom-field assignment for a newly created Lead via the Pipedrive API? Any guidance or examples would be greatly appreciated.

Thank you in advance!

Hey,

I think you are mixing 2 concepts here:

To add a brand new custom field to leads, you do indeed use POST /api/v1/dealFields to add it as deals and leads share their custom fields.

To add a value to a specific custom field of a lead, you can use POST /api/v1/leads or PATCH /api/v1/leads/:uuid, e.g.

{
    "8f778459bfd0552cecfbcaa894ee30a82ac001eb": "my custom field value"
}