Embedded Copilot Chat
Endpoint for managing the per-user AI copilot chat session embedded within an app.
GET /api/apps/{id}/chat
Get or create the embedded AI chat session for the current user within an app. If no chat session exists, one is automatically created.
Authentication: Required
Path Parameters:
| Parameter | Type | Description |
|---|---|---|
id | string | App UUID or natural ID |
Response:
{
"id": "chat-uuid-1234",
"appId": "d4f8a2b1-1234-5678-90ab-cdef12345678",
"username": "john.doe",
"embedded": true,
"modelId": "go_everyday",
"name": "Sales Dashboard",
"autoRename": false,
"messages": [],
"createdAt": "2024-02-13T10:00:00.000Z",
"updatedAt": "2024-02-13T10:00:00.000Z"
}
Key Fields:
| Field | Description |
|---|---|
embedded | Always true for app-scoped chats |
modelId | The AI model used (prefers go_everyday, falls back to first chat-capable model) |
autoRename | Always false — the chat name stays fixed to the app name |
messages | Chat message history (empty on first creation) |
Behavior:
- If a chat already exists for this user and app, returns the existing chat
- If no chat exists, creates one with
embedded: trueand the app's name - The response includes a HAL
selflink pointing to/api/chats/{chatId}for subsequent chat interactions
Permissions Required: None (404 if user cannot read the app)