curl --request GET \
--url https://api.happenstance.ai/v1/chat/{chat_id}/turns/{turn_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.happenstance.ai/v1/chat/{chat_id}/turns/{turn_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.happenstance.ai/v1/chat/{chat_id}/turns/{turn_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"chat_id": "<string>",
"status": "queued",
"message": "<string>",
"messages": [
"<string>"
],
"reply": {
"markdown": "<string>",
"people_count": 123,
"people_new_count": 123,
"drafts_count": 123,
"updates": [
"<string>"
],
"searches": [
{
"search_id": "<string>",
"status": "running",
"page_id": "<string>",
"turn_id": "<string>",
"query": "<string>",
"results_count": 123
}
],
"suggested_followup": "<string>",
"questions": [
{
"index": 123,
"header": "<string>",
"question": "<string>",
"options": [
{
"label": "<string>",
"description": "<string>"
}
],
"multi_select": true
}
]
},
"usage": {
"searches": 123,
"web_searches": 123,
"model_calls": 123,
"people_reviewed": 123,
"credits_charged": 123,
"scope": {
"my_connections": true,
"friends_connections": true,
"all_groups": true,
"group_ids": [
"<string>"
]
}
},
"created_at": "<string>",
"elapsed_seconds": 123,
"stop_reason": "done",
"started_by": "message",
"completed_at": "<string>",
"last_activity_at": "<string>",
"next_turn_id": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "https://developer.happenstance.ai/api-reference/introduction#error-response-format",
"detail": "<string>",
"instance": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "https://developer.happenstance.ai/api-reference/introduction#error-response-format",
"detail": "<string>",
"instance": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "https://developer.happenstance.ai/api-reference/introduction#error-response-format",
"detail": "<string>",
"instance": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "https://developer.happenstance.ai/api-reference/introduction#error-response-format",
"detail": "<string>",
"instance": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "https://developer.happenstance.ai/api-reference/introduction#error-response-format",
"detail": "<string>",
"instance": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "https://developer.happenstance.ai/api-reference/introduction#error-response-format",
"detail": "<string>",
"instance": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "https://developer.happenstance.ai/api-reference/introduction#error-response-format",
"detail": "<string>",
"instance": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "https://developer.happenstance.ai/api-reference/introduction#error-response-format",
"detail": "<string>",
"instance": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "https://developer.happenstance.ai/api-reference/introduction#error-response-format",
"detail": "<string>",
"instance": "<string>"
}Get Chat Turn
A turn: its status, Chat’s reply so far (markdown), the searches it ran, and its usage
and charge once finished. Poll every 5 seconds for the first minute, then every 10; turns
with searches usually take 1 to 3 minutes. Not rate limited. latest reads the chat’s
newest turn; the response’s id names it.
curl --request GET \
--url https://api.happenstance.ai/v1/chat/{chat_id}/turns/{turn_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.happenstance.ai/v1/chat/{chat_id}/turns/{turn_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.happenstance.ai/v1/chat/{chat_id}/turns/{turn_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"chat_id": "<string>",
"status": "queued",
"message": "<string>",
"messages": [
"<string>"
],
"reply": {
"markdown": "<string>",
"people_count": 123,
"people_new_count": 123,
"drafts_count": 123,
"updates": [
"<string>"
],
"searches": [
{
"search_id": "<string>",
"status": "running",
"page_id": "<string>",
"turn_id": "<string>",
"query": "<string>",
"results_count": 123
}
],
"suggested_followup": "<string>",
"questions": [
{
"index": 123,
"header": "<string>",
"question": "<string>",
"options": [
{
"label": "<string>",
"description": "<string>"
}
],
"multi_select": true
}
]
},
"usage": {
"searches": 123,
"web_searches": 123,
"model_calls": 123,
"people_reviewed": 123,
"credits_charged": 123,
"scope": {
"my_connections": true,
"friends_connections": true,
"all_groups": true,
"group_ids": [
"<string>"
]
}
},
"created_at": "<string>",
"elapsed_seconds": 123,
"stop_reason": "done",
"started_by": "message",
"completed_at": "<string>",
"last_activity_at": "<string>",
"next_turn_id": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "https://developer.happenstance.ai/api-reference/introduction#error-response-format",
"detail": "<string>",
"instance": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "https://developer.happenstance.ai/api-reference/introduction#error-response-format",
"detail": "<string>",
"instance": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "https://developer.happenstance.ai/api-reference/introduction#error-response-format",
"detail": "<string>",
"instance": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "https://developer.happenstance.ai/api-reference/introduction#error-response-format",
"detail": "<string>",
"instance": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "https://developer.happenstance.ai/api-reference/introduction#error-response-format",
"detail": "<string>",
"instance": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "https://developer.happenstance.ai/api-reference/introduction#error-response-format",
"detail": "<string>",
"instance": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "https://developer.happenstance.ai/api-reference/introduction#error-response-format",
"detail": "<string>",
"instance": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "https://developer.happenstance.ai/api-reference/introduction#error-response-format",
"detail": "<string>",
"instance": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "https://developer.happenstance.ai/api-reference/introduction#error-response-format",
"detail": "<string>",
"instance": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
A turn ID from POST /v1/chat or /messages, or latest for the chat's newest turn
Response
Successful Response
Response from GET /v1/chat/{chat_id}/turns/{turn_id}: a message and Chat's work on it.
The turn's id
The chat's id
queued (not started), running, completed, failed (not charged) or cancelled
queued, running, completed, failed, cancelled The message that started the turn, or for a scheduled run the task's instruction
Every message in the turn: the first started it, any later one was sent while it ran and joined it. A scheduled run's turn has none.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
When the turn started (ISO 8601)
Seconds since the turn started, or how long it took once finished
Why a finished turn ended: done; needs_input (Chat asked questions and waits for the answers, see reply.questions); stopped (cancelled); error. Null while running.
done, needs_input, stopped, error message: a message or answers started the turn. schedule: one of the chat's scheduled tasks ran, and nobody sent a message (only a chat started in the app has scheduled tasks).
message, schedule When the turn finished (ISO 8601)
When Chat last made progress on the turn (a reply, a search starting or finishing). A running turn with no progress for several minutes is stuck or slow and can be cancelled.
The chat's next turn, once one was started
