---
title: "Add a texter as a contact"
description: "Make the sender of a received text a contact, or file the text under the contact that already has the number. `POST /api/v1/sms/{id}/contact`"
url: https://www.unitpost.com/docs/sms/post-sms-id-contact
section: "SMS API reference"
updated: 2026-11-11
---
# Add a texter as a contact

`POST /api/v1/sms/{id}/contact`

Make the sender of a received text a contact, or file the text under the contact that already has the number. Phone only: no name and no consent (texting a number isn't consent to marketing). Every earlier text with that number that no contact holds is filed under the contact too, so `contact_id` reads it from then on. Answers the contact: `201` when it is new, `200` when it existed. It counts against the plan's contacts (`403 limit_reached` when full). A number that texted STOP stays opted out. A text you sent is refused (`409`). Requires the `contacts:write` capability.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | — |

## Response fields (200)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `object` | string | yes | — |
| `id` | string | yes | — |
| `email` | string \| null | yes | — |
| `phone` | string \| null | no | — |
| `first_name` | string \| null | yes | — |
| `last_name` | string \| null | yes | — |
| `unsubscribed` | boolean | yes | — |
| `unsubscribed_at` | string \| null | yes | — |
| `unsubscribe_reason` | enum \| null | yes | — |
| `custom_fields` | object | yes | — |
| `created_at` | string | yes | — |
| `updated_at` | string | yes | — |

## Responses

| Status | Description |
| --- | --- |
| 200 | The contact that already had the number. |
| 201 | The new contact. |
| 400 | The body isn't JSON. |
| 401 | Missing or invalid API key. |
| 403 | Insufficient scope (`contacts:write` and `sms:read`), or the plan's contacts are full (`limit_reached`). |
| 404 | Text not found, or SMS is not enabled. |
| 409 | A text you sent, not one you received. |
| 422 | An unknown key. |

## Example request

```bash
curl -X POST 'https://www.unitpost.com/api/v1/sms/sms_123/contact' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0' \
  -H 'Content-Type: application/json' \
  -d '{ }'
```

## Example response (200)

```json
{
  "object": "contact",
  "id": "id_123",
  "email": "customer@example.com",
  "phone": "string",
  "first_name": "string",
  "last_name": "string",
  "unsubscribed": false,
  "unsubscribed_at": "2026-01-01T00:00:00.000Z",
  "unsubscribe_reason": "USER",
  "custom_fields": {},
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z"
}
```

## Links

- HTML reference (with Node.js, Python, Ruby, PHP, Laravel, Go, Java, Rust, .NET and CLI examples): https://www.unitpost.com/docs/sms/post-sms-id-contact
- OpenAPI 3.1 (full schemas): https://www.unitpost.com/api/v1/openapi.json
