# Create contact

> Create a contact in a workspace.

Source: https://docs.mycrmsim.com/docs/contacts/create-contact

```http
POST https://backend.mysmsgateway.app/api/v1/ext/contacts
```

- Category: myCRMSIM Contacts / Contacts
- Auth: Bearer access token
- Scope: `contacts.write`

`workspace_id` is required and must belong to the installer.

**⚠️ At least one of `email` or `phone_number` is required.** Sending both omitted returns 400 `Either email or phone_number is required`. The two fields each have their own uniqueness constraint inside a workspace, so a contact is always identifiable by at least one of them.

Every other field is optional — see the response Schema tab for the full row that comes back on success.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `workspace_id` | body | number | yes | Workspace to attach the contact to. Must belong to the installer. Example: `7` |
| `first_name` | body | string | no | Given name. Max 50 chars. Example: `Ada` |
| `last_name` | body | string | no | Family name. Max 50 chars. Example: `Lovelace` |
| `email` | body | string | no | **Conditionally required** — at least one of `email` or `phone_number` must be provided. Normalized to lowercase. Max 100 chars. Example: `ada@example.com` |
| `phone_number` | body | string | no | **Conditionally required** — at least one of `email` or `phone_number` must be provided. Max 20 chars. Example: `+15551234567` |
| `company_name` | body | string | no | Company / organization. Max 100 chars. |
| `website` | body | string | no | Public website URL. Max 255 chars. |
| `linkedin_profile` | body | string | no | LinkedIn profile URL. Max 255 chars. |
| `summary` | body | string (text) | no | Free-form summary / bio. |
| `details` | body | object | no | Loosely-typed JSON details bag. |
| `address` | body | string | no | Street address. Max 255 chars. |
| `city` | body | string | no | Max 100 chars. |
| `state` | body | string | no | Max 100 chars. |
| `country` | body | string | no | Max 100 chars. |
| `timezone` | body | string | no | IANA timezone, e.g. Europe/London. |
| `custom_fields` | body | object | no | Workspace-defined custom fields (JSON). |
| `tags` | body | array<string> | no | Up to 20 strings, each max 64 chars. Example: `["lead","priority"]` |
| `notes` | body | string \| array<string> | no | Free-form notes. Accepts a single string or an array of strings. |
| `is_verified_sms` | body | boolean | no | Phone has been verified for SMS. |
| `is_verified_whatsapp` | body | boolean | no | Phone has been verified for WhatsApp. |
| `is_verified_imessage` | body | boolean | no | Phone has been verified for iMessage. |
| `last_contacted` | body | string (ISO 8601) | no | When this contact was last contacted. |

## Request body

```json
{
  "workspace_id": 7,
  "first_name": "Ada",
  "last_name": "Lovelace",
  "email": "ada@example.com",
  "phone_number": "+15551234567",
  "company_name": "Analytical Engines Ltd",
  "website": "https://analyticalengines.example.com",
  "linkedin_profile": "https://linkedin.com/in/ada",
  "summary": "Mathematician + first programmer. Interested in early CRM tooling.",
  "details": {
    "source": "newsletter",
    "priority": "high"
  },
  "address": "12 Mayfair St",
  "city": "London",
  "state": "Greater London",
  "country": "United Kingdom",
  "timezone": "Europe/London",
  "custom_fields": {
    "lead_score": 92,
    "owner": "gary"
  },
  "tags": [
    "lead",
    "priority",
    "engineer"
  ],
  "notes": [
    "Spoke at conference 2026-05-15",
    "Wants a quote on the Pro tier"
  ],
  "is_verified_sms": true,
  "is_verified_whatsapp": false,
  "is_verified_imessage": false,
  "last_contacted": "2026-05-20T11:02:09.000Z"
}
```

## Response fields (contact)

| Field | Type | Description |
| --- | --- | --- |
| `id` | number | Unique identifier of the contact. |
| `workspace_id` | number | The workspace this contact lives in. |
| `user_id` | number | The installer this contact belongs to. |
| `first_name` | string, nullable | Given name. Max 50 chars. |
| `last_name` | string, nullable | Family name. Max 50 chars. |
| `email` | string, nullable | Primary email. Unique within a workspace. Normalized to lowercase. Max 100 chars. |
| `phone_number` | string, nullable | Primary phone number. Unique within a workspace. Max 20 chars. |
| `company_name` | string, nullable | Company / organization name. Max 100 chars. |
| `website` | string, nullable | Public website URL. Max 255 chars. |
| `linkedin_profile` | string, nullable | LinkedIn profile URL. Max 255 chars. |
| `summary` | string (text), nullable | Free-form summary / bio. |
| `details` | object, nullable | Loosely-typed details bag (JSON). Use this for app-specific metadata that doesn't fit a column. |
| `address` | string, nullable | Street address. Max 255 chars. |
| `city` | string, nullable | City. Max 100 chars. |
| `state` | string, nullable | State / region. Max 100 chars. |
| `country` | string, nullable | Country name. Max 100 chars. |
| `timezone` | string, nullable | IANA timezone (e.g. Europe/London). Max 100 chars. |
| `custom_fields` | object, nullable | Workspace-defined custom fields (JSON). |
| `tags` | array<string>, nullable | Up to 20 short labels. |
| `notes` | array<string>, nullable | Free-form notes. Accepts a string or an array on write; reads always return an array. |
| `is_verified_sms` | boolean, nullable | Phone number has been verified for SMS. |
| `is_verified_whatsapp` | boolean, nullable | Phone number has been verified for WhatsApp. |
| `is_verified_imessage` | boolean, nullable | Phone number has been verified for iMessage. |
| `last_contacted` | string (ISO 8601), nullable | When the contact last had a message exchange. |
| `created_at` | string (ISO 8601) | When the contact was first created. |
| `updated_at` | string (ISO 8601) | When the contact was last modified. |
| `deleted_at` | string (ISO 8601), nullable | Set when the contact has been soft-deleted. null for active records. |

## Response 201

Created

```json
{
  "success": true,
  "data": {
    "id": 1234,
    "first_name": "Ada",
    "last_name": "Lovelace",
    "email": "ada@example.com",
    "phone_number": "+15551234567",
    "company_name": "Analytical Engines Ltd",
    "website": "https://analyticalengines.example.com",
    "linkedin_profile": "https://linkedin.com/in/ada",
    "summary": "Mathematician + first programmer. Interested in early CRM tooling.",
    "details": {
      "source": "newsletter",
      "priority": "high"
    },
    "address": "12 Mayfair St",
    "city": "London",
    "state": "Greater London",
    "country": "United Kingdom",
    "timezone": "Europe/London",
    "custom_fields": {
      "lead_score": 92,
      "owner": "gary"
    },
    "is_verified_sms": true,
    "is_verified_whatsapp": false,
    "is_verified_imessage": false,
    "last_contacted": "2026-05-20T11:02:09.000Z",
    "notes": [
      "Spoke at conference 2026-05-15"
    ],
    "tags": [
      "lead",
      "priority"
    ],
    "workspace_id": 7,
    "user_id": 42,
    "created_at": "2026-05-21T09:14:22.000Z",
    "updated_at": "2026-05-21T09:14:22.000Z",
    "deleted_at": null
  }
}
```

## Response 400

Missing required fields

```json
{
  "success": false,
  "message": "Either email or phone_number is required"
}
```

## Response 404

workspace_id not accessible to this token

```json
{
  "success": false,
  "message": "Workspace not found or not accessible to this token"
}
```

## Response 409

Duplicate contact in this workspace

```json
{
  "success": false,
  "message": "A contact with this email or phone number already exists in this workspace."
}
```
