Skip to content
SynupAPI
Get an API key
POSTapi.synup.com/api/v4/users/locations/add

Add Locations to User

This API associates specific locations with a user, granting them access to manage those locations.

Behavior:

  • Supports assigning multiple locations to a single user.
  • Updates the user's permissions and access scope based on assigned locations.
Requires an API key. Send it as Authorization: API <your-key> — see Getting started.

Parameters

Body

NameTypeRequiredDescription
inputobjectrequired
input.userIdstringrequiredID of the user to associate locations with
input.locationIdsarray of stringrequiredArray of location IDs to associate with the user

Request

Request
curl -X POST 'https://api.synup.com/api/v4/users/locations/add' \
  -H 'Authorization: API YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "input": {
    "userId": "VXNlcjoxMjMyMDE=",
    "locationIds": [
      "TG9jYXRpb246MTE3NjE5NQ==",
      "TG9jYXRpb246MTE0NzgxNA=="
    ]
  }
}'

Responses

StatusDescription
200Locations successfully added to user
400Bad Request - Invalid input parameters
401Unauthorized - Valid API key required
403Forbidden - Insufficient permissions
404Not Found - User or locations not found
Example response
{
  "data": {
    "addLocationsForUser": {
      "status": [
        {
          "errors": null,
          "locationId": "TG9jYXRpb246MTE3NjE5NQ==",
          "success": true
        },
        {
          "errors": null,
          "locationId": "TG9jYXRpb246MTE0NzgxNA==",
          "success": true
        }
      ]
    }
  }
}

Response body

NameTypeRequiredDescription
dataobjectoptional
data.addLocationsForUserobjectoptional
data.addLocationsForUser.statusarray of objectoptional
data.addLocationsForUser.status[].errorsarray of stringoptionalArray of error messages if any occurred
data.addLocationsForUser.status[].locationIdstringoptionalID of the location being added
data.addLocationsForUser.status[].successbooleanoptionalIndicates if the location was successfully added