---
agentTools:
  projectIndex: https://devdocs.drift.com/llms.txt
---

# Retrieving Contacts

Contacts can be retrieved both via contactId, as well as email.

Note that email is not a primary identifier, and it's possible that multiple contacts have the same email - so querying on email returns a list. ID will always return one entry (if the contact exists).

[block:api-header]
{
  "title": "Single (Query by ID)"
}
[/block]

`GET https://driftapi.com/contacts/{contactId}`

[block:api-header]
{
  "title": "Multiple (Query by Email)"
}
[/block]

`GET https://driftapi.com/contacts`

Accepted Query Parameters:

* `email` filters out contacts where the email does not match
* `limit` sets a max for the number of contacts returned

`ex: GET  https://driftapi.com/contacts?email=test@test.com`

[block:code]
{
  "codes": [
    {
      "code": "response-success:\n\nHeaders: Link: \"<link>; rel='next'\"\n{\n    \"data\": {\n        \"id\": 1234567890,\n        \"createdAt\": 1617825403810,\n        \"attributes\": {\n            \"original_ip\": \"45.42.45.124,52.89.138.153\",\n            \"_END_USER_VERSION\": 87,\n            \"_end_user_version\": 87,\n            \"recent_entrance_page_url\": \"http://www.yoursite.com\",\n            \"recent_entrance_page_title\": \"Your Website\",\n            \"_calculated_version\": 87,\n            \"ip\": \"45.42.45.124,52.89.138.153\",\n            \"externalId\": \"a12-1234\",\n            \"tags\": [],\n            \"original_entrance_page_url\": \"http://www.yoursite.com\",\n            \"original_entrance_page_title\": \"Your Website\",\n            \"socialProfiles\": {},\n            \"last_active\": 1617826661680,\n            \"first_name\": \"Bruce Wayne\",\n            \"email\": \"drifter222@drift.com\",\n            \"events\": {},\n            \"start_date\": 1617825403810\n        }\n    }\n}",
      "language": "json",
      "name": "Successful response"
    }
  ]
}
[/block]

[block:callout]
{
  "type": "info",
  "title": "Retrieving contacts by external id (your identifier)",
  "body": "If you identified a contact with a custom identifier, use the following syntax to retrieve a contact by that ID, replacing `USER-143` with your ID value. You can also provide multiple `id` query params if you want to retrieve multiple contacts at once in a single request.\n\n `https://driftapi.com/contacts?idType=external&id=USER-143`"
}
[/block]