> ## Documentation Index
> Fetch the complete documentation index at: https://docs.theomnibot.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Contact by Identifier: ID, Email, or Phone

> Use GET /api/v1/contacts/{identifier} to retrieve a single contact from your ChatbotX Workspace by internal ID, email address, or phone number.

The Get Contact endpoint retrieves a single contact record by a flexible identifier. You can look up any contact using their internal ChatbotX ID, their email address, or their phone number — all with the same endpoint. The response includes the full contact object with profile fields, tags, custom fields, notes, inbox connections, and the most recent conversation.

<Info>
  **GET** `/api/v1/contacts/{identifier}`
</Info>

## Path Parameters

<ParamField path="identifier" type="string" required>
  A contact lookup string using one of the three supported prefix formats. Minimum length: 1 character.

  | Format          | Example                  |
  | --------------- | ------------------------ |
  | `id:<value>`    | `id:123456789`           |
  | `email:<value>` | `email:user@example.com` |
  | `phone:<value>` | `phone:+84708123123`     |
</ParamField>

## Code Examples

<CodeGroup>
  ```bash curl theme={null}
  # Look up by email
  curl --request GET \
    --url "https://app.chatbotx.io/api/v1/contacts/email:user@example.com" \
    --header "Authorization: Bearer YOUR_API_TOKEN"

  # Look up by phone
  curl --request GET \
    --url "https://app.chatbotx.io/api/v1/contacts/phone:+84708123123" \
    --header "Authorization: Bearer YOUR_API_TOKEN"

  # Look up by internal ID
  curl --request GET \
    --url "https://app.chatbotx.io/api/v1/contacts/id:123456789" \
    --header "Authorization: Bearer YOUR_API_TOKEN"
  ```

  ```python Python theme={null}
  import requests

  identifier = "email:user@example.com"
  url = f"https://app.chatbotx.io/api/v1/contacts/{identifier}"
  headers = {"Authorization": "Bearer YOUR_API_TOKEN"}

  response = requests.get(url, headers=headers)
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const identifier = 'email:user@example.com';
  const options = {
    method: 'GET',
    headers: { Authorization: 'Bearer YOUR_API_TOKEN' }
  };

  fetch(`https://app.chatbotx.io/api/v1/contacts/${identifier}`, options)
    .then(res => res.json())
    .then(data => console.log(data))
    .catch(err => console.error(err));
  ```
</CodeGroup>

## Response Fields

<ResponseField name="id" type="string" required>Unique contact ID.</ResponseField>
<ResponseField name="createdAt" type="string (date-time)" required>Timestamp when the contact was created.</ResponseField>
<ResponseField name="updatedAt" type="string (date-time)" required>Timestamp of the last update.</ResponseField>
<ResponseField name="avatar" type="string | null" required>URL of the contact's profile image.</ResponseField>
<ResponseField name="phoneNumber" type="string | null" required>Contact's phone number.</ResponseField>
<ResponseField name="email" type="string | null" required>Contact's email address.</ResponseField>
<ResponseField name="emailVerified" type="boolean" required>Whether the email has been verified.</ResponseField>
<ResponseField name="emailOptIn" type="boolean" required>Whether the contact opted in to email communications.</ResponseField>
<ResponseField name="firstName" type="string | null" required>Contact's first name.</ResponseField>
<ResponseField name="lastName" type="string | null" required>Contact's last name.</ResponseField>
<ResponseField name="fullName" type="string | null" required>Computed full name.</ResponseField>
<ResponseField name="gender" type="string | null" required>One of `male`, `female`, `unknown`.</ResponseField>
<ResponseField name="lastReadAt" type="string (date-time) | null" required>When the contact last read a message.</ResponseField>
<ResponseField name="ref" type="string | null" required>External reference identifier.</ResponseField>
<ResponseField name="country" type="string | null" required>Contact's country.</ResponseField>
<ResponseField name="state" type="string | null" required>Contact's state or region.</ResponseField>
<ResponseField name="city" type="string | null" required>Contact's city.</ResponseField>
<ResponseField name="locale" type="string | null" required>Contact's locale string.</ResponseField>
<ResponseField name="timezone" type="string | null" required>Contact's timezone.</ResponseField>
<ResponseField name="subscribedAt" type="string (date-time) | null" required>When the contact subscribed.</ResponseField>
<ResponseField name="broadcastSubscribedAt" type="string (date-time) | null" required>When the contact subscribed to broadcasts.</ResponseField>
<ResponseField name="blockedAt" type="string (date-time) | null" required>When blocked, or `null` if not blocked.</ResponseField>
<ResponseField name="workspaceId" type="string" required>ID of the owning Workspace.</ResponseField>
<ResponseField name="contactCustomFields" type="array" required>Custom field values for this contact.</ResponseField>
<ResponseField name="tags" type="array" required>Tags applied to this contact.</ResponseField>
<ResponseField name="contactNotes" type="array" required>Notes attached to this contact.</ResponseField>
<ResponseField name="contactInboxes" type="array" required>Active inbox connections for this contact.</ResponseField>
<ResponseField name="conversation" type="object | null" required>Most recent conversation object, or `null`.</ResponseField>

## Example Response

```json theme={null}
{
  "id": "clx1abc123",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2024-01-15T10:22:00Z",
  "avatar": null,
  "phoneNumber": "+84708123123",
  "email": "user@example.com",
  "emailVerified": true,
  "emailOptIn": true,
  "firstName": "Jane",
  "lastName": "Doe",
  "fullName": "Jane Doe",
  "gender": "female",
  "lastReadAt": "2024-01-14T08:00:00Z",
  "ref": null,
  "country": "VN",
  "state": null,
  "city": "Ho Chi Minh City",
  "location": null,
  "locale": "vi-VN",
  "timezone": "Asia/Ho_Chi_Minh",
  "subscribedAt": "2023-11-07T05:31:56Z",
  "broadcastSubscribedAt": "2023-11-07T05:31:56Z",
  "blockedAt": null,
  "workspaceId": "ws123",
  "contactCustomFields": [
    {
      "id": "cf1",
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z",
      "value": "premium",
      "contactId": "clx1abc123",
      "customFieldId": "field1"
    }
  ],
  "tags": [
    {
      "id": "tag1",
      "name": "VIP",
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z",
      "workspaceId": "ws123"
    }
  ],
  "contactNotes": [],
  "contactInboxes": [],
  "conversation": null
}
```
