---
title: "Add Locations to User"
method: POST
path: "/users/locations/add"
tags: ["User Management", "Users", "Locations"]
---

# Add Locations to User

`POST /users/locations/add`

## Request

- Base URL: `https://api.synup.com/api/v4`
- URL: `https://api.synup.com/api/v4/users/locations/add`
- Auth: none required
- TypeScript: <https://skmtc.dev/synup/apis/synup-api/docs/users/locations/add/post.ts> (a function with typed inputs; its response is checked against the schema)

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.

## Headers

- `Authorization` string

## Request body

- object
  - `input` AddLocationsInput, required
    - `userId` string, required: ID of the user to associate locations with
    - `locationIds` string[], required: Array of location IDs to associate with the user

## Response `200`

Locations successfully added to user

- AddLocationsResponse
  - `data` object
    - `addLocationsForUser` object
      - `status` LocationAddStatusV2[]
        - `errors` string[], nullable: Array of error messages if any occurred
        - `locationId` string: ID of the location being added
        - `success` boolean: Indicates if the location was successfully added

## Other responses

- `400`: Bad Request - Invalid input parameters
- `401`: Unauthorized - Valid API key required
- `403`: Forbidden - Insufficient permissions
- `404`: Not Found - User or locations not found

---

[API](https://skmtc.dev/synup/apis/synup-api.md) - [All operations](https://skmtc.dev/synup/apis/synup-api/llms.txt) - [OpenAPI document](https://skmtc.dev/synup/apis/synup-api/revisions/67de2d51c22e?raw)
