---
title: "Run a reporting query (POST)"
method: POST
path: "/apidata"
tags: ["API"]
---

# Run a reporting query (POST)

`POST /apidata`

## Request

- Base URL: `https://api3.mountain.com`
- URL: `https://api3.mountain.com/apidata`
- Auth: none declared
- TypeScript: <https://skmtc.dev/mountain/apis/mntn-ai-ops-reporting-api/docs/apidata/post.ts> (a function with typed inputs; its response is checked against the schema)

Same semantics as GET, with a JSON body for `filter`, column lists, and pagination. Recommended for non-trivial `filter` payloads.

## Request body

- DataRequest: POST /apidata JSON body. Use **GET /apilist** to discover valid column identifiers (for `data`, `sum`, and `filter`).
  - `key` string, required: Advertiser API key (required on every request).
  - `data` union[], required: Columns to return. Each item is either a column identifier string or a filtered column object. Use **GET /apilist** to discover valid column identifiers (for `data`, `sum`, and `filter`).
    - union
      - FilteredColumn: List of data columns to query
        - `alias` string
        - `friendly` string
        - `name` string
        - `type` string, required
        - `filter` union[]
          - union
            - And: Optional JSON **object** that restricts which rows are returned. Use the same shape for **POST** `filter` and **GET** `filter` (URL-encoded). **Filter types — column predicates:** Each property key is a column identifier (`table.column`). The value can be: - **Operator object:** keys are operator names and values are comparison values (for example `{"equals": "Live"}`, `{"in": ["a","b"]}`). - **Scalar** (string or number): shorthand for `equals`. - **Array:** shorthand for membership (`in`). **Filter types — logical groups:** Properties named `AND`, `OR`, or `NOT` hold a nested object that follows the same rules (more column predicates and/or nested `AND` / `OR` / `NOT`). **Operator keys** (allowed keys inside an operator object): `equals`, `not`, `in`, `notIn`, `lt`, `lte`, `gt`, `gte`, `contains`, `notContains`, `startsWith`, `endsWith`, `hasAny`. Use **GET /apilist** to discover valid column identifiers (for `data`, `sum`, and `filter`).
            - Not: Optional JSON **object** that restricts which rows are returned. Use the same shape for **POST** `filter` and **GET** `filter` (URL-encoded). **Filter types — column predicates:** Each property key is a column identifier (`table.column`). The value can be: - **Operator object:** keys are operator names and values are comparison values (for example `{"equals": "Live"}`, `{"in": ["a","b"]}`). - **Scalar** (string or number): shorthand for `equals`. - **Array:** shorthand for membership (`in`). **Filter types — logical groups:** Properties named `AND`, `OR`, or `NOT` hold a nested object that follows the same rules (more column predicates and/or nested `AND` / `OR` / `NOT`). **Operator keys** (allowed keys inside an operator object): `equals`, `not`, `in`, `notIn`, `lt`, `lte`, `gt`, `gte`, `contains`, `notContains`, `startsWith`, `endsWith`, `hasAny`. Use **GET /apilist** to discover valid column identifiers (for `data`, `sum`, and `filter`).
            - Or: Optional JSON **object** that restricts which rows are returned. Use the same shape for **POST** `filter` and **GET** `filter` (URL-encoded). **Filter types — column predicates:** Each property key is a column identifier (`table.column`). The value can be: - **Operator object:** keys are operator names and values are comparison values (for example `{"equals": "Live"}`, `{"in": ["a","b"]}`). - **Scalar** (string or number): shorthand for `equals`. - **Array:** shorthand for membership (`in`). **Filter types — logical groups:** Properties named `AND`, `OR`, or `NOT` hold a nested object that follows the same rules (more column predicates and/or nested `AND` / `OR` / `NOT`). **Operator keys** (allowed keys inside an operator object): `equals`, `not`, `in`, `notIn`, `lt`, `lte`, `gt`, `gte`, `contains`, `notContains`, `startsWith`, `endsWith`, `hasAny`. Use **GET /apilist** to discover valid column identifiers (for `data`, `sum`, and `filter`).
            - Value: Optional JSON **object** that restricts which rows are returned. Use the same shape for **POST** `filter` and **GET** `filter` (URL-encoded). **Filter types — column predicates:** Each property key is a column identifier (`table.column`). The value can be: - **Operator object:** keys are operator names and values are comparison values (for example `{"equals": "Live"}`, `{"in": ["a","b"]}`). - **Scalar** (string or number): shorthand for `equals`. - **Array:** shorthand for membership (`in`). **Filter types — logical groups:** Properties named `AND`, `OR`, or `NOT` hold a nested object that follows the same rules (more column predicates and/or nested `AND` / `OR` / `NOT`). **Operator keys** (allowed keys inside an operator object): `equals`, `not`, `in`, `notIn`, `lt`, `lte`, `gt`, `gte`, `contains`, `notContains`, `startsWith`, `endsWith`, `hasAny`. Use **GET /apilist** to discover valid column identifiers (for `data`, `sum`, and `filter`).
              - …
        - `nullReplacement` object
      - SimpleColumn: List of data columns to query
        - `alias` string
        - `friendly` string
        - `name` string
        - `type` string, required
  - `sum` string[]
  - `filter` Filter: Optional JSON **object** that restricts which rows are returned. Use the same shape for **POST** `filter` and **GET** `filter` (URL-encoded). **Filter types — column predicates:** Each property key is a column identifier (`table.column`). The value can be: - **Operator object:** keys are operator names and values are comparison values (for example `{"equals": "Live"}`, `{"in": ["a","b"]}`). - **Scalar** (string or number): shorthand for `equals`. - **Array:** shorthand for membership (`in`). **Filter types — logical groups:** Properties named `AND`, `OR`, or `NOT` hold a nested object that follows the same rules (more column predicates and/or nested `AND` / `OR` / `NOT`). **Operator keys** (allowed keys inside an operator object): `equals`, `not`, `in`, `notIn`, `lt`, `lte`, `gt`, `gte`, `contains`, `notContains`, `startsWith`, `endsWith`, `hasAny`. Use **GET /apilist** to discover valid column identifiers (for `data`, `sum`, and `filter`).
  - `begin` string, required: start date of the query
  - `end` string: end date of the query
  - `format` 'human' | 'json' | 'csv' | 'excel': defines the content type of the response
  - `formatdata` boolean: when set to true, the values in the response data will be each be formatted
  - `fullname` boolean
  - `limit` integer: when set, the number of rows returned will be limited to this number
  - `offset` integer: when set, the query will skip this number of rows. Used for pagination
  - `sort` string[]: when set, data will be returned sorted by this column and direction
  - `dataColumns` string[]

