Skip to content
Skip to Content
DevelopersAPI referenceCleanup

Merge copies of one page

POST
/v1/cleanup/duplicates/merge

Folds copies of one page into the copy that stays, all in one transaction. The copy that stays gets:

  • every tag from the other copies
  • their notes, joined with a blank line (a note already inside another is not repeated, and if joining would pass 1 MB the kept note stays alone)
  • a favourite flag if any copy had one
  • a place in every list the other copies were in

The other copies are deleted like any deleted item: a tombstone for sync, an item.deleted webhook event, and their stored files removed. A refused merge changes nothing.

Authorization

bearer
headerAuthorizationBearer <token>

A personal API key (ga_…), sent as Authorization: Bearer ga_…. A key gets 403 on a resource it has no access to, and on anything that changes data without write access.

Request Body

application/json
  1. body
keep_id*string

The copy that stays

Length26 <= length <= 26
remove_ids*array<>

The copies to fold into keep_id and delete. All of them must be copies of the same page as keep_id.

Items1 <= items <= 50

Response Body

Which copy stayed and which were removed

application/json
  1. response
kept_id*string
removed_ids*array<string>
Example Request
curl -X POST 'https://example.com/v1/cleanup/duplicates/merge' \  -H 'Content-Type: application/json' \  -d '{  "keep_id": "stringstringstringstringst",  "remove_ids": [    "stringstringstringstringst"  ]}'
Example Response
{  "kept_id": "string",  "removed_ids": [    "string"  ]}