/api/v4/locations/oauth-disconnectDisconnect one location from a publisher
Severs a single location's connection to a publisher, the counterpart to the per-location OAuth connect URL.
Parameters
Body
| Name | Type | Required | Description |
|---|---|---|---|
| input | object | required | Wrapper object. The entire request body must be nested under `input`. |
| input.locationId | string | required | Base64-encoded Relay ID of the one location to disconnect. The gateway forwards it upstream as `id`. |
| input.site | string | optional | Publisher to disconnect from: `GOOGLE`, `FACEBOOK`, or `APPLE`. Required unless you send `providerId`. |
| input.providerId | string | optional | The publisher's own account identifier, as an alternative to `site`. Required unless you send `site`. |
Sample request
Ready-to-paste body. Replace placeholder IDs and values with yours.
{ "input": { "locationId": "TG9jYXRpb246MTgwMDI4OQ==", "site": "GOOGLE" }}Responses
200Connection removed. Response key `disconnectConnectedAccountsLocations`.
{ "data": { "disconnectConnectedAccountsLocations": { "clientMutationId": null, "success": true, "errors": null } }}401Unauthenticated, missing or invalid API key.
403The key is valid but not permitted to disconnect this location (`SY90003`).
Removes a single location's connection to a publisher. It is the disconnect half of the per-location OAuth flow started by Create an OAuth connect URL for one location.
This route and Disconnect a listing from a location are the same operation behind two paths: both take the identical input body and both resolve to the upstream disconnectConnectedAccountsLocations mutation, which is why the response key is that name rather than either path's. Pick whichever path reads better in your integration; there is no behavioural difference.
The body must be wrapped in input and carry a single locationId, plus either site or providerId to say which connection to sever. Sending neither returns SY10056 ("Site is not valid for the location disconnection"); a location with no active connection for that site returns SY10057 rather than a silent success, so success: true really does mean a link was removed. It is not a bulk endpoint, so loop for several locations. To disconnect an entire account's worth of locations at once, use Bulk-disconnect Google accounts instead.
Use case: undoing a mis-targeted connect
When a user connects the wrong publisher listing to a store, disconnect it here with site set to that publisher, then send them back through the connect URL (or run trigger-matches and Connect a listing) to attach the correct one. Disconnecting leaves the location and its data intact; only the outbound sync to that publisher stops.
This endpoint mutates a live connection. The request shape and sample response above are documented from the gateway's request translation (
maskLocationId) and the upstreamDeleteConnectedAccountsLocationsmutation, not captured from a live call.
curl -X POST 'https://listingsapi.com/api/v4/locations/oauth-disconnect' \ -H "Authorization: API $LISTINGSAPI_KEY" \ -H 'Content-Type: application/json' \ -d '{ "input": { "locationId": "TG9jYXRpb246MTgwMDI4OQ==", "site": "GOOGLE" } }'