# Create or update contact (/api-reference/contacts/createContact)

`POST /contacts`

Base URL: `https://next-api.useplunk.com`

Create a new contact or update existing (upsert by email)

## Request body

- `email`: string (email) (required)
- `subscribed`: boolean
- `data`: object

Example:

```json
{
  "email": "user@example.com"
}
```

## Responses

### `200` — Contact updated

- `id`: string — Unique contact identifier
- `email`: string (email) — Contact email address
- `subscribed`: boolean — Subscription status
- `data`: object — Custom contact data fields
- `createdAt`: string (date-time)
- `updatedAt`: string (date-time)
- `_meta`: object
  - `isNew`: boolean
  - `isUpdate`: boolean

```json
{
  "id": "string",
  "email": "user@example.com",
  "subscribed": false,
  "data": null,
  "createdAt": "2026-05-17T18:27:16.093Z",
  "updatedAt": "2026-05-17T18:27:16.093Z",
  "_meta": {
    "isNew": false,
    "isUpdate": false
  }
}
```

### `201` — Contact created

- `id`: string — Unique contact identifier
- `email`: string (email) — Contact email address
- `subscribed`: boolean — Subscription status
- `data`: object — Custom contact data fields
- `createdAt`: string (date-time)
- `updatedAt`: string (date-time)
- `_meta`: object
  - `isNew`: boolean
  - `isUpdate`: boolean

```json
{
  "id": "string",
  "email": "user@example.com",
  "subscribed": false,
  "data": null,
  "createdAt": "2026-05-17T18:27:16.093Z",
  "updatedAt": "2026-05-17T18:27:16.093Z",
  "_meta": {
    "isNew": false,
    "isUpdate": false
  }
}
```

## Example request

```bash
curl -X POST 'https://next-api.useplunk.com/contacts' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"email":"user@example.com"}'
```
