URL:
https://<kgserver_replicaId>/synchronize
Methods:
POST
Version Introduced:
12.1

Description

The synchronize operation is performed on a knowledge graph service replica. The operation synchronizes changes between the knowledge graph service and the replica based on the replicaId provided by the client. The Sync feature must be enabled on the knowledge graph service.

The client obtains the replicaId by executing the create operation or by accessing the replicas resource. The syncDirection determines what kind of edits are accepted during the synchronize operation. syncDirection is defined during the create operation and is determined by a combination of portal user types and knowledge graph service capabilities. The create operation provides more details on the syncDirection types defined in a replica.

When synchronizing changes from the knowledge graph service to the replica, the synchronize response returns the syncDataUrl which can be used to download the file containing edits for the replica.

Request parameters

ParameterDetails

downloadParameters

(Required)

Specifies what data will be downloaded. When this option is set to replicaSnapshot the server will return current entities and relationships, as defined by the replica definition, instead of edits.

When using replicaDeltas edits from the knowledge graph service will be downloaded to the replica based on the replica definition and lastSyncDate

Syntax

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
{
  "synchronizeReplicaRequest": {
    "downloadParameters": {
      "replicaDeltas": {
        "lastSyncDate": <int64> // milliseconds since epoch
      }
    }
  }
}

Values: replicaDeltas | replicaSnapshot

dataFormat

(required)

The format of the download data. The only supported format is PBF

uploadEdits

(required)

Specifies how edits will be uploaded from the replica to the knowledge graph service. When using uploadFile, the portal item id is required as editsUploadId.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
   {
    "synchronizeReplicaRequest": {
    "downloadParameters": {
      "replicaSnapshot": {},
      "dataFormat": <PBF>
    },
    "uploadEdits": {
      "uploadFile": {
        "editsUploadId": <bytes>,
          "uploadFormat": <PBF>
      }
    }
    }
  }

When using syncApplyEdits, the edits will be uploaded from the replica to the knowledge graph service by executing the applyEdits operation.

Syntax

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{
  "synchronizeReplicaRequest": {
  "downloadParameters": {
    "replicaDeltas": {
      "lastSyncDate": <int64>
    },
    "dataFormat": "PBF"
  },
  "uploadEdits": {
    "syncApplyEdits": {
    "editsHeader": {},
    "frames": {
      "frames": [
      {
        "adds": {}
      },
      {
        "updates": {}
      },
      {
        "deletes": {}
      }
      ]
    }
    }
  }
  }
}

Values: syncApplyEdits | uploadFile

uploadFormat

(optional)

Specifies the file format for upload when uploadEdits is set to uploadFile. The only supported format is PBF

async

(Optional)

If true, the request is processed as an asynchronous job, and a URL is returned that a client can visit to check the status of the job. The default is false.

Values: true | false

f

The response format. The default format is html.

Values: html | pbf

Example usage

The following is a sample URL used to access the synchronize operation for a replica ID 13034e5f-177d-4754-af3e-298bc708cbc4 on a knowledge graph service named FieldService. This example request highlights downloading a snapshot of the knowledge graph service and using an upload file for edit upload:

https://organization.example.com/<context>/rest/services/Hosted/FieldService/KnowledgeGraphServer/replicas/13034e5f-177d-4754-af3e-298bc708cbc4/synchronize

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
 {
  "synchronizeReplicaRequest": {
   "downloadParameters": {
    "replicaSnapshot": {},
    "dataFormat": "PBF"
   },
   "uploadEdits": {
    "uploadFile": {
     "editsUploadId": "00000001-ABCD-EF11-9999-0123456789AB",
     "uploadFormat": "PBF"
    }
   }
  }
 }

Example Response syntax

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
{
  "synchronizeReplicaResult": {
    "replicaId": <bytes>,
    "syncDate": <int64>,
    "downloadResults": {
      "syncDataFormat": <PBF>,
      "syncDataUrl": <URL>
    }
	}
}

Example Response

The below is the example response to the above request:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
{
  "synchronizeReplicaResult": {
    "replicaId": "{6ED11D5E-F3B8-4D15-9A78-B784E54803D8}",
    "syncDate": "2026-03-07T23:09:14.993Z",
    "downloadResults": {
      "syncDataFormat": "PBF",
      "syncDataUrl": "https:///organization.example.com/server/rest/directories/arcgisoutput/Hosted/FieldService_KnowledgeGraphServer/_ags_kgs_25556a35-b71e-472e-a20b-56aba12b0dba.zip"
    }
	}
}

Requests and responses

This operation can be performed by sending a PBF-formatted request and receiving a PBF-formatted response. The status of the operation can be queried using a PBF-formatted response. Details of the request and response parameters are provided in the appropriate .proto files.

PBF Request

Create a PBF-formatted request to perform this operation based on the SynchronizeReplicaRequest.proto file.

PBF Response

When executing this operation asynchronously, create a PBF-formatted response to query the status of the operation based on the AsyncStatusResponse.proto file.

Create a PBF-formatted response to query the status of the operation based on the SynchronizeReplicaResponse.proto file.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.