## Response `200`

Report data in the requested format

- JsonDataResponse: Response format when format=json is specified
  - `report-name` string: Name of the report
  - `publisher-name` string: Name of the advertiser or 'Grouped Advertisers'
  - `begin` string: Start date/time of the data range
  - `end` string: End date/time of the data range
  - `columns` object[]: Metadata about each column in the response
    - `table` string: Table name in lowercase
    - `name` string: Column name in lowercase
    - `friendly` string: User-friendly column name
    - `alias` string: Column alias (if applicable)
    - `help` string: Column description
    - `format` string: Data format type (date, number, text, percentage, etc.)
    - `icon` string: Icon type for UI display
    - `friendly-suffix` string: Suffix for display (e.g., '%' for percentages)
    - `target_direction_negative` boolean: Whether lower values are better
  - `rows` object[]: Array of data rows, each containing column name-value pairs

## Other responses

- `400`: Invalid request parameters
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `413`: Payload Too Large — the query exceeds server memory limits. Use the asynchronous /batch endpoint for large requests. See [Batch docs](https://api3.mountain.com/docs#batch/description/overview).
- `500`: Internal server error
- `504`: Gateway Timeout — the query exceeded the synchronous request time limit.

---

[API](https://skmtc.dev/mountain/apis/mntn-ai-ops-reporting-api.md) - [All operations](https://skmtc.dev/mountain/apis/mntn-ai-ops-reporting-api/llms.txt) - [OpenAPI document](https://skmtc.dev/mountain/apis/mntn-ai-ops-reporting-api/revisions/826e4445c45e?raw)
