---
title: "List emails"
method: GET
path: "/cases/{case_id}/emails"
tags: ["Emails"]
---

# List emails

`GET /cases/{case_id}/emails`

## Request

- Base URL: `https://api.example.com/v1`
- URL: `https://api.example.com/v1/cases/{case_id}/emails`
- Auth: none declared

List all emails sent for a case, including delivery status and receipts.

## Query parameters

- `page` integer
- `per_page` integer
- `status` 'draft' | 'queued' | 'sent' | 'delivered' | 'bounced' | 'failed'
- `institution_contact_id` string
- `sort_by` 'created_at' | 'sent_at'
- `sort_order` 'asc' | 'desc'

## Response `200`

List of emails.

- object
  - `data` Email[]
    - `id` string
    - `institution_contact_id` string, nullable: Reference to the institution contact emailed.
    - `to_addresses` string[]
    - `cc_addresses` string[]
    - `from_address` string, email: Sunset-managed sender address.
    - `subject` string
    - `body_text` string: Plain text version of the email body.
    - `body_html` string, nullable: HTML version of the email body.
    - `attachments` object[]
      - `id` string
      - `file_name` string
      - `file_size_bytes` integer
      - `mime_type` string
      - `document_id` string, nullable: Reference to a case document, if attached from the case.
    - `status` 'draft' | 'queued' | 'sent' | 'delivered' | 'bounced' | 'failed'
    - `sent_at` string, date-time, nullable
    - `delivered_at` string, date-time, nullable
    - `opened_at` string, date-time, nullable: Timestamp when the recipient opened the email (if tracking is available).
    - `bounce_reason` string, nullable
    - `sent_by` string, nullable: User ID of the person who sent the email.
    - `receipt` object, nullable: Delivery receipt details.
      - `message_id` string
      - `provider` string
      - `status` 'accepted' | 'delivered' | 'bounced' | 'deferred'
      - `status_detail` string, nullable
      - `timestamp` string, date-time
    - `notes` string, nullable
    - `created_at` string, date-time
    - `updated_at` string, date-time
  - `meta` PaginationMeta
    - `page` integer
    - `per_page` integer
    - `total_count` integer
    - `total_pages` integer
    - `next_cursor` string, nullable: Opaque cursor for fetching the next page. Pass as the `cursor` query parameter. Null when on the last page.
    - `has_more` boolean: Whether more results exist beyond this page.

## Other responses

- `404`: Resource not found.

---

[API](https://skmtc.dev/hellosunset/apis/sunset-api.md) - [All operations](https://skmtc.dev/hellosunset/apis/sunset-api/llms.txt) - [OpenAPI document](https://skmtc.dev/hellosunset/apis/sunset-api/revisions/f128e5526efe?raw)
