Skip to main content

Sync local mutations​

An endpoint to sync local mutations to the server.

Query Parameters
    lastMutationAt float required

    The timestamp of the last mutation that was applied on the server. The value needs to match the latest value from get mutations endpoint, otherwise, the request will be rejected.

Request Body
    mutations object[] required
  • Array [
  • type string required

    Possible values: [CREATE, UPDATE, DELETE]

    The type of the mutation

    resource string required

    Possible values: [BOOKMARK, COLLECTION, COLLECTION_BOOKMARK, NOTE]

    Resource the mutation applies to.

    resourceId string

    Server's ID for finding the resource during update/delete operations.

    data object

    Resource data. Format depends on resource type.

  • ]
Responses

Request has been handled successfully.

Response Headers
  • X-Mutation-At string

    Unix timestamp (milliseconds) of the latest mutation for the user. Clients should store this value and include it in subsequent mutation requests for optimistic concurrency control.


Schema
    success boolean
    data object

    Response schema for post mutations endpoint

    mutations object[]

    Array of mutations that were successfully applied on the server.

  • Array [
  • type string required

    Possible values: [CREATE, UPDATE, DELETE]

    The type of the mutation

    resource string required

    Possible values: [BOOKMARK, COLLECTION, COLLECTION_BOOKMARK, NOTE]

    The resource the mutation was applied to.

    resourceId string

    The id of the resource the mutation was applied to. Will not be present for resources that use composite keys (e.g. COLLECTION_BOOKMARK uses data.collection and data.bookmark instead).

    data object

    The latest version of the data of the resource that was mutated. Will be empty when the mutation is a delete.

    timestamp float required

    Unix timestamp when the latest mutation of the resource occurred

  • ]
  • page float

    Current page number

    limit float

    Items per page

    total float

    Total number of mutations

    hasMore boolean

    Whether more pages exist

    lastMutationAt float required

    Timestamp of the latest mutation that was applied on the server. This should be used for subsequent sync requests.

Loading...