> For a complete page index, fetch https://developer.close.com/llms.txt

# Update an existing lead

PUT https://api.close.com/api/v1/lead/{id}/
Content-Type: application/json

Supports non-destructive patches. Nested `contacts` cannot be updated through this endpoint -- use the Contacts API instead.

**status**: See `status` and `status_id` guidance on the create endpoint.

**custom.FIELD\_ID** (optional): See `custom.FIELD_ID` guidance on the create endpoint. You can also unset a single field, e.g.:

```json
{ "custom.cf_v6S011I6MqcbVvB2FA5Nk8dr5MkL8sWuCiG8cUleO9c": null }
```

If the custom field accepts multiple values, you can specify `.add` or `.remove` as part of the field key to add/remove a single value to/from a list of values, e.g.:

```json
{ "custom.cf_v6S011I6MqcbVvB2FA5Nk8dr5MkL8sWuCiG8cUleO9c.add": "Wednesday" }
```

adds "Wednesday" to the list of values which already exist on the given lead.

Reference: https://developer.close.com/api/resources/leads/update

## Authentication

- `Authorization` header (basic auth, required) — Use your API key as the username and leave the password empty.
- `Authorization` header (bearer token, required)

## Request

### Path parameters

- `id` (string, required)

### Body (application/json)

- `any`

## Response

### 200

Successful response

- `contact_ids` (list of string, required)
- `created_by` (string, required, nullable)
- `date_created` (datetime, required)
- `date_updated` (datetime, required)
- `description` (string, required, nullable)
- `html_url` (string, required)
- `id` (string, required)
- `name` (string, required, nullable)
- `organization_id` (string, required)
- `status_id` (string, required)
- `updated_by` (string, required, nullable)
- `url` (string, required, nullable)
- `addresses` (list of object, optional)
  - `address_1` (string, required, nullable)
  - `address_2` (string, required, nullable)
  - `city` (string, required, nullable)
  - `country` (string, required, nullable)
  - `label` (string, required, nullable)
  - `state` (string, required, nullable)
  - `zipcode` (string, required, nullable)
  - `tz_ids` (list of string, optional)
- `contacts_summary` (string, optional)
- `created_by_name` (string, optional, nullable)
- `display_name` (string, optional)
- `integration_links` (list of object, optional)
  - `name` (string, required)
  - `url` (string, required)
- `localtime` (datetime, optional, nullable)
- `primary_address_full` (string, optional, nullable)
- `primary_address_summary` (string, optional, nullable)
- `primary_email` (object, optional, nullable)
  - `email` (string, required)
  - `is_unsubscribed` (boolean, required)
  - `type` (string, required)
- `primary_phone` (object, optional, nullable)
  - `phone` (string, required)
  - `type` (string, required)
  - `country` (string, optional, nullable)
  - `outbound_sms_blocked` (boolean, optional)
  - `phone_formatted` (string, optional)
  - `tz_ids` (list of string, optional)
- `recent_calls` (list of map from string to any, optional)
- `source` (string, optional, nullable)
- `status_label` (string, optional)
- `summaries` (list of map from string to any, optional)
- `tasks` (list of map from string to any, optional)
- `updated_by_name` (string, optional, nullable)
- `contacts` (list of object, optional, deprecated)
  - `created_by` (string, required, nullable)
  - `date_created` (datetime, required)
  - `date_updated` (datetime, required)
  - `display_name` (string, required)
  - `id` (string, required)
  - `name` (string, required, nullable)
  - `organization_id` (string, required)
  - `title` (string, required, nullable)
  - `updated_by` (string, required, nullable)
  - `emails` (list of object, optional)
    - `email` (string, required)
    - `is_unsubscribed` (boolean, required)
    - `type` (string, required)
  - `integration_links` (list of object, optional)
    - `name` (string, required)
    - `url` (string, required)
  - `lead_id` (string, optional, nullable)
  - `lead_suggestions_operation_id` (string, optional, nullable)
  - `phones` (list of object, optional)
    - `phone` (string, required)
    - `type` (string, required)
    - `country` (string, optional, nullable)
    - `outbound_sms_blocked` (boolean, optional)
    - `phone_formatted` (string, optional)
    - `tz_ids` (list of string, optional)
  - `recent_calls` (list of object, optional)
    - `dialer_id` (string, required, nullable)
    - `duration` (integer, required)
    - `finish_timestamp` (datetime, required)
    - `id` (string, required)
    - `status` (enum, required) — Current status of the call.
      - Allowed values: `created`, `in-progress`, `completed`, `cancel`, `no-answer`, `busy`, `failed`, `timeout`
  - `subscriptions` (list of object, optional)
    - `contact_email` (string, required, nullable)
    - `date_created` (datetime, required)
    - `initial_email_id` (string, required, nullable)
    - `sequence_id` (string, required)
    - `sequence_name` (string, required)
    - `sequence_status` (enum, required)
      - Allowed values: `active`, `paused`, `draft`
    - `start_date` (datetime, required, nullable)
    - `subscription_id` (string, required)
    - `subscription_status` (enum, required)
      - Allowed values: `active`, `paused`, `finished`, `goal`, `error`
    - `subscription_status_reason` (enum, required, nullable) — Reason for each higher level status on a Workflow run.
      - Allowed values: `manual`, `pending-call-timed-out`, `bulk-action`, `rate-limited`, `sequence-deleted`, `workflow-paused`, `filter-not-matched`, `insufficient-ai-credit-balance`, `reply-received`, `call-answered`, `meeting-booked`, `lead-status-changed`, `outcome-met`, `account-invalid`, `account-failures`, `sending-throttled-too-long`, `membership-inactive`, `send-as-error`, `email-bounced`, `call-failed`, `sms-failed`, `no-user-phone`, `billing-error`, `assignment-field-invalid`, `lead-status-field-invalid`, `assignees-missing`, `run-as-disabled`, `lead-not-visible`, `internal-error`, `field-mapping-error`, `filter-config-invalid`, `email-ai-generation-failed`
  - `timezone` (string, optional, nullable)
  - `timezone_source` (string, optional, nullable)
  - `urls` (list of object, optional)
    - `type` (string, required)
    - `url` (string, required)
