# Bulk Add Location Groups to Users

`POST /api/v1/users/bulk-location-groups`

Appends location groups to many users in one request (append semantics — existing groups are preserved). Requires the `update` ability and the MANAGE_USERS permission.

## Request body

```json
{
    "assignments": [
        {
            "user": "6e2b9d41-8c7a-4f3e-b1d5-9a0c2e4f6b81",
            "location_group_ids": [
                "9d3f6b2e-5a41-4c7e-9a0b-2f1c8e7d4a63"
            ]
        }
    ]
}
```

## Example request

```bash
curl -X POST "https://app.franchisesee.com/api/v1/users/bulk-location-groups" \
  -H "Authorization: Bearer $FRANCHISESEE_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "assignments": [
        {
            "user": "6e2b9d41-8c7a-4f3e-b1d5-9a0c2e4f6b81",
            "location_group_ids": [
                "9d3f6b2e-5a41-4c7e-9a0b-2f1c8e7d4a63"
            ]
        }
    ]
}'
```

## Responses

### 200 Success

```json
{
    "total": 2,
    "success_count": 2,
    "error_count": 0,
    "results": [
        {
            "index": 0,
            "user": "jordan.rivera@example.com",
            "status": "success",
            "groups_added": 1,
            "total_groups": 2
        }
    ]
}
```

### 401 Authentication failed or missing.

```json
{
    "message": "Unauthenticated."
}
```

### 403 The token lacks the required ability or the caller is not permitted.

```json
{
    "message": "This API token does not have the 'create' ability."
}
```

### 422 Validation failed.

```json
{
    "message": "The name field is required.",
    "errors": {
        "name": [
            "The name field is required."
        ]
    }
}
```
