> ## Documentation Index
> Fetch the complete documentation index at: https://docs.drin.run/llms.txt
> Use this file to discover all available pages before exploring further.

# Update a contact

> PATCH /v1/contacts/{id} — partially update a contact's name, metadata, or subscription state.

A partial update. Send only the fields you want to change; everything else is left untouched.

**`PATCH /v1/contacts/{id}`**

## Path parameters

<ParamField body="id" type="string" required>
  The contact id to update.
</ParamField>

## Body

Send any subset of the following.

<ParamField body="firstName" type="string | null">
  New given name. Pass `null` to clear it.
</ParamField>

<ParamField body="lastName" type="string | null">
  New family name. Pass `null` to clear it.
</ParamField>

<ParamField body="metadata" type="object">
  Replace the contact's metadata object.
</ParamField>

<Tip>
  **Flip subscription with the dedicated endpoints.** To opt a contact in or out, prefer [unsubscribe](/api-reference/contacts/unsubscribe) and [resubscribe](/api-reference/contacts/resubscribe) — they also stamp and clear `unsubscribedAt` for you.
</Tip>

## Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PATCH https://api.drin.run/v1/contacts/ct_7Yh2Lp \
    -H "Authorization: Bearer $DRIN_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{ "lastName": "King", "metadata": { "plan": "scale" } }'
  ```

  ```typescript Node.js theme={null}
  import { DrinClient } from "@drin00/sdk";

  const drin = new DrinClient({ apiKey: process.env.DRIN_API_KEY });

  await drin.contacts.update("ct_7Yh2Lp", {
    lastName: "King",
    metadata: { plan: "scale" },
  });

  // Pass null to clear a name field.
  await drin.contacts.update("ct_7Yh2Lp", { firstName: null });
  ```
</CodeGroup>

## Response

Returns `200 OK` with the updated contact. An unknown id returns `404 not_found`.

```json 200 OK theme={null}
{
  "id": "ct_7Yh2Lp",
  "email": "ada@example.com",
  "firstName": "Ada",
  "lastName": "King",
  "subscribed": true,
  "unsubscribedAt": null,
  "metadata": { "plan": "scale" },
  "createdAt": "2026-06-02T17:30:00.000Z",
  "updatedAt": "2026-06-02T18:05:11.000Z"
}
```
