---
title: "GET /v2/threads/{threadId}"
method: GET
path: "/v2/threads/{threadId}"
---

# GET /v2/threads/{threadId}

`GET /v2/threads/{threadId}`

## Request

- Base URL: `https://api.langtail.com`
- URL: `https://api.langtail.com/v2/threads/{threadId}`
- Auth: none declared. Required headers: `X-API-Key`

Retrieves a thread by its ID.

## Path parameters

- `threadId` string, required

## Headers

- `X-API-Key` string, required

## Response `200`

Successful response

- object
  - `id` string, required: The unique identifier for the thread.
  - `createdAt` integer, required: The Unix timestamp (in seconds) of when the thread was created.
  - `projectId` string, required: The ID of the project this thread belongs to.
  - `deletedAt` string, date-time, nullable: The timestamp when the thread was deleted, if applicable.
  - `createLog` object, nullable: A log created by the first message that creates the thread.
    - `id` string: The unique identifier for the log.
    - `url` string: The URL of the request.
    - `stream` boolean: Indicates if the request was streamed.
    - `metadata` string: Additional metadata associated with the log.
    - `promptId` string: The ID of the prompt used.
    - `threadId` string, nullable: The ID of the associated thread, if any.
    - `assistant` boolean: Indicates if an assistant was used.
    - `projectId` string: The ID of the project.
    - `requestIP` string: The IP address of the request.
    - `startedAt` string, date-time: The timestamp when the request started.
    - `variables` string: Variables used in the request.
    - `parameters` string: Parameters used in the request.
    - `promptSlug` string: The slug of the prompt used.
    - `doNotRecord` boolean: Indicates if the request should not be recorded.
    - `environment` string: The environment in which the request was made.
    - `openAIKeyId` string: The ID of the OpenAI key used.
    - `projectSlug` string: The slug of the project.
    - `requestData` string: Data associated with the request.
    - `deploymentId` string: The ID of the deployment.
    - `organizationId` string: The ID of the organization.
    - `projectAPIKeyId` string: The ID of the project API key.
    - `organizationSlug` string: The slug of the organization.
    - `deploymentVersion` string, nullable: The version of the deployment, if applicable.
    - `promptHistoryHash` string: A hash of the prompt history.
    - `openAIOrganization` string, nullable: The OpenAI organization, if applicable.
  - `metadata` object, nullable: A set of key-value pairs that can be attached to the thread. This can be used to store additional information about the thread to facilitate filtering or organization.

## Other responses

- `404`: Thread not found or not in the project

---

[API](https://skmtc.dev/langtail/apis/langtail-prompt-endpoint.md) - [All operations](https://skmtc.dev/langtail/apis/langtail-prompt-endpoint/llms.txt) - [OpenAPI document](https://skmtc.dev/langtail/apis/langtail-prompt-endpoint/revisions/7186c80b2e39?raw)
