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

# Get Contact by ID

> Retrieves a single contact by its unique identifier.

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url https://api.autosend.com/v1/contacts/{id} \
    --header 'Authorization: Bearer <token>'
  ```

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

  url = "https://api.autosend.com/v1/contacts/{id}"

  headers = {
      "Authorization": "Bearer <token>"
  }

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

  ```javascript JavaScript theme={null}
  fetch('https://api.autosend.com/v1/contacts/{id}', {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer <token>'
    }
  })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
  ```

  ```php PHP theme={null}
  <?php

  $url = 'https://api.autosend.com/v1/contacts/{id}';

  $ch = curl_init($url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_HTTPHEADER, [
      'Authorization: Bearer <token>'
  ]);

  $response = curl_exec($ch);
  curl_close($ch);

  echo $response;
  ?>
  ```

  ```go Go theme={null}
  package main

  import (
      "fmt"
      "net/http"
  )

  func main() {
      url := "https://api.autosend.com/v1/contacts/{id}"
      
      req, _ := http.NewRequest("GET", url, nil)
      req.Header.Set("Authorization", "Bearer <token>")
      
      client := &http.Client{}
      resp, err := client.Do(req)
      if err != nil {
          fmt.Println("Error:", err)
          return
      }
      defer resp.Body.Close()
      
      fmt.Println("Response Status:", resp.Status)
  }
  ```

  ```java Java theme={null}
  import java.net.HttpURLConnection;
  import java.net.URL;

  public class GetContactById {
      public static void main(String[] args) {
          try {
              URL url = new URL("https://api.autosend.com/v1/contacts/{id}");
              HttpURLConnection con = (HttpURLConnection) url.openConnection();
              
              con.setRequestMethod("GET");
              con.setRequestProperty("Authorization", "Bearer <token>");
              
              int status = con.getResponseCode();
              System.out.println("Response Status: " + status);
              
          } catch (Exception e) {
              e.printStackTrace();
          }
      }
  }
  ```

  ```ruby Ruby theme={null}
  require 'net/http'
  require 'uri'

  uri = URI('https://api.autosend.com/v1/contacts/{id}')

  http = Net::HTTP.new(uri.host, uri.port)
  http.use_ssl = true

  request = Net::HTTP::Get.new(uri.path)
  request['Authorization'] = 'Bearer <token>'

  response = http.request(request)
  puts response.body
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "data": {
      "id": "507f1f77bcf86cd799439011",
      "email": "john.doe@example.com",
      "firstName": "John",
      "lastName": "Doe",
      "userId": "user_12345",
      "customFields": {
        "company": "Acme Corp",
        "role": "Developer",
        "plan": "premium"
      },
      "listIds":["692822107f092ea9019d3af8"],
      "updatedAt": "2024-01-15T10:30:00.000Z",
      "createdAt": "2024-01-15T10:30:00.000Z",
      "projectId": "229f1f77bcf86cd9273048038"
    }
  }
  ```
</ResponseExample>

***

### Authorizations

<ParamField path="Authorizations" type="string | header" required>
  Bearer authentication header of the form Bearer `<token>`, where `<token>` is your auth token.
</ParamField>

### Path Parameters

<ParamField path="id" type="string" required>
  Unique contact ID

  Example: `"507f1f77bcf86cd799439011"`
</ParamField>

### Response

<span className="text-sm">Contact retrieved successfully</span>

<ResponseField name="success" type="boolean">
  Indicates if the request was successful

  Example: `true`
</ResponseField>

<ResponseField name="data" type="object">
  <Expandable title="child attributes">
    <ResponseField name="data.id" type="string">
      Contact ID

      Example: `"507f1f77bcf86cd799439011"`
    </ResponseField>

    <ResponseField name="data.email" type="string">
      Contact email address

      Example: `"john.doe@example.com"`
    </ResponseField>

    <ResponseField name="data.firstName" type="string">
      Contact's first name

      Example: `"John"`
    </ResponseField>

    <ResponseField name="data.lastName" type="string">
      Contact's last name

      Example: `"Doe"`
    </ResponseField>

    <ResponseField name="data.userId" type="string">
      Your application's user identifier

      Example: `"user_12345"`
    </ResponseField>

    <ResponseField name="data.customFields" type="object">
      Custom contact attributes

      <Expandable title="child attributes">
        <ResponseField name="customFields.{key}" type="string" />
      </Expandable>

      Example:

      ```jsx theme={null}
      {
        "company": "Acme Corp",
        "role": "Developer",
        "plan": "premium"
      }
      ```
    </ResponseField>

    <ResponseField name="data.createdAt" type="string">
      Contact creation timestamp

      Example: `"2024-01-15T10:30:00.000Z"`
    </ResponseField>

    <ResponseField name="data.updatedAt" type="string">
      Contact last update timestamp

      Example: `"2024-01-15T10:30:00.000Z"`
    </ResponseField>

    <ResponseField name="data.projectId" type="string">
      Project ID that the contact belongs to

      Example: `"229f1f77bcf86cd9273048038"`
    </ResponseField>

    <ResponseField name="data.listIds" type="array">
      Contact List IDs

      Example: `["507f1f77bcf86cd799439011"]`
    </ResponseField>
  </Expandable>
</ResponseField>


## OpenAPI

````yaml GET /contacts/{id}
openapi: 3.1.0
info:
  title: AutoSend API
  description: AutoSend REST API for managing contacts and sending emails
  version: 1.0.0
servers:
  - url: https://api.autosend.com/v1
security:
  - bearerAuth: []
paths:
  /contacts/{id}:
    get:
      summary: Get Contact by ID
      description: Retrieves a single contact by its unique identifier.
components: {}

````