EmailElement Docs

Contact API Walkthrough

Prerequisites

  • An EmailElement account with at least one Contact List
  • An API key with Contact API permission set to Full Access
  • An API client such as Postman, cURL, or your application code

Step 1: Find Your Contact List ID

Introduction

  1. Navigate to Contact Lists from the sidebar

    Click 'Contact Lists'

  2. Find the list you want to add contacts to

  3. The ID is in the left column of the grid

    Get Contact List ID

  4. Copy it — it goes in the API URL

Step 2: Generate an API Key

  1. Navigate to Account > API Keys

    Click 'Account'

    Click 'API Keys'

  2. Click Add

    Click 'Add'

  3. Enter a name for the key, for example "Contact API - Production"

    Name your key

  4. Set the Contact API permission to Full Access

    Set key permissions

  5. Set the other permissions as needed

  6. Click Create

    Click 'Create'

  7. Click Copy. The key stays available — you can return to Account > API Keys and copy it again later

    Click your new Key

    Click 'Copy'

  8. Store it somewhere safe and do not share it

Step 3: Use the API Documentation Generator

  1. Navigate to API Documentation from the sidebar

    Click API Documentation

  2. Select Contact API

  3. Pick the tab for the call you want. POST (V2) and GET (V2) are the current ones. The V1 tabs are marked deprecated and are there for existing integrations

    Use GET or POST

    Update GET query string

    Click 'POST'

  4. Under Fields, tick the fields to include. Email is always required and cannot be unticked

    Email field

    Select more fields

  5. Under Required Fields, tick any field that must carry a value. A contact missing one is rejected

  6. Click + Add New Custom Field to create a field without leaving the page

    Click '+ Add New Custom Field'

    Name custom field

    Choose custom field type

    Click 'Create'

    Select new custom field

  7. The generator builds the Request URL, and for POST the Request Body, as you tick

    Request Body

    Custom field is added to Request Body

  8. Copy them

    Copy Request URL

  9. Each tab lists every response code that call can return, with an example body. Read that list before writing your error handling

Step 4: Configure Your API Client

Using Postman

  1. Create a new request

    Set up Request in Postman

  2. Set the method to POST

    Click 'POST'

  3. Paste the Request URL from the generator

    Enter Request URL

  4. Replace YOUR_LIST_ID with your Contact List ID

    Add your Contact List ID

  5. On the Headers tab add key x-api-key with your API key as the value

    Click 'Authorization'

    Choose Auth Type

    Fill 'x-api-key'

    Enter API Key

  6. On the Body tab choose Raw, set the type to JSON, and paste the Request Body

    Click 'Body'

    Click 'raw'

    Paste Request Body

  7. Replace the placeholder values with real contact data

    Update Request Body

Using cURL

curl -X POST "https://api.emailelement.com/api/ContactList/YOUR_LIST_ID/Contacts?overwriteExisting=true"   -H "x-api-key: YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{
    "data": [
      {
        "Email": "jane.doe@example.com",
        "First Name": "Jane",
        "Last Name": "Doe"
      }
    ],
    "requiredFields": ["First Name"]
  }'

The field names are the ones on your Contact List, spaces and all. They are not camelCase, in the request or in the response.

V1 takes a different body — the contact array on its own, with no data wrapper and no requiredFields. Moving only the list id in the path is not enough to switch versions.

Step 5: Send the Request and Check the Result

  1. Send the request

    Click 'Send'

  2. Branch on the HTTP status code, not on the body. See CONTACT_API_REFERENCE.md for why

    Click 'OK'

  3. On a 200, compare the data array in the response against what you sent. That array is the list of contacts that were actually stored. A 200 can still have dropped some

  4. Read messages for the reason behind anything that was dropped

  5. Navigate to Contact Lists and check the Record Count went up

    Return to 'Contact Lists'

    View updated Contact List

Adding Contacts in Bulk

  • The POST call takes an array of contacts in one request
  • Contacts are validated as a batch. More than 10% failing rejects the whole request with a 400 and adds nothing. 10% or fewer failing gives a 200, adds the rest, and reports the failures
  • A request of fewer than ten contacts is all or nothing, because one failure already exceeds 10%
  • overwriteExisting defaults to true on all four routes, V1 and V2, so a contact already on the list has their data updated. Send overwriteExisting=false to leave existing contacts alone

Common Errors

Status Code Meaning Resolution
400 Too many contacts failed validation More than 10% were invalid. Read messages, fix them, and send again
400 No contacts supplied The body arrived but data was absent or empty
400 Missing or unparseable request body Check the JSON parses and the Content-Type is application/json
400 Contact list not found Check the list ID, and that the list belongs to the account the key was issued for
401 Unauthorized Check the API key value and that the header is named x-api-key
403 Forbidden The key needs Contact API set to Full Access
500 Unexpected error Retry. If it persists, contact support with the time of the request

There is no 404 and no 429 on this API. An unknown list id comes back as a 400.

Something went wrong. Reloading the page usually fixes it. Reload ×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.