# \_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'}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fieldmotion.com/fieldmotion-api-docs/user/_setareas.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
