Skip to main content

Notes - Note Save

Endpoint

/i/notes/save

Overview

Creates a new note or updates an existing note.

Authentication

  • API Key (parameter): api_key=YOUR_API_KEY
  • Auth Token (parameter): auth_token=YOUR_AUTH_TOKEN
  • Auth Token (header): countly-token: YOUR_AUTH_TOKEN

Permissions

  • Requires core create permission for the target app (app_id) or global admin access.

Request Parameters

ParameterTypeRequiredDescription
api_keyStringYes (or use auth_token)Dashboard API key.
auth_tokenStringYes (or use api_key)Dashboard auth token.
app_idStringYes for non-global-admin usersTarget app ID used for permission validation.
argsJSON String (Object)YesNote payload.

args Object Structure

FieldTypeRequiredDescription
noteStringYesNote body text.
tsNumberYesTimestamp used by notes filtering (Unix ms).
noteTypeStringYesNote visibility type (for example public).
colorStringYesNote color identifier.
categoryBooleanNoCategory flag.
emailsArray of StringNoShared recipient emails for visibility.
_idStringNoExisting note id; when provided, endpoint updates that note.
app_idStringYesApp id stored in the note document.

Example args value:

{
"app_id": "6991c75b024cb89cdc04efd2",
"note": "Traffic anomaly reviewed",
"ts": 1739788800000,
"noteType": "public",
"color": "#F59E0B",
"emails": ["ops@example.com"]
}

Response

Success Response

{
"result": "Success"
}

Response Fields

FieldTypeDescription
resultStringOperation status message.

Error Responses

Status Code: 403 Forbidden

{
"result": "Not allow to edit note"
}

Status Code: 503 Service Unavailable

{
"result": "Save note failed"
}

Status Code: 503 Service Unavailable

{
"result": "Insert Note failed."
}

Behavior/Processing

Behavior Modes

ModeTriggerProcessing PathResponse Shape
Create noteargs._id not providedReads latest note indicator for app, increments it, inserts new note.Wrapped success/error message.
Update noteargs._id providedValidates edit permission, updates note fields (except owner/created timestamp).Wrapped success/error message.

Impact on Other Data

  • New-note mode reads existing note indicators for the same app to assign the next indicator value.

Database Collections

CollectionUsed forData touched by this endpoint
countly.notesPrimary notes storage.Reads latest indicator, inserts new notes, or updates existing notes.

Examples

Example 1: Create note

/i/notes/save?api_key=YOUR_API_KEY&app_id=6991c75b024cb89cdc04efd2&args={"app_id":"6991c75b024cb89cdc04efd2","note":"Traffic anomaly reviewed","ts":1739788800000,"noteType":"public","color":"#F59E0B"}
{
"result": "Success"
}

Example 2: Update note

/i/notes/save?api_key=YOUR_API_KEY&app_id=6991c75b024cb89cdc04efd2&args={"_id":"67b2fc5a7274b47fce18c301","app_id":"6991c75b024cb89cdc04efd2","note":"Updated note text","ts":1739788800000,"noteType":"public","color":"#22C55E"}
{
"result": "Success"
}

Limitations

  • Edit permission depends on note ownership and visibility (public/private).
  • Invalid JSON in args can fail validation before note processing.

Last Updated

2026-02-17