List Threads
/threads List threads from your workspace, with optional filtering and pagination. An M2M client lists all threads of its workspace, including private and group-shared threads. A Sign in with Amp access token lists only the threads its user can see in the application’s workspace, as the Amp app lists them: their own threads, threads shared with the workspace or by link, and threads shared with them or their groups; this is experimental, requires access from the Amp team, and is limited for now to the Amp team’s own project, to `orderBy=updatedAt` with an `updatedAfter` in the last 25 hours, and to listing without `query`. Threads are listed by time of first sync in ascending order for sorting stability, unless `orderBy` says otherwise.
OAuth Scopes
amp.api:workspace.threads.meta:viewQuery Parameters
limit Maximum number of results to return.
integer Default: 50
cursor Cursor for pagination to get the next set of results.
string query Search query to filter threads by content. A Sign in with Amp access token needs the 'amp.api:workspace.threads.contents:view' scope to search.
string project Only include threads in this project. Accepts a project ID (UUID) or namespace/name (case insensitive). The project must belong to the workspace. Returns 400 if the project is not found in the workspace.
value string · uuid string after Only include threads where the thread's initial sync time is after this date (ISO 8601 format). Not allowed with `orderBy=updatedAt`.
string · date-time before Only include threads where the thread's initial sync time is before this date (ISO 8601 format). Not allowed with `orderBy=updatedAt`.
string · date-time updatedAfter Only include threads last updated after this date (ISO 8601 format). Requires `orderBy=updatedAt`.
string · date-time orderBy Which time to list threads by: firstSyncedAt, the initial sync time (default), which keeps pages stable, or updatedAt, the last update time, to find recently active threads. A thread that is updated while you page by updatedAt moves, so it can appear on two pages or on none; dedupe by `id`.
string firstSyncedAt | updatedAtsort Sort order for results. ASC = oldest first (default), DESC = newest first.
string ASC | DESCvisibility Only include threads with this sharing setting: private (only the creator, plus anyone it is shared with directly), group_shared (shared with groups), workspace_shared (every workspace member), or public_unlisted (anyone with the link). Use workspace_shared to leave out threads that not every member can read.
string private | group_shared | workspace_shared | public_unlisteduserEmail Only include threads created by the user with this email address. The user must be a current workspace member or have created threads in the workspace, such as a former member. Not allowed with a Sign in with Amp access token; use `userID`.
string · email userID Only include threads created by the user with this user ID. For an M2M client, the user must be a current workspace member or have created threads in the workspace, such as a former member.
string HTTP Request
curl 'https://ampcode.com/api/v2/threads?limit=50' \ --request GET \ --header 'Authorization: Bearer <token>' \ --header 'Accept: application/json'
HTTP Response
200 Content Type application/json {
"nextCursor": "string",
"threads": [
{
"id": "string",
"title": "string",
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z",
"firstSyncedAt": "2026-01-01T00:00:00.000Z",
"creatorUserID": "string",
"agentState": {
"state": "working",
"updatedAt": "2026-01-01T00:00:00.000Z"
},
"hostname": "string",
"mainThreadID": "string",
"parentThreadID": "string",
"repositories": [
{
"url": "string",
"dir": "string"
}
],
"labels": [
"string"
]
}
]
}Responses
200 The request has succeeded.
Response Body
application/jsonobject Response model for thread list operations
nextCursorstring Pagination cursor for getting the next set of results.
threadsREQUIREDarray Array of threads matching the query
object A conversation thread in Amp
idREQUIREDstring Unique identifier for the thread.
titlestring Title of the thread. Only returned if an M2M client or Sign in with Amp access token has the 'amp.api:workspace.threads.contents:view' scope; a personal access token with the 'amp.api:threads:view' scope always gets it.
createdAtstring · date-time When the thread was created.
updatedAtstring · date-time When the thread was last updated.
firstSyncedAtstring · date-time When the thread was first synced.
creatorUserIDREQUIREDstring User ID of the thread creator.
agentStateobject Last state the thread’s agent reported, which can trail the agent by about 10 seconds. Unset until the agent first reports, so a thread just created has none; keep polling until it is set.
stateREQUIREDstring working | idle | awaiting_approval | errorworking: the agent is running a turn. idle: the agent finished its turn and waits for the next message. awaiting_approval: the agent waits for a person to approve a tool call. error: the turn stopped on an error; Amp may retry it on its own.
updatedAtREQUIREDstring · date-time When the agent reported this state.
hostnamestring Hostname of the machine running a local CLI or runner executor. Only returned if an M2M client or Sign in with Amp access token has the 'amp.api:workspace.threads.contents:view' scope; a personal access token with the 'amp.api:threads:view' scope always gets it.
mainThreadIDstring ID of the main thread, if this is a sub-thread
parentThreadIDstring ID of the thread whose execution created this thread (for example a child thread spawned by another thread with create_thread, by Puck, or by a plugin). Unset for threads without a parent, and becomes unset if the parent thread is deleted. A creating thread in another workspace is not returned.
repositoriesarray Repositories in which this thread started working. Only returned if an M2M client or Sign in with Amp access token has the 'amp.api:workspace.threads.contents:view' scope; a personal access token with the 'amp.api:threads:view' scope always gets it.
object urlREQUIREDstring The normalized URL to the repository (e.g., https://github.com/owner/repo). Normalization is not guaranteed (e.g., for obscure or ambiguous SSH Git remote URL formats), so you should inspect for outliers.
dirstring The subdirectory within the repository in which the thread started working. Omitted if it is the root directory of the repository.
labelsarray Normalized label names attached to the thread, sorted alphabetically. An empty array means the thread has no labels. Only returned if an M2M client or Sign in with Amp access token has the 'amp.api:workspace.threads.contents:view' scope; a personal access token with the 'amp.api:threads:view' scope always gets it.
string subThreadsarray Sub-threads belonging to this thread.
v2.Thread A conversation thread in Amp
idREQUIREDstring Unique identifier for the thread.
titlestring Title of the thread. Only returned if an M2M client or Sign in with Amp access token has the 'amp.api:workspace.threads.contents:view' scope; a personal access token with the 'amp.api:threads:view' scope always gets it.
createdAtstring · date-time When the thread was created.
updatedAtstring · date-time When the thread was last updated.
firstSyncedAtstring · date-time When the thread was first synced.
creatorUserIDREQUIREDstring User ID of the thread creator.
agentStateobject Last state the thread’s agent reported, which can trail the agent by about 10 seconds. Unset until the agent first reports, so a thread just created has none; keep polling until it is set.
stateREQUIREDstring working | idle | awaiting_approval | errorworking: the agent is running a turn. idle: the agent finished its turn and waits for the next message. awaiting_approval: the agent waits for a person to approve a tool call. error: the turn stopped on an error; Amp may retry it on its own.
updatedAtREQUIREDstring · date-time When the agent reported this state.
hostnamestring Hostname of the machine running a local CLI or runner executor. Only returned if an M2M client or Sign in with Amp access token has the 'amp.api:workspace.threads.contents:view' scope; a personal access token with the 'amp.api:threads:view' scope always gets it.
mainThreadIDstring ID of the main thread, if this is a sub-thread
parentThreadIDstring ID of the thread whose execution created this thread (for example a child thread spawned by another thread with create_thread, by Puck, or by a plugin). Unset for threads without a parent, and becomes unset if the parent thread is deleted. A creating thread in another workspace is not returned.
repositoriesarray Repositories in which this thread started working. Only returned if an M2M client or Sign in with Amp access token has the 'amp.api:workspace.threads.contents:view' scope; a personal access token with the 'amp.api:threads:view' scope always gets it.
object urlREQUIREDstring The normalized URL to the repository (e.g., https://github.com/owner/repo). Normalization is not guaranteed (e.g., for obscure or ambiguous SSH Git remote URL formats), so you should inspect for outliers.
dirstring The subdirectory within the repository in which the thread started working. Omitted if it is the root directory of the repository.
labelsarray Normalized label names attached to the thread, sorted alphabetically. An empty array means the thread has no labels. Only returned if an M2M client or Sign in with Amp access token has the 'amp.api:workspace.threads.contents:view' scope; a personal access token with the 'amp.api:threads:view' scope always gets it.
string subThreadsarray Sub-threads belonging to this thread.
v2.Thread A conversation thread in Amp
idREQUIREDstring Unique identifier for the thread.
titlestring Title of the thread. Only returned if an M2M client or Sign in with Amp access token has the 'amp.api:workspace.threads.contents:view' scope; a personal access token with the 'amp.api:threads:view' scope always gets it.
createdAtstring · date-time When the thread was created.
updatedAtstring · date-time When the thread was last updated.
firstSyncedAtstring · date-time When the thread was first synced.
creatorUserIDREQUIREDstring User ID of the thread creator.
agentStateobject Last state the thread’s agent reported, which can trail the agent by about 10 seconds. Unset until the agent first reports, so a thread just created has none; keep polling until it is set.
stateREQUIREDstring working | idle | awaiting_approval | errorworking: the agent is running a turn. idle: the agent finished its turn and waits for the next message. awaiting_approval: the agent waits for a person to approve a tool call. error: the turn stopped on an error; Amp may retry it on its own.
updatedAtREQUIREDstring · date-time When the agent reported this state.
hostnamestring Hostname of the machine running a local CLI or runner executor. Only returned if an M2M client or Sign in with Amp access token has the 'amp.api:workspace.threads.contents:view' scope; a personal access token with the 'amp.api:threads:view' scope always gets it.
mainThreadIDstring ID of the main thread, if this is a sub-thread
parentThreadIDstring ID of the thread whose execution created this thread (for example a child thread spawned by another thread with create_thread, by Puck, or by a plugin). Unset for threads without a parent, and becomes unset if the parent thread is deleted. A creating thread in another workspace is not returned.
repositoriesarray Repositories in which this thread started working. Only returned if an M2M client or Sign in with Amp access token has the 'amp.api:workspace.threads.contents:view' scope; a personal access token with the 'amp.api:threads:view' scope always gets it.
object labelsarray Normalized label names attached to the thread, sorted alphabetically. An empty array means the thread has no labels. Only returned if an M2M client or Sign in with Amp access token has the 'amp.api:workspace.threads.contents:view' scope; a personal access token with the 'amp.api:threads:view' scope always gets it.
string subThreadsarray Sub-threads belonging to this thread.
v2.Thread A conversation thread in Amp
Example
{
"nextCursor": "string",
"threads": [
{
"id": "string",
"title": "string",
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z",
"firstSyncedAt": "2026-01-01T00:00:00.000Z",
"creatorUserID": "string",
"agentState": {
"state": "working",
"updatedAt": "2026-01-01T00:00:00.000Z"
},
"hostname": "string",
"mainThreadID": "string",
"parentThreadID": "string",
"repositories": [
{
"url": "string",
"dir": "string"
}
],
"labels": [
"string"
]
}
]
} 400 Invalid query parameters
Response Body
application/jsonobject errorREQUIREDstring Error message describing what went wrong
Example
{
"error": "string"
} 401 Unauthorized
Response Body
application/jsonobject errorREQUIREDstring Error message describing what went wrong
Example
{
"error": "string"
} 403 Forbidden: missing scope(s), or a Sign in with Amp application or user without access
Response Body
application/jsonobject errorREQUIREDstring Error message describing what went wrong
Example
{
"error": "string"
} 500 Internal server error
Response Body
application/jsonobject errorREQUIREDstring Error message describing what went wrong
Example
{
"error": "string"
}