Thread: Get v1
The Get Thread API allows you to retrieve thread information like its metadata and other details.
You will need to generate an API key to authenticate your requests. For more information, visit the User/Org API key documentation.
GET/v1/threads/{threadId}
Retrieve a thread by its ID.
Headers
- Name
Authorization
- Type
- string
- Required
- Required
- Description
Replace
YOUR_API_KEY
with your User/Org API key
Path Parameters
- Name
threadId
- Type
- string
- Required
- Required
- Description
The unique identifier of the thread to retrieve.
Install the SDK
npm i langbase
Environment variables
.env file
LANGBASE_API_KEY="<YOUR_API_KEY>"
Retrieve a thread
Get a thread
GET
/v1/threads/{threadId}curl https://api.langbase.com/v1/threads/{thread_id} \
-H 'Authorization: Bearer <YOUR_API_KEY>'
Response
The response is a ThreadsBaseResponse
object with information about the requested thread.
- Name
id
- Type
- string
- Description
The unique identifier for the thread.
- Name
object
- Type
- string
- Description
The type of object. Always "thread".
- Name
created_at
- Type
- number
- Description
The Unix timestamp (in seconds) for when the thread was created.
- Name
metadata
- Type
- Record<string, string>
- Description
The metadata associated with the thread. This may include custom fields that were added when the thread was created or updated.
Response Example
{
"id": "5c99a194-b084-4abb-9fb7-3045e4f7c4d4",
"object": "thread",
"created_at": 1714322048,
"metadata": {
"userId": "user123",
"topic": "support",
"status": "active",
"priority": "high"
}
}