Skip to content

Notes

Create, update, and delete internal operator notes on chat sessions. Notes are private annotations visible only to operators — they are never sent to external channels or customers.

Overview

Notes are internal messages attached to a session. They appear as amber-colored bubbles in the chat interface and are distinguished from regular messages.

Each note supports an AI visibility flag (isNoteVisibleToAi). When enabled, the note content is included in the AI agent's conversation context, allowing you to give the AI additional instructions or context without the customer seeing it.

Create Note

Creates a new note on a session.

http
POST /channels/{channelId}/sessions/{sessionId}/agent-messages
Path ParameterDescription
channelIdThe channel ID (find it in Settings → Channels → Channel ID)
sessionIdThe session/conversation ID

Request Parameters

FieldTypeRequiredDescription
contentstringYesThe note text (max 10,000 characters)
isNotebooleanYesMust be true to create a note
isNoteVisibleToAibooleanNoWhether the AI agent can see this note (default: false)

Example Request

bash
curl -X POST "https://api.maiacompany.io/channels/CHANNEL_ID/sessions/SESSION_ID/agent-messages" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Customer prefers communication in Portuguese. Follow up next week.",
    "isNote": true,
    "isNoteVisibleToAi": true
  }'

Response

Returns 200 OK with the created note:

json
{
  "id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
  "sessionId": "550e8400-e29b-41d4-a716-446655440000",
  "agentId": "agent-uuid",
  "role": "assistant",
  "content": "Customer prefers communication in Portuguese. Follow up next week.",
  "timestamp": 1704067200000,
  "isNote": true,
  "isNoteVisibleToAi": true,
  "isNewSession": false
}

TIP

This uses the same endpoint as From Human messages. The isNote: true flag is what distinguishes a note from a regular message.

Update Note

Updates an existing note's content and/or AI visibility.

http
PATCH /channels/{channelId}/sessions/{sessionId}/notes/{messageId}
Path ParameterDescription
channelIdThe channel ID (find it in Settings → Channels → Channel ID)
sessionIdThe session/conversation ID
messageIdThe note's message ID

Request Parameters

FieldTypeRequiredDescription
contentstringYesThe updated note text (max 10,000 characters)
isNoteVisibleToAibooleanNoWhether the AI agent can see this note

Example Request

bash
curl -X PATCH "https://api.maiacompany.io/channels/CHANNEL_ID/sessions/SESSION_ID/notes/MESSAGE_ID" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Updated: Customer confirmed meeting for Thursday at 3pm.",
    "isNoteVisibleToAi": true
  }'

Response

Returns 200 OK with the updated note:

json
{
  "id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
  "content": "Updated: Customer confirmed meeting for Thursday at 3pm.",
  "isNoteVisibleToAi": true
}

Delete Note

Permanently deletes a note from a session.

http
DELETE /channels/{channelId}/sessions/{sessionId}/notes/{messageId}
Path ParameterDescription
channelIdThe channel ID (find it in Settings → Channels → Channel ID)
sessionIdThe session/conversation ID
messageIdThe note's message ID

Example Request

bash
curl -X DELETE "https://api.maiacompany.io/channels/CHANNEL_ID/sessions/SESSION_ID/notes/MESSAGE_ID" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Response

Returns 200 OK:

json
{
  "message": "Note deleted successfully"
}

Webhook Events

Note operations trigger webhook events that you can subscribe to:

Event TypeTrigger
note_createdA new note is created
note_updatedA note's content is edited
note_deletedA note is deleted

All note webhook payloads include messageId, sessionId, channelId, and operator info.

Note webhooks are configured through the Webhook Center (Settings → Webhooks), the same place as CRM webhooks. See CRM Webhooks for setup instructions and payload details.

Error Responses

StatusDescription
400Missing path parameters, empty content, or content too long
401Invalid or missing authentication token
403Note belongs to a different account
404Note not found
500Internal server error

WARNING

Only messages created as notes (isNote: true) can be updated or deleted via the notes endpoints. Attempting to update or delete a regular message will return a 400 error.

MAIA Platform Documentation