Add a contact

POST /contacts

This endpoint add a new contact. It returns the contact object.

application/json

Body Required

Responses

POST /contacts
curl \
 -X POST https://api.usecollect.com/v1/contacts \
 --user "username:password" \
 -H "Content-Type: application/json" \
 -d '{"email":"john@example.com","firstName":"John","lastName":"Doe","tags":["Speaker"],"customFields":[{"variable":"color","value":"Blue"},{"variable":"country","value":"US"}]}'
Request example
{
  "email": "john@example.com",
  "firstName": "John",
  "lastName": "Doe",
  "tags": [
    "Speaker"
  ],
  "customFields": [
    {
      "variable": "color",
      "value": "Blue"
    },
    {
      "variable": "country",
      "value": "US"
    }
  ]
}
Response examples (200)
{
  "_id": "uBJadNFcjrC6emRom",
  "email": "johndoe@example.com",
  "firstName": "John",
  "lastName": "Doe",
  "nbRequest": 0,
  "tag": [
    "Speaker"
  ],
  "custom": [
    {
      "_id": "yw6XDyeFvbqr86yA6",
      "name": "Favorite color",
      "variable": "color",
      "value": "Blue"
    },
    {
      "_id": "CqdFwGX3yitk9zf8z",
      "name": "Country",
      "variable": "country",
      "value": "US"
    }
  ],
  "createdAt": "2023-02-22 13:40:26 UTC",
  "requests": []
}