POSTapi.synup.com/api/v4/users/locations/remove
Remove Locations for User
This API removes specific locations associated with a user, revoking their access to those locations.
Behavior:
- Supports removing one or multiple locations from a user.
- Updates the user’s permissions and access scope accordingly.
Requires an API key. Send it as
Authorization: API <your-key> — see Getting started.Parameters
Body
| Name | Type | Required | Description |
|---|---|---|---|
input | object | required | |
input.userId | string | required | Base64 encoded user ID |
input.locationIds | array of string | required |
Request
Request
curl -X POST 'https://api.synup.com/api/v4/users/locations/remove' \
-H 'Authorization: API YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"input": {
"userId": "VXNlcjoxMDA1Mw==",
"locationIds": [
"TG9jYXRpb246NTE1MzA=",
"TG9jYXRpb246NTE1MjY="
]
}
}'const res = await fetch('https://api.synup.com/api/v4/users/locations/remove', {
method: 'POST',
headers: {
Authorization: 'API YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"input": {
"userId": "VXNlcjoxMDA1Mw==",
"locationIds": [
"TG9jYXRpb246NTE1MzA=",
"TG9jYXRpb246NTE1MjY="
]
}
}),
});
const data = await res.json();import requests
res = requests.post(
"https://api.synup.com/api/v4/users/locations/remove",
headers={
"Authorization": "API YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"input": {
"userId": "VXNlcjoxMDA1Mw==",
"locationIds": [
"TG9jYXRpb246NTE1MzA=",
"TG9jYXRpb246NTE1MjY="
]
}
},
)
data = res.json()req, _ := http.NewRequest("POST", "https://api.synup.com/api/v4/users/locations/remove", bytes.NewBufferString(payload))
req.Header.Set("Authorization", "API YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)Responses
| Status | Description |
|---|---|
200 | Successfully removed locations for user |
Example response (generated from the schema)
{
"data": {
"removeLocationsForUser": {
"status": [
{
"errors": [
"string"
],
"locationId": "string",
"success": true
}
]
}
}
}Response body
| Name | Type | Required | Description |
|---|---|---|---|
data | object | optional | |
data.removeLocationsForUser | object | optional | |
data.removeLocationsForUser.status | array of object | optional | |
data.removeLocationsForUser.status[].errors | array of string | optional | Array of error messages if any |
data.removeLocationsForUser.status[].locationId | string | optional | Base64 encoded location ID that was removed |
data.removeLocationsForUser.status[].success | boolean | optional | Whether the location was successfully removed |