# Update channel

> Update a contact's channel properties.

`PATCH https://api.zavu.dev/v1/contacts/{contactId}/channels/{channelId}`

Update a contact's channel properties.

## Parameters

- `contactId` (path, string, required)
- `channelId` (path, string, required): Channel ID.

## Body

- `label` (string, nullable): Optional label for the channel. Set to null to clear.
- `verified` (boolean): Whether the channel is verified.
- `metadata` (object)
  - `{key}` (string)

## Responses

### 200

Channel updated.

- `channel` (object, required): A communication channel for a contact.
  - `id` (string, required)
  - `channel` (string, required): Channel type. One of: `sms`, `whatsapp`, `email`, `telegram`, `instagram`, `messenger`, `voice`.
  - `identifier` (string, required): Channel identifier (phone number or email address).
  - `countryCode` (string): ISO country code for phone numbers.
  - `label` (string): Optional label for the channel.
  - `isPrimary` (boolean, required): Whether this is the primary channel for its type.
  - `verified` (boolean, required): Whether this channel has been verified.
  - `metrics` (object): Delivery metrics for this channel.
    - `successCount` (integer)
    - `failureCount` (integer)
    - `totalAttempts` (integer)
    - `avgDeliveryTimeMs` (number)
    - `lastSuccessAt` (string<date-time>)
  - `lastInboundAt` (string<date-time>): Last time a message was received on this channel.
  - `metadata` (object)
    - `{key}` (string)
  - `createdAt` (string<date-time>, required)
  - `updatedAt` (string<date-time>)

### 400

Invalid request.

- `code` (string, required)
- `message` (string, required)
- `details` (object)

### 401

Unauthorized.

- `code` (string, required)
- `message` (string, required)
- `details` (object)

### 404

Contact or channel not found.

- `code` (string, required)
- `message` (string, required)
- `details` (object)

## Example

```bash
curl -X PATCH "https://api.zavu.dev/v1/contacts/contact_abc123/channels/channel_abc123" \
  -H "Authorization: Bearer $ZAVUDEV_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "label": "string"
}'
```

```typescript
import Zavudev from "@zavudev/sdk";

const zavu = new Zavudev({ apiKey: process.env.ZAVUDEV_API_KEY });

const result = await zavu.contacts.channels.update("channel_abc123", {
  contactId: "contact_abc123",
  label: "string",
});

console.log(result);
```
