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

# Update a Call activity

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

Most commonly used to update `note_html` or `outcome_id`. Some fields (`status`, `duration`, `direction`) cannot be updated for internal calls made through Close's VoIP system.

**`note_html` and `note`**: setting one overwrites the other. If both are provided, `note_html` takes precedence. `note_html` supports rich-text HTML; `note` is plaintext only.

**Deleting recordings**: for internal calls, changing or clearing `recording_url` or `voicemail_url`, or setting `recording_transcript` to `null`, permanently deletes the corresponding recording, voicemail, or transcript. This requires the `delete_own_activities` permission for your own calls, or `manage_others_activities` for other users' calls and calls not assigned to a user. Without the required permission the request fails with a `400` error.

Reference: https://developer.close.com/api/resources/activities/calls/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)

- `activity_at` (datetime, optional, nullable)
- `contact_id` (string, optional, nullable)
- `conversation_type_id` (string, optional, nullable)
- `duration` (integer, optional, nullable)
- `lead_id` (string, optional, nullable)
- `note` (string, optional, nullable)
- `note_html` (string, optional, nullable)
- `outcome_id` (string, optional, nullable)
- `phone` (string, optional, nullable) — Phone number in E.164 format
- `playbook_id` (string, optional, nullable)
- `quality_info` (string, optional, nullable)
- `recording_url` (string, optional, nullable)
- `status` (enum, optional)
  - Allowed values: `created`, `in-progress`, `completed`, `cancel`, `no-answer`, `busy`, `failed`, `timeout`
- `user_id` (string, optional, nullable)
- `voicemail_url` (string, optional, nullable)

## Response

### 200

Successful response

- `_type` (string, required)
- `activity_at` (datetime, required, nullable)
- `contact_id` (string, required, nullable)
- `created_by` (string, required, nullable)
- `date_created` (datetime, required)
- `date_updated` (datetime, required)
- `id` (string, required)
- `lead_id` (string, required, nullable)
- `organization_id` (string, required)
- `outcome_id` (string, required, nullable)
- `source` (enum, required) — Source of a phone activity. Describes whether the phone activity (such as a call or an SMS) was handled by Close's telephony provider or handled externally by a 3rd party and is merely logged in Close.
  - Allowed values: `Close.io`, `External`
- `status` (enum, required) — Current status of the call.
  - Allowed values: `created`, `in-progress`, `completed`, `cancel`, `no-answer`, `busy`, `failed`, `timeout`
- `updated_by` (string, required, nullable)
- `user_id` (string, required, nullable)
- `users` (list of string, required)
- `created_by_name` (string, optional, nullable)
- `sequence_id` (string, optional, nullable)
- `sequence_name` (string, optional, nullable)
- `sequence_subscription_id` (string, optional, nullable)
- `updated_by_name` (string, optional, nullable)
- `user_name` (string, optional, nullable)

## Examples

**Request**

```json
{
  "note_html": "<body><p>This is some new call note.</p></body>",
  "outcome_id": "outcome_031uY9IKV1JxfNKM9n2qCw"
}
```

**Response**

```json
{
  "_type": "Call",
  "activity_at": "2013-02-01T00:51:33+00:00",
  "contact_id": "cont_q4xYmlGhA3060dEl0NDJuHRxPMuVjqLn30AFSzh1fRk",
  "created_by": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA",
  "date_created": "2013-02-20T06:34:33.637000+00:00",
  "date_updated": "2013-02-20T06:34:35.656000+00:00",
  "id": "acti_Ay0QqN91HKAHVQUesISYV8QlhDobGfWb1Ui3TE75pJR",
  "lead_id": "lead_s6vHFTK1TSRoH6otXOexWDO9jM4xyb1kELHDoU7Fdsp",
  "organization_id": "orga_RbREgmiiwcr1w2b4cOnCMQaQPSIFxMqAD2Dh243uxcH",
  "outcome_id": "outcome_031uY9IKV1JxfNKM9n2qCw",
  "source": "Close.io",
  "status": "completed",
  "updated_by": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA",
  "user_id": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA",
  "users": [],
  "call_method": "regular",
  "cost": "2",
  "dialer_id": null,
  "dialer_saved_search_id": null,
  "direction": "outbound",
  "disposition": "answered",
  "duration": 10,
  "local_country_iso": "US",
  "local_phone": "+16505556666",
  "local_phone_formatted": "+1 650-555-6666",
  "note": "This is some new call note.",
  "note_html": "<body><p>This is some new call note.</p></body>",
  "phone": "+16503334444",
  "recording_url": null,
  "remote_country_iso": "US",
  "remote_phone": "+16503334444",
  "remote_phone_formatted": "+1 650-333-4444",
  "voicemail_duration": null,
  "voicemail_url": null
}
```

**SDK Code**

```python activities.calls_update_example
import requests

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

payload = {
    "note_html": "<body><p>This is some new call note.</p></body>",
    "outcome_id": "outcome_031uY9IKV1JxfNKM9n2qCw"
}
headers = {
    "Content-Type": "application/json"
}

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

print(response.json())
```

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

const options = {
  method: 'PUT',
  headers: {Authorization: `Basic ${credentials}`, 'Content-Type': 'application/json'},
  body: '{"note_html":"<body><p>This is some new call note.</p></body>","outcome_id":"outcome_031uY9IKV1JxfNKM9n2qCw"}'
};

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

```go activities.calls_update_example
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"note_html\": \"<body><p>This is some new call note.</p></body>\",\n  \"outcome_id\": \"outcome_031uY9IKV1JxfNKM9n2qCw\"\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 activities.calls_update_example
require 'uri'
require 'net/http'

url = URI("https://api.close.com/api/v1/activity/call/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  \"note_html\": \"<body><p>This is some new call note.</p></body>\",\n  \"outcome_id\": \"outcome_031uY9IKV1JxfNKM9n2qCw\"\n}"

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

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

HttpResponse<String> response = Unirest.put("https://api.close.com/api/v1/activity/call/id/")
  .basicAuth("<CLOSE_API_KEY>", "")
  .header("Content-Type", "application/json")
  .body("{\n  \"note_html\": \"<body><p>This is some new call note.</p></body>\",\n  \"outcome_id\": \"outcome_031uY9IKV1JxfNKM9n2qCw\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.close.com/api/v1/activity/call/id/', [
  'body' => '{
  "note_html": "<body><p>This is some new call note.</p></body>",
  "outcome_id": "outcome_031uY9IKV1JxfNKM9n2qCw"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
    'auth' => ['<CLOSE_API_KEY>', ''],
]);

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

```csharp activities.calls_update_example
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://api.close.com/api/v1/activity/call/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  \"note_html\": \"<body><p>This is some new call note.</p></body>\",\n  \"outcome_id\": \"outcome_031uY9IKV1JxfNKM9n2qCw\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```