Skip to main content
GET
/
agents
/
{id}
/
v1
/
contexts
/
{contextId}
Javascript SDK (Beta)
import { CortiEnvironment, CortiClient } from "@corti/sdk";

const client = new CortiClient({
    environment: CortiEnvironment.Eu,
    auth: {
        clientId: "YOUR_CLIENT_ID",
        clientSecret: "YOUR_CLIENT_SECRET"
    },
    tenantName: "YOUR_TENANT_NAME"
});
await client.agents.getContext("12345678-90ab-cdef-gh12-34567890abc", "contextId");
{
  "id": "<string>",
  "items": [
    {
      "id": "<string>",
      "contextId": "<string>",
      "status": {
        "state": "submitted",
        "message": {
          "role": "user",
          "parts": [
            {
              "kind": "text",
              "text": "<string>",
              "metadata": {}
            }
          ],
          "metadata": {},
          "extensions": [
            "<string>"
          ],
          "referenceTaskIds": [
            "<string>"
          ],
          "messageId": "<string>",
          "taskId": "<string>",
          "contextId": "<string>",
          "kind": "message"
        },
        "timestamp": "2023-11-07T05:31:56Z"
      },
      "history": [
        {
          "role": "user",
          "parts": [
            {
              "kind": "text",
              "text": "<string>",
              "metadata": {}
            }
          ],
          "metadata": {},
          "extensions": [
            "<string>"
          ],
          "referenceTaskIds": [
            "<string>"
          ],
          "messageId": "<string>",
          "taskId": "<string>",
          "contextId": "<string>",
          "kind": "message"
        }
      ],
      "artifacts": [
        {
          "artifactId": "<string>",
          "name": "<string>",
          "description": "<string>",
          "parts": [
            {
              "kind": "text",
              "text": "<string>",
              "metadata": {}
            }
          ],
          "metadata": {},
          "extensions": [
            "<string>"
          ]
        }
      ],
      "metadata": {},
      "kind": "task"
    }
  ]
}

Headers

Tenant-Name
string
required

Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request.

Example:

"copiloteu"

Path Parameters

id
string
required

The identifier of the agent associated with the context.

Example:

"12345678-90ab-cdef-gh12-34567890abc"

contextId
string
required

The identifier of the context (thread) to retrieve tasks for.

Query Parameters

limit
integer
default:100

The maximum number of tasks and messages to return. If not specified all history is returned.

offset
integer

The number of tasks and messages to skip before starting to collect the result set. Default is 0.

Response

Tasks retrieved successfully.

id
string

The context ID.

items
object[]
  • Option 1
  • Option 2