Conversations API
Overview
The Conversations API provides endpoints for managing AI chat conversations, including creating, retrieving, updating, and archiving conversations.
Data Flow
Base Endpoint
/index.php/apps/openregister/api/conversations
Authentication
All endpoints require authentication via Nextcloud session or app password.
Endpoints
List Conversations
Retrieve all active conversations for the current user in their active organisation.
GET /index.php/apps/openregister/api/conversations
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
limit | integer | No | 50 | Maximum number of conversations to return |
offset | integer | No | 0 | Number of conversations to skip (for pagination) |
includeDeleted | boolean | No | false | Include soft-deleted conversations |
Response
{
"results": [
{
"id": 1,
"uuid": "550e8400-e29b-41d4-a716-446655440001",
"title": "Customer Support Query",
"userId": "admin",
"organisation": 1,
"agentId": 5,
"metadata": {
"source": "web",
"tags": ["support", "billing"]
},
"deletedAt": null,
"created": "2024-11-05T10:00:00Z",
"updated": "2024-11-05T10:30:00Z",
"messageCount": 8
}
],
"total": 15,
"limit": 50,
"offset": 0
}
Status Codes
200 OK: Conversations retrieved successfully500 Internal Server Error: Server error occurred
Get Conversation
Retrieve a single conversation with all its messages.
GET /index.php/apps/openregister/api/conversations/{uuid}
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
uuid | string | Yes | Conversation UUID |
Response
{
"id": 1,
"uuid": "550e8400-e29b-41d4-a716-446655440001",
"title": "Customer Support Query",
"userId": "admin",
"organisation": 1,
"agentId": 5,
"metadata": {
"source": "web",
"tags": ["support", "billing"]
},
"deletedAt": null,
"created": "2024-11-05T10:00:00Z",
"updated": "2024-11-05T10:30:00Z",
"messages": [
{
"id": 1,
"uuid": "660e8400-e29b-41d4-a716-446655440001",
"conversationId": 1,
"role": "user",
"content": "How do I update my billing information?",
"sources": [],
"created": "2024-11-05T10:00:00Z"
},
{
"id": 2,
"uuid": "660e8400-e29b-41d4-a716-446655440002",
"conversationId": 1,
"role": "assistant",
"content": "To update your billing information, navigate to...",
"sources": [
{
"type": "file",
"id": "doc-001",
"name": "billing-guide.pdf",
"relevance": 0.95
}
],
"created": "2024-11-05T10:00:15Z"
}
],
"messageCount": 8
}
Status Codes
200 OK: Conversation retrieved successfully403 Forbidden: User doesn't have access to this conversation404 Not Found: Conversation not found500 Internal Server Error: Server error occurred
Create Conversation
Create a new conversation with a specific agent.
POST /index.php/apps/openregister/api/conversations