# Contacts

## Create Contact

<mark style="color:green;">`POST`</mark> `https://api.iphub.com.au/api/v1/contacts`

Creates a contact or updates an existing contact.

#### Query Parameters

| Name           | Type   | Description      |         |                                                                                                                 |
| -------------- | ------ | ---------------- | ------- | --------------------------------------------------------------------------------------------------------------- |
| updateExisting | string | <p>'phoneNumber' | 'email' | 'userId'<br><br>If a contact is found with the matching field above, it will be updated instead of created.</p> |

#### Headers

| Name          | Type   | Description                                                 |
| ------------- | ------ | ----------------------------------------------------------- |
| Authorization | string | Authentication token of the form \`bearer ${sessionToken}\` |

#### Request Body

| Name         | Type   | Description                                                            |
| ------------ | ------ | ---------------------------------------------------------------------- |
| firstName    | string | First Name                                                             |
| lastName     | string | Last Name                                                              |
| company      | string | Company                                                                |
| email        | string | Email                                                                  |
| phoneNumbers | array  | <p>Array of phone numbers eg)<br>\['+61404123456', '+61433222444']</p> |
| customFields | object | <p>Key Value object of custom fields<br>{'example': 'some\_value'}</p> |
| userId       | string | User ID in your database or CRM                                        |
| tags         | array  | Array of custom tags. This can be used to trigger flows.               |

{% tabs %}
{% tab title="200 " %}

```
{
    id: string
}
```

{% endtab %}
{% endtabs %}
