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

# \_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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.fieldmotion.com/fieldmotion-api-docs/departments/_list.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
