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

# Fetch threads

<Snippet file="graphql/sdk-note.mdx" />

We provide a number of methods for fetching threads:

1. [Get a thread by ID](#get-a-thread-by-id)
2. [Get a thread by external ID](#get-a-thread-by-external-id)
3. [List threads](#list-threads) — paginated, with filters
4. [Search threads](#search-threads) — full-text search on title, description and message contents

All of these endpoints require the following permissions:

* `thread:read`

## Get a thread by ID

<Snippet file="graphql/get-thread-by-id.mdx" />

## Get a thread by external ID

A thread's `externalId` is unique within a customer, which is why the customer ID is required when looking up by external ID.

<Snippet file="graphql/get-thread-by-external-id.mdx" />

## List threads

The `threads` query supports rich filtering (status, status detail, assignee, customer, labels, priority, date ranges) and sorting. This is the right query for building inbox-style views.

<Snippet file="graphql/list-threads.mdx" />

## Search threads

`searchThreads` performs a full-text search across thread title, description and message contents. For exact lookups prefer [`thread`](#get-a-thread-by-id) or [`threadByExternalId`](#get-a-thread-by-external-id).

<Snippet file="graphql/search-threads.mdx" />
