API ReferenceEndpoints

Context

Context management API

MethodPathDescription
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 current user's contexts

GET /api/v1/contexts/{workspace}

Retrieve all contexts for the authenticated user in a workspace

Path Parameters

NameRequiredDescription
workspaceYesWorkspace identifier

Responses

StatusDescription
200Contexts retrieved successfully

Example Response

{
  "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
    }
  ]
}

Example

curl -X GET "https://poliglot.io/api/v1/contexts/my-workspace" \
  -H "Authorization: Bearer <your-token>"

Create a new context

POST /api/v1/contexts/{workspace}

Create a new context in a workspace for the authenticated user

Path Parameters

NameRequiredDescription
workspaceYesWorkspace identifier

Request Body

Content-Type: application/json

FieldTypeDescription
titlestring

Responses

StatusDescription
200Context created successfully

Response Shape

FieldTypeDescription
idstring (uuid)Context ID
workspaceIdstring (uuid)Workspace ID
createdByUserResponseUser who created the context
titlestringContext title
createdAtstring (date-time)When the context was created
updatedAtstring (date-time)When the context was last updated
lastActiveAtstring (date-time)When the context was last active (last message)
activatedMatricesstring[]Matrix URIs that are activated in this context
checkpointAtstring (date-time)When the last checkpoint was saved to S3. Null if no checkpoint exists.
checkpointSizeBytesinteger (int64)Total size of the current checkpoint in bytes. Null if no checkpoint exists.

Example Response

{
  "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
  }
}

Example

curl -X POST "https://poliglot.io/api/v1/contexts/my-workspace" \
  -H "Authorization: Bearer <your-token>"
  -H "Content-Type: application/json" \
  -d '{}'

Get context by ID

GET /api/v1/contexts/{workspace}/{id}

Retrieve a context by its ID

Path Parameters

NameRequiredDescription
workspaceYesWorkspace identifier
idYesContext ID

Responses

StatusDescription
200Context retrieved successfully
404Context not found

Response Shape

FieldTypeDescription
idstring (uuid)Context ID
workspaceIdstring (uuid)Workspace ID
createdByUserResponseUser who created the context
titlestringContext title
createdAtstring (date-time)When the context was created
updatedAtstring (date-time)When the context was last updated
lastActiveAtstring (date-time)When the context was last active (last message)
activatedMatricesstring[]Matrix URIs that are activated in this context
checkpointAtstring (date-time)When the last checkpoint was saved to S3. Null if no checkpoint exists.
checkpointSizeBytesinteger (int64)Total size of the current checkpoint in bytes. Null if no checkpoint exists.

Example Response

{
  "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
  }
}

Example

curl -X GET "https://poliglot.io/api/v1/contexts/my-workspace/<id>" \
  -H "Authorization: Bearer <your-token>"

Delete context

DELETE /api/v1/contexts/{workspace}/{id}

Delete an existing context

Path Parameters

NameRequiredDescription
workspaceYesWorkspace identifier
idYesContext ID

Responses

StatusDescription
200Context deleted successfully
404Context not found

Example Response

{
  "success": true,
  "data": "string"
}

Example

curl -X DELETE "https://poliglot.io/api/v1/contexts/my-workspace/<id>" \
  -H "Authorization: Bearer <your-token>"

On this page