---
title: "Create a saved report"
method: POST
path: "/v2/saved_reports"
tags: ["Saved Reports"]
---

# Create a saved report

`POST /v2/saved_reports`

## Request

- Base URL: `https://api.tenjin.com`
- URL: `https://api.tenjin.com/v2/saved_reports`
- Auth: HTTP bearer

## Request body

- PostSavedReportsRequest
  - `name` string, required: Name of the saved report
  - `granularity` 'daily' | 'weekly' | 'monthly' | 'totals-daily', required: Granularity of the report
  - `group_by` string[], required: Dimensions to group the report by, comma-separated or as an array. The dimensions and combinations each report_type takes: user_acquisition: `channel`, `app`, `country`, `campaign`, `site`, `creative`, `channel,app,country`, `channel,app`, `campaign,country`; ad_revenue: `channel`, `app`, `country`, `ad_placement`, `channel,app,country`, `channel,app`, `app,country`
  - `report_type` 'user_acquisition' | 'ad_revenue', required: `user_acquisition` for a spend report, `ad_revenue` for an ad revenue report
  - `past_number_days` integer: Number of days before today that the report covers
  - `channel_ids` integer[]: Ids of the channels the report covers, comma-separated or as an array; all when blank
  - `app_ids` string[]: Ids of the apps the report covers, comma-separated or as an array; all when blank
  - `metrics` string[]: Metrics of the report, comma-separated or as an array: any of the [spend metrics](https://api-docs.tenjin.com/metric_definitions#spend) for user_acquisition, or of the [ad revenue metrics](https://api-docs.tenjin.com/metric_definitions#ad_revenue) for ad_revenue. A POST without metrics uses spend, impressions, clicks, installs, cpi, ctr, cvr, tcpi for user_acquisition, and ad_revenue, impressions, clicks, ecpm, ecpc for ad_revenue

## Response `201`

The created saved report

- SavedReportDocument
  - `data` SavedReportResource, required
    - `id` string, uuid, required
    - `type` 'saved_report', required
    - `attributes` object, required
      - `name` string, required: Name of the saved report
      - `past_number_days` integer, required: Number of days before today that the report covers
      - `metrics` string[], required: Metrics of the report
      - `granularity` 'daily' | 'weekly' | 'monthly' | 'totals-daily', required: Granularity of the report
      - `report_type` 'user_acquisition' | 'ad_revenue', required: `user_acquisition` for a spend report, `ad_revenue` for an ad revenue report
      - `channel_ids` integer[], required: Ids of the channels the report covers; all when empty
      - `app_ids` string[], required: Ids of the apps the report covers; all when empty
      - `group_by` string, nullable, required: The dimension the report groups by, or the name of its combination: `channel_app_country`, `channel_app`, `campaign_country`, `app_country`. A report saved outside the API can hold several dimensions, comma-separated (`app,site`). Null when a stored dimension has no API name
  - `links` Links, required
    - `self` string, uri, required: URL of this request
    - `first` string, uri: URL of the first page of a list
    - `prev` string, uri: URL of the previous page of a list
    - `next` string, uri: URL of the next page of a list
    - `last` string, uri: URL of the last page of a list
  - `meta` object, required: Always empty

## Other responses

- `400`: A param is missing or invalid, a record is not found, or the request cannot be served
- `401`: Missing or invalid credentials, or no access to the requested data
- `403`: Invalid token, or the user's role does not allow the request
- `498`: Expired token, or a token with an invalid signature
- `503`: Read-only mode during maintenance; try again later

---

[API](https://skmtc.dev/tenjin/apis/reporting-metrics-api.md) - [All operations](https://skmtc.dev/tenjin/apis/reporting-metrics-api/llms.txt) - [OpenAPI document](https://skmtc.dev/tenjin/apis/reporting-metrics-api/revisions/cffd908625be?raw)
