Patch a contact. `:subscriber` is an id or email. Delete stays disabled; use [Unsubscribe](/docs/api-reference/v2/subscribers-unsubscribe). Permission: `subscribers`.

Omitted `resubscribe` does **not** re-subscribe an unsubscribed contact. Optional `skipDoubleOptIn: true` promotes `PENDING_CONFIRMATION` to `SUBSCRIBED` before tag events.

## Path Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| `subscriber` | string | **Required.** Subscriber id or email. |

## Body Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| `email` | string | New email address. |
| `name` | string or null | Display name. |
| `phone` | string or null | Phone number. |
| `tags` | string[] | Tag names to attach. |
| `fields` | `Record<string, string \| null>` | Custom field values. |
| `replaceTags` | boolean | When `true`, replace existing tags with `tags`. |
| `resubscribe` | boolean | Re-subscribe an `UNSUBSCRIBED` contact. |
| `triggerWorkflows` | boolean | Fire tag / field workflows. |
| `skipDoubleOptIn` | boolean | Promote `PENDING_CONFIRMATION` to `SUBSCRIBED`. |
| `ipAddress` | string | Client IP stored as evidence. |
| `country` | string | ISO 3166-1 alpha-2 country code. |

## Response Fields

| Field | Type | Description |
| ----- | ---- | ----------- |
| `id` | string | Subscriber id. |
| `email` | string | Email address. |
| `name` | string or null | Display name. |
| `phone` | string or null | Phone number. |
| `status` | string | Current status. |
| `tags` | `{ id, name }[]` | Current audience tags. |
| `fields` | object | Custom fields. |
| `warnings` | string[] | Present when some tags or fields could not be applied. |

## Errors

| Status | `name` | When |
| ------ | ------ | ---- |
| 401 | `missing_api_key` | Missing or invalid bearer token |
| 403 | `missing_permission` | Token lacks the `subscribers` permission |
| 404 | `not_found` | Unknown id or email |
| 422 | `validation_error` | Invalid payload |

## Related

- [Get Subscriber](/docs/api-reference/v2/subscribers-get)
- [Unsubscribe Subscriber](/docs/api-reference/v2/subscribers-unsubscribe)
- [SDK: lumail.subscribers.update](/docs/sdk/v2/subscribers-update)


## API Reference
**Method:** PATCH
**Endpoint:** /api/v2/subscribers/:subscriber

### SDK
```ts
import { Lumail } from "lumail";

const lumail = new Lumail({ apiKey: process.env.LUMAIL_API_KEY });
const { data, error } = await lumail.subscribers.update("user@example.com", {
  name: "Ada Lovelace",
});
if (error) {
  throw error;
}
console.log(data.name);
```

### cURL
```bash
curl -X PATCH https://lumail.io/api/v2/subscribers/user@example.com \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"Ada Lovelace"}'
```

### JavaScript
```javascript
const response = await fetch(
  "https://lumail.io/api/v2/subscribers/user@example.com",
  {
    method: "PATCH",
    headers: {
      Authorization: "Bearer YOUR_API_TOKEN",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ name: "Ada Lovelace" }),
  },
);
const data = await response.json();
```

### Success Response
```json
{
  "id": "sub_abc123",
  "email": "user@example.com",
  "name": "Ada Lovelace",
  "status": "SUBSCRIBED"
}
```

### Error Response
```json
{
  "name": "not_found",
  "message": "Subscriber not found",
  "statusCode": 404
}
```
