> For the complete documentation index, see [llms.txt](https://navixy.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://navixy.com/docs/navixy-api/user-api/backend-api/resources/commons/report/report_schedule.md).

# Report schedule

Contains report schedule object description and API calls to interact with it.

## schedule\_entry object:

```json
{
  "id": 1,
  "enabled": true,
  "parameters": {
    "period": "1m",
    "schedule": {
      "type": "weekdays",
      "weekdays": [1, 2, 3, 4, 5]
    },
    "report": {
      "trackers": [1],
      "title": "Title",
      "time_filter": {
        "from": "00:00:00",
        "to": "23:59:59",
        "weekdays": [1, 2, 3, 4, 5, 6, 7]
      },
      "geocoder": "yandex",
      "plugin": {
        "plugin_id": 4,
        "show_idle_duration": false
      },
      "include_places_in_address": true,
      "include_zones_in_address": true
    },
    "emails": ["email@example.ru"],
    "email_format": "pdf",
    "email_zip": false,
    "sending_time": "12:00:00"
  },
  "fire_time": "2014-09-05 00:00:00",
  "last_result": {
    "success": true,
    "id": 1
  }
}
```

* `id` - int. Schedule id, ignored on create.
* `enabled` - boolean. `true` if the scheduled report enabled.
* `report` - object. Report parameters, same as in [`report/tracker/generate`](/docs/navixy-api/user-api/backend-api/resources/commons/report/report_tracker.md#generate). Includes the optional `include_places_in_address` and `include_zones_in_address` flags (both boolean, default `true`) that toggle whether place (POI) and geofence (zone) names are prepended to addresses in the generated report.
* `period` - string. Report period, "Xm" | "w" | "d" | "y".
* `emails` - optional string array. List of emails.
* `email_format` - [enum](/docs/navixy-api/user-api/backend-api.md#data-types). Can be "pdf" | "xls".
* `sending_time` - optional string. Local time for sending reports, default "00:00:00", hourly granularity.
* `fire_time` - optional string. Last schedule fire time, ignored on create/update.
* `last_result` object with last report creation result.
  * `id` - int. An ID of generated report.

## API actions

API path: `/report/schedule`.

### create

Creates a new report schedule entry.

**required sub-user rights**: `reports`.

#### Parameters

| name     | description                                                        | type        |
| -------- | ------------------------------------------------------------------ | ----------- |
| schedule | Schedule object without fields "id", "fire\_time", "last\_result". | JSON object |

#### Example

cURL

{% code overflow="wrap" %}

```sh
curl -X POST 'https://api.eu.navixy.com/v2/report/schedule/create' \
    -H 'Content-Type: application/json' \
    -d '{"hash": "a6aa75587e5c59c32d347da438505fc3", "schedule": {"enabled": true, "parameters": {"report": {"title": "Trip report", "trackers": [669673], "time_filter": {"from": "00:00:00", "to": "23:59:59", "weekdays": [1,2,3,4,5,6,7]}, "plugin": {"hide_empty_tabs": true, "plugin_id": 4, "show_seconds": false, "include_summary_sheet_only": false, "split": true, "show_idle_duration": false, "show_coordinates": false, "filter": true, "group_by_driver": false}}, "period": "1w", "email_zip": false, "email_format": "xls", "emails": ["test@example.com"], "sending_time": "00:00:00", "schedule": {"type": "weekdays", "weekdays": [1]}}}}}'
```

{% endcode %}

#### Response

```json
{
  "success": true,
  "id": 111
}
```

* `id` - int. An ID of the created schedule entry.

#### Errors

* 217 - List contains nonexistent entities - if one or more of tracker IDs belong to nonexistent tracker (or to a tracker belonging to different user).
* 222 - Plugin not found - if specified report plugin not found.
* 236 - Feature unavailable due to.

### delete

Deletes report schedule with the specified ID.

**required sub-user rights**: `reports`.

#### Parameters

| name         | description                          | type |
| ------------ | ------------------------------------ | ---- |
| schedule\_id | ID of the report schedule to delete. | int  |

#### Examples

{% tabs %}
{% tab title="cURL" %}

```sh
curl -X POST 'https://api.eu.navixy.com/v2/report/schedule/delete' \
    -H 'Content-Type: application/json' \
    -d '{"hash": "a6aa75587e5c59c32d347da438505fc3", "schedule_id": 1234567}'
```

{% endtab %}

{% tab title="HTTP GET" %}
{% code overflow="wrap" %}

```http
https://api.eu.navixy.com/v2/report/schedule/delete?hash=a6aa75587e5c59c32d347da438505fc3&schedule_id=1234567
```

{% endcode %}
{% endtab %}
{% endtabs %}

#### Response

```json
{
  "success": true
}
```

#### Errors

* 201 - Not found in the database - if there is no schedule with specified ID.

### list

Get all report schedules belonging to user.

**required sub-user rights**: `reports`.

#### Parameters

Only API key `hash`.

#### Examples

{% tabs %}
{% tab title="cURL" %}

```sh
curl -X POST 'https://api.eu.navixy.com/v2/report/schedule/list' \
    -H 'Content-Type: application/json' \
    -d '{"hash": "a6aa75587e5c59c32d347da438505fc3"}'
```

{% endtab %}

{% tab title="HTTP GET" %}
{% code overflow="wrap" %}

```http
https://api.eu.navixy.com/v2/report/schedule/list?hash=a6aa75587e5c59c32d347da438505fc3
```

{% endcode %}
{% endtab %}
{% endtabs %}

#### Response

```json
{
  "success": true,
  "list": [
    {
      "id": 1,
      "enabled": true,
      "parameters": {
        "period": "1m",
        "schedule": {
          "type": "weekdays",
          "weekdays": [1, 2, 3, 4, 5]
        },
        "report": {
          "trackers": [1],
          "title": "Title",
          "time_filter": {
            "from": "00:00:00",
            "to": "23:59:59",
            "weekdays": [1, 2, 3, 4, 5, 6, 7]
          },
          "geocoder": "yandex",
          "plugin": {
            "plugin_id": 4,
            "show_idle_duration": false
          },
          "include_places_in_address": true,
          "include_zones_in_address": true
        },
        "emails": ["email@example.ru"],
        "email_format": "pdf",
        "email_zip": false,
        "sending_time": "12:00:00"
      },
      "fire_time": "2014-09-05 00:00:00",
      "last_result": {
        "success": true,
        "id": 1
      }
    }
  ]
}
```

#### Errors

[General](/docs/navixy-api/user-api/backend-api/errors.md#error-codes) types only.

### update

Update existing report schedule.

**required sub-user rights**: `reports`.

#### Parameters

| name     | description                                                  | type        |
| -------- | ------------------------------------------------------------ | ----------- |
| schedule | Schedule object without fields "fire\_time", "last\_result". | JSON object |

#### Example

cURL

{% code overflow="wrap" %}

```sh
curl -X POST 'https://api.eu.navixy.com/v2/report/schedule/update' \
    -H 'Content-Type: application/json' \
    -d '{"hash": "a6aa75587e5c59c32d347da438505fc3", "schedule": {"enabled": true, "parameters": {"report": {"title": "Trip report", "trackers": [669673], "time_filter": {"from": "00:00:00", "to": "23:59:59", "weekdays": [1,2,3,4,5,6,7]}, "plugin": {"hide_empty_tabs": true, "plugin_id": 4, "show_seconds": false, "include_summary_sheet_only": false, "split": true, "show_idle_duration": false, "show_coordinates": false, "filter": true, "group_by_driver": false}}, "period": "1w", "email_zip": false, "email_format": "xls", "emails": ["test@example.com"], "sending_time": "00:00:00", "schedule": {"type": "weekdays", "weekdays": [1]}}}}}'
```

{% endcode %}

#### Response

```json
{
  "success": true
}
```

#### Errors

* 217 - List contains nonexistent entities - if one or more of tracker IDs belong to nonexistent tracker (or to a tracker belonging to different user).
* 222 - Plugin not found - if specified report plugin not found.
* 236 - Feature unavailable due to tariff restrictions - if device's tariff does not allow usage of reports.


---

# 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://navixy.com/docs/navixy-api/user-api/backend-api/resources/commons/report/report_schedule.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.
