latestSwagger 2.02026-08-101561322.2 MB

3e4029d19684

Contacts

Add a new contact

<a class="try-sandbox-link" href="https://sandbox.textmagic.com/#/Contacts/createContact" target="_blank">Try in sandbox</a><br>

post/api/v2/contacts/normalized

Request body

firstNamestring

Contact first name.

lastNamestring

Contact last name.

phonestring required

Phone number in E.164 format.

emailstring email

Contact email address.

companyNamestring

Company name.

listsstring required

Contact list ID. Each contact must be assigned to at least one list.

favoritedboolean

Is the contact marked as favorite?

blockedboolean

Is the contact blocked for outgoing and incoming messaging?

type0 | 1

Force type of phone. Possible values: 0 is landline; 1 is mobile; default is -1 (auto-detection).

local0 | 1

Treat phone numbers passed in the request body as local.

countrystring

The 2-letter ISO country code for local phone numbers, used when local is set to true. Default is the account country.

tagsinteger[]

An array of tag IDs that will be assigned to the contact.

ownerinteger

Contact Owner ID

Example request

{
  "firstName": "Charles",
  "lastName": "Conway",
  "phone": "447860021130",
  "email": "charles@example.com",
  "companyName": "Example Ltd.",
  "lists": "10541,18599",
  "type": 1,
  "customFieldValues": [
    {
      "id": 515,
      "userCustomFieldId": 515,
      "name": "Custom name",
      "value": "Custom value",
      "createdAt": "2015-02-11T07:33:19+0000"
    }
  ],
  "country": "US",
  "tags": [
    23,
    45
  ],
  "owner": 2
}

Response

Contact has been created with success.

idinteger required

Resource ID.

hrefstring required

A link to this resource. If you want to fetch it, just GET this address.

Example response

{
  "id": 515,
  "href": "/api/v2/entity_name/1"
}