POST/api/v4/locations/oauth-disconnect

Disconnect one location from a publisher

Severs a single location's connection to a publisher, the counterpart to the per-location OAuth connect URL.

Requires an API key. See Authentication for header format and key rotation.

Parameters

Body

NameTypeRequiredDescription
inputobjectrequiredWrapper object. The entire request body must be nested under `input`.
input.locationIdstringrequiredBase64-encoded Relay ID of the one location to disconnect. The gateway forwards it upstream as `id`.
input.sitestringoptionalPublisher to disconnect from: `GOOGLE`, `FACEBOOK`, or `APPLE`. Required unless you send `providerId`.
input.providerIdstringoptionalThe 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.

Request body
{  "input": {    "locationId": "TG9jYXRpb246MTgwMDI4OQ==",    "site": "GOOGLE"  }}

Responses

200Connection removed. Response key `disconnectConnectedAccountsLocations`.
Response
{  "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 upstream DeleteConnectedAccountsLocations mutation, not captured from a live call.

Request
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"    }  }'