> For the complete documentation index, see [llms.txt](https://docs.fieldmotion.com/fieldmotion-api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fieldmotion.com/fieldmotion-api-docs/user/_setareas.md).

# \_setAreas

Sets the areas of a User.

### Parameters

#### id

The ID of the User.

#### location\_ids

An array of Area IDs to be linked to the User.

### Example

```
FM_api('User_setAreas', [
        'id' => '123',
        'location_ids' => '["90098","90099","120071"]'
    ]
);
```

### Result

#### On Success

```
{'ok':1}
```

#### On Failure

If the "id" parameter is missing or has an integer value less than 1:

```
{'error':'parameter missing or invalid: id'}
```

If the "location\_ids" parameter is missing or is not an array:

```
{'error':'parameter missing or invalid: locations'}
```
