Conversations
Store and manage chat conversation history. Conversations can be owned by users or projects and support multiple models.
Create a new conversation
Authorization
api_key API key authentication using Bearer token format
In: header
Request Body
application/json
Initial messages (optional)
Models used in this conversation
Owner of the conversation
Title of the conversation
Response Body
application/json
application/json
curl -X POST "https://loading/admin/v1/conversations" \ -H "Content-Type: application/json" \ -d '{ "owner": { "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9", "type": "project" }, "title": "string" }'{
"created_at": "2019-08-24T14:15:22Z",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"messages": [
{
"content": "string",
"role": "string"
}
],
"models": [
"string"
],
"owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05",
"owner_type": "project",
"pin_order": 0,
"title": "string",
"updated_at": "2019-08-24T14:15:22Z"
}{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}Get a conversation by ID
Authorization
api_key API key authentication using Bearer token format
In: header
Path Parameters
Conversation ID
uuidResponse Body
application/json
application/json
curl -X GET "https://loading/admin/v1/conversations/497f6eca-6276-4993-bfeb-53cbbbba6f08"{
"created_at": "2019-08-24T14:15:22Z",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"messages": [
{
"content": "string",
"role": "string"
}
],
"models": [
"string"
],
"owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05",
"owner_type": "project",
"pin_order": 0,
"title": "string",
"updated_at": "2019-08-24T14:15:22Z"
}{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}Update a conversation
Authorization
api_key API key authentication using Bearer token format
In: header
Path Parameters
Conversation ID
uuidRequest Body
application/json
Replace all messages
New models list
New title
Response Body
application/json
application/json
curl -X PATCH "https://loading/admin/v1/conversations/497f6eca-6276-4993-bfeb-53cbbbba6f08" \ -H "Content-Type: application/json" \ -d '{}'{
"created_at": "2019-08-24T14:15:22Z",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"messages": [
{
"content": "string",
"role": "string"
}
],
"models": [
"string"
],
"owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05",
"owner_type": "project",
"pin_order": 0,
"title": "string",
"updated_at": "2019-08-24T14:15:22Z"
}{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}Delete a conversation
Authorization
api_key API key authentication using Bearer token format
In: header
Path Parameters
Conversation ID
uuidResponse Body
application/json
curl -X DELETE "https://loading/admin/v1/conversations/497f6eca-6276-4993-bfeb-53cbbbba6f08"{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}Append messages to a conversation
Authorization
api_key API key authentication using Bearer token format
In: header
Path Parameters
Conversation ID
uuidRequest Body
application/json
Response Body
application/json
application/json
curl -X POST "https://loading/admin/v1/conversations/497f6eca-6276-4993-bfeb-53cbbbba6f08/messages" \ -H "Content-Type: application/json" \ -d '{ "messages": [ { "content": "string", "role": "string" } ] }'[
{
"content": "string",
"role": "string"
}
]{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}Set pin order for a conversation
Authorization
api_key API key authentication using Bearer token format
In: header
Path Parameters
Conversation ID
uuidRequest Body
application/json
The pin order (0 = first, higher = lower in list). Set to null to unpin.
int32Response Body
application/json
application/json
curl -X PUT "https://loading/admin/v1/conversations/497f6eca-6276-4993-bfeb-53cbbbba6f08/pin" \ -H "Content-Type: application/json" \ -d '{}'{
"created_at": "2019-08-24T14:15:22Z",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"messages": [
{
"content": "string",
"role": "string"
}
],
"models": [
"string"
],
"owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05",
"owner_type": "project",
"pin_order": 0,
"title": "string",
"updated_at": "2019-08-24T14:15:22Z"
}{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}List conversations by project
Authorization
api_key API key authentication using Bearer token format
In: header
Path Parameters
Organization slug
Project slug
Query Parameters
Maximum number of results to return
int64Cursor for keyset pagination. Encoded as base64 string.
Pagination direction: "forward" (default) or "backward".
Include soft-deleted records in results
Response Body
application/json
application/json
application/json
curl -X GET "https://loading/admin/v1/organizations/string/projects/string/conversations"{
"data": [
{
"created_at": "2019-08-24T14:15:22Z",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"messages": [
{
"content": "string",
"role": "string"
}
],
"models": [
"string"
],
"owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05",
"owner_type": "project",
"pin_order": 0,
"title": "string",
"updated_at": "2019-08-24T14:15:22Z"
}
],
"pagination": {
"has_more": true,
"limit": 100,
"next_cursor": "MTczMzU4MDgwMDAwMDphYmMxMjM0NS02Nzg5LTAxMjMtNDU2Ny0wMTIzNDU2Nzg5YWI",
"prev_cursor": "string"
}
}{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}List conversations by user
Authorization
api_key API key authentication using Bearer token format
In: header
Path Parameters
User ID
uuidQuery Parameters
Maximum number of results to return
int64Cursor for keyset pagination. Encoded as base64 string.
Pagination direction: "forward" (default) or "backward".
Include soft-deleted records in results
Response Body
application/json
application/json
application/json
curl -X GET "https://loading/admin/v1/users/497f6eca-6276-4993-bfeb-53cbbbba6f08/conversations"{
"data": [
{
"created_at": "2019-08-24T14:15:22Z",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"messages": [
{
"content": "string",
"role": "string"
}
],
"models": [
"string"
],
"owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05",
"owner_type": "project",
"pin_order": 0,
"title": "string",
"updated_at": "2019-08-24T14:15:22Z"
}
],
"pagination": {
"has_more": true,
"limit": 100,
"next_cursor": "MTczMzU4MDgwMDAwMDphYmMxMjM0NS02Nzg5LTAxMjMtNDU2Ny0wMTIzNDU2Nzg5YWI",
"prev_cursor": "string"
}
}{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}List all conversations accessible to a user
Authorization
api_key API key authentication using Bearer token format
In: header
Path Parameters
User ID
uuidQuery Parameters
Maximum number of conversations to return
int641 <= value <= 1000Response Body
application/json
application/json
curl -X GET "https://loading/admin/v1/users/497f6eca-6276-4993-bfeb-53cbbbba6f08/conversations/accessible"{
"data": [
{
"created_at": "2019-08-24T14:15:22Z",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"messages": [
{
"content": "string",
"role": "string"
}
],
"models": [
"string"
],
"owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05",
"owner_type": "project",
"pin_order": 0,
"title": "string",
"updated_at": "2019-08-24T14:15:22Z",
"project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9",
"project_name": "string",
"project_slug": "string"
}
],
"pagination": {
"has_more": true,
"limit": 100,
"next_cursor": "MTczMzU4MDgwMDAwMDphYmMxMjM0NS02Nzg5LTAxMjMtNDU2Ny0wMTIzNDU2Nzg5YWI",
"prev_cursor": "string"
}
}{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}