Skip to main content

Update bookmark

Enterprise

This endpoint is part of Countly Enterprise. To get access, contact sales or compare versions. Existing customers can reach the support portal with questions.

Endpoint

/i/drill/edit_bookmark

Overview

Updates an existing bookmark created by the current member. The stored query uses the same field names and operator syntax as /o?method=segmentation queryObject.

Authentication

Pass api_key or auth_token as a query parameter, or send countly-token as a header. See Authentication.

Permissions

Requires drill Read permission.

Request Parameters

ParameterTypeRequiredDescription
app_idStringYesTarget app ID.
bookmark_idStringYesBookmark ID to edit.
event_keyStringYesEvent key for bookmark scope.
query_objJSON String (Object)YesDrill query object as JSON string. Use the same shape as /o?method=segmentation queryObject, for example {"up.cc":"US"} or {"sg.plan":{"$in":["pro"]}}.
query_textStringYesHuman-readable query label stored with the bookmark. If empty with a normal bookmark, the server stores {} as query_obj.
by_valJSON String (Array)YesDrill projection key list as JSON string, equivalent to /o?method=segmentation projectionKey, for example ["up.p"] or ["sg.plan"].
by_val_textStringYesHuman-readable projection label stored with the bookmark. If by_val or by_val_text is empty, the server stores [] and an empty label.
nameStringYesBookmark name.
descStringYesBookmark description.
globalBoolean StringYestrue or false.
visualizationStringNoVisualization hint.
api_keyStringConditionalRequired if auth_token is not provided.
auth_tokenStringConditionalRequired if api_key is not provided.

Examples

/i/drill/edit_bookmark?
app_id=64f5c0d8f4f7ac0012ab3456&
bookmark_id=67bd31c92e7f0b0012ab4567&
event_key=[CLY]_session&
name=US Sessions Updated&
desc=Updated bookmark description&
global=false&
query_obj={"up.cc":"US"}&
query_text=Country is US&
by_val=["up.p"]&
by_val_text=Platform

Response

Success Response

{
"result": {
"status": "Success",
"sign": "f3eab4f2f8d1..."
}
}

Response Fields

FieldTypeDescription
result.statusStringSuccess status string.
result.signStringUpdated bookmark signature hash.

Error Responses

  • 200
{
"result": "Not enough args"
}
  • 400
{
"result": "Bookmark not found"
}
  • 400
{
"result": "Duplicate entry"
}

Behavior

  • Validates required update fields.
  • Loads bookmark by ID and ensures it is owned by the current member. Unlike delete, global bookmarks are not editable unless the current member is also the creator.
  • Parses query_obj to detect internal bookmarks. For normal bookmarks, query_obj and query_text must both be provided or the stored query is reset to {} with an empty label.
  • Stores by_val only when both by_val and by_val_text are provided; otherwise stores [] and an empty label.
  • Recomputes signature and event-app hash from the merged bookmark state.
  • Rejects duplicate bookmarks when the recomputed sign already exists.
  • Updates bookmark and emits bookmark/systemlog events.
Implementation details

Database Collections

CollectionUsed forData touched by this endpoint
countly_drill.drill_bookmarksEndpoint data sourceStores endpoint-related records this endpoint reads or modifies.
countly.systemlogsAudit trailContains system action records used by this endpoint for audit output or audit writes.