# \_list

Returns a list of Departments and their details.

### Parameters

#### fields

An array of extra fields from the Department data which can be requested and returned:

* email
* meta
* users
* last\_edited
* cdate
* assets
* customers

The id and names of Departments are always returned regardless of request via this parameter.

#### last\_edited

A filter which removes any Departments which have been last edited before the chosen date. (e.g a Departments which was last edited on 2025-03-29 07:38:00 will not be included if "last\_edited" is 2025-04-17 15:00:00)

### Example

```
FM_api('Departments_list',[
    'fields'=>'["id","name","users","assets","last_edited"]',
    'last_edited'=>'2025-07-20 00:00:00'
    ]
);
```

#### On Success

```
[{"id":"427100","name":"Test1","users":null,"assets":"556200","last_edited":"2025-07-20 17:29:57"},{"id":"427101","name":"Test2","users":"92447","assets":null,"last_edited":"2025-07-20 17:29:53"}]
```


---

# 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/departments/_list.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.
