Context
Context management API
| Method | Path | Description |
|---|
| GET | /api/v1/contexts/{workspace} | Get current user's contexts |
| POST | /api/v1/contexts/{workspace} | Create a new context |
| GET | /api/v1/contexts/{workspace}/{id} | Get context by ID |
| DELETE | /api/v1/contexts/{workspace}/{id} | Delete context |
GET /api/v1/contexts/{workspace}
Retrieve all contexts for the authenticated user in a workspace
| Name | Required | Description |
|---|
workspace | Yes | Workspace identifier |
| Status | Description |
|---|
200 | Contexts retrieved successfully |
{
"success": true,
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"workspaceId": "550e8400-e29b-41d4-a716-446655440000",
"createdBy": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"username": "string",
"email": "string",
"firstName": "string",
"lastName": "string",
"website": "string",
"emailVerified": true,
"createdAt": "2025-03-28T14:22:03Z",
"updatedAt": "2025-03-28T14:22:03Z"
},
"title": "string",
"createdAt": "2025-03-28T14:22:03Z",
"updatedAt": "2025-03-28T14:22:03Z",
"lastActiveAt": "2025-03-28T14:22:03Z",
"activatedMatrices": [
"string"
],
"checkpointAt": "2025-03-28T14:22:03Z",
"checkpointSizeBytes": 0
}
]
}
curl -X GET "https://poliglot.io/api/v1/contexts/my-workspace" \
-H "Authorization: Bearer <your-token>"
POST /api/v1/contexts/{workspace}
Create a new context in a workspace for the authenticated user
| Name | Required | Description |
|---|
workspace | Yes | Workspace identifier |
Content-Type: application/json
| Field | Type | Description |
|---|
title | string | |
| Status | Description |
|---|
200 | Context created successfully |
| Field | Type | Description |
|---|
id | string (uuid) | Context ID |
workspaceId | string (uuid) | Workspace ID |
createdBy | UserResponse | User who created the context |
title | string | Context title |
createdAt | string (date-time) | When the context was created |
updatedAt | string (date-time) | When the context was last updated |
lastActiveAt | string (date-time) | When the context was last active (last message) |
activatedMatrices | string[] | Matrix URIs that are activated in this context |
checkpointAt | string (date-time) | When the last checkpoint was saved to S3. Null if no checkpoint exists. |
checkpointSizeBytes | integer (int64) | Total size of the current checkpoint in bytes. Null if no checkpoint exists. |
{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"workspaceId": "550e8400-e29b-41d4-a716-446655440000",
"createdBy": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"username": "string",
"email": "string",
"firstName": "string",
"lastName": "string",
"website": "string",
"emailVerified": true,
"createdAt": "2025-03-28T14:22:03Z",
"updatedAt": "2025-03-28T14:22:03Z"
},
"title": "string",
"createdAt": "2025-03-28T14:22:03Z",
"updatedAt": "2025-03-28T14:22:03Z",
"lastActiveAt": "2025-03-28T14:22:03Z",
"activatedMatrices": [
"string"
],
"checkpointAt": "2025-03-28T14:22:03Z",
"checkpointSizeBytes": 0
}
}
curl -X POST "https://poliglot.io/api/v1/contexts/my-workspace" \
-H "Authorization: Bearer <your-token>"
-H "Content-Type: application/json" \
-d '{}'
GET /api/v1/contexts/{workspace}/{id}
Retrieve a context by its ID
| Name | Required | Description |
|---|
workspace | Yes | Workspace identifier |
id | Yes | Context ID |
| Status | Description |
|---|
200 | Context retrieved successfully |
404 | Context not found |
| Field | Type | Description |
|---|
id | string (uuid) | Context ID |
workspaceId | string (uuid) | Workspace ID |
createdBy | UserResponse | User who created the context |
title | string | Context title |
createdAt | string (date-time) | When the context was created |
updatedAt | string (date-time) | When the context was last updated |
lastActiveAt | string (date-time) | When the context was last active (last message) |
activatedMatrices | string[] | Matrix URIs that are activated in this context |
checkpointAt | string (date-time) | When the last checkpoint was saved to S3. Null if no checkpoint exists. |
checkpointSizeBytes | integer (int64) | Total size of the current checkpoint in bytes. Null if no checkpoint exists. |
{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"workspaceId": "550e8400-e29b-41d4-a716-446655440000",
"createdBy": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"username": "string",
"email": "string",
"firstName": "string",
"lastName": "string",
"website": "string",
"emailVerified": true,
"createdAt": "2025-03-28T14:22:03Z",
"updatedAt": "2025-03-28T14:22:03Z"
},
"title": "string",
"createdAt": "2025-03-28T14:22:03Z",
"updatedAt": "2025-03-28T14:22:03Z",
"lastActiveAt": "2025-03-28T14:22:03Z",
"activatedMatrices": [
"string"
],
"checkpointAt": "2025-03-28T14:22:03Z",
"checkpointSizeBytes": 0
}
}
curl -X GET "https://poliglot.io/api/v1/contexts/my-workspace/<id>" \
-H "Authorization: Bearer <your-token>"
DELETE /api/v1/contexts/{workspace}/{id}
Delete an existing context
| Name | Required | Description |
|---|
workspace | Yes | Workspace identifier |
id | Yes | Context ID |
| Status | Description |
|---|
200 | Context deleted successfully |
404 | Context not found |
{
"success": true,
"data": "string"
}
curl -X DELETE "https://poliglot.io/api/v1/contexts/my-workspace/<id>" \
-H "Authorization: Bearer <your-token>"