Retrieve Thread
GEThttps://api.confident-ai.com/v1/threads/{threadId}
Retrieves a thread by ID from your Confident AI project.
curl -X GET "https://api.confident-ai.com/v1/threads/{threadId}" \
-H "CONFIDENT_API_KEY: <PROJECT-API-KEY>"{
"success": true,
"data": {
"threadId": "thread-123",
"createdAt": "2025-01-15T10:30:00Z",
"lastActivity": "2025-01-15T11:45:00Z",
"metadata": {
"userId": "user-456"
},
"tags": [
"support"
],
"metricCollectionName": "conversation-metrics",
"totalTraces": 5,
"metricsData": [
{
"metricName": "Answer Relevancy",
"score": 0.95
}
],
"annotations": [
{
"id": "annotation-1",
"rating": 5
}
],
"traces": [
{
"id": "TRACE-ID",
"uuid": "trace-uuid-1",
"name": "User Message",
"startTime": "2025-01-15T10:30:00Z",
"endTime": "2025-01-15T10:30:05Z",
"input": "Hello, I need help",
"output": "Hi! How can I assist you today?",
"environment": "production"
}
]
},
"deprecated": false
}Headers
CONFIDENT_API_KEYstringRequiredThe API key of your Confident AI project.
Path parameters
threadIdstringRequiredThis is the thread ID you wish to retrieve.
Response
successbooleanThis is true if the thread was successfully retrieved.
dataobjectThis maps to the thread retrieved.
Show 10 propertiesHide 10 properties
threadIdstringThis is the thread ID you supplied when creating the thread.
createdAtstringThis is when the thread was created.
lastActivitystringThis is when the thread was last active.
metadataobjectThis is the custom metadata attached to the thread.
tagslist of stringsThis is the list of tags associated with the thread.
metricCollectionNamestringThis is the name of the metric collection assigned to evaluate the thread.
totalTracesintegerThis is the total number of traces in this thread.
metricsDatalist of objectsThis is the evaluation metrics data for the thread.
Show 21 propertiesHide 21 properties
idstringThe unique identifier of the metrics data entry.
projectIdstringThe project this metric data belongs to.
traceUuidstringThe UUID of the trace this metric data is associated with, if any.
spanUuidstringThe UUID of the span this metric data is associated with, if any.
testCaseIdstringThe ID of the test case this metric data is associated with, if any.
testRunIdstringThe ID of the test run this metric data is associated with, if any.
threadIdstringThe ID of the thread this metric data is associated with, if any.
namestringThe name of the metric.
multiTurnbooleanWhether this metric was evaluated on a multi-turn conversation.
scorenumberThe final metric score.
reasonstringThe reason for the metric score, generated by the evaluation model at evaluation time.
successbooleanWhether the metric score is above the threshold.
createdAtstringThe time the metric data was created.
evaluatedAtstringThe time the metric was evaluated.
thresholdnumberThe threshold for the metric, which determines if the metric is passing or failing.
strictModebooleanWhether the metric was run in strict mode, which outputs a binary score of 0 or 1.
skippedbooleanWhether the metric evaluation was skipped.
evaluationModelstringThe evaluation model used to run the evaluation.
errorstringThe error message if the evaluation failed.
evaluationCostnumberThe cost of running the evaluation.
verboseLogsstringThe verbose logs of the evaluation, which breaks down the metric score calculation into individual steps.
annotationslist of objectsThis is the list of annotations associated with the thread.
Show 14 propertiesHide 14 properties
idstringThis is the id of the annotation generated by Confident AI, not to be confused with the alias you supplied or version number.
ratingintegerThis is the annotated rating score.
typeenumThis is the type of annotation, which can be either thumbs rating or five star rating.
Show 2 enum valuesHide 2 enum values
THUMBS_RATINGFIVE_STAR_RATING
namestringThe name of the annotation.
expectedOutcomestringThis is the annotated expected outcome, for conversation annotations.
expectedOutputstringThis is the annotated expected output, for span and trace annotations.
explanationstringThis is the explanation for the annotation.
createdAtstringThe timestamp when the annotation was created.
traceUuidstringThe UUID of the trace associated with this annotation, if applicable.
spanUuidstringThe UUID of the span associated with this annotation, if applicable.
threadIdstringThe ID of the thread associated with this annotation, if applicable.
testCaseIdstringThe ID of the test case associated with this annotation, if applicable.
userobjectThe user who created this annotation.
Show 4 propertiesHide 4 properties
idstringThe id of the user.
emailstringThe email address of the user.
namestringThe name of the user.
imagestringThe image of the user.
userEmailstringThe email address of the user created this annotation. The field is being deprecated. Please use
user.emailinstead.
traceslist of objectsThis is the list of traces in this thread.
Show 21 propertiesHide 21 properties
uuidstringThis is the uuid of the trace, not to be confused with the trace id.
inputanyThis is the input to the trace.
outputanyThis is the output of the trace.
startTimestringThis is the time the span started.
endTimestringThis is the time the span ended.
namestringThis is the name of the trace.
metadataobjectThis is any additional metadata associated with the span.
environmentenumThis is the environment where the trace was created.
Show 4 enum valuesHide 4 enum values
productiondevelopmentstagingtesting
threadIdstringThis is the thread id of the trace, which groups traces in the same thread into a conversation.
testCaseIdstringThis is the test case id of the trace, which is only set if the trace was created in a testing environment.
userIdstringThis is the user id you provided for this trace.
projectIdstringThis is the id of the project where the trace lives.
metricCollectionNamestringThis is the name of the metric collection assigned to evaluate the trace.
retrievalContextlist of stringsThis is the retrieval context associated with the trace, to be used for evaluations.
contextlist of stringsThis is the ideal retrieval context associated with the trace, to be used for evaluations.
expectedOutputlist of objectsThis is the expected output associated with the trace, to be used for evaluations.
Show 5 propertiesHide 5 properties
namestringThis is the name of the tool.
descriptionstringThis is the description of the tool.
inputParametersobjectThis is the input parameters that are passed to the tool.
outputstringThis is the output of the tool.
reasoningstringThis is the reasoning your LLM provided for the tool call.
expectedToolslist of objectsThis is the list of expected tools associated with the trace, to be used for evaluations.
Show 5 propertiesHide 5 properties
namestringThis is the name of the tool.
descriptionstringThis is the description of the tool.
inputParametersobjectThis is the input parameters that are passed to the tool.
outputstringThis is the output of the tool.
reasoningstringThis is the reasoning your LLM provided for the tool call.
metricsDatalist of objectsThis is the list of metrics data associated with the trace after running evaluations.
Show 21 propertiesHide 21 properties
idstringThe unique identifier of the metrics data entry.
projectIdstringThe project this metric data belongs to.
traceUuidstringThe UUID of the trace this metric data is associated with, if any.
spanUuidstringThe UUID of the span this metric data is associated with, if any.
testCaseIdstringThe ID of the test case this metric data is associated with, if any.
testRunIdstringThe ID of the test run this metric data is associated with, if any.
threadIdstringThe ID of the thread this metric data is associated with, if any.
namestringThe name of the metric.
multiTurnbooleanWhether this metric was evaluated on a multi-turn conversation.
scorenumberThe final metric score.
reasonstringThe reason for the metric score, generated by the evaluation model at evaluation time.
successbooleanWhether the metric score is above the threshold.
createdAtstringThe time the metric data was created.
evaluatedAtstringThe time the metric was evaluated.
thresholdnumberThe threshold for the metric, which determines if the metric is passing or failing.
strictModebooleanWhether the metric was run in strict mode, which outputs a binary score of 0 or 1.
skippedbooleanWhether the metric evaluation was skipped.
evaluationModelstringThe evaluation model used to run the evaluation.
errorstringThe error message if the evaluation failed.
evaluationCostnumberThe cost of running the evaluation.
verboseLogsstringThe verbose logs of the evaluation, which breaks down the metric score calculation into individual steps.
annotationobjectThis is the text annotation for the trace.
Show 14 propertiesHide 14 properties
idstringThis is the id of the annotation generated by Confident AI, not to be confused with the alias you supplied or version number.
ratingintegerThis is the annotated rating score.
typeenumThis is the type of annotation, which can be either thumbs rating or five star rating.
Show 2 enum valuesHide 2 enum values
THUMBS_RATINGFIVE_STAR_RATING
namestringThe name of the annotation.
expectedOutcomestringThis is the annotated expected outcome, for conversation annotations.
expectedOutputstringThis is the annotated expected output, for span and trace annotations.
explanationstringThis is the explanation for the annotation.
createdAtstringThe timestamp when the annotation was created.
traceUuidstringThe UUID of the trace associated with this annotation, if applicable.
spanUuidstringThe UUID of the span associated with this annotation, if applicable.
threadIdstringThe ID of the thread associated with this annotation, if applicable.
testCaseIdstringThe ID of the test case associated with this annotation, if applicable.
userobjectThe user who created this annotation.
Show 4 propertiesHide 4 properties
idstringThe id of the user.
emailstringThe email address of the user.
namestringThe name of the user.
imagestringThe image of the user.
userEmailstringThe email address of the user created this annotation. The field is being deprecated. Please use
user.emailinstead.
tagslist of stringsThis is the list of tags associated with the trace, which is useful for grouping and filtering for traces.
spanslist of objectsThis is the list of spans in the trace.
Show 37 propertiesHide 37 properties
idstringThis is the id of the span generated by Confident AI, not to be confused with the uuid of the span.
uuidstringThis is the uuid of the span, not to be confused with the span id.
namestringThis is the name of the span.
inputanyThis is the input to the span.
outputanyThis is the output of the span.
errorstringThis is the error string that caused the span to fail, if an error occurred.
parentUuidstringThis is the uuid of the parent span, if any.
startTimestringThis is the time the span started.
endTimestringThis is the time the span ended.
traceUuidstringThis is the uuid of the trace containing the span.
agentHandoffslist of unknownThis is the list of agent handoffs associated with an agent span.
availableToolslist of unknownThis is the list of available tools associated with an agent span.
chunkSizeintegerThis is the chunk size of each retrieved context for a retriever span.
costPerInputTokennumberThis is the cost per input token of the LLM model for an LLM span.
costPerOutputTokennumberThis is the cost per output token of the LLM model for an LLM span.
descriptionstringThis is a description if the span is a tool span.
embedderstringThis is the embedder model used in a retriever span.
inputTokenCostnumberThis is the total cost of the input tokens passed to the LLM model in an LLM span.
inputTokenCountintegerThis is the total number of input tokens passed to the LLM model in an LLM span.
modelstringThis is the LLM model used in an LLM span.
providerstringThis is the LLM provider used in an LLM span.
integrationstringThis is the integration associated with the span.
outputTokenCostnumberThis is the total cost of the output tokens generated by the LLM model in an LLM span.
outputTokenCountintegerThis is the total number of output tokens generated by the LLM model in an LLM span.
statusenumThis is the error status of the span.
Show 3 enum valuesHide 3 enum values
SUCCESSFAILEDPENDING
topKintegerThis is the top K chunks retrieved from your knowledge base.
typestringThis is the type of the span.
metricCollectionNamestringThis is the name of the metric collection to evaluate the span.
retrievalContextlist of stringsThis is the retrieval context of your span, which is to be used for evaluation.
contextlist of stringsThis is the ideal retrieval context of your span, which is to be used for evaluation.
expectedOutputstringThis is the expected output of your span, which is the ideal actual output and to be used for evaluation.
toolsCalledlist of objectsThis is the tools called by your span, which is to be used for evaluation.
Show 5 propertiesHide 5 properties
namestringThis is the name of the tool.
descriptionstringThis is the description of the tool.
inputParametersobjectThis is the input parameters that are passed to the tool.
outputstringThis is the output of the tool.
reasoningstringThis is the reasoning your LLM provided for the tool call.
expectedToolslist of objectsThis is the expected tools to be called by the span, which is to be used for evaluation.
Show 5 propertiesHide 5 properties
namestringThis is the name of the tool.
descriptionstringThis is the description of the tool.
inputParametersobjectThis is the input parameters that are passed to the tool.
outputstringThis is the output of the tool.
reasoningstringThis is the reasoning your LLM provided for the tool call.
metricsDatalist of objectsThis is the metrics data associated with the span.
Show 21 propertiesHide 21 properties
idstringThe unique identifier of the metrics data entry.
projectIdstringThe project this metric data belongs to.
traceUuidstringThe UUID of the trace this metric data is associated with, if any.
spanUuidstringThe UUID of the span this metric data is associated with, if any.
testCaseIdstringThe ID of the test case this metric data is associated with, if any.
testRunIdstringThe ID of the test run this metric data is associated with, if any.
threadIdstringThe ID of the thread this metric data is associated with, if any.
namestringThe name of the metric.
multiTurnbooleanWhether this metric was evaluated on a multi-turn conversation.
scorenumberThe final metric score.
reasonstringThe reason for the metric score, generated by the evaluation model at evaluation time.
successbooleanWhether the metric score is above the threshold.
createdAtstringThe time the metric data was created.
evaluatedAtstringThe time the metric was evaluated.
thresholdnumberThe threshold for the metric, which determines if the metric is passing or failing.
strictModebooleanWhether the metric was run in strict mode, which outputs a binary score of 0 or 1.
skippedbooleanWhether the metric evaluation was skipped.
evaluationModelstringThe evaluation model used to run the evaluation.
errorstringThe error message if the evaluation failed.
evaluationCostnumberThe cost of running the evaluation.
verboseLogsstringThe verbose logs of the evaluation, which breaks down the metric score calculation into individual steps.
annotationobjectThis is the text annotation for the span.
Show 14 propertiesHide 14 properties
idstringThis is the id of the annotation generated by Confident AI, not to be confused with the alias you supplied or version number.
ratingintegerThis is the annotated rating score.
typeenumThis is the type of annotation, which can be either thumbs rating or five star rating.
Show 2 enum valuesHide 2 enum values
THUMBS_RATINGFIVE_STAR_RATING
namestringThe name of the annotation.
expectedOutcomestringThis is the annotated expected outcome, for conversation annotations.
expectedOutputstringThis is the annotated expected output, for span and trace annotations.
explanationstringThis is the explanation for the annotation.
createdAtstringThe timestamp when the annotation was created.
traceUuidstringThe UUID of the trace associated with this annotation, if applicable.
spanUuidstringThe UUID of the span associated with this annotation, if applicable.
threadIdstringThe ID of the thread associated with this annotation, if applicable.
testCaseIdstringThe ID of the test case associated with this annotation, if applicable.
userobjectThe user who created this annotation.
Show 4 propertiesHide 4 properties
idstringThe id of the user.
emailstringThe email address of the user.
namestringThe name of the user.
imagestringThe image of the user.
userEmailstringThe email address of the user created this annotation. The field is being deprecated. Please use
user.emailinstead.
environmentenumThis is the environment where your span was posted, which helps with separating and debugging spans from different environments on the Confident AI platform.
Show 4 enum valuesHide 4 enum values
productiondevelopmentstagingtesting
metadataobjectThis is any additional metadata associated with the span.
deprecatedbooleanThis is true if this endpoint is deprecated.