Skip to main content
POST
/
agents
/
{id}
/
v1
/
message:send
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.messageSend("12345678-90ab-cdef-gh12-34567890abc", {
    message: {
        role: "user",
        parts: [{
                kind: "text",
                text: "text"
            }],
        messageId: "messageId",
        kind: "message"
    }
});
{
  "message": {
    "role": "user",
    "parts": [
      {
        "kind": "text",
        "text": "<string>",
        "metadata": {}
      }
    ],
    "metadata": {},
    "extensions": [
      "<string>"
    ],
    "referenceTaskIds": [
      "<string>"
    ],
    "messageId": "<string>",
    "taskId": "<string>",
    "contextId": "<string>",
    "kind": "message"
  },
  "task": {
    "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"

Body

application/json
message
object
required
configuration
object
metadata
object

Optional metadata that will be associated with the message.

Response

Message processed successfully.

message
object
task
object