Skip to main content
Use messages to write customer chat, support updates, order notices, and AI-assisted replies into Connect360.

Send As Workspace

By default, messages are sent as the workspace member attached to the API key.
const message = await plato.v1.connect.send.mutate({
  conversationId: "conversation_id",
  content: {
    en: "Hello from the support team.",
  },
});

Send As Customer

Use sender: "customer" when the message came from a website visitor or external customer.
const message = await plato.v1.connect.send.mutate({
  conversationId: "conversation_id",
  sender: "customer",
  customer: {
    externalId: "website_user_123",
    name: "Jane Customer",
    email: "[email protected]",
  },
  content: {
    en: "I need help with my order.",
  },
  channelIdentifier: "example.com",
});

Input

{
  conversationId: string;
  content?: Partial<Record<"en" | "ar" | "tr", unknown>> | null;
  attachmentIds?: string[] | null;
  flags?: string[] | null;
  parentId?: string | null;
  templateId?: string | null;
  templateContext?: unknown;
  channelId?: string | null;
  channelIdentifier?: string | null;
  sender?: "workspace" | "customer";
  customerId?: string | null;
  customer?: {
    id?: string | null;
    externalId?: string | null;
    name?: string | null;
    email?: string | null;
    phone?: string | null;
    image?: string | null;
    metadata?: Record<string, unknown> | null;
  } | null;
  ai?: {
    agentId: string;
    channelId?: string | null;
  } | null;
}

Replies

Use parentId when replying to a specific message.
await plato.v1.connect.send.mutate({
  conversationId: "conversation_id",
  parentId: "message_id",
  content: {
    en: "Following up on this message.",
  },
});

Attachments

Upload files with the Connect360 attachment endpoint, then pass the returned file ids:
await plato.v1.connect.send.mutate({
  conversationId: "conversation_id",
  content: {
    en: "Attached is the document.",
  },
  attachmentIds: ["file_id_1"],
});
See Attachments.

Trigger AI After Sending

Pass an AI agent id to request an AI reply after the message is stored.
await plato.v1.connect.send.mutate({
  conversationId: "conversation_id",
  content: {
    en: "Can you help this customer?",
  },
  ai: {
    agentId: "ai_agent_id",
  },
});
AI replies run asynchronously.

List Messages

const page = await plato.v1.connect.listMessages.query({
  conversationId: "conversation_id",
  limit: 50,
});
Response:
{
  items: [
    {
      id: "message_id",
      content: {
        en: "Hello"
      },
      conversationId: "conversation_id",
      attachments: [],
      sender: {}
    }
  ],
  nextCursor: "message_id_for_next_page"
}
Messages are returned oldest-to-newest inside each page. To fetch the next page:
const nextPage = await plato.v1.connect.listMessages.query({
  conversationId: "conversation_id",
  cursor: page.nextCursor,
  limit: 50,
});