> This page is for version v2 (default).
> For other versions, use one of these documentation indexes:
> - v2 (default): https://docs.pinnacle.sh/v-2/llms.txt
> - v1: https://docs.pinnacle.sh/v1/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.pinnacle.sh/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.pinnacle.sh/_mcp/server.

# Update Call Metadata

PATCH https://api.pinnacle.sh/calls/{id}
Content-Type: application/json

Replace a call's metadata. For live calls, future call events carry the updated metadata.

Reference: https://docs.pinnacle.sh/api-reference/calls/lifecycle/update-call

## Authentication

- `PINNACLE-API-KEY` header (required) — API Key authentication via header

## Request

### Path parameters

- `id` (string, required) — Pinnacle call ID.

### Body (application/json)

This endpoint expects an UpdateCallParams.

- `metadata` (map from string to string, required) — String metadata carried on future call events. Maximum serialized size is 2 KB.

## Response

### 200

Updated call.

- `id` (string, required)
- `state` (enum, required) — Current voice call lifecycle state. This field is named `state` on Call objects and `status` on `CALL.STATUS` webhook payloads. - `INITIATED`: Pinnacle accepted the call request and is setting up the call with the voice provider. - `RINGING`: The call is ringing and has not been answered yet. - `ANSWERED`: The call has been answered and is active. - `BRIDGED`: The call is connected to another call leg, such as after a transfer or bridge command. - `ENDED`: The call ended normally. - `FAILED`: The call could not be established or could not continue because of a provider or system failure. - `NO_ANSWER`: The call rang until timeout without being answered. - `BUSY`: The destination was busy. - `CANCELED`: The call was canceled before normal completion.
  - Allowed values: `INITIATED`, `RINGING`, `ANSWERED`, `BRIDGED`, `ENDED`, `FAILED`, `NO_ANSWER`, `BUSY`, `CANCELED`
- `direction` (enum, required) — Direction of the call relative to your Pinnacle team. - `INBOUND`: The call originated from an external caller and was received by one of your Pinnacle voice-enabled phone numbers. - `OUTBOUND`: The call was created from Pinnacle and dialed out from one of your voice-enabled phone numbers.
  - Allowed values: `INBOUND`, `OUTBOUND`
- `to` (string, required)
- `from` (string, required)
- `created_at` (string, required)
- `started_at` (string, required, nullable)
- `answered_at` (string, required, nullable)
- `ended_at` (string, required, nullable)
- `metadata` (map from string to string, required)
- `record` (boolean, required) — Whether recording was requested when this call was created. This is intent, not progress. `recording_state` says what happened to the audio; `record` says whether any was ever asked for. A call with `record: true` and `recording_state: null` after it has ended means a recording was expected but never produced.
- `recording_state` (enum, required, nullable) — If no recording has been captured or enabled for the call, then `null`.
  - Allowed values: `PENDING`, `READY`, `FAILED`, `DELETED`
- `hangup_cause` (string, required, nullable)
- `conference_id` (string, optional, nullable) — The conference this call is in, or was most recently in; `null` if never. Returned by `GET /calls/{id}`.

## Errors

### 400 Bad Request Error

Validation failed. The payload has missing required fields and/or invalid types.&#x20; See [https://zod.dev/error-formatting](https://zod.dev/error-formatting) for more information.

- `description` (string, required) — Human-readable summary of validation failures.
- `errors` (ZodErrorErrors, required) — Structured dictionary of issues containing two main sections: - `errors`: Array of global validation errors not tied to specific fields - `properties`: Object mapping field names to their specific validation errors, where each field contains an `errors` array

### 401 Unauthorized Error

The request lacks valid authentication credentials or the provided credentials are invalid.&#x20; Ensure you're including a valid API key in the request headers and that your account has the necessary permissions to access this endpoint.

- `error` (string, required) — Human-readable description of the error that occurred, corresponding to the HTTP status code.

### 404 Not Found Error

The requested resource could not be found.&#x20; This may occur if the identifier is incorrect, the resource has been deleted, or you don't have permission to access it.

- `error` (string, required) — Human-readable description of the error that occurred, corresponding to the HTTP status code.

### 500 Internal Server Error

An unexpected error occurred on Pinnacle's servers while processing your request.&#x20; If this error persists, please contact support with the request details.

- `error` (string, required) — Human-readable description of the error that occurred, corresponding to the HTTP status code.

### 502 Bad Gateway Error

One of Pinnacle's providers failed. Please try again later.

- `error` (string, required) — Human-readable description of the error that occurred, corresponding to the HTTP status code.

### 503 Service Unavailable Error

This service is temporarily unavailable. Please try again later or contact support if the issue continues.

- `error` (string, required) — Human-readable description of the error that occurred, corresponding to the HTTP status code.

## Types

### ZodErrorErrors

Structured dictionary of issues containing two main sections: - `errors`: Array of global validation errors not tied to specific fields - `properties`: Object mapping field names to their specific validation errors, where each field contains an `errors` array

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "id": "string",
  "state": "INITIATED",
  "direction": "INBOUND",
  "to": "string",
  "from": "string",
  "created_at": "2024-01-15T09:30:00Z",
  "started_at": "2024-01-15T09:30:00Z",
  "answered_at": "2024-01-15T09:30:00Z",
  "ended_at": "2024-01-15T09:30:00Z",
  "metadata": {},
  "record": true,
  "recording_state": null,
  "hangup_cause": "string",
  "conference_id": "conf_Hk2mX9pQ4rT7vB1nL8sW"
}
```

**SDK Code**

```python
import requests

url = "https://api.pinnacle.sh/calls/call_7cQe4F8xT1yB2mN9pK3L"

payload = {}
headers = {
    "PINNACLE-API-KEY": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.pinnacle.sh/calls/call_7cQe4F8xT1yB2mN9pK3L';
const options = {
  method: 'PATCH',
  headers: {'PINNACLE-API-KEY': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{}'
};

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.pinnacle.sh/calls/call_7cQe4F8xT1yB2mN9pK3L"

	payload := strings.NewReader("{}")

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

	req.Header.Add("PINNACLE-API-KEY", "<apiKey>")
	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.pinnacle.sh/calls/call_7cQe4F8xT1yB2mN9pK3L")

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

request = Net::HTTP::Patch.new(url)
request["PINNACLE-API-KEY"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{}"

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.patch("https://api.pinnacle.sh/calls/call_7cQe4F8xT1yB2mN9pK3L")
  .header("PINNACLE-API-KEY", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.pinnacle.sh/calls/call_7cQe4F8xT1yB2mN9pK3L', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
    'PINNACLE-API-KEY' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.pinnacle.sh/calls/call_7cQe4F8xT1yB2mN9pK3L");
var request = new RestRequest(Method.PATCH);
request.AddHeader("PINNACLE-API-KEY", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "PINNACLE-API-KEY": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.pinnacle.sh/calls/call_7cQe4F8xT1yB2mN9pK3L")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```