2faa857793e8

latestOpenAPI 3.0.12026-07-245277551.2 MB
Stock reports

Publish a new report

Publish a single report to a stock report with optional rules.

The API returns a 201 CREATED if the creation was successful.

post/datainsights/v1.1/stock_reports

Headers

X-PROPERTY-IDinteger required

Property id of the client

Request body

report_idinteger required

Report Id

Example request

{
  "rules": {
    "feature_ids": [
      "1"
    ],
    "country_codes": [
      "US"
    ]
  }
}

Response

Created

idinteger required

Report id

titlestring required

Report title

descriptionstring nullable

Report description

dataset_id1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 required

Dataset id

type'List' | 'Summary' | 'Pivot' required

Report type

folder_idinteger nullable required

Folder id

schedule_idsinteger[] required

Report schedule ids

updated_atstring

Report updated at

property_idsinteger[]

Report property ids

user_idinteger required

User id

publishedboolean

Published status of the report

Example response

{
  "title": "Report title",
  "description": "Report description",
  "dataset_id": 1,
  "columns": [
    {
      "cdf": {
        "type": "default",
        "column": "credit_amount"
      },
      "metrics": [
        "sum"
      ]
    }
  ],
  "group_rows": [
    {
      "cdf": {
        "type": "default",
        "column": "credit_amount"
      }
    }
  ],
  "group_columns": [
    {
      "cdf": {
        "type": "default",
        "column": "credit_amount"
      }
    }
  ],
  "periods": [
    {
      "cdf": {
        "type": "default",
        "column": "credit_amount"
      },
      "name": "Month-To-Date",
      "id": "start_of_last_year_to_today",
      "start": "'2014-12-22T03:12:58'|'start_current_year'",
      "end": "'2014-12-22T03:12:58'|'today'"
    }
  ],
  "comparisons": [
    {
      "name": "Range 1",
      "id": "range_1",
      "filters": {
        "and": [
          {
            "cdf": {
              "type": "default",
              "column": "credit_amount"
            }
          }
        ]
      }
    }
  ],
  "filters": {
    "and": [
      {
        "cdf": {
          "type": "default",
          "column": "credit_amount"
        }
      }
    ],
    "or": [
      {
        "cdf": {
          "type": "default",
          "column": "credit_amount"
        }
      }
    ]
  },
  "sort": [
    {
      "cdf": {
        "type": "default",
        "column": "credit_amount"
      },
      "direction": "asc"
    }
  ],
  "formats": {
    "date": "YYYY-MM-DD"
  },
  "type": "List",
  "tags": [
    {
      "name": "#Financial"
    }
  ],
  "schedule_ids": [
    1
  ],
  "custom_cdfs": [
    {
      "column": "full_address",
      "name": "Full address",
      "description": "CDF with the full address information",
      "kind": "String",
      "format": "currency"
    }
  ],
  "published": true,
  "rules": {
    "feature_ids": [
      "1"
    ],
    "country_codes": [
      "US"
    ]
  }
}