{
"error": "invalid request: upstream pbx.example.com: mode cannot change; delete the upstream and create it again"
}
{
"error": "missing or unknown API key"
}
{
"error": "plan changed; run sync again"
}
{
"error": "internal error"
}
Config
Make the tenant's configuration match a snapshot
Plans the changes that make the tenant’s apps, upstreams, and
managed mode users match snapshot, and applies them in one
transaction. pgw stores either every change or none.
pgw matches an app by platform and bundle ID, an upstream by host,
and a user by upstream host and username. A field that the snapshot
leaves out takes the default of a create request. An empty secret
keeps the stored one. A change names the fields that change, and
names a changed secret without its value. Without prune, pgw
deletes nothing. With prune, it deletes the records that the
snapshot leaves out, and devices counts the bindings that each
delete removes. pgw deletes an upstream’s users with it. pgw never
compares or deletes the users of an upstream with
user_source: kamailio.
With dry_run, pgw returns the plan and its digest and changes
nothing. When a plan deletes anything, an apply must send the
plan_digest of the dry run, and pgw answers 409 when the plan
changed since then. pgw answers 409, also for a dry run, when
the snapshot gives an upstream a host or a domain that another
tenant uses. pgw answers 400 when it gives one host or domain to
two of the tenant’s upstreams. A domain can move from one upstream
to another in one sync. pgw checks the database of each new Kamailio
upstream, and of each upstream whose Kamailio settings or password
change, before it plans to store them.
The body can be up to 16 MiB.
POST
/
config
/
sync
Error
A valid request URL is required to generate request examples
{
"error": "invalid request: upstream pbx.example.com: mode cannot change; delete the upstream and create it again"
}
{
"error": "missing or unknown API key"
}
{
"error": "plan changed; run sync again"
}
{
"error": "internal error"
}
Authorizations
Authorization
string
header
required
The tenant API key that POST /bootstrap returned.
Body
application/json
snapshot
object
required
A tenant's configuration. The records use the fields of the create
requests, except that a secret can be empty, which keeps the stored
one. A null list leaves its records alone, even with prune. An empty list names the section with no records,
so prune deletes every record of that kind. An export always
sends apps, upstreams, and the users of each upstream whose
users pgw stores.
Show child attributes
prune
boolean
default:false
Delete the records that the snapshot leaves out, within the
lists that it sends. A null or missing list deletes nothing.
dry_run
boolean
default:false
Return the plan and change nothing.
plan_digest
string
The plan_digest of the dry run. Required when the plan deletes.
Response
The plan, and whether pgw applied it.
changes
object[]
required
Show child attributes
plan_digest
string
required
Identifies the plan. It doesn't depend on the order of the
changes or on their devices.
applied
boolean
required
Whether pgw stored the changes.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"pgw","description":"Documentation for pgw, the RFC 8599 push gateway for SIP.","colors":{"primary":"#2563eb","light":"#38bdf8","dark":"#0369a1"},"logo":{"light":"https://mintcdn.com/pgw/AxRzHBtQGOZ6Qv0v/logo/light.svg?fit=max\u0026auto=format\u0026n=AxRzHBtQGOZ6Qv0v\u0026q=85\u0026s=3247acd1cff3a49682e5cb75ed65f662","dark":"https://mintcdn.com/pgw/AxRzHBtQGOZ6Qv0v/logo/dark.svg?fit=max\u0026auto=format\u0026n=AxRzHBtQGOZ6Qv0v\u0026q=85\u0026s=a79e42db455abadbc9e15d88c72bac43","href":"https://pgw.sipmicro.services/"},"favicon":"https://mintcdn.com/pgw/AxRzHBtQGOZ6Qv0v/favicon.svg?fit=max\u0026auto=format\u0026n=AxRzHBtQGOZ6Qv0v\u0026q=85\u0026s=4a2f2dbd7c24e23be16239974fed9f48","api":{"playground":{"display":"interactive","proxy":false},"examples":{"languages":["curl","go","python","javascript"]}},"appearance":{"default":"dark"},"background":{"color":{"dark":"#000000"}},"navbar":{"primary":{"type":"button","label":"Download","href":"https://pgw.sipmicro.services/#download"}},"fonts":{"family":"Inter"},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"pgw","hasAudioNarration":false,"actualSubdomain":"pgw","customDomains":["docs.pgw.sipmicro.services"],"gitSource":{"type":"github","owner":"civilcoder55","repo":"pgw-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":"","_id":"6af9754d4fd4397144e5b6cb"},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6afd77f05780c727fdcc104e","clientVersion":"0.0.4177","searchFilterCounts":[{"language":"default","tag":"API reference","count":28},{"language":"default","tag":"Endpoints","count":24},{"language":"default","tag":"Operations","count":11},{"language":"default","tag":"Configuration","count":11},{"language":"default","tag":"Get started","count":8},{"language":"default","tag":"Upstreams","count":8},{"language":"default","tag":"App developers","count":7},{"language":"default","tag":"Platform","count":7},{"language":"default","tag":"Observability","count":6},{"language":"default","tag":"Reference","count":6}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":":root{--sidebar-width: 14rem}"}],"page":{"pagePath":"api-reference/config/make-the-tenants-configuration-match-a-snapshot","slug":"/api-reference/config/make-the-tenants-configuration-match-a-snapshot","pageMetadata":{"title":"Make the tenant's configuration match a snapshot","description":"Plans the changes that make the tenant's apps, upstreams, and\nmanaged mode users match `snapshot`, and applies them in one\ntransaction. pgw stores either every change or none.\n\npgw matches an app by platform and bundle ID, an upstream by host,\nand a user by upstream host and username. A field that the snapshot\nleaves out takes the default of a create request. An empty secret\nkeeps the stored one. A change names the fields that change, and\nnames a changed secret without its value. Without `prune`, pgw\ndeletes nothing. With `prune`, it deletes the records that the\nsnapshot leaves out, and `devices` counts the bindings that each\ndelete removes. pgw deletes an upstream's users with it. pgw never\ncompares or deletes the users of an upstream with\n`user_source: kamailio`.\n\nWith `dry_run`, pgw returns the plan and its digest and changes\nnothing. When a plan deletes anything, an apply must send the\n`plan_digest` of the dry run, and pgw answers `409` when the plan\nchanged since then. pgw answers `409`, also for a dry run, when\nthe snapshot gives an upstream a host or a domain that another\ntenant uses. pgw answers `400` when it gives one host or domain to\ntwo of the tenant's upstreams. A domain can move from one upstream\nto another in one sync. pgw checks the database of each new Kamailio\nupstream, and of each upstream whose Kamailio settings or password\nchange, before it plans to store them.\n\nThe body can be up to 16 MiB.\n","deprecated":null,"version":null,"openapi":"/reference/openapi.yaml post /config/sync","href":"/api-reference/config/make-the-tenants-configuration-match-a-snapshot","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_Fragment, {\n children: [_jsxs(_components.p, {\n children: [\"Plans the changes that make the tenant’s apps, upstreams, and\\nmanaged mode users match \", _jsx(_components.code, {\n children: \"snapshot\"\n }), \", and applies them in one\\ntransaction. pgw stores either every change or none.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"pgw matches an app by platform and bundle ID, an upstream by host,\\nand a user by upstream host and username. A field that the snapshot\\nleaves out takes the default of a create request. An empty secret\\nkeeps the stored one. A change names the fields that change, and\\nnames a changed secret without its value. Without \", _jsx(_components.code, {\n children: \"prune\"\n }), \", pgw\\ndeletes nothing. With \", _jsx(_components.code, {\n children: \"prune\"\n }), \", it deletes the records that the\\nsnapshot leaves out, and \", _jsx(_components.code, {\n children: \"devices\"\n }), \" counts the bindings that each\\ndelete removes. pgw deletes an upstream’s users with it. pgw never\\ncompares or deletes the users of an upstream with\\n\", _jsx(_components.code, {\n children: \"user_source: kamailio\"\n }), \".\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"With \", _jsx(_components.code, {\n children: \"dry_run\"\n }), \", pgw returns the plan and its digest and changes\\nnothing. When a plan deletes anything, an apply must send the\\n\", _jsx(_components.code, {\n children: \"plan_digest\"\n }), \" of the dry run, and pgw answers \", _jsx(_components.code, {\n children: \"409\"\n }), \" when the plan\\nchanged since then. pgw answers \", _jsx(_components.code, {\n children: \"409\"\n }), \", also for a dry run, when\\nthe snapshot gives an upstream a host or a domain that another\\ntenant uses. pgw answers \", _jsx(_components.code, {\n children: \"400\"\n }), \" when it gives one host or domain to\\ntwo of the tenant’s upstreams. A domain can move from one upstream\\nto another in one sync. pgw checks the database of each new Kamailio\\nupstream, and of each upstream whose Kamailio settings or password\\nchange, before it plans to store them.\"]\n }), \"\\n\", _jsx(_components.p, {\n children: \"The body can be up to 16 MiB.\"\n })]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Make the tenant's configuration match a snapshot","description":"Plans the changes that make the tenant's apps, upstreams, and\nmanaged mode users match `snapshot`, and applies them in one\ntransaction. pgw stores either every change or none.\n\npgw matches an app by platform and bundle ID, an upstream by host,\nand a user by upstream host and username. A field that the snapshot\nleaves out takes the default of a create request. An empty secret\nkeeps the stored one. A change names the fields that change, and\nnames a changed secret without its value. Without `prune`, pgw\ndeletes nothing. With `prune`, it deletes the records that the\nsnapshot leaves out, and `devices` counts the bindings that each\ndelete removes. pgw deletes an upstream's users with it. pgw never\ncompares or deletes the users of an upstream with\n`user_source: kamailio`.\n\nWith `dry_run`, pgw returns the plan and its digest and changes\nnothing. When a plan deletes anything, an apply must send the\n`plan_digest` of the dry run, and pgw answers `409` when the plan\nchanged since then. pgw answers `409`, also for a dry run, when\nthe snapshot gives an upstream a host or a domain that another\ntenant uses. pgw answers `400` when it gives one host or domain to\ntwo of the tenant's upstreams. A domain can move from one upstream\nto another in one sync. pgw checks the database of each new Kamailio\nupstream, and of each upstream whose Kamailio settings or password\nchange, before it plans to store them.\n\nThe body can be up to 16 MiB.\n","deprecated":null,"version":null,"openapi":"/reference/openapi.yaml post /config/sync","href":"/api-reference/config/make-the-tenants-configuration-match-a-snapshot","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["Config"],"operationId":"syncConfig","summary":"Make the tenant's configuration match a snapshot","description":"Plans the changes that make the tenant's apps, upstreams, and\nmanaged mode users match `snapshot`, and applies them in one\ntransaction. pgw stores either every change or none.\n\npgw matches an app by platform and bundle ID, an upstream by host,\nand a user by upstream host and username. A field that the snapshot\nleaves out takes the default of a create request. An empty secret\nkeeps the stored one. A change names the fields that change, and\nnames a changed secret without its value. Without `prune`, pgw\ndeletes nothing. With `prune`, it deletes the records that the\nsnapshot leaves out, and `devices` counts the bindings that each\ndelete removes. pgw deletes an upstream's users with it. pgw never\ncompares or deletes the users of an upstream with\n`user_source: kamailio`.\n\nWith `dry_run`, pgw returns the plan and its digest and changes\nnothing. When a plan deletes anything, an apply must send the\n`plan_digest` of the dry run, and pgw answers `409` when the plan\nchanged since then. pgw answers `409`, also for a dry run, when\nthe snapshot gives an upstream a host or a domain that another\ntenant uses. pgw answers `400` when it gives one host or domain to\ntwo of the tenant's upstreams. A domain can move from one upstream\nto another in one sync. pgw checks the database of each new Kamailio\nupstream, and of each upstream whose Kamailio settings or password\nchange, before it plans to store them.\n\nThe body can be up to 16 MiB.\n","requestBody":"9d7a30ed-8237-45be-912d-96ca74b96db7","responses":{"200":"ad61cab7-38e2-4ad2-a93e-71c088bcf20c","400":"d17f940f-8a4a-4792-8831-c6a8ec19ec40","401":"fc36d1e1-b187-4cf6-ad62-4ce561397c40","409":"977dc1c4-e0d2-4a11-b193-8bdd4460289f","500":"ddc5a83c-647f-4846-a021-2fea43577cc3"},"method":"post","type":"path","servers":["962d9e3c-eaaf-4447-9e2e-c710d720d8c4","ca7875ea-5910-467e-ba3d-4340b8927ded"],"security":["d5d8905a-dbea-4877-8c19-6dd7a6f5eb2e"],"path":"/config/sync","baseUrlOptions":["{baseUrl}","http://localhost:8080/api/v1"],"title":"Make the tenant's configuration match a snapshot","codeSamples":[],"requestExampleLanguages":["bash","go","python","javascript"],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated","disableProxy":true},"dependencies":{"parameters":{},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["snapshot"],"properties":{"snapshot":{"type":"object","required":["apps","upstreams"],"description":"A tenant's configuration. The records use the fields of the create\nrequests, except that a secret can be empty, which keeps the stored\none. A `null` list leaves its records alone, even with `prune`. An empty list names the section with no records,\nso `prune` deletes every record of that kind. An export always\nsends `apps`, `upstreams`, and the `users` of each upstream whose\nusers pgw stores.\n","properties":{"apps":{"oneOf":[{"type":"array","items":{"type":"object","additionalProperties":false,"required":["platform","bundle_id"],"properties":{"platform":{"type":"string","enum":["ios","android","web"],"isRequired":true,"uniqueKey":"snapshot.apps.oneOf.0.items.[INDEX].platform","typeLabel":"enum\u003cstring>"},"bundle_id":{"type":"string","description":"The iOS bundle ID or the Android package name. For a web app, any label.","isRequired":true,"uniqueKey":"snapshot.apps.oneOf.0.items.[INDEX].bundle_id","typeLabel":"string"},"name":{"type":"string","maxLength":64,"description":"A name for the app, which log lines show. Without one, log lines show the bundle ID. Up to 64 characters, with no control characters.","uniqueKey":"snapshot.apps.oneOf.0.items.[INDEX].name","typeLabel":"string"},"apns_team_id":{"type":"string","description":"The Apple team ID. Required for iOS.","uniqueKey":"snapshot.apps.oneOf.0.items.[INDEX].apns_team_id","typeLabel":"string"},"apns_key_id":{"type":"string","description":"The APNs key ID. Required for iOS.","uniqueKey":"snapshot.apps.oneOf.0.items.[INDEX].apns_key_id","typeLabel":"string"},"apns_key_pem":{"type":"string","description":"The contents of the APNs `.p8` key, a PKCS","writeOnly":true,"uniqueKey":"snapshot.apps.oneOf.0.items.[INDEX].apns_key_pem","typeLabel":"string"},"apns_environment":{"type":"string","enum":["production","sandbox"],"default":"production","description":"Use `sandbox` for builds from Xcode.","uniqueKey":"snapshot.apps.oneOf.0.items.[INDEX].apns_environment","typeLabel":"enum\u003cstring>"},"fcm_project_id":{"type":"string","description":"The Firebase project ID. pgw sends pushes to this project. Required for Android. Must not be all digits.","uniqueKey":"snapshot.apps.oneOf.0.items.[INDEX].fcm_project_id","typeLabel":"string"},"fcm_project_number":{"type":"string","pattern":"^[0-9]*$","description":"The Firebase project number. Optional, but Linphone identifies its project by this number, so a Linphone build needs it.","uniqueKey":"snapshot.apps.oneOf.0.items.[INDEX].fcm_project_number","typeLabel":"string"},"fcm_service_account_json":{"type":"string","description":"The contents of the Firebase service account key file. Required for Android.","writeOnly":true,"uniqueKey":"snapshot.apps.oneOf.0.items.[INDEX].fcm_service_account_json","typeLabel":"string"},"vapid_subject":{"type":"string","description":"A `mailto:` or `https:` URI that push services can use to contact you. Required for web.","uniqueKey":"snapshot.apps.oneOf.0.items.[INDEX].vapid_subject","typeLabel":"string"},"vapid_private_key_pem":{"type":"string","description":"A P-256 private key in PEM, PKCS","writeOnly":true,"uniqueKey":"snapshot.apps.oneOf.0.items.[INDEX].vapid_private_key_pem","typeLabel":"string"},"delivery_mode":{"type":"string","enum":["provisional","always_push"],"description":"Omit to use the gateway default.","uniqueKey":"snapshot.apps.oneOf.0.items.[INDEX].delivery_mode","typeLabel":"enum\u003cstring>"},"managed_refresh_push":{"type":"string","enum":["","on","off"],"description":"Whether pgw sends the app's managed iOS and Android devices a refresh push before their registration expires. Omit to use the gateway default.","uniqueKey":"snapshot.apps.oneOf.0.items.[INDEX].managed_refresh_push","typeLabel":"enum\u003cstring>"}},"uniqueKey":"snapshot.apps.oneOf.0.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"snapshot.apps.oneOf.0","typeLabel":"object[]"},{"type":"null","items":{"type":"object","additionalProperties":false,"required":["platform","bundle_id"],"properties":{"platform":{"type":"string","enum":["ios","android","web"]},"bundle_id":{"type":"string","description":"The iOS bundle ID or the Android package name. For a web app, any label."},"name":{"type":"string","maxLength":64,"description":"A name for the app, which log lines show. Without one, log lines show the bundle ID. Up to 64 characters, with no control characters."},"apns_team_id":{"type":"string","description":"The Apple team ID. Required for iOS."},"apns_key_id":{"type":"string","description":"The APNs key ID. Required for iOS."},"apns_key_pem":{"type":"string","description":"The contents of the APNs `.p8` key, a PKCS","writeOnly":true},"apns_environment":{"type":"string","enum":["production","sandbox"],"default":"production","description":"Use `sandbox` for builds from Xcode."},"fcm_project_id":{"type":"string","description":"The Firebase project ID. pgw sends pushes to this project. Required for Android. Must not be all digits."},"fcm_project_number":{"type":"string","pattern":"^[0-9]*$","description":"The Firebase project number. Optional, but Linphone identifies its project by this number, so a Linphone build needs it."},"fcm_service_account_json":{"type":"string","description":"The contents of the Firebase service account key file. Required for Android.","writeOnly":true},"vapid_subject":{"type":"string","description":"A `mailto:` or `https:` URI that push services can use to contact you. Required for web."},"vapid_private_key_pem":{"type":"string","description":"A P-256 private key in PEM, PKCS","writeOnly":true},"delivery_mode":{"type":"string","enum":["provisional","always_push"],"description":"Omit to use the gateway default."},"managed_refresh_push":{"type":"string","enum":["","on","off"],"description":"Whether pgw sends the app's managed iOS and Android devices a refresh push before their registration expires. Omit to use the gateway default."}}},"isRequired":true,"uniqueKey":"snapshot.apps.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"snapshot.apps","typeLabel":"object[] | null"},"upstreams":{"oneOf":[{"type":"array","items":{"type":"object","additionalProperties":false,"required":["name","host"],"description":"An upstream with its managed mode users beside its fields. The\nfields are those of `CreateUpstreamRequest`, except that\n`kamailio.password` can be left out, which keeps the stored one.\n","properties":{"name":{"type":"any","isRequired":true,"uniqueKey":"snapshot.upstreams.oneOf.0.items.[INDEX].name","typeLabel":"any"},"host":{"type":"any","isRequired":true,"uniqueKey":"snapshot.upstreams.oneOf.0.items.[INDEX].host","typeLabel":"any"},"domains":{"type":"any","uniqueKey":"snapshot.upstreams.oneOf.0.items.[INDEX].domains","typeLabel":"any"},"port":{"type":"any","uniqueKey":"snapshot.upstreams.oneOf.0.items.[INDEX].port","typeLabel":"any"},"transport":{"type":"any","uniqueKey":"snapshot.upstreams.oneOf.0.items.[INDEX].transport","typeLabel":"any"},"max_expires":{"type":"any","uniqueKey":"snapshot.upstreams.oneOf.0.items.[INDEX].max_expires","typeLabel":"any"},"invite_source_cidrs":{"type":"any","uniqueKey":"snapshot.upstreams.oneOf.0.items.[INDEX].invite_source_cidrs","typeLabel":"any"},"strict_path":{"type":"any","uniqueKey":"snapshot.upstreams.oneOf.0.items.[INDEX].strict_path","typeLabel":"any"},"mode":{"type":"any","uniqueKey":"snapshot.upstreams.oneOf.0.items.[INDEX].mode","typeLabel":"any"},"keepalive_seconds":{"type":"any","uniqueKey":"snapshot.upstreams.oneOf.0.items.[INDEX].keepalive_seconds","typeLabel":"any"},"realm":{"type":"any","uniqueKey":"snapshot.upstreams.oneOf.0.items.[INDEX].realm","typeLabel":"any"},"managed_registration":{"type":"any","uniqueKey":"snapshot.upstreams.oneOf.0.items.[INDEX].managed_registration","typeLabel":"any"},"contact_strategy":{"type":"any","uniqueKey":"snapshot.upstreams.oneOf.0.items.[INDEX].contact_strategy","typeLabel":"any"},"user_source":{"type":"any","uniqueKey":"snapshot.upstreams.oneOf.0.items.[INDEX].user_source","typeLabel":"any"},"kamailio":{"type":"any","uniqueKey":"snapshot.upstreams.oneOf.0.items.[INDEX].kamailio","typeLabel":"any"},"app_auth":{"type":"any","uniqueKey":"snapshot.upstreams.oneOf.0.items.[INDEX].app_auth","typeLabel":"any"},"bearer":{"type":"any","uniqueKey":"snapshot.upstreams.oneOf.0.items.[INDEX].bearer","typeLabel":"any"},"users":{"oneOf":[{"type":"array","description":"The upstream's users. Not allowed with `user_source: kamailio`.\nWhen `null` or left out, `prune` leaves the upstream's users\nalone.\n","items":{"type":"object","additionalProperties":false,"required":["username"],"description":"A managed mode user in a snapshot. The fields are those of\n`CreateUserRequest`, except that `password` can be left out, which\nkeeps the stored one. A new user needs a password.\n","properties":{"username":{"type":"any","isRequired":true,"uniqueKey":"snapshot.upstreams.oneOf.0.items.[INDEX].users.oneOf.0.items.[INDEX].username","typeLabel":"any"},"domain":{"type":"any","uniqueKey":"snapshot.upstreams.oneOf.0.items.[INDEX].users.oneOf.0.items.[INDEX].domain","typeLabel":"any"},"auth_username":{"type":"any","uniqueKey":"snapshot.upstreams.oneOf.0.items.[INDEX].users.oneOf.0.items.[INDEX].auth_username","typeLabel":"any"},"password":{"type":"any","uniqueKey":"snapshot.upstreams.oneOf.0.items.[INDEX].users.oneOf.0.items.[INDEX].password","typeLabel":"any"},"enabled":{"type":"any","uniqueKey":"snapshot.upstreams.oneOf.0.items.[INDEX].users.oneOf.0.items.[INDEX].enabled","typeLabel":"any"}},"uniqueKey":"snapshot.upstreams.oneOf.0.items.[INDEX].users.oneOf.0.items.[INDEX]","typeLabel":"object"},"uniqueKey":"snapshot.upstreams.oneOf.0.items.[INDEX].users.oneOf.0","typeLabel":"object[]"},{"type":"null","description":"The upstream's users. Not allowed with `user_source: kamailio`.\nWhen `null` or left out, `prune` leaves the upstream's users\nalone.\n","items":{"type":"object","additionalProperties":false,"required":["username"],"description":"A managed mode user in a snapshot. The fields are those of\n`CreateUserRequest`, except that `password` can be left out, which\nkeeps the stored one. A new user needs a password.\n","properties":{"username":{"type":"any"},"domain":{"type":"any"},"auth_username":{"type":"any"},"password":{"type":"any"},"enabled":{"type":"any"}}},"uniqueKey":"snapshot.upstreams.oneOf.0.items.[INDEX].users.oneOf.1","typeLabel":"null"}],"uniqueKey":"snapshot.upstreams.oneOf.0.items.[INDEX].users","typeLabel":"object[] | null"}},"uniqueKey":"snapshot.upstreams.oneOf.0.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"snapshot.upstreams.oneOf.0","typeLabel":"object[]"},{"type":"null","items":{"type":"object","additionalProperties":false,"required":["name","host"],"description":"An upstream with its managed mode users beside its fields. The\nfields are those of `CreateUpstreamRequest`, except that\n`kamailio.password` can be left out, which keeps the stored one.\n","properties":{"name":{"type":"any"},"host":{"type":"any"},"domains":{"type":"any"},"port":{"type":"any"},"transport":{"type":"any"},"max_expires":{"type":"any"},"invite_source_cidrs":{"type":"any"},"strict_path":{"type":"any"},"mode":{"type":"any"},"keepalive_seconds":{"type":"any"},"realm":{"type":"any"},"managed_registration":{"type":"any"},"contact_strategy":{"type":"any"},"user_source":{"type":"any"},"kamailio":{"type":"any"},"app_auth":{"type":"any"},"bearer":{"type":"any"},"users":{"oneOf":[{"type":"array","description":"The upstream's users. Not allowed with `user_source: kamailio`.\nWhen `null` or left out, `prune` leaves the upstream's users\nalone.\n","items":{"type":"object","additionalProperties":false,"required":["username"],"description":"A managed mode user in a snapshot. The fields are those of\n`CreateUserRequest`, except that `password` can be left out, which\nkeeps the stored one. A new user needs a password.\n","properties":{"username":{"type":"any"},"domain":{"type":"any"},"auth_username":{"type":"any"},"password":{"type":"any"},"enabled":{"type":"any"}}}},{"type":"null","description":"The upstream's users. Not allowed with `user_source: kamailio`.\nWhen `null` or left out, `prune` leaves the upstream's users\nalone.\n","items":{"type":"object","additionalProperties":false,"required":["username"],"description":"A managed mode user in a snapshot. The fields are those of\n`CreateUserRequest`, except that `password` can be left out, which\nkeeps the stored one. A new user needs a password.\n","properties":{"username":{"type":"any"},"domain":{"type":"any"},"auth_username":{"type":"any"},"password":{"type":"any"},"enabled":{"type":"any"}}}}]}}},"isRequired":true,"uniqueKey":"snapshot.upstreams.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"snapshot.upstreams","typeLabel":"object[] | null"}},"isRequired":true,"uniqueKey":"snapshot","typeLabel":"object"},"prune":{"type":"boolean","default":false,"description":"Delete the records that the snapshot leaves out, within the\nlists that it sends. A `null` or missing list deletes nothing.\n","uniqueKey":"prune","typeLabel":"boolean"},"dry_run":{"type":"boolean","default":false,"description":"Return the plan and change nothing.","uniqueKey":"dry_run","typeLabel":"boolean"},"plan_digest":{"type":"string","description":"The `plan_digest` of the dry run. Required when the plan deletes.","uniqueKey":"plan_digest","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"example":{"snapshot":{"apps":[{"platform":"android","bundle_id":"com.example.phone","fcm_project_id":"example-phone"}],"upstreams":[{"name":"Main PBX","host":"pbx.example.com","mode":"managed","invite_source_cidrs":["203.0.113.10/32"],"users":[{"username":"1001"}]}]},"prune":true,"dry_run":true},"examples":{"Example":{"title":"Example","value":{"snapshot":{"apps":[{"platform":"android","bundle_id":"com.example.phone","fcm_project_id":"example-phone"}],"upstreams":[{"name":"Main PBX","host":"pbx.example.com","mode":"managed","invite_source_cidrs":["203.0.113.10/32"],"users":[{"username":"1001"}]}]},"prune":true,"dry_run":true}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"ad61cab7-38e2-4ad2-a93e-71c088bcf20c":{"description":"The plan, and whether pgw applied it.","content":{"application/json":{"schema":{"type":"object","required":["changes","plan_digest","applied"],"properties":{"changes":{"type":"array","items":{"type":"object","required":["op","kind","key"],"properties":{"op":{"type":"string","enum":["create","update","delete"],"isRequired":true,"uniqueKey":"changes.items.[INDEX].op","typeLabel":"enum\u003cstring>"},"kind":{"type":"string","enum":["app","upstream","user"],"isRequired":true,"uniqueKey":"changes.items.[INDEX].kind","typeLabel":"enum\u003cstring>"},"key":{"type":"string","description":"The record's natural key: `platform/bundle_id` for an app, the\nhost for an upstream, and `host/username` for a user, or\n`host/username@domain` for a user of an upstream with domains.\n","example":"pbx.example.com/1001","isRequired":true,"uniqueKey":"changes.items.[INDEX].key","typeLabel":"string"},"fields":{"type":"array","description":"The fields that an update changes. A secret is named, never shown.","items":{"type":"string","uniqueKey":"changes.items.[INDEX].fields.items.[INDEX]","typeLabel":"string"},"uniqueKey":"changes.items.[INDEX].fields","typeLabel":"string[]"},"devices":{"type":"integer","description":"The bindings that a delete removes.","uniqueKey":"changes.items.[INDEX].devices","typeLabel":"integer"}},"uniqueKey":"changes.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"changes","typeLabel":"object[]"},"plan_digest":{"type":"string","description":"Identifies the plan. It doesn't depend on the order of the\nchanges or on their `devices`.\n","isRequired":true,"uniqueKey":"plan_digest","typeLabel":"string"},"applied":{"type":"boolean","description":"Whether pgw stored the changes.","isRequired":true,"uniqueKey":"applied","typeLabel":"boolean"}},"uniqueKey":"","typeLabel":"object"},"example":{"changes":[{"op":"update","kind":"app","key":"android/com.example.phone","fields":["fcm_service_account_json"]},{"op":"delete","kind":"upstream","key":"old.example.com","devices":3}],"plan_digest":"9f2c4e0b7a1d3f5e6c8b9a0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f","applied":false},"examples":{"Example":{"title":"Example","value":{"changes":[{"op":"update","kind":"app","key":"android/com.example.phone","fields":["fcm_service_account_json"]},{"op":"delete","kind":"upstream","key":"old.example.com","devices":3}],"plan_digest":"9f2c4e0b7a1d3f5e6c8b9a0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f","applied":false}}},"exampleType":"examples"}},"exampleType":"examples"},"d17f940f-8a4a-4792-8831-c6a8ec19ec40":{"description":"The body isn't valid, a record in the snapshot isn't valid, or a\nKamailio database check failed. The message names the record by\nits key.\n","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"What went wrong. Never contains the values that you sent.","isRequired":true,"uniqueKey":"error","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":"invalid request: upstream pbx.example.com: mode cannot change; delete the upstream and create it again"},"examples":{"Example":{"title":"Example","value":{"error":"invalid request: upstream pbx.example.com: mode cannot change; delete the upstream and create it again"}}},"exampleType":"examples"}},"exampleType":"examples"},"fc36d1e1-b187-4cf6-ad62-4ce561397c40":{"description":"The API key is missing or unknown.","headers":{"WWW-Authenticate":{"schema":{"type":"string","const":"Bearer"}}},"content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"What went wrong. Never contains the values that you sent.","isRequired":true,"uniqueKey":"error","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":"missing or unknown API key"},"examples":{"Example":{"title":"Example","value":{"error":"missing or unknown API key"}}},"exampleType":"examples"}},"exampleType":"examples"},"977dc1c4-e0d2-4a11-b193-8bdd4460289f":{"description":"The plan deletes and `plan_digest` is missing or isn't the plan's,\nor an upstream host or domain in the snapshot overlaps a name of\nanother tenant.\npgw changed nothing.\n","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"What went wrong. Never contains the values that you sent.","isRequired":true,"uniqueKey":"error","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":"plan changed; run sync again"},"examples":{"Example":{"title":"Example","value":{"error":"plan changed; run sync again"}}},"exampleType":"examples"}},"exampleType":"examples"},"ddc5a83c-647f-4846-a021-2fea43577cc3":{"description":"pgw failed to complete the request. The details are in pgw's log.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"What went wrong. Never contains the values that you sent.","isRequired":true,"uniqueKey":"error","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":"internal error"},"examples":{"Example":{"title":"Example","value":{"error":"internal error"}}},"exampleType":"examples"}},"exampleType":"examples"}},"security":{"d5d8905a-dbea-4877-8c19-6dd7a6f5eb2e":{"apiKey":{"type":"http","scheme":"bearer","description":"The tenant API key that `POST /bootstrap` returned.","scopes":[],"schemeName":"apiKey"}}},"servers":{"962d9e3c-eaaf-4447-9e2e-c710d720d8c4":{"url":"{baseUrl}","description":"Your pgw admin listener","variables":{"baseUrl":{"default":"http://127.0.0.1:8080/api/v1","description":"The address of admin_listen, followed by /api/v1."}}},"ca7875ea-5910-467e-ba3d-4340b8927ded":{"url":"http://localhost:8080/api/v1","description":"pgw on this computer"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"The tenant API key that `POST /bootstrap` returned.","scopes":[],"schemeName":"apiKey"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"The tenant API key that `POST /bootstrap` returned.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"apiKey","name":"Authorization"}],"title":"apiKey"}]},"originalFileLocation":"reference/openapi.yaml"},"subdomain":"pgw","siteName":"pgw","title":"Make the tenant's configuration match a snapshot - pgw","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-18T09:44:02.127Z","originalFileLocation":"api-reference/config/make-the-tenants-configuration-match-a-snapshot.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Plans the changes that make the tenant\u0026#x27;s apps, upstreams, and managed mode users match snapshot, and applies them in one transaction. pgw stores either every change or none. pgw matches an app by platform and bundle ID, an upstream by host, and a user by upstream host and username. A field that the snapshot leaves out takes the default of a create request. An empty secret keeps the stored one. A change names the fields that change, and names a changed secret without its value. Without prune, pgw deletes nothing. With prune, it deletes the records that the snapshot leaves out, and devices counts the bindings that each delete removes. pgw deletes an upstream\u0026#x27;s users with it. pgw never compares or deletes the users of an upstream with user_source: kamailio. With dry_run, pgw returns the plan and its digest and changes nothing. When a plan deletes anything, an apply must send the plan_digest of the dry run, and pgw answers 409 when the plan changed since then. pgw answers 409, also for a dry run, when the snapshot gives an upstream a host or a domain that another tenant uses. pgw answers 400 when it gives one host or domain to two of the tenant\u0026#x27;s upstreams. A domain can move from one upstream to another in one sync. pgw checks the database of each new Kamailio upstream, and of each upstream whose Kamailio settings or password change, before it plans to store them. The body can be up to 16 MiB.\">\u003cmeta data-mint-head name=\"application-name\" content=\"pgw\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/pgw/EnF0PB9t_jslDyUs/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/pgw/EnF0PB9t_jslDyUs/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/pgw/EnF0PB9t_jslDyUs/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/pgw/EnF0PB9t_jslDyUs/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/pgw/EnF0PB9t_jslDyUs/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/pgw/EnF0PB9t_jslDyUs/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/pgw/EnF0PB9t_jslDyUs/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/pgw/EnF0PB9t_jslDyUs/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/pgw/EnF0PB9t_jslDyUs/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Make the tenant\u0026#x27;s configuration match a snapshot - pgw\">\u003cmeta data-mint-head property=\"og:description\" content=\"Plans the changes that make the tenant\u0026#x27;s apps, upstreams, and managed mode users match snapshot, and applies them in one transaction. pgw stores either every change or none. pgw matches an app by platform and bundle ID, an upstream by host, and a user by upstream host and username. A field that the snapshot leaves out takes the default of a create request. An empty secret keeps the stored one. A change names the fields that change, and names a changed secret without its value. Without prune, pgw deletes nothing. With prune, it deletes the records that the snapshot leaves out, and devices counts the bindings that each delete removes. pgw deletes an upstream\u0026#x27;s users with it. pgw never compares or deletes the users of an upstream with user_source: kamailio. With dry_run, pgw returns the plan and its digest and changes nothing. When a plan deletes anything, an apply must send the plan_digest of the dry run, and pgw answers 409 when the plan changed since then. pgw answers 409, also for a dry run, when the snapshot gives an upstream a host or a domain that another tenant uses. pgw answers 400 when it gives one host or domain to two of the tenant\u0026#x27;s upstreams. A domain can move from one upstream to another in one sync. pgw checks the database of each new Kamailio upstream, and of each upstream whose Kamailio settings or password change, before it plans to store them. The body can be up to 16 MiB.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"pgw\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.pgw.sipmicro.services/api-reference/config/make-the-tenants-configuration-match-a-snapshot\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://pgw.mintlify.site/_mintlify/api/og/v2?division=Config\u0026amp;title=Make+the+tenant%27s+configuration+match+a+snapshot\u0026amp;description=Plans+the+changes+that+make+the+tenant%27s+apps%2C+upstreams%2C+and%0Amanaged+mode+users+match+%60snapshot%60%2C+and+applies+them+in+one%0Atransaction.+pgw+stores+either+every+\u0026amp;theme=8d7f0f3427552df5bcb33776\u0026amp;signature=4ebe21348b98561ab2eaab8efc4f7d173a95c2301ae7066cd70cc7766f95d14f\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Make the tenant\u0026#x27;s configuration match a snapshot - pgw\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Plans the changes that make the tenant\u0026#x27;s apps, upstreams, and managed mode users match snapshot, and applies them in one transaction. pgw stores either every change or none. pgw matches an app by platform and bundle ID, an upstream by host, and a user by upstream host and username. A field that the snapshot leaves out takes the default of a create request. An empty secret keeps the stored one. A change names the fields that change, and names a changed secret without its value. Without prune, pgw deletes nothing. With prune, it deletes the records that the snapshot leaves out, and devices counts the bindings that each delete removes. pgw deletes an upstream\u0026#x27;s users with it. pgw never compares or deletes the users of an upstream with user_source: kamailio. With dry_run, pgw returns the plan and its digest and changes nothing. When a plan deletes anything, an apply must send the plan_digest of the dry run, and pgw answers 409 when the plan changed since then. pgw answers 409, also for a dry run, when the snapshot gives an upstream a host or a domain that another tenant uses. pgw answers 400 when it gives one host or domain to two of the tenant\u0026#x27;s upstreams. A domain can move from one upstream to another in one sync. pgw checks the database of each new Kamailio upstream, and of each upstream whose Kamailio settings or password change, before it plans to store them. The body can be up to 16 MiB.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://pgw.mintlify.site/_mintlify/api/og/v2?division=Config\u0026amp;title=Make+the+tenant%27s+configuration+match+a+snapshot\u0026amp;description=Plans+the+changes+that+make+the+tenant%27s+apps%2C+upstreams%2C+and%0Amanaged+mode+users+match+%60snapshot%60%2C+and+applies+them+in+one%0Atransaction.+pgw+stores+either+every+\u0026amp;theme=8d7f0f3427552df5bcb33776\u0026amp;signature=4ebe21348b98561ab2eaab8efc4f7d173a95c2301ae7066cd70cc7766f95d14f\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/pgw/EnF0PB9t_jslDyUs/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"pgw\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#2563eb\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.pgw.sipmicro.services/api-reference/config/make-the-tenants-configuration-match-a-snapshot\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/config/make-the-tenants-configuration-match-a-snapshot.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.pgw.sipmicro.services/#organization\",\"name\":\"pgw\",\"url\":\"https://docs.pgw.sipmicro.services\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/pgw/AxRzHBtQGOZ6Qv0v/logo/light.svg?fit=max\u0026auto=format\u0026n=AxRzHBtQGOZ6Qv0v\u0026q=85\u0026s=3247acd1cff3a49682e5cb75ed65f662\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.pgw.sipmicro.services#website\",\"name\":\"pgw\",\"url\":\"https://docs.pgw.sipmicro.services\",\"publisher\":{\"@id\":\"https://docs.pgw.sipmicro.services/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.pgw.sipmicro.services/api-reference/config/make-the-tenants-configuration-match-a-snapshot#webpage\",\"url\":\"https://docs.pgw.sipmicro.services/api-reference/config/make-the-tenants-configuration-match-a-snapshot\",\"name\":\"Make the tenant's configuration match a snapshot\",\"description\":\"Plans the changes that make the tenant's apps, upstreams, and managed mode users match snapshot, and applies them in one transaction. pgw stores either every change or none. pgw matches an app by platform and bundle ID, an upstream by host, and a user by upstream host and username. A field that the snapshot leaves out takes the default of a create request. An empty secret keeps the stored one. A change names the fields that change, and names a changed secret without its value. Without prune, pgw deletes nothing. With prune, it deletes the records that the snapshot leaves out, and devices counts the bindings that each delete removes. pgw deletes an upstream's users with it. pgw never compares or deletes the users of an upstream with user_source: kamailio. With dry_run, pgw returns the plan and its digest and changes nothing. When a plan deletes anything, an apply must send the plan_digest of the dry run, and pgw answers 409 when the plan changed since then. pgw answers 409, also for a dry run, when the snapshot gives an upstream a host or a domain that another tenant uses. pgw answers 400 when it gives one host or domain to two of the tenant's upstreams. A domain can move from one upstream to another in one sync. pgw checks the database of each new Kamailio upstream, and of each upstream whose Kamailio settings or password change, before it plans to store them. The body can be up to 16 MiB.\",\"dateModified\":\"2026-11-18T09:44:02.127Z\",\"isPartOf\":{\"@id\":\"https://docs.pgw.sipmicro.services#website\"},\"breadcrumb\":{\"@id\":\"https://docs.pgw.sipmicro.services/api-reference/config/make-the-tenants-configuration-match-a-snapshot#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.pgw.sipmicro.services/api-reference/config/make-the-tenants-configuration-match-a-snapshot#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Endpoints\",\"item\":\"https://docs.pgw.sipmicro.services/api-reference/tenant/create-the-first-tenant\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Config\",\"item\":\"https://docs.pgw.sipmicro.services/api-reference/config/export-the-tenants-configuration\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Make the tenant's configuration match a snapshot\",\"item\":\"https://docs.pgw.sipmicro.services/api-reference/config/make-the-tenants-configuration-match-a-snapshot\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.pgw.sipmicro.services/api-reference/config/make-the-tenants-configuration-match-a-snapshot#apireference\",\"headline\":\"Make the tenant's configuration match a snapshot\",\"name\":\"Make the tenant's configuration match a snapshot\",\"description\":\"Plans the changes that make the tenant's apps, upstreams, and managed mode users match snapshot, and applies them in one transaction. pgw stores either every change or none. pgw matches an app by platform and bundle ID, an upstream by host, and a user by upstream host and username. A field that the snapshot leaves out takes the default of a create request. An empty secret keeps the stored one. A change names the fields that change, and names a changed secret without its value. Without prune, pgw deletes nothing. With prune, it deletes the records that the snapshot leaves out, and devices counts the bindings that each delete removes. pgw deletes an upstream's users with it. pgw never compares or deletes the users of an upstream with user_source: kamailio. With dry_run, pgw returns the plan and its digest and changes nothing. When a plan deletes anything, an apply must send the plan_digest of the dry run, and pgw answers 409 when the plan changed since then. pgw answers 409, also for a dry run, when the snapshot gives an upstream a host or a domain that another tenant uses. pgw answers 400 when it gives one host or domain to two of the tenant's upstreams. A domain can move from one upstream to another in one sync. pgw checks the database of each new Kamailio upstream, and of each upstream whose Kamailio settings or password change, before it plans to store them. The body can be up to 16 MiB.\",\"url\":\"https://docs.pgw.sipmicro.services/api-reference/config/make-the-tenants-configuration-match-a-snapshot\",\"mainEntityOfPage\":{\"@id\":\"https://docs.pgw.sipmicro.services/api-reference/config/make-the-tenants-configuration-match-a-snapshot#webpage\"},\"dateModified\":\"2026-11-18T09:44:02.127Z\",\"publisher\":{\"@id\":\"https://docs.pgw.sipmicro.services/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.pgw.sipmicro.services#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"pgw\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"pgw\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/config/make-the-tenants-configuration-match-a-snapshot.md","siteName":"pgw","nav":{"global":null,"tabs":[{"tab":"Platform","pages":[{"title":"Platform","href":""}]},{"tab":"Configuration","pages":[{"title":"Configuration","href":"/upstreams/managed-mode"}]},{"tab":"App developers","pages":[{"title":"App developers","href":"/apps/overview"}]},{"tab":"Operations","pages":[{"title":"Operations","href":"/deploy/install"}]},{"tab":"Observability","pages":[{"title":"Observability","href":"/health-checks"}]},{"tab":"API reference","groups":[{"group":"Get started","pages":[{"title":"API reference","sidebarTitle":"Introduction","icon":"book","href":"/api/introduction"},{"title":"Authenticate API requests","sidebarTitle":"Authentication","icon":"fingerprint","href":"/api/authentication"},{"title":"Handle API errors","sidebarTitle":"Errors","icon":"circle-exclamation","href":"/api/errors"},{"title":"Page through lists","sidebarTitle":"Pagination","icon":"list-ol","href":"/api/pagination"}]},{"group":"Endpoints","pages":[{"group":"Tenant","pages":[{"title":"Create the first tenant","deprecated":null,"version":null,"openapi":"/reference/openapi.yaml post /bootstrap","href":"/api-reference/tenant/create-the-first-tenant"},{"title":"Get the caller's tenant","deprecated":null,"version":null,"openapi":"/reference/openapi.yaml get /tenant","href":"/api-reference/tenant/get-the-callers-tenant"}]},{"group":"Apps","pages":[{"title":"List apps","deprecated":null,"version":null,"openapi":"/reference/openapi.yaml get /apps","href":"/api-reference/apps/list-apps"},{"title":"Register an app","deprecated":null,"version":null,"openapi":"/reference/openapi.yaml post /apps","href":"/api-reference/apps/register-an-app"},{"title":"Change an app's delivery mode or VAPID subject","deprecated":null,"version":null,"openapi":"/reference/openapi.yaml patch /apps/{id}","href":"/api-reference/apps/change-an-apps-delivery-mode-or-vapid-subject"},{"title":"Export a web app's VAPID private key","deprecated":null,"version":null,"openapi":"/reference/openapi.yaml get /apps/{id}/vapid-key","href":"/api-reference/apps/export-a-web-apps-vapid-private-key"}]},{"group":"Upstreams","pages":[{"title":"List upstreams","deprecated":null,"version":null,"openapi":"/reference/openapi.yaml get /upstreams","href":"/api-reference/upstreams/list-upstreams"},{"title":"Add a PBX","deprecated":null,"version":null,"openapi":"/reference/openapi.yaml post /upstreams","href":"/api-reference/upstreams/add-a-pbx"},{"title":"Delete an upstream","deprecated":null,"version":null,"openapi":"/reference/openapi.yaml delete /upstreams/{id}","href":"/api-reference/upstreams/delete-an-upstream"},{"title":"Change an upstream","deprecated":null,"version":null,"openapi":"/reference/openapi.yaml patch /upstreams/{id}","href":"/api-reference/upstreams/change-an-upstream"}]},{"group":"Users","pages":[{"title":"List an upstream's users","deprecated":null,"version":null,"openapi":"/reference/openapi.yaml get /upstreams/{id}/users","href":"/api-reference/users/list-an-upstreams-users"},{"title":"Add a user to an upstream","deprecated":null,"version":null,"openapi":"/reference/openapi.yaml post /upstreams/{id}/users","href":"/api-reference/users/add-a-user-to-an-upstream"},{"title":"Drop a user's registrations","deprecated":null,"version":null,"openapi":"/reference/openapi.yaml post /upstreams/{id}/revocations","href":"/api-reference/users/drop-a-users-registrations"},{"title":"Delete a user","deprecated":null,"version":null,"openapi":"/reference/openapi.yaml delete /users/{id}","href":"/api-reference/users/delete-a-user"},{"title":"Change a user's password or auth username, or turn it on or off","deprecated":null,"version":null,"openapi":"/reference/openapi.yaml patch /users/{id}","href":"/api-reference/users/change-a-users-password-or-auth-username-or-turn-it-on-or-off"}]},{"group":"Bindings","pages":[{"title":"List registered devices","deprecated":null,"version":null,"openapi":"/reference/openapi.yaml get /bindings","href":"/api-reference/bindings/list-registered-devices"},{"title":"Delete a registered device","deprecated":null,"version":null,"openapi":"/reference/openapi.yaml delete /bindings/{key}","href":"/api-reference/bindings/delete-a-registered-device"},{"title":"Send a device a silent test push","deprecated":null,"version":null,"openapi":"/reference/openapi.yaml post /bindings/{key}/test-push","href":"/api-reference/bindings/send-a-device-a-silent-test-push"}]},{"group":"Push events","pages":[{"title":"List recent push attempts","deprecated":null,"version":null,"openapi":"/reference/openapi.yaml get /push-events","href":"/api-reference/push-events/list-recent-push-attempts"}]},{"group":"TLS","pages":[{"title":"Load the certificate again","deprecated":null,"version":null,"openapi":"/reference/openapi.yaml post /tls/reload","href":"/api-reference/tls/load-the-certificate-again"}]},{"group":"Register bans","pages":[{"title":"List the active REGISTER bans","deprecated":null,"version":null,"openapi":"/reference/openapi.yaml get /register-bans","href":"/api-reference/register-bans/list-the-active-register-bans"},{"title":"Lift a REGISTER ban","deprecated":null,"version":null,"openapi":"/reference/openapi.yaml delete /register-bans/{source}","href":"/api-reference/register-bans/lift-a-register-ban"}]},{"group":"Config","pages":[{"title":"Export the tenant's configuration","description":"Returns the tenant's apps, upstreams, and managed mode users as a\nsnapshot that `POST /config/sync` accepts. Apps are sorted by\nplatform and bundle ID, upstreams by host, and each upstream's users\nby domain, then username. pgw returns no secret: it leaves out\n`apns_key_pem`, `fcm_service_account_json`, `kamailio.password`, and\neach user's `password`, like every other empty field. It also leaves\nout the users of an upstream with `user_source: kamailio`.\n","deprecated":null,"version":null,"openapi":"/reference/openapi.yaml get /config/export","href":"/api-reference/config/export-the-tenants-configuration"},{"title":"Make the tenant's configuration match a snapshot","deprecated":null,"version":null,"openapi":"/reference/openapi.yaml post /config/sync","href":"/api-reference/config/make-the-tenants-configuration-match-a-snapshot"}]}]}]}]},"basePath":"","title":"Make the tenant's configuration match a snapshot - pgw","deploymentId":"dpl_HhUetB7eHHDAmK9T1Teip38TgFx9","buildId":"dpl_HhUetB7eHHDAmK9T1Teip38TgFx9","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-jJHA3WSo.js","utils-DbZn3Mjn.js","cloneDeep-CnBnaSyy.js","_Uint8Array-CMQtTgBR.js","isObject-FP1Yky1u.js","utils-Bl2DvzOJ.js","addUniqueKeysToSchema-BwOLo9p1.js","snippetPresets-BBiPpKa-.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-C0px4Tml.js","isEqual-zAyttAAO.js","usePlaygroundInputsStore-Dell6dGw.js","shallow-0VKqkSqN.js","getApiPlaygroundDisplay-CP_ctPEB.js","CodeSnippet-5L35ic0s.js","CodeSnippets-DOXbNhJw.js","Page-DRLI_2Ue.js","getPastedJson-VhzT9m2P.js","icon-CD8_AtCO.js","MethodPill-DGgOMftG.js","DuplicateIcon-DZ6A_EtN.js","createIcon-DUl4oM5f.js","DynamicMarkdown-BGHukeRM.js","SectionHeading-ChrEUs8u.js","axios-vUo_bRtp.js","Markdown-Dj-na-_-.js","dist-C5gjFYHe.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","katex-YMM-FMeD.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js","AssistantPageLink-DEBW87tT.js"]}