> For the complete documentation index, see [llms.txt](https://apidocs.zerionsoftware.com/doc/iformbuilder-v80/llms.txt)

# Retrieve Usage

> GET /usage
> 
> Returns a daily device or API transaction report from the analytics service, for one profile or for the whole server.
> 
> - `overall` runs from `start` to the latest day and takes no `end`.
> - `detail` and `profile-detail` run from `start` to `end`.
> - The period is at most 366 days.
> 
> ### Authorization
> 
> SERVER and COMPANY users. A COMPANY user sees only their own profile: `profile_id` defaults to it, and any other `profile_id` answers 403. A SERVER user may pass any `profile_id`, or none for the server-wide report. BASIC users get 403.



## Servers
- https://api.iformbuilder.com/exzact/api/v80/[servername]: https://api.iformbuilder.com/exzact/api/v80/[servername]


## Authentication methods
- Oauth2


## Parameters
### Headers

- **Authorization** (string)
  e.g. Bearer {access_token}



### Query parameters

- **report** (string)
  the report to run

- **transaction_type** (string)
  device transactions or API calls

- **profile_id** (integer)
  id of the profile; a COMPANY user's own profile when omitted, the whole server for a SERVER user when omitted

- **start** (string(date))
  first day of the period, `YYYY-MM-DD`

- **end** (string(date))
  last day of the period, `YYYY-MM-DD`; required for `detail` and `profile-detail`, not accepted for `overall`



## Responses
### 200
OK - the analytics service's report, relayed as it answered. A JSON report is returned as is. A CSV report (a header row, then one row per day) is returned as `text/csv`; the rows of the `overall` report are put on separate lines.

### 400
Bad Request - `report` or `transaction_type` is missing or not one of its values, `profile_id` is not a positive integer, `start` or `end` is missing or not a date, `end` was sent with the `overall` report, `start` is after `end` (or after today for `overall`), or the period is longer than 366 days.

### 401
Unauthorized - missing or invalid bearer token.

### 403
Forbidden - the user is a BASIC user, or a COMPANY user asked for another profile's `profile_id`.

### 502
Bad Gateway - the analytics service could not be reached, or answered with an error (its HTTP status is in `error_message`). The service's address and response body are never returned.

### 503
Service Unavailable - the analytics service is not configured on this server.


[Powered by Bump.sh](https://bump.sh)
