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

# Get email by Id

> Get email by Id

Get email by Id

```http theme={null}
GET https://services.leadconnectorhq.com/conversations/messages/email/{id}
```

## Autorización

<ParamField header="Authorization" type="string" required>
  Bearer token generado desde el portal Leadway. Ver [Autenticación](/authentication).
</ParamField>

<ParamField header="Version" type="string" required default="2021-07-28">
  Versión de la API.
</ParamField>

## Respuestas

<Accordion title="200 - Email object for the id given.">
  <ResponseField name="id" type="string" required default="ve9EPM428h8vShlRW1KT" />

  <ResponseField name="altId" type="string" default="ve9EPM428h8vShlRW1KT">
    External Id
  </ResponseField>

  <ResponseField name="threadId" type="string" required default="ve9EPM428h8vShlRW1KT">
    Message Id or thread Id
  </ResponseField>

  <ResponseField name="locationId" type="string" required default="ve9EPM428h8vShlRW1KT" />

  <ResponseField name="contactId" type="string" required default="ve9EPM428h8vShlRW1KT" />

  <ResponseField name="conversationId" type="string" required default="ve9EPM428h8vShlRW1KT" />

  <ResponseField name="dateAdded" type="string" required default="2024-03-27T18:13:49.000Z" />

  <ResponseField name="subject" type="string" default="Order confirm" />

  <ResponseField name="body" type="string" required default="Hi there" />

  <ResponseField name="direction" type="string" required>
    Posibles valores: 'inbound', 'outbound'
  </ResponseField>

  <ResponseField name="status" type="string">
    Posibles valores: 'pending', 'scheduled', 'sent', 'delivered', 'read', 'undelivered', 'connected', 'failed', 'opened'
  </ResponseField>

  <ResponseField name="contentType" type="string" required default="text/plain" />

  <ResponseField name="attachments" type="string[]">
    An array of attachment URLs.
  </ResponseField>

  <ResponseField name="provider" type="string" />

  <ResponseField name="from" type="string" required>
    Name and Email Id of the sender
  </ResponseField>

  <ResponseField name="to" type="string[]" required>
    List of email Ids of the receivers
  </ResponseField>

  <ResponseField name="cc" type="string[]">
    List of email Ids of the people in the cc field
  </ResponseField>

  <ResponseField name="bcc" type="string[]">
    List of email Ids of the people in the bcc field
  </ResponseField>

  <ResponseField name="replyToMessageId" type="string">
    In case of reply, email message Id of the reply to email
  </ResponseField>

  <ResponseField name="source" type="string">
    Email source Posibles valores: 'workflow', 'bulk\_actions', 'campaign', 'api', 'app'
  </ResponseField>

  <ResponseField name="conversationProviderId" type="string" default="cI08i1Bls3iTB9bKgF01">
    Conversation provider ID
  </ResponseField>

  ```json theme={null}
  {
    "id": "ve9EPM428h8vShlRW1KT",
    "altId": "ve9EPM428h8vShlRW1KT",
    "threadId": "ve9EPM428h8vShlRW1KT",
    "locationId": "ve9EPM428h8vShlRW1KT",
    "contactId": "ve9EPM428h8vShlRW1KT",
    "conversationId": "ve9EPM428h8vShlRW1KT",
    "dateAdded": "2024-03-27T18:13:49.000Z",
    "subject": "Order confirm",
    "body": "Hi there",
    "direction": "inbound",
    "status": "pending",
    "contentType": "text/plain",
    "attachments": [
      "string"
    ],
    "provider": "string",
    "from": "string",
    "to": [
      "string"
    ],
    "cc": [
      "string"
    ],
    "bcc": [
      "string"
    ],
    "replyToMessageId": "string",
    "source": "workflow",
    "conversationProviderId": "cI08i1Bls3iTB9bKgF01"
  }
  ```
</Accordion>

## Ejemplo

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET 'https://services.leadconnectorhq.com/conversations/messages/email/YOUR_id' \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -H 'Version: 2021-07-28'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://services.leadconnectorhq.com/conversations/messages/email/YOUR_id', {
    method: 'GET',
    headers: {
      Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
      Version: '2021-07-28',
    },
  });
  const data = await response.json();
  ```

  ```python Python theme={null}
  import os, requests
  response = requests.request(
      'GET',
      'https://services.leadconnectorhq.com/conversations/messages/email/YOUR_id',
      headers={
          'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
          'Version': '2021-07-28',
      },
  )
  data = response.json()
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://services.leadconnectorhq.com/conversations/messages/email/YOUR_id');
  curl_setopt_array($ch, [
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_CUSTOMREQUEST => 'GET',
      CURLOPT_HTTPHEADER => [
          'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
          'Version: 2021-07-28',
      ],
  ]);
  $data = json_decode(curl_exec($ch), true);
  ```
</CodeGroup>
