> For the complete documentation index, see [llms.txt](https://docs.balena.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.balena.io/reference/api/resources/fleet.md).

# Fleet

## Available Fields

| Field                                  |
| -------------------------------------- |
| `id`                                   |
| `uuid`                                 |
| `organization`                         |
| `actor`                                |
| `app_name`                             |
| `slug`                                 |
| `should_be_running__release`           |
| `application_type`                     |
| `is_for__device_type`                  |
| `should_track_latest_release`          |
| `is_accessible_by_support_until__date` |
| `is_public`                            |
| `is_host`                              |
| `is_archived`                          |
| `is_discoverable`                      |
| `is_stored_at__repository_url`         |
| `created_at`                           |

***

## Examples

### Get all fleets of an organization by its HANDLE

```bash
GET "https://api.balena-cloud.com/v7/application?\$filter=organization/any(o:o/handle%20eq%20%27<ORG_HANDLE>%27)" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>" 
```

### Get all fleets

Note: This will also include all public fleets of the platform. In most cases retrieving the fleets by their organization will be preferable.

```bash
GET "https://api.balena-cloud.com/v7/application" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>" 
```

### Get all fleets associated with authenticated user

```bash
GET "https://api.balena-cloud.com/v7/application?\$filter=is_directly_accessible_by__user/any(dau:true)" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>" 
```

### Get fleet by ID

```bash
GET "https://api.balena-cloud.com/v7/application(<ID>)" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>" 
```

### Get fleet by SLUG

```bash
GET "https://api.balena-cloud.com/v7/application(slug='<SLUG>')" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>" 
```

### Get fleet by name

```bash
GET "https://api.balena-cloud.com/v7/application?\$filter=app_name%20eq%20'<NAME>'" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>" 
```

### Get fleet by SLUG along with its devices

```bash
GET "https://api.balena-cloud.com/v7/application(slug='<SLUG>')?\$expand=owns__device" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>" 
```

### Get fleet by id along with its devices

```bash
GET "https://api.balena-cloud.com/v7/application(<ID>)?\$expand=owns__device" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>" 
```

### Filter public fleets from result

```bash
GET "https://api.balena-cloud.com/v7/application?\$filter=is_public%20eq%20false" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>" 
```

### Create fleet

To retrieve the numeric ORGANIZATION\_ID & DEVICE\_TYPE\_ID, check the respective documentation page for the organization & device type resources.

```bash
POST "https://api.balena-cloud.com/v7/application" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>" \
--data '{
    "app_name": "<NAME>",
    "organization": <ORGANIZATION_ID>,
    "is_for__device_type": <DEVICE_TYPE_ID>
}'
```

### Delete fleet

```bash
DELETE "https://api.balena-cloud.com/v7/application(<ID>)" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>" 
```

### Get the target release of a fleet

```bash
GET "https://api.balena-cloud.com/v7/application(slug='<SLUG>')?\$select=should_be_running__release" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>" 
```

### Pin entire fleet to a specific release by ID

```bash
PATCH "https://api.balena-cloud.com/v7/application(<ID>)" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>" \
--data '{
    "should_be_running__release": "<RELEASE ID>"
    "should_track_latest_release": false
}'
```

### Pin entire fleet to a specific release by SLUG

```bash
PATCH "https://api.balena-cloud.com/v7/application(slug='<SLUG>')" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>" \
--data '{
    "should_be_running__release": "<RELEASE ID>"
    "should_track_latest_release": false
}'
```

### Disable automatic update tracking for a fleet

```bash
PATCH "https://api.balena-cloud.com/v7/application(<ID>)" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>" \
--data '{
    "should_track_latest_release": "false"
}'
```

### Enable automatic update tracking for a fleet

```bash
PATCH "https://api.balena-cloud.com/v7/application(<ID>)" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>" \
--data '{
    "should_track_latest_release": "true"
}'
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.balena.io/reference/api/resources/fleet.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
