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

# API Design

Learn about the flow state design of the API

The API is designed as a flow state with several branches. You always start at the top and move forward with each command in the branches, until you hit an endpoint, which either executes a command or returns a query result.

> **Note**: `fetch()` endpoints will always return a bookmark, which you can reenter with the `query` property.

#### Example:

```javascript
const library = wranglebot.query.library.one("mylibrary").fetch();

library.query.metafiles.many().fetch(); //returns all metafiles in the library
```

**Download the Chart in Full Size:**

{% file src="/files/Djs4HexrdG3q8hmJBWlo" %}

<div align="center"><figure><img src="https://3064555674-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fzkd8Kf8puC7kB5qc6VXv%2Fuploads%2Fk9atQOZ75v4ZSn0Rg6Xg%2FWrangleBot%20NodeJS%20API.png?alt=media&amp;token=5fc05774-fd6c-4783-90ae-0d42adf3fba5" alt=""><figcaption></figcaption></figure></div>
