Is this what you're trying to do?
import requests
from arcgis import GIS
from arcgis.features import FeatureLayerCollection
url = "https://pythonapi.playground.esri.com/server/rest/services/Hosted/Ports_in_the_Western_US/FeatureServer"
gis = GIS("https://pythonapi.playground.esri.com/portal", "arcgis_python", "amazing_arcgis_123")
flc = FeatureLayerCollection(url, gis)
replica = flc.replicas.create(
replica_name = 'arcgis_python_api_ports',
layers='0',
sync_model="perLayer",
target_type="server",
data_format="sqlite",
asynchronous=True
)
status_url = replica["statusUrl"]
params = {
"f": "json",
"token": gis._con.token
}
r = requests.post(status_url, params=params)
Where you can then use r.json() to get a json response from the status url:
{'responseType': 'esriReplicaResponseTypeData',
'replicaID': '037B207A-4E7B-423C-AC99-F9EE3AAE96E6',
'replicaName': 'arcgis_python_1696596866617',
'resultUrl': 'https://pythonapi.playground.esri.com/server/rest/directories/arcgisjobs/system/synctools_gpserver/je1fb0eacd85444baae62274cd6ea9811/scratch/_ags_data5464957EDC9346558F5FFEA3DCE5AEBC.geodatabase',
'transportType': 'esriTransportTypeURL',
'targetType': 'server',
'lastUpdatedTime': 1696596867000,
'layerServerGens': [{'serverGen': 1696596865593, 'id': 0, 'serverSibGen': 0}],
'submissionTime': 1696596865000,
'status': 'Completed'}