GET /api/v1/contacts/{contactId}
One contact with its list and its tags.
Authorization
| Role in the organization | This endpoint |
|---|---|
OWNER | Allowed |
ADMIN | Allowed |
MEMBER | Allowed |
Path parameters
| Parameter | Type | Description |
|---|---|---|
contactId | string | Required. 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
| Field | Type | Description |
|---|---|---|
success | boolean | Indicates if the operation was successful |
data.id | string | Identifier of the contact |
data.email | string | Its address — unique inside its list |
data.firstName | string | null | First name |
data.lastName | string | null | Last name |
data.phone | string | null | International 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.birthDate | string | null | Real calendar date YYYY-MM-DD, year 0001–9999, no later than today in UTC. Returned as a date-only string. |
data.locale | string | null | Well-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.country | string | null | Two ASCII letters, trimmed and uppercased (for example fr → FR). Only the shape is checked, not membership in a country-code registry. |
data.status | string | pending, subscribed, unsubscribed, bounced, complained |
data.listId | string | The list it belongs to — a contact belongs to exactly one |
data.list | object | {id, name} of that list |
data.tags | array | {id, name} of every tag carried |
data.customFields | object | Custom 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.attribution | object | Where the contact came from: {firstTouch, lastTouch, history}. Always present |
data.attribution.firstTouch | object | null | The entry point with the earliest capturedAt. null when the contact has none |
data.attribution.lastTouch | object | null | The entry point with the latest capturedAt. null when the contact has none |
data.attribution.history[] | array | The 20 most recent entry points, newest first. [] when the contact has none |
data.createdAt | string | ISO creation date |
data.updatedAt | string | ISO date of last change |
firstTouch, lastTouch and history[]:
| Field | Type | Description |
|---|---|---|
event | string | How 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 |
channel | string | The channel sent, or the one deduced from the source (meta, youtube, google, email, other) |
utmSource / utmMedium / utmCampaign / utmContent / utmTerm | string | null | The UTM values sent, null when absent |
fbclid / gclid | string | null | Click identifiers, null when absent |
referrer | string | null | The referring page, null when absent |
landingUrl | string | null | The landing page, null when absent |
extra | object | The other values sent, {} when none |
capturedAt | string | ISO 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,localeandcountryare optional. Omission preserves an existing value;nullclears it. Omitted fields on a new contact arenull. 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 inhistory.historyholds the 20 most recent entry points; a back-dated or older first touch is still returned infirstTouch. - 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.