# Update a contact

> Change a contact's profile, custom properties, or subscription status.

`PUT https://api-connect.nxiom.com/api/v1/emails/contacts/{contactId}`

## Authorization

Requires `email.full_access`.

## Path parameters

| Field | Type | Description |
| --- | --- | --- |
| `contactId` | string · required | The contact's ID, starting with `con_`. |

## Body parameters

| Field | Type | Description |
| --- | --- | --- |
| `email` | string · required | The contact's email address. Send the current address to keep it. |
| `userId` | string or null · optional | Your identifier for this person. `null` clears it. |
| `firstName` | string · optional | First name. An empty string clears the value. |
| `lastName` | string · optional | Last name. An empty string clears the value. |
| `phoneNumber` | string · optional | Phone number. |
| `properties` | object · optional | Replaces the contact's custom property values. Properties you leave out are cleared; omit the field to keep them unchanged. |
| `emailStatus` | string · optional | `subscribed` or `unsubscribed`. Unsubscribing stops email to this address. |

Fields you omit, other than `email`, keep their current values.

## Request

### cURL

```shell
curl -X PUT "https://api-connect.nxiom.com/api/v1/emails/contacts/YOUR_CONTACT_ID" \
  -H "Authorization: Bearer $NEXIOM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "email": "reader@example.com",
  "firstName": "Samantha",
  "emailStatus": "unsubscribed"
}'
```

### Node.js

```typescript
import { NexiomConnect } from '@nexiom/connect';

const apiKey = process.env.NEXIOM_API_KEY;
if (!apiKey) throw new Error('Set NEXIOM_API_KEY');

const nexiom = new NexiomConnect({ apiKey });

const { data, error } = await nexiom.contacts.update('YOUR_CONTACT_ID', {
  email: 'reader@example.com',
  firstName: 'Samantha',
  emailStatus: 'unsubscribed',
});

if (error) throw new Error(`${error.code}: ${error.message}`);
console.log(data.email_status);
```

### PHP

```php
<?php

use Nexiom\Connect\NexiomConnect;

$apiKey = getenv('NEXIOM_API_KEY');
if (!$apiKey) {
    throw new RuntimeException('Set NEXIOM_API_KEY');
}

$nexiom = new NexiomConnect($apiKey);

$contact = $nexiom->contacts->update('YOUR_CONTACT_ID', [
    'email' => 'reader@example.com',
    'firstName' => 'Samantha',
    'emailStatus' => 'unsubscribed',
]);

echo $contact['email_status'];
```

## Response

HTTP `200`. The updated contact is returned under `data`, in the same shape as [Create a contact](/docs/api/contacts/create). Changing `emailStatus` to `unsubscribed` also sends a [`contact.unsubscribed`](/docs/webhooks/contacts/unsubscribed) webhook event.

### 200 OK

Example response. Identifiers are illustrative.

```json
{
  "data": {
    "id": "con_example",
    "email": "reader@example.com",
    "user_id": "user_123",
    "first_name": "Samantha",
    "last_name": "Rivera",
    "phone_number": null,
    "email_status": "unsubscribed",
    "source": "manual",
    "created_at": "2026-10-02T10:00:00.000Z",
    "updated_at": "2026-10-02T11:00:00.000Z"
  }
}
```

### 400 Bad Request

The request is invalid. Correct it before retrying; `details` lists the failing fields.

```json
{
  "error": "invalid_argument",
  "message": "Request doesn't match the schema",
  "correlationId": "req_example",
  "details": {
    "context": "body",
    "issues": []
  }
}
```

### 401 Unauthorized

The API key is missing, malformed, revoked, or expired.

```json
{
  "error": "unauthorized",
  "message": "Invalid API key",
  "correlationId": "req_example"
}
```

### 403 Forbidden

The API key lacks a required permission, or its domain restriction does not allow this sender.

```json
{
  "error": "not_allowed",
  "message": "Missing required API key permissions: email.full_access",
  "correlationId": "req_example"
}
```

### 404 Not Found

No contact with this ID exists in the API key's project.

```json
{
  "error": "not_found",
  "message": "Contact not found",
  "correlationId": "req_example"
}
```

### 409 Conflict

The resource already exists.

```json
{
  "error": "duplicate_error",
  "message": "Resource already exists",
  "correlationId": "req_example"
}
```

---

Source: https://connect.nxiom.com/docs/api/contacts/update