- `opportunities` (list of object, optional, deprecated)
  - `annualized_expected_value` (integer, required, nullable)
  - `annualized_value` (integer, required, nullable)
  - `confidence` (integer, required)
  - `contact_id` (string, required, nullable)
  - `created_by` (string, required, nullable)
  - `date_created` (datetime, required)
  - `date_lost` (datetime, required, nullable)
  - `date_updated` (datetime, required)
  - `date_won` (date, required, nullable)
  - `expected_value` (integer, required, nullable)
  - `id` (string, required)
  - `lead_id` (string, required)
  - `note` (string, required, nullable)
  - `note_html` (string, required, nullable)
  - `organization_id` (string, required)
  - `status_id` (string, required)
  - `updated_by` (string, required, nullable)
  - `user_id` (string, required)
  - `value` (integer, required, nullable)
  - `value_period` (enum, required)
    - Allowed values: `one_time`, `monthly`, `annual`
  - `attachments` (list of object, optional)
    - `content_type` (string, required, nullable)
    - `filename` (string, required, nullable)
    - `size` (integer, required, nullable)
    - `url` (string, required)
    - `thumbnail_url` (string, optional, nullable)
  - `comment_summary` (object, optional, nullable)
    - `comment_count` (integer, required)
    - `thread_id` (string, required)
  - `contact_name` (string, optional, nullable)
  - `created_by_name` (string, optional, nullable)
  - `integration_links` (list of object, optional)
    - `name` (string, required)
    - `url` (string, required)
  - `is_stalled` (boolean, optional)
  - `lead_name` (string, optional, nullable)
  - `lead_primary_email` (object, optional, nullable)
    - `email` (string, required)
    - `is_unsubscribed` (boolean, required)
    - `type` (string, required)
  - `lead_primary_phone` (list of object, optional, nullable)
    - `phone` (string, required)
    - `type` (string, required)
    - `country` (string, optional, nullable)
    - `outbound_sms_blocked` (boolean, optional)
    - `phone_formatted` (string, optional)
    - `tz_ids` (list of string, optional)
  - `pipeline_id` (string, optional, nullable)
  - `pipeline_name` (string, optional, nullable)
  - `stall_status` (object, optional, nullable)
    - `communication_issue` (enum, required) — The communication issue that is causing the stalled opportunity. If there is no issue, set to NoIssue.
      - Allowed values: `no_issue`, `cant_get_in_touch`, `no_communication_attempts`
    - `next_action` (object, required) — An action item recommended to progress or resolve the stalled opportunity.
      - `action` (enum, required) — The recommended next step to progress or resolve the stalled opportunity
        - Allowed values: `mark_as_lost`, `change_status`, `follow_up`, `adjust_close_date`, `ask_someone_else_to_reach_out`, `change_communication_method`
      - `justification` (string, required) — A short justification for the recommended action in the sales pipeline. Maximum 2 sentences.
  - `status_display_name` (string, optional)
  - `status_label` (string, optional)
  - `status_type` (enum, optional)
    - Allowed values: `won`, `lost`, `active`
  - `suggested_action` (object, optional, nullable)
    - `action` (enum, required)
      - Allowed values: `change_status`, `adjust_close_date`, `follow_up_email`, `follow_up_call`, `follow_up_sms`
    - `details` (object or object or object or object or object, required, nullable)
      - OpportunityChangeStatusActionDetails
        - `status_id` (string, required)
      - OpportunityFollowUpEmailActionDetails
        - `contact_id` (string, required)
        - `message_draft` (string, required)
        - `subject_draft` (string, required)
      - OpportunityFollowUpSMSActionDetails
        - `contact_id` (string, required)
        - `message_draft` (string, required)
      - OpportunityFollowUpCallActionDetails
        - `call_plan` (string, required)
        - `contact_id` (string, required)
      - OpportunityAdjustCloseDateActionDetails
        - `close_date` (date, required)
    - `justification` (string, required)
  - `updated_by_name` (string, optional, nullable)
  - `user_name` (string, optional, nullable)
  - `value_currency` (string, optional, nullable)
  - `value_formatted` (string, optional, nullable)

