{
  "url": "https://telipot.com/catalog/tasks/google-analytics.reports.batch",
  "id": "google-analytics.reports.batch",
  "name": "Up to five reports on one property in one request",
  "provider": {
    "slug": "google-analytics",
    "name": "Google Analytics 4"
  },
  "capability": "analytics.reports.batch",
  "platform": "analytics",
  "kind": "data",
  "tier": "core",
  "identity": "account",
  "identityLabel": "Company account",
  "price": {
    "amount": "Free",
    "state": "free",
    "label": "Free",
    "detail": "Free from the tool",
    "type": "free"
  },
  "providers": 1,
  "retention": "standard",
  "runsOn": "free",
  "live": true,
  "summary": "Returns multiple reports in a batch. All reports must be for the same Google Analytics property.",
  "method": "POST",
  "path": "/v1beta/properties/{propertyId}:batchRunReports",
  "host": "https://analyticsdata.googleapis.com",
  "docsUrl": "https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties/batchRunReports",
  "auth": {
    "scheme": "oauth",
    "label": "oauth · OAuth 2.0 with PKCE",
    "short": "oauth · OAuth 2.0"
  },
  "scope": "own_account",
  "principal": "organization",
  "requiredScopes": [
    "analytics.readonly"
  ],
  "verification": {
    "state": "none",
    "label": "Not verified yet",
    "detail": "Not checked yet. We test with a real request before we mark it."
  },
  "input": [
    {
      "name": "propertyId",
      "location": "pathParams",
      "type": "string",
      "required": true,
      "constraints": [],
      "note": "The numeric id of a GA4 property, as google-analytics.accounts.summaries returns it after properties/"
    },
    {
      "name": "requests",
      "location": "body",
      "type": "array",
      "required": true,
      "constraints": [
        "at most 5"
      ],
      "note": "Up to 5 report requests, each the body of google-analytics.reports.run; the property is the one in the path"
    }
  ],
  "sampleInput": {
    "propertyId": "123456789",
    "requests": [
      {
        "dateRanges": [
          {
            "startDate": "2026-09-01",
            "endDate": "2026-09-30"
          }
        ],
        "dimensions": [
          {
            "name": "country"
          }
        ],
        "metrics": [
          {
            "name": "activeUsers"
          }
        ]
      }
    ]
  },
  "inputSchema": {
    "type": "object",
    "properties": {
      "propertyId": {
        "type": "string",
        "description": "The numeric id of a GA4 property, as google-analytics.accounts.summaries returns it after properties/",
        "examples": [
          "123456789"
        ]
      },
      "requests": {
        "type": "array",
        "description": "Up to 5 report requests, each the body of google-analytics.reports.run; the property is the one in the path",
        "examples": [
          [
            {
              "dateRanges": [
                {
                  "startDate": "2026-09-01",
                  "endDate": "2026-09-30"
                }
              ],
              "dimensions": [
                {
                  "name": "country"
                }
              ],
              "metrics": [
                {
                  "name": "activeUsers"
                }
              ]
            }
          ]
        ],
        "maxItems": 5
      }
    },
    "required": [
      "propertyId",
      "requests"
    ],
    "additionalProperties": false
  },
  "output": [
    {
      "name": "reports",
      "type": "object[]",
      "description": "One report per request, in order, each shaped as the answer of google-analytics.reports.run"
    },
    {
      "name": "kind",
      "type": "string"
    }
  ],
  "outputSchema": {
    "type": "object",
    "properties": {
      "reports": {
        "type": "array",
        "description": "One report per request, in order, each shaped as the answer of google-analytics.reports.run",
        "items": {
          "type": "object",
          "properties": {
            "dimensionHeaders": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  }
                }
              }
            },
            "metricHeaders": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string"
                  }
                }
              }
            },
            "rows": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "dimensionValues": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "value": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "metricValues": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "value": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            },
            "rowCount": {
              "type": "integer"
            },
            "metadata": {
              "type": "object"
            },
            "kind": {
              "type": "string"
            }
          }
        }
      },
      "kind": {
        "type": "string"
      }
    }
  },
  "example": {
    "file": "examples/google-analytics.reports.batch.json",
    "json": {
      "reports": [
        {
          "dimensionHeaders": [
            {
              "name": "country"
            }
          ],
          "metricHeaders": [
            {
              "name": "activeUsers",
              "type": "TYPE_INTEGER"
            }
          ],
          "rows": [
            {
              "dimensionValues": [
                {
                  "value": "United States"
                }
              ],
              "metricValues": [
                {
                  "value": "1842"
                }
              ]
            },
            {
              "dimensionValues": [
                {
                  "value": "Germany"
                }
              ],
              "metricValues": [
                {
                  "value": "311"
                }
              ]
            }
          ],
          "rowCount": 37,
          "metadata": {
            "currencyCode": "USD",
            "timeZone": "America/Los_Angeles"
          },
          "kind": "analyticsData#runReport"
        }
      ],
      "kind": "analyticsData#batchRunReports"
    }
  },
  "commands": {
    "mode": "run",
    "cli": "telipot run google-analytics.reports.batch \\\n  --input-json '{\"propertyId\":\"123456789\",\"requests\":[{\"dateRanges\":[{\"startDate\":\"2026-09-01\",\"endDate\":\"2026-09-30\"}],\"dimensions\":[{\"name\":\"country\"}],\"metrics\":[{\"name\":\"activeUsers\"}]}]}'",
    "http": "curl https://api.telipot.com/v1/tasks/google-analytics.reports.batch/run \\\n  -H \"Authorization: Bearer $TELIPOT_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"propertyId\":\"123456789\",\"requests\":[{\"dateRanges\":[{\"startDate\":\"2026-09-01\",\"endDate\":\"2026-09-30\"}],\"dimensions\":[{\"name\":\"country\"}],\"metrics\":[{\"name\":\"activeUsers\"}]}]}'",
    "quote": "telipot run google-analytics.reports.batch \\\n  --input-json '{\"propertyId\":\"123456789\",\"requests\":[{\"dateRanges\":[{\"startDate\":\"2026-09-01\",\"endDate\":\"2026-09-30\"}],\"dimensions\":[{\"name\":\"country\"}],\"metrics\":[{\"name\":\"activeUsers\"}]}]}' \\\n  --quote"
  },
  "siblings": []
}
