Skip to content

UPSERT a Lead (by custom field)

PUT https://api.copper.com/developer_api/v1/leads/upsert

Note that this endpoint is eligible to return computed custom field values, click here for more information.

Request body

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
{
  "properties": {
    "name": "My Lead",
    "email": {
      "email": "mylead@gmail.test",
      "category": "work"
    }
  },
 "match": {
      "field_name": "custom",
      "field_value": {
      "custom_field_definition_id": 100764,
        "value" : "Some text"
      }
    }
}

Example Requests

UPSERT a Leads

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
curl --location --request PUT "https://api.copper.com/developer_api/v1/leads/upsert" \
  --header "X-PW-AccessToken: YOUR_TOKEN_HERE" \
  --header "X-PW-Application: developer_api" \
  --header "X-PW-UserEmail: YOUR_EMAIL_HERE" \
  --header "Content-Type: application/json" \
  --data "{
  \"properties\": {
    \"name\": \"My Lead\",
    \"email\": {
      \"email\": \"mylead@gmail.test\",
      \"category\": \"work\"
    }
  },
    \"match\": {
      \"field_name\": \"custom\",
      \"field_value\": {
      \"custom_field_definition_id\": 178384,
        \"value\" : 1
      }
    }
}"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
  "id": 8982702,
  "name": "My Lead",
  "prefix": null,
  "first_name": "My",
  "last_name": "Lead",
  "middle_name": null,
  "suffix": null,
  "address": null,
  "assignee_id": null,
  "company_name": null,
  "customer_source_id": null,
  "details": null,
  "email": {
    "email": "mylead@gmail.test",
    "category": "work"
  },
  "interaction_count": 0,
  "monetary_unit": null,
  "monetary_value": null,
  "socials": [],
  "status": "New",
  "status_id": 208231,
  "tags": [],
  "title": null,
  "websites": [],
  "phone_numbers": [],
  "custom_fields": [
    {
      "custom_field_definition_id": 100764,
      "value": null
    },
    {
      "custom_field_definition_id": 103481,
      "value": null
    },
    {
      "custom_field_definition_id": 128735,
      "value": null
    }
  ],
  "date_created": 1489531171,
  "date_modified": 1512006056,
  "date_last_contacted": null
}