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

# Email Logs

> Retrieve a paginated list of transactional emails sent from your project.

## Headers

<ParamField header="Authorization" type="string" required>
  `Bearer YOUR_API_KEY`
</ParamField>

## Query Parameters

<ParamField query="type" type="string">
  Filter by email type. Values: `transactional`, `campaign`, `magic_link`, `welcome`, `invite`.
</ParamField>

<ParamField query="limit" type="number" default="50">
  Number of results to return. Max `100`.
</ParamField>

<ParamField query="offset" type="number" default="0">
  Number of results to skip for pagination.
</ParamField>

## Response

<ResponseField name="logs" type="array">
  Array of log objects.

  <Expandable title="Log object">
    <ResponseField name="id" type="string">Log entry UUID.</ResponseField>
    <ResponseField name="to_email" type="string">Recipient email address.</ResponseField>
    <ResponseField name="from_email" type="string">Sender address used.</ResponseField>
    <ResponseField name="subject" type="string">Email subject.</ResponseField>
    <ResponseField name="email_type" type="string">Type of email — `transactional`, `campaign`, `magic_link`, `welcome`, or `invite`.</ResponseField>
    <ResponseField name="status" type="string">`sent`, `delivered`, `bounced`, or `failed`.</ResponseField>
    <ResponseField name="message_id" type="string">Provider message ID.</ResponseField>
    <ResponseField name="open_count" type="number">Number of times the email was opened.</ResponseField>
    <ResponseField name="click_count" type="number">Number of tracked link clicks.</ResponseField>
    <ResponseField name="sent_at" type="string">ISO 8601 timestamp of when the email was sent.</ResponseField>
    <ResponseField name="opened_at" type="string">Timestamp of first open (if opened).</ResponseField>
    <ResponseField name="tags" type="object">Custom metadata tags attached at send time.</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="total" type="number">
  Total count of matching log entries.
</ResponseField>

<ResponseField name="limit" type="number">
  Page size used for this request.
</ResponseField>

<ResponseField name="offset" type="number">
  Offset used for this request.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.usegately.com/api/v1/email/logs?type=transactional&limit=10" \
    -H "Authorization: Bearer gately_YOUR_API_KEY"
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    'https://api.usegately.com/api/v1/email/logs?type=transactional&limit=10',
    {
      headers: {
        'Authorization': 'Bearer gately_YOUR_API_KEY',
      },
    }
  );

  const { logs, total } = await response.json();
  ```

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

  response = requests.get(
      'https://api.usegately.com/api/v1/email/logs',
      headers={'Authorization': 'Bearer gately_YOUR_API_KEY'},
      params={'type': 'transactional', 'limit': 10},
  )

  print(response.json())
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={null}
  {
    "logs": [
      {
        "id": "a1b2c3d4-e5f6-...",
        "to_email": "user@example.com",
        "from_email": "hello@yourdomain.com",
        "subject": "Welcome to Acme!",
        "email_type": "transactional",
        "status": "sent",
        "message_id": "0100019fc2ed413a-69325b2f-...",
        "open_count": 2,
        "click_count": 1,
        "sent_at": "2026-08-02T10:30:00Z",
        "opened_at": "2026-08-02T10:35:00Z",
        "tags": { "type": "welcome" }
      }
    ],
    "total": 42,
    "limit": 10,
    "offset": 0
  }
  ```

  ```json Unauthorized (401) theme={null}
  {
    "error": "Invalid or missing API key"
  }
  ```
</ResponseExample>
