# Reports

Reports generation

## Fetch a combined route, Events and Positions report for the Devices or Groups

`GET /reports/combined`

At least one _deviceId_ or one _groupId_ must be passed

Authentication (security requirement alternatives):

```json
[
  {
    "BasicAuth": []
  },
  {
    "ApiKey": []
  }
]
```

- BasicAuth: http (basic)
- ApiKey: http (bearer)

Parameters:

- `deviceId` (query, Array<integer>, optional)
  Type: Array<integer>
  
  Items:
    Type: integer

- `groupId` (query, Array<integer>, optional)
  Type: Array<integer>
  
  Items:
    Type: integer

- `from` (query, string, date-time, required) - in ISO 8601 format. eg. `1963-11-22T18:30:00Z`
  Type: string, date-time

- `to` (query, string, date-time, required) - in ISO 8601 format. eg. `1963-11-22T18:30:00Z`
  Type: string, date-time

Responses:

- 200: OK

Content type: application/json

Type: Array<CombinedReportItem>

Items:
  Reference: [CombinedReportItem](https://sourcey-traccar.pages.dev/api-reference/models/combinedreportitem/index.md); Type: CombinedReportItem

- 401: Unauthorized

## Examples

### cURL

```bash
curl -X GET 'https://demo.traccar.org/api/reports/combined?from=2024-01-15T09%3A30%3A00Z&to=2024-01-15T09%3A30%3A00Z' \
  -H 'Authorization: Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE'
```

### JavaScript

```javascript
const response = await fetch('https://demo.traccar.org/api/reports/combined?from=2024-01-15T09%3A30%3A00Z&to=2024-01-15T09%3A30%3A00Z', {
  method: 'GET',
  headers: {
    'Authorization': 'Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.get(
    'https://demo.traccar.org/api/reports/combined?from=2024-01-15T09%3A30%3A00Z&to=2024-01-15T09%3A30%3A00Z',
    headers={
        'Authorization': 'Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE',
    },
)
print(response.text)
```


## Fetch a list of Positions within the time period for the Devices or Groups

`GET /reports/route`

At least one _deviceId_ or one _groupId_ must be passed

Authentication (security requirement alternatives):

```json
[
  {
    "BasicAuth": []
  },
  {
    "ApiKey": []
  }
]
```

- BasicAuth: http (basic)
- ApiKey: http (bearer)

Parameters:

- `deviceId` (query, Array<integer>, optional)
  Type: Array<integer>
  
  Items:
    Type: integer

- `groupId` (query, Array<integer>, optional)
  Type: Array<integer>
  
  Items:
    Type: integer

- `from` (query, string, date-time, required) - in ISO 8601 format. eg. `1963-11-22T18:30:00Z`
  Type: string, date-time

- `to` (query, string, date-time, required) - in ISO 8601 format. eg. `1963-11-22T18:30:00Z`
  Type: string, date-time

Responses:

- 200: OK

Content type: application/json

Type: Array<Position>

Items:
  Reference: [Position](https://sourcey-traccar.pages.dev/api-reference/models/position/index.md); Type: Position

Content type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

Type: Array<Position>

Items:
  Reference: [Position](https://sourcey-traccar.pages.dev/api-reference/models/position/index.md); Type: Position

- 401: Unauthorized

## Examples

### cURL

```bash
curl -X GET 'https://demo.traccar.org/api/reports/route?from=2024-01-15T09%3A30%3A00Z&to=2024-01-15T09%3A30%3A00Z' \
  -H 'Authorization: Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE'
```

### JavaScript

```javascript
const response = await fetch('https://demo.traccar.org/api/reports/route?from=2024-01-15T09%3A30%3A00Z&to=2024-01-15T09%3A30%3A00Z', {
  method: 'GET',
  headers: {
    'Authorization': 'Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.get(
    'https://demo.traccar.org/api/reports/route?from=2024-01-15T09%3A30%3A00Z&to=2024-01-15T09%3A30%3A00Z',
    headers={
        'Authorization': 'Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE',
    },
)
print(response.text)
```


## Download the route report as a spreadsheet or send it by email

`GET /reports/route/{type}`

Use `type=xlsx` to download the report, `type=mail` to deliver it by email asynchronously.

Authentication (security requirement alternatives):

```json
[
  {
    "BasicAuth": []
  },
  {
    "ApiKey": []
  }
]
```

- BasicAuth: http (basic)
- ApiKey: http (bearer)

Parameters:

- `type` (path, string, required)
  Type: string
  
  enum: ["xlsx","mail"]

- `deviceId` (query, Array<integer>, optional)
  Type: Array<integer>
  
  Items:
    Type: integer

- `groupId` (query, Array<integer>, optional)
  Type: Array<integer>
  
  Items:
    Type: integer

- `from` (query, string, date-time, required) - in ISO 8601 format. eg. `1963-11-22T18:30:00Z`
  Type: string, date-time

- `to` (query, string, date-time, required) - in ISO 8601 format. eg. `1963-11-22T18:30:00Z`
  Type: string, date-time

Responses:

- 200: Spreadsheet attachment

Content type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

Type: string, binary

- 204: Report queued for email delivery

- 401: Unauthorized

- 404: Not found

## Examples

### cURL

```bash
curl -X GET 'https://demo.traccar.org/api/reports/route/xlsx?from=2024-01-15T09%3A30%3A00Z&to=2024-01-15T09%3A30%3A00Z' \
  -H 'Authorization: Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE'
```

### JavaScript

```javascript
const response = await fetch('https://demo.traccar.org/api/reports/route/xlsx?from=2024-01-15T09%3A30%3A00Z&to=2024-01-15T09%3A30%3A00Z', {
  method: 'GET',
  headers: {
    'Authorization': 'Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.get(
    'https://demo.traccar.org/api/reports/route/xlsx?from=2024-01-15T09%3A30%3A00Z&to=2024-01-15T09%3A30%3A00Z',
    headers={
        'Authorization': 'Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE',
    },
)
print(response.text)
```


## Fetch a list of Events within the time period for the Devices or Groups

`GET /reports/events`

At least one _deviceId_ or one _groupId_ must be passed

Authentication (security requirement alternatives):

```json
[
  {
    "BasicAuth": []
  },
  {
    "ApiKey": []
  }
]
```

- BasicAuth: http (basic)
- ApiKey: http (bearer)

Parameters:

- `deviceId` (query, Array<integer>, optional)
  Type: Array<integer>
  
  Items:
    Type: integer

- `groupId` (query, Array<integer>, optional)
  Type: Array<integer>
  
  Items:
    Type: integer

- `type` (query, Array<string>, optional) - % can be used to return events of all types
  Type: Array<string>
  
  Items:
    Type: string

- `from` (query, string, date-time, required) - in ISO 8601 format. eg. `1963-11-22T18:30:00Z`
  Type: string, date-time

- `to` (query, string, date-time, required) - in ISO 8601 format. eg. `1963-11-22T18:30:00Z`
  Type: string, date-time

Responses:

- 200: OK

Content type: application/json

Type: Array<Event>

Items:
  Reference: [Event](https://sourcey-traccar.pages.dev/api-reference/models/event/index.md); Type: Event

Content type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

Type: Array<Event>

Items:
  Reference: [Event](https://sourcey-traccar.pages.dev/api-reference/models/event/index.md); Type: Event

- 401: Unauthorized

## Examples

### cURL

```bash
curl -X GET 'https://demo.traccar.org/api/reports/events?from=2024-01-15T09%3A30%3A00Z&to=2024-01-15T09%3A30%3A00Z' \
  -H 'Authorization: Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE'
```

### JavaScript

```javascript
const response = await fetch('https://demo.traccar.org/api/reports/events?from=2024-01-15T09%3A30%3A00Z&to=2024-01-15T09%3A30%3A00Z', {
  method: 'GET',
  headers: {
    'Authorization': 'Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.get(
    'https://demo.traccar.org/api/reports/events?from=2024-01-15T09%3A30%3A00Z&to=2024-01-15T09%3A30%3A00Z',
    headers={
        'Authorization': 'Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE',
    },
)
print(response.text)
```


## Download the events report as a spreadsheet or send it by email

`GET /reports/events/{type}`

Use `type=xlsx` to download the report, `type=mail` to deliver it by email asynchronously.

Authentication (security requirement alternatives):

```json
[
  {
    "BasicAuth": []
  },
  {
    "ApiKey": []
  }
]
```

- BasicAuth: http (basic)
- ApiKey: http (bearer)

Parameters:

- `type` (path, string, required)
  Type: string
  
  enum: ["xlsx","mail"]

- `deviceId` (query, Array<integer>, optional)
  Type: Array<integer>
  
  Items:
    Type: integer

- `groupId` (query, Array<integer>, optional)
  Type: Array<integer>
  
  Items:
    Type: integer

- `type` (query, Array<string>, optional) - Event types to include; `%` matches all
  Type: Array<string>
  
  Items:
    Type: string

- `alarm` (query, Array<string>, optional) - Alarm types to include
  Type: Array<string>
  
  Items:
    Type: string

- `from` (query, string, date-time, required) - in ISO 8601 format. eg. `1963-11-22T18:30:00Z`
  Type: string, date-time

- `to` (query, string, date-time, required) - in ISO 8601 format. eg. `1963-11-22T18:30:00Z`
  Type: string, date-time

Responses:

- 200: Spreadsheet attachment

Content type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

Type: string, binary

- 204: Report queued for email delivery

- 401: Unauthorized

- 404: Not found

## Examples

### cURL

```bash
curl -X GET 'https://demo.traccar.org/api/reports/events/xlsx?from=2024-01-15T09%3A30%3A00Z&to=2024-01-15T09%3A30%3A00Z' \
  -H 'Authorization: Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE'
```

### JavaScript

```javascript
const response = await fetch('https://demo.traccar.org/api/reports/events/xlsx?from=2024-01-15T09%3A30%3A00Z&to=2024-01-15T09%3A30%3A00Z', {
  method: 'GET',
  headers: {
    'Authorization': 'Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.get(
    'https://demo.traccar.org/api/reports/events/xlsx?from=2024-01-15T09%3A30%3A00Z&to=2024-01-15T09%3A30%3A00Z',
    headers={
        'Authorization': 'Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE',
    },
)
print(response.text)
```


## Fetch geofence enter/exit intervals within the time period for Devices or Groups

`GET /reports/geofences`

At least one _deviceId_ or one _groupId_ must be passed

Authentication (security requirement alternatives):

```json
[
  {
    "BasicAuth": []
  },
  {
    "ApiKey": []
  }
]
```

- BasicAuth: http (basic)
- ApiKey: http (bearer)

Parameters:

- `deviceId` (query, Array<integer>, optional)
  Type: Array<integer>
  
  Items:
    Type: integer

- `groupId` (query, Array<integer>, optional)
  Type: Array<integer>
  
  Items:
    Type: integer

- `geofenceId` (query, Array<integer>, optional)
  Type: Array<integer>
  
  Items:
    Type: integer

- `from` (query, string, date-time, required) - in ISO 8601 format. eg. `1963-11-22T18:30:00Z`
  Type: string, date-time

- `to` (query, string, date-time, required) - in ISO 8601 format. eg. `1963-11-22T18:30:00Z`
  Type: string, date-time

Responses:

- 200: OK

Content type: application/json

Type: Array<ReportGeofences>

Items:
  Reference: [ReportGeofences](https://sourcey-traccar.pages.dev/api-reference/models/reportgeofences/index.md); Type: ReportGeofences

- 401: Unauthorized

## Examples

### cURL

```bash
curl -X GET 'https://demo.traccar.org/api/reports/geofences?from=2024-01-15T09%3A30%3A00Z&to=2024-01-15T09%3A30%3A00Z' \
  -H 'Authorization: Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE'
```

### JavaScript

```javascript
const response = await fetch('https://demo.traccar.org/api/reports/geofences?from=2024-01-15T09%3A30%3A00Z&to=2024-01-15T09%3A30%3A00Z', {
  method: 'GET',
  headers: {
    'Authorization': 'Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.get(
    'https://demo.traccar.org/api/reports/geofences?from=2024-01-15T09%3A30%3A00Z&to=2024-01-15T09%3A30%3A00Z',
    headers={
        'Authorization': 'Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE',
    },
)
print(response.text)
```


## Fetch a list of ReportSummary within the time period for the Devices or Groups

`GET /reports/summary`

At least one _deviceId_ or one _groupId_ must be passed

Authentication (security requirement alternatives):

```json
[
  {
    "BasicAuth": []
  },
  {
    "ApiKey": []
  }
]
```

- BasicAuth: http (basic)
- ApiKey: http (bearer)

Parameters:

- `deviceId` (query, Array<integer>, optional)
  Type: Array<integer>
  
  Items:
    Type: integer

- `groupId` (query, Array<integer>, optional)
  Type: Array<integer>
  
  Items:
    Type: integer

- `from` (query, string, date-time, required) - in ISO 8601 format. eg. `1963-11-22T18:30:00Z`
  Type: string, date-time

- `to` (query, string, date-time, required) - in ISO 8601 format. eg. `1963-11-22T18:30:00Z`
  Type: string, date-time

Responses:

- 200: OK

Content type: application/json

Type: Array<ReportSummary>

Items:
  Reference: [ReportSummary](https://sourcey-traccar.pages.dev/api-reference/models/reportsummary/index.md); Type: ReportSummary

Content type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

Type: Array<ReportSummary>

Items:
  Reference: [ReportSummary](https://sourcey-traccar.pages.dev/api-reference/models/reportsummary/index.md); Type: ReportSummary

- 401: Unauthorized

## Examples

### cURL

```bash
curl -X GET 'https://demo.traccar.org/api/reports/summary?from=2024-01-15T09%3A30%3A00Z&to=2024-01-15T09%3A30%3A00Z' \
  -H 'Authorization: Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE'
```

### JavaScript

```javascript
const response = await fetch('https://demo.traccar.org/api/reports/summary?from=2024-01-15T09%3A30%3A00Z&to=2024-01-15T09%3A30%3A00Z', {
  method: 'GET',
  headers: {
    'Authorization': 'Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.get(
    'https://demo.traccar.org/api/reports/summary?from=2024-01-15T09%3A30%3A00Z&to=2024-01-15T09%3A30%3A00Z',
    headers={
        'Authorization': 'Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE',
    },
)
print(response.text)
```


## Download the summary report as a spreadsheet or send it by email

`GET /reports/summary/{type}`

Use `type=xlsx` to download the report, `type=mail` to deliver it by email asynchronously.

Authentication (security requirement alternatives):

```json
[
  {
    "BasicAuth": []
  },
  {
    "ApiKey": []
  }
]
```

- BasicAuth: http (basic)
- ApiKey: http (bearer)

Parameters:

- `type` (path, string, required)
  Type: string
  
  enum: ["xlsx","mail"]

- `deviceId` (query, Array<integer>, optional)
  Type: Array<integer>
  
  Items:
    Type: integer

- `groupId` (query, Array<integer>, optional)
  Type: Array<integer>
  
  Items:
    Type: integer

- `from` (query, string, date-time, required) - in ISO 8601 format. eg. `1963-11-22T18:30:00Z`
  Type: string, date-time

- `to` (query, string, date-time, required) - in ISO 8601 format. eg. `1963-11-22T18:30:00Z`
  Type: string, date-time

- `daily` (query, boolean, optional) - Aggregate values by day instead of the full period
  Type: boolean

Responses:

- 200: Spreadsheet attachment

Content type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

Type: string, binary

- 204: Report queued for email delivery

- 401: Unauthorized

- 404: Not found

## Examples

### cURL

```bash
curl -X GET 'https://demo.traccar.org/api/reports/summary/xlsx?from=2024-01-15T09%3A30%3A00Z&to=2024-01-15T09%3A30%3A00Z' \
  -H 'Authorization: Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE'
```

### JavaScript

```javascript
const response = await fetch('https://demo.traccar.org/api/reports/summary/xlsx?from=2024-01-15T09%3A30%3A00Z&to=2024-01-15T09%3A30%3A00Z', {
  method: 'GET',
  headers: {
    'Authorization': 'Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.get(
    'https://demo.traccar.org/api/reports/summary/xlsx?from=2024-01-15T09%3A30%3A00Z&to=2024-01-15T09%3A30%3A00Z',
    headers={
        'Authorization': 'Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE',
    },
)
print(response.text)
```


## Fetch a list of ReportTrips within the time period for the Devices or Groups

`GET /reports/trips`

At least one _deviceId_ or one _groupId_ must be passed

Authentication (security requirement alternatives):

```json
[
  {
    "BasicAuth": []
  },
  {
    "ApiKey": []
  }
]
```

- BasicAuth: http (basic)
- ApiKey: http (bearer)

Parameters:

- `deviceId` (query, Array<integer>, optional)
  Type: Array<integer>
  
  Items:
    Type: integer

- `groupId` (query, Array<integer>, optional)
  Type: Array<integer>
  
  Items:
    Type: integer

- `from` (query, string, date-time, required) - in ISO 8601 format. eg. `1963-11-22T18:30:00Z`
  Type: string, date-time

- `to` (query, string, date-time, required) - in ISO 8601 format. eg. `1963-11-22T18:30:00Z`
  Type: string, date-time

Responses:

- 200: OK

Content type: application/json

Type: Array<ReportTrips>

Items:
  Reference: [ReportTrips](https://sourcey-traccar.pages.dev/api-reference/models/reporttrips/index.md); Type: ReportTrips

Content type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

Type: Array<ReportTrips>

Items:
  Reference: [ReportTrips](https://sourcey-traccar.pages.dev/api-reference/models/reporttrips/index.md); Type: ReportTrips

- 401: Unauthorized

## Examples

### cURL

```bash
curl -X GET 'https://demo.traccar.org/api/reports/trips?from=2024-01-15T09%3A30%3A00Z&to=2024-01-15T09%3A30%3A00Z' \
  -H 'Authorization: Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE'
```

### JavaScript

```javascript
const response = await fetch('https://demo.traccar.org/api/reports/trips?from=2024-01-15T09%3A30%3A00Z&to=2024-01-15T09%3A30%3A00Z', {
  method: 'GET',
  headers: {
    'Authorization': 'Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.get(
    'https://demo.traccar.org/api/reports/trips?from=2024-01-15T09%3A30%3A00Z&to=2024-01-15T09%3A30%3A00Z',
    headers={
        'Authorization': 'Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE',
    },
)
print(response.text)
```


## Download the trips report as a spreadsheet or send it by email

`GET /reports/trips/{type}`

Use `type=xlsx` to download the report, `type=mail` to deliver it by email asynchronously.

Authentication (security requirement alternatives):

```json
[
  {
    "BasicAuth": []
  },
  {
    "ApiKey": []
  }
]
```

- BasicAuth: http (basic)
- ApiKey: http (bearer)

Parameters:

- `type` (path, string, required)
  Type: string
  
  enum: ["xlsx","mail"]

- `deviceId` (query, Array<integer>, optional)
  Type: Array<integer>
  
  Items:
    Type: integer

- `groupId` (query, Array<integer>, optional)
  Type: Array<integer>
  
  Items:
    Type: integer

- `from` (query, string, date-time, required) - in ISO 8601 format. eg. `1963-11-22T18:30:00Z`
  Type: string, date-time

- `to` (query, string, date-time, required) - in ISO 8601 format. eg. `1963-11-22T18:30:00Z`
  Type: string, date-time

Responses:

- 200: Spreadsheet attachment

Content type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

Type: string, binary

- 204: Report queued for email delivery

- 401: Unauthorized

- 404: Not found

## Examples

### cURL

```bash
curl -X GET 'https://demo.traccar.org/api/reports/trips/xlsx?from=2024-01-15T09%3A30%3A00Z&to=2024-01-15T09%3A30%3A00Z' \
  -H 'Authorization: Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE'
```

### JavaScript

```javascript
const response = await fetch('https://demo.traccar.org/api/reports/trips/xlsx?from=2024-01-15T09%3A30%3A00Z&to=2024-01-15T09%3A30%3A00Z', {
  method: 'GET',
  headers: {
    'Authorization': 'Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.get(
    'https://demo.traccar.org/api/reports/trips/xlsx?from=2024-01-15T09%3A30%3A00Z&to=2024-01-15T09%3A30%3A00Z',
    headers={
        'Authorization': 'Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE',
    },
)
print(response.text)
```


## Fetch a list of ReportStops within the time period for the Devices or Groups

`GET /reports/stops`

At least one _deviceId_ or one _groupId_ must be passed

Authentication (security requirement alternatives):

```json
[
  {
    "BasicAuth": []
  },
  {
    "ApiKey": []
  }
]
```

- BasicAuth: http (basic)
- ApiKey: http (bearer)

Parameters:

- `deviceId` (query, Array<integer>, optional)
  Type: Array<integer>
  
  Items:
    Type: integer

- `groupId` (query, Array<integer>, optional)
  Type: Array<integer>
  
  Items:
    Type: integer

- `from` (query, string, date-time, required) - in ISO 8601 format. eg. `1963-11-22T18:30:00Z`
  Type: string, date-time

- `to` (query, string, date-time, required) - in ISO 8601 format. eg. `1963-11-22T18:30:00Z`
  Type: string, date-time

Responses:

- 200: OK

Content type: application/json

Type: Array<ReportStops>

Items:
  Reference: [ReportStops](https://sourcey-traccar.pages.dev/api-reference/models/reportstops/index.md); Type: ReportStops

Content type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

Type: Array<ReportStops>

Items:
  Reference: [ReportStops](https://sourcey-traccar.pages.dev/api-reference/models/reportstops/index.md); Type: ReportStops

- 401: Unauthorized

## Examples

### cURL

```bash
curl -X GET 'https://demo.traccar.org/api/reports/stops?from=2024-01-15T09%3A30%3A00Z&to=2024-01-15T09%3A30%3A00Z' \
  -H 'Authorization: Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE'
```

### JavaScript

```javascript
const response = await fetch('https://demo.traccar.org/api/reports/stops?from=2024-01-15T09%3A30%3A00Z&to=2024-01-15T09%3A30%3A00Z', {
  method: 'GET',
  headers: {
    'Authorization': 'Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.get(
    'https://demo.traccar.org/api/reports/stops?from=2024-01-15T09%3A30%3A00Z&to=2024-01-15T09%3A30%3A00Z',
    headers={
        'Authorization': 'Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE',
    },
)
print(response.text)
```


## Download the stops report as a spreadsheet or send it by email

`GET /reports/stops/{type}`

Use `type=xlsx` to download the report, `type=mail` to deliver it by email asynchronously.

Authentication (security requirement alternatives):

```json
[
  {
    "BasicAuth": []
  },
  {
    "ApiKey": []
  }
]
```

- BasicAuth: http (basic)
- ApiKey: http (bearer)

Parameters:

- `type` (path, string, required)
  Type: string
  
  enum: ["xlsx","mail"]

- `deviceId` (query, Array<integer>, optional)
  Type: Array<integer>
  
  Items:
    Type: integer

- `groupId` (query, Array<integer>, optional)
  Type: Array<integer>
  
  Items:
    Type: integer

- `from` (query, string, date-time, required) - in ISO 8601 format. eg. `1963-11-22T18:30:00Z`
  Type: string, date-time

- `to` (query, string, date-time, required) - in ISO 8601 format. eg. `1963-11-22T18:30:00Z`
  Type: string, date-time

Responses:

- 200: Spreadsheet attachment

Content type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

Type: string, binary

- 204: Report queued for email delivery

- 401: Unauthorized

- 404: Not found

## Examples

### cURL

```bash
curl -X GET 'https://demo.traccar.org/api/reports/stops/xlsx?from=2024-01-15T09%3A30%3A00Z&to=2024-01-15T09%3A30%3A00Z' \
  -H 'Authorization: Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE'
```

### JavaScript

```javascript
const response = await fetch('https://demo.traccar.org/api/reports/stops/xlsx?from=2024-01-15T09%3A30%3A00Z&to=2024-01-15T09%3A30%3A00Z', {
  method: 'GET',
  headers: {
    'Authorization': 'Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.get(
    'https://demo.traccar.org/api/reports/stops/xlsx?from=2024-01-15T09%3A30%3A00Z&to=2024-01-15T09%3A30%3A00Z',
    headers={
        'Authorization': 'Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE',
    },
)
print(response.text)
```


## Download the devices report as a spreadsheet or send it by email

`GET /reports/devices/{type}`

Use `type=xlsx` to download the report, `type=mail` to deliver it by email asynchronously.

Authentication (security requirement alternatives):

```json
[
  {
    "BasicAuth": []
  },
  {
    "ApiKey": []
  }
]
```

- BasicAuth: http (basic)
- ApiKey: http (bearer)

Parameters:

- `type` (path, string, required)
  Type: string
  
  enum: ["xlsx","mail"]

Responses:

- 200: Spreadsheet attachment

Content type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

Type: string, binary

- 204: Report queued for email delivery

- 401: Unauthorized

- 404: Not found

## Examples

### cURL

```bash
curl -X GET 'https://demo.traccar.org/api/reports/devices/xlsx' \
  -H 'Authorization: Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE'
```

### JavaScript

```javascript
const response = await fetch('https://demo.traccar.org/api/reports/devices/xlsx', {
  method: 'GET',
  headers: {
    'Authorization': 'Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.get(
    'https://demo.traccar.org/api/reports/devices/xlsx',
    headers={
        'Authorization': 'Basic WU9VUl9VU0VSTkFNRTpZT1VSX1BBU1NXT1JE',
    },
)
print(response.text)
```
