Add a contact

POST /contacts

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

application/json

Body Required

  • firstName string

    First name of the contact

  • lastName string

    Last name of the contact

  • email string

    Email of the contact

  • company string

    Company name of the contact

  • tag array[string]

    List of tags for the contact

  • customFields array[object]
    Hide customFields attributes Show customFields attributes object
    • _id string
    • name string
    • variable string
    • value string

Responses

  • 200 application/json

    Success

    Hide response attributes Show response attributes object
    • _id string
    • email string(email)
    • firstName string
    • lastName string
    • company string
    • tag array[string]
    • custom array[object]
      Hide custom attributes Show custom attributes object
      • _id string
      • name string
      • variable string
      • value string
    • campaignId string
    • createdAt string
    • status string
    • privacy string
    • branding object

      Additional properties are allowed.

      Hide branding attributes Show branding attributes object
      • useBranding boolean
      • brandingId string
    • note object

      Additional properties are allowed.

      Hide note attributes Show note attributes object
      • date string
      • note string
  • 400

    Bad Request -- Your request is invalid.

  • 401

    Unauthorized -- Your API key is wrong.

  • 403

    Forbidden -- The object requested is hidden for administrators only.

  • 404

    Not Found -- The specified object could not be found.

  • 429

    Too Many Requests -- You're requesting too many objects! Slow down!

  • 500

    Internal Server Error -- We had a problem with our server. Try again later.

  • 503

    Service Unavailable -- We're temporarily offline for maintenance. Please try again later.

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