## Examples

**Request**

```json
{
  "description": "Best show ever canceled.  Sad."
}
```

**Response**

```json
{
  "contact_ids": [
    "cont_qpjDKxbN3WWsuhaJjg2Qr9pkqHqe1yviZ5BS0dEyz05"
  ],
  "created_by": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA",
  "date_created": "2013-02-20T05:30:24.854000+00:00",
  "date_updated": "2013-02-20T05:43:41.622000+00:00",
  "description": "Best show ever canceled.  Sad.",
  "html_url": "https://app.close.com/lead/lead_70jZ5hiVt5X31MZ3vJ0R0GJMqJEihkoF7TtSVFbN2ty/",
  "id": "lead_70jZ5hiVt5X31MZ3vJ0R0GJMqJEihkoF7TtSVFbN2ty",
  "name": "Bluth Company",
  "organization_id": "orga_RbREgmiiwcr1w2b4cOnCMQaQPSIFxMqAD2Dh243uxcH",
  "status_id": "stat_1ZdiZqcSIkoGVnNOyxiEY58eTGQmFNG3LPlEVQ4V7Nk",
  "updated_by": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA",
  "url": "http://thebluthcompany.tumblr.com/",
  "addresses": [],
  "display_name": "Bluth Company",
  "status_label": "Potential",
  "tasks": [],
  "contacts": [
    {
      "created_by": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA",
      "date_created": "2013-02-20T05:30:24.844000+00:00",
      "date_updated": "2013-02-20T05:43:41.611000+00:00",
      "display_name": "Gob",
      "id": "cont_qpjDKxbN3WWsuhaJjg2Qr9pkqHqe1yviZ5BS0dEyz05",
      "name": "Gob",
      "organization_id": "orga_RbREgmiiwcr1w2b4cOnCMQaQPSIFxMqAD2Dh243uxcH",
      "title": "sr. vice president",
      "updated_by": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA",
      "emails": [
        {
          "email": "gob@example.com",
          "is_unsubscribed": false,
          "type": "office"
        }
      ],
      "phones": [
        {
          "phone": "+18004445555",
          "type": "office",
          "phone_formatted": "+1 800-444-5555"
        }
      ]
    }
  ],
  "opportunities": []
}
```

**SDK Code**

```python
import requests

url = "https://api.close.com/api/v1/lead/:id/"

payload = { "description": "Best show ever canceled.  Sad." }
headers = {
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers, auth=("<CLOSE_API_KEY>", ""))

print(response.json())
```

```javascript
const url = 'https://api.close.com/api/v1/lead/:id/';
const credentials = btoa("<CLOSE_API_KEY>:");

const options = {
  method: 'PUT',
  headers: {Authorization: `Basic ${credentials}`, 'Content-Type': 'application/json'},
  body: '{"description":"Best show ever canceled.  Sad."}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.close.com/api/v1/lead/:id/"

	payload := strings.NewReader("{\n  \"description\": \"Best show ever canceled.  Sad.\"\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.SetBasicAuth("<CLOSE_API_KEY>", "")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.close.com/api/v1/lead/:id/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request.basic_auth("<CLOSE_API_KEY>", "")
request["Content-Type"] = 'application/json'
request.body = "{\n  \"description\": \"Best show ever canceled.  Sad.\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.close.com/api/v1/lead/:id/")
  .basicAuth("<CLOSE_API_KEY>", "")
  .header("Content-Type", "application/json")
  .body("{\n  \"description\": \"Best show ever canceled.  Sad.\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.close.com/api/v1/lead/:id/', [
  'body' => '{
  "description": "Best show ever canceled.  Sad."
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
    'auth' => ['<CLOSE_API_KEY>', ''],
]);

echo $response->getBody();
```

```csharp
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://api.close.com/api/v1/lead/:id/");
client.Authenticator = new HttpBasicAuthenticator("<CLOSE_API_KEY>", "");
var request = new RestRequest(Method.PUT);

request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"description\": \"Best show ever canceled.  Sad.\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```