---
title: "Creates a GA4 report"
method: POST
path: "/googleanalytics4/report"
tags: ["Google analytics 4 reports"]
---

# Creates a GA4 report

`POST /googleanalytics4/report`

## Request

- The document declares no server URL.
- Auth: API key in header `TWN-InstanceKey` and API key in header `TWN-Authentication`

## Request body

- Ga4ReportCreateApiModel: Model for creating a new GA4 report configuration.
  - `Name` string: Name of the report.
  - `PropertyName` string: Name of the GA4 property. Something like properties/123456.
  - `MetricNames` string[]: API names of the metrics to include in the report.
  - `Filters` Ga4ReportFilterApiModel[]: Filters to apply to the report.
    - `DimensionName` string: API name of the dimension to filter on.
    - `Value` string: Value the dimension must match.
    - `DisplayName` string, nullable: User friendly display name of the filter dimension.
  - `NrOfDaysBack` integer: Number of days back the report data covers.
  - `MappingDimensionName` string: API name of the dimension used for mapping report rows to products.
  - `MappingAttributeId` integer: Identifier of the attribute used for mapping report rows to products.
  - `RegexTemplate` string, nullable: Optional regex template applied to dimension values during mapping.

## Response `200`

OK

- Ga4ReportApiModel: Represents a GA4 report configuration.
  - `Id` integer: Unique identifier of the report.
  - `Name` string: Name of the report.
  - `Property` ReportPropertyApiModel: Represents the GA4 property a report is linked to.
    - `Name` string: Name of the property. Something like properties/123456.
    - `DisplayName` string: User friendly display name of the property.
    - `ErrorMessage` string, nullable: Error message when the property could not be retrieved from Google (for example no access). Empty when there is no issue.
  - `Metrics` ReportMetricApiModel[]: Metrics included in the report.
    - `Name` string: API name of the metric.
    - `DisplayName` string: User friendly display name of the metric.
  - `Filters` Ga4ReportFilterApiModel[]: Filters applied to the report.
    - `DimensionName` string: API name of the dimension to filter on.
    - `Value` string: Value the dimension must match.
    - `DisplayName` string, nullable: User friendly display name of the filter dimension.
  - `NrOfDaysBack` integer: Number of days back the report data covers.
  - `MappingDimension` ReportDimensionApiModel: Represents a GA4 dimension used for mapping report rows to products.
    - `Name` string: API name of the dimension.
    - `DisplayName` string: User friendly display name of the dimension.
  - `MappingAttribute` ReportAttributeApiModel: Represents the attribute used for mapping GA4 report rows to products.
    - `Id` integer: Unique identifier of the attribute.
    - `Name` string: Name of the attribute.
  - `RegexTemplate` string, nullable: Optional regex template applied to dimension values during mapping.

## Other responses

- `400`: Bad Request

---

[API](https://skmtc.dev/tweakwise/apis/app-api.md) - [All operations](https://skmtc.dev/tweakwise/apis/app-api/llms.txt) - [OpenAPI document](https://skmtc.dev/tweakwise/apis/app-api/revisions/dc936bf76941?raw)
