Skip to main content
GET
/
api
/
threads
List Threads
curl --request GET \
  --url https://api.example.com/api/threads
{
  "id": "<string>",
  "serviceId": "<string>",
  "subject": "<string>",
  "customerEmail": "<string>",
  "customerName": "<string>",
  "categoryId": "<string>",
  "status": "<string>",
  "detectedLanguage": "<string>",
  "isRead": true,
  "lastMessageAt": "<string>",
  "draft": "<string>",
  "draftSubject": "<string>",
  "draftAttachments": [
    {}
  ],
  "translation": "<string>",
  "lastMessagePreview": "<string>",
  "messageCount": 123,
  "messages": [
    {
      "id": "<string>",
      "fromEmail": "<string>",
      "fromName": "<string>",
      "toEmail": "<string>",
      "body": "<string>",
      "direction": "<string>",
      "timestamp": "<string>",
      "attachments": [
        {}
      ]
    }
  ],
  "error": "<string>"
}
Retrieves a paginated list of email threads for a specific service account, ordered by most recent activity.

Authentication

Requires active session. User must be authenticated. Permission Level: Any authenticated user (view, edit, send, or admin)

Query Parameters

serviceId
string
required
The ID of the Gmail service account to fetch threads from. Must be a valid gmailAccounts.id.
includeMessages
string
default:"0"
Set to 1 to include full message arrays in the response. When 0 (default), only messageCount and lastMessagePreview are returned.
limit
number
default:"100"
Maximum number of threads to return. Must be between 1 and 200. Values outside this range are clamped.

Response

Returns an array of thread objects, ordered by lastMessageAt descending.
id
string
Unique thread identifier
serviceId
string
ID of the service account this thread belongs to
subject
string
Email thread subject line
customerEmail
string
Email address of the customer/sender
customerName
string
Display name of the customer/sender
categoryId
string
ID of the category assigned to this thread (empty string if none)
status
string
Thread status: inbox, sent, or archived
detectedLanguage
string
ISO language code detected from the thread content (e.g., en, ko)
isRead
boolean
Whether the thread has been marked as read
lastMessageAt
string
ISO 8601 timestamp of the most recent message in the thread
draft
string
HTML content of the draft reply (empty string if no draft exists)
draftSubject
string
Subject line for the draft (defaults to Re: {subject})
draftAttachments
array
Array of draft attachments (currently always empty)
translation
string
Translated version of the draft content (empty if no translation)
lastMessagePreview
string
Plain text preview of the most recent message with HTML stripped
messageCount
number
Total number of messages in the thread
messages
array
Array of message objects (only included when includeMessages=1)

Error Responses

error
string
Error message describing what went wrong
Status 400: Missing required serviceId parameter
{
  "error": "serviceId required"
}
Status 401: User is not authenticated

Examples

curl -X GET 'https://app.delightbridge.com/api/threads?serviceId=service_123&limit=50' \
  -H 'Cookie: session=...'

Response Example

[
  {
    "id": "thread_abc123",
    "serviceId": "service_123",
    "subject": "Question about order #5678",
    "customerEmail": "[email protected]",
    "customerName": "Jane Smith",
    "categoryId": "cat_support",
    "status": "inbox",
    "detectedLanguage": "en",
    "isRead": false,
    "lastMessageAt": "2026-03-01T10:30:00.000Z",
    "draft": "<p>Thank you for reaching out. We're looking into this.</p>",
    "draftSubject": "Re: Question about order #5678",
    "draftAttachments": [],
    "translation": "",
    "lastMessagePreview": "I have a question about my recent order...",
    "messageCount": 2,
    "messages": []
  }
]

Build docs developers (and LLMs) love