Get a contact

GET /api/v1/contacts/{contactId} One contact with its list and its tags.

Authorization

Role in the organizationThis endpoint
OWNERAllowed
ADMINAllowed
MEMBERAllowed
A key carries the role its creator holds in this organization — never a role on AgentsMail itself. See API keys.

Path parameters

ParameterTypeDescription
contactIdstringRequired. The contact to read

Example

bash
curl -H "x-api-key: $AGENTMAIL_API_KEY" \
  "https://www.agentsmail.io/api/v1/contacts/$CONTACT_ID"

Response

  • 200 OK — the call succeeded.
  • 401 Unauthorized — missing or invalid key, or its owner left the organization.
  • 404 Not Found — no such resource, or it belongs to another organization. The API never confirms that an id exists to a caller who has no right to it.
  • 429 Too Many Requests — over 120 requests in a minute for this key.

Response fields

FieldTypeDescription
successbooleanIndicates if the operation was successful
data.idstringIdentifier of the contact
data.emailstringIts address — unique inside its list
data.firstNamestring | nullFirst name
data.lastNamestring | nullLast name
data.phonestring | nullInternational number: leading +, then 8–15 digits, first digit nonzero. Spaces, parentheses, periods and hyphens are removed. Local numbers, 00 prefixes and extensions are rejected; reachability is not checked.
data.birthDatestring | nullReal calendar date YYYY-MM-DD, year 0001–9999, no later than today in UTC. Returned as a date-only string.
data.localestring | nullWell-formed BCP 47 language tag, trimmed and canonicalized (for example fr-fr → fr-FR), up to 100 characters. Not limited to the interface languages.
data.countrystring | nullTwo ASCII letters, trimmed and uppercased (for example fr → FR). Only the shape is checked, not membership in a country-code registry.
data.statusstringpending, subscribed, unsubscribed, bounced, complained
data.listIdstringThe list it belongs to — a contact belongs to exactly one
data.listobject{id, name} of that list
data.tagsarray{id, name} of every tag carried
data.customFieldsobjectCustom field values of the contact, by key: text, number, boolean, or a date as an ISO string in UTC. {} when the contact has no value. Only custom fields defined in your organization settings appear
data.attributionobjectWhere the contact came from: {firstTouch, lastTouch, history}. Always present
data.attribution.firstTouchobject | nullThe entry point with the earliest capturedAt. null when the contact has none
data.attribution.lastTouchobject | nullThe entry point with the latest capturedAt. null when the contact has none
data.attribution.history[]arrayThe 20 most recent entry points, newest first. [] when the contact has none
data.createdAtstringISO creation date
data.updatedAtstringISO date of last change
Fields of an entry point — the same in firstTouch, lastTouch and history[]:
FieldTypeDescription
eventstringHow the contact arrived: api when an API call created the contact, signup when a sign-up page created it, resubscribe when the address was already in the list
channelstringThe channel sent, or the one deduced from the source (meta, youtube, google, email, other)
utmSource / utmMedium / utmCampaign / utmContent / utmTermstring | nullThe UTM values sent, null when absent
fbclid / gclidstring | nullClick identifiers, null when absent
referrerstring | nullThe referring page, null when absent
landingUrlstring | nullThe landing page, null when absent
extraobjectThe other values sent, {} when none
capturedAtstringISO date in UTC of the entry point

Example response

json
{
  "success": true,
  "data": {
    "id": "4d19c0a2",
    "email": "ada@example.com",
    "firstName": "Ada",
    "lastName": "Lovelace",
    "phone": null,
    "birthDate": null,
    "locale": null,
    "country": null,
    "status": "subscribed",
    "listId": "0b7c51e8",
    "list": {
      "id": "0b7c51e8",
      "name": "Newsletter"
    },
    "tags": [
      {
        "id": "7c2ef4b1",
        "name": "vip"
      }
    ],
    "customFields": {
      "utm_source": "meta",
      "signup_at": "2026-11-15T00:00:00.000Z"
    },
    "attribution": {
      "firstTouch": {
        "event": "api",
        "channel": "meta",
        "utmSource": "meta",
        "utmMedium": "paid",
        "utmCampaign": "webi-nov-test1",
        "utmContent": null,
        "utmTerm": null,
        "fbclid": null,
        "gclid": null,
        "referrer": null,
        "landingUrl": null,
        "extra": {},
        "capturedAt": "2026-11-01T09:00:00.000Z"
      },
      "lastTouch": {
        "event": "resubscribe",
        "channel": "youtube",
        "utmSource": "youtube",
        "utmMedium": null,
        "utmCampaign": null,
        "utmContent": null,
        "utmTerm": null,
        "fbclid": null,
        "gclid": null,
        "referrer": null,
        "landingUrl": null,
        "extra": {},
        "capturedAt": "2026-11-10T17:30:00.000Z"
      },
      "history": [
        {
          "event": "resubscribe",
          "channel": "youtube",
          "utmSource": "youtube",
          "utmMedium": null,
          "utmCampaign": null,
          "utmContent": null,
          "utmTerm": null,
          "fbclid": null,
          "gclid": null,
          "referrer": null,
          "landingUrl": null,
          "extra": {},
          "capturedAt": "2026-11-10T17:30:00.000Z"
        },
        {
          "event": "api",
          "channel": "meta",
          "utmSource": "meta",
          "utmMedium": "paid",
          "utmCampaign": "webi-nov-test1",
          "utmContent": null,
          "utmTerm": null,
          "fbclid": null,
          "gclid": null,
          "referrer": null,
          "landingUrl": null,
          "extra": {},
          "capturedAt": "2026-11-01T09:00:00.000Z"
        }
      ]
    },
    "createdAt": "2026-08-23T10:22:05.000Z",
    "updatedAt": "2026-08-23T10:22:05.000Z"
  }
}

Notes

  • phone, birthDate, locale and country are optional. Omission preserves an existing value; null clears it. Omitted fields on a new contact are null. Empty strings are rejected.
  • A phone number does not grant permission to send SMS or WhatsApp messages. These profile fields do not change subscription status or consent.
  • The first touch is the earliest capturedAt, even when it is not in history. history holds the 20 most recent entry points; a back-dated or older first touch is still returned in firstTouch.
  • An entry point is added by each call to Add or update one contact that carries an attribution, and by each subscription through a sign-up page whose visitor arrived with campaign parameters or a referrer. This page only reads them.