---
updatedAt: 2026-04-24T16:37:26.000Z
agentTools:
  projectIndex: https://developers.cloudbeds.com/llms.txt
---

# Get stock report data by id

Based on the report `type` generated while creating a stock report the data structure returned may have multiple formats.

## Types
#### List
```
{
    ...
    "columns": ...
    "settings": {
        ...
        "totals": false,
        "transpose": false,
    }
}
```

#### List (Totals)
```
{
    ...
    "columns": ...
    "settings": {
        ...
        "totals": true,
        "transpose": false,

    }
}
```
#### PeriodList
```
{
    ...
    "columns": ...
    "periods": ...
    "settings": {
        ...
        "totals": false,
        "transpose": true|false,
    }
}
```


#### Summary
```
{
    ...
    "columns": ...
    "group_rows": ...
    "settings": {
        ...
        "totals": false,
        "transpose": true|false,

    }
}
```

#### Summary (Totals)
```
{
    ...
    "columns": ...
    "group_rows": ...
    "settings": {
        ...
        "totals": true
        "transpose: true|false,
    }
}
```
#### PeriodSummary
```
{
    ...
    "columns": ...
    "group_rows": ...
    "periods": ...
    "settings": {
        ...
        "totals": false,
        "transpose": true|false,
    }
}
```


#### Pivot
```
{
    ...
    "columns": ...
    "group_rows": ...
    "group_columns": ...
    "settings": {
        ...
        "totals": false,
        "transpose": true|false
    }
}
```

#### Pivot (Totals)
```
{
    ...
    "columns": ...
    "group_rows": ...
    "group_columns": ...
    "settings": {
        ...
        "totals": true,
        "transpose": true|false,
    }
}
```

## Data

| Type                  | Headers | Index  | Records | Group Rows | Group Columns | Totals | Periods | Transpose |
| --------------------  | ------- | ------ | ------- | ---------- | ------------- | ------ | ------- | --------- |
| **List**              | Yes     | No     | Yes     | No         | No            | No     | No      | No        |
| **List (Totals)**     | Yes     | No     | Yes     | No         | No            | Yes    | No      | No        |
| **PeriodList**        | Yes     | Yes    | Yes     | No         | No            | No     | Yes     | Yes       |
| **Summary**           | Yes     | Yes    | Yes     | Yes        | No            | No     | No      | Yes       |
| **Summary (Details)** | Yes     | Yes    | Yes     | Yes        | No            | Yes    | No      | No        |
| **Summary (Totals)**  | Yes     | Yes    | Yes     | Yes        | No            | Yes    | No      | Yes       |
| **PeriodSummary**     | Yes     | Yes    | Yes     | Yes        | No            | No     | Yes     | Yes       |
| **Pivot**             | Yes     | Yes    | Yes     | Yes        | Yes           | No     | No      | Yes       |
| **Pivot (Totals)**    | Yes     | Yes    | Yes     | Yes        | Yes           | Yes    | No      | Yes       |

# OpenAPI definition

````json
{
  "info": {
    "description": "#### The Cloudbeds Data Insights API provides programmatic methods to access report data in [Data Insights](https://www.cloudbeds.com/measure-success/). With the Cloudbeds Data Insights API, you can:\n\n- Build custom reports to display Cloudbeds data.\n- Automate complex reporting tasks to save time.\n- Integrate your Cloudbeds data with other business applications.\n- Schedule your reports to your email in a custom frequency\n- Access stock/custom reports created by Cloudbeds\n- And many others\n- Export Request has a limit of 100000 records\n- Data and Summary requests has a limit of 100 records when the mode is Preview\n- Data and Summary requests has a limit of 12000 records when the mode is Run\n\n*Note: The API return application/json*.",
    "version": "1.1",
    "title": "Data Insights API",
    "termsOfService": "https://www.cloudbeds.com/terms/api/",
    "contact": {
      "email": "support@cloudbeds.com"
    },
    "license": {
      "name": "Cloudbeds",
      "url": "https://www.cloudbeds.com/"
    }
  },
  "components": {
    "securitySchemes": {
      "Authorization": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "##### Authorization refers to the process of granting a user or application access permissions to Cloudbeds data and features.\n\nTo authenticate your users, your App will need to implement an [authorization code flow](https://datatracker.ietf.org/doc/html/rfc6749#section-4.1).\n[Cloudbeds API Authentication](https://hotels.cloudbeds.com/api/docs/#api-Authentication) lets you direct your users to an authorization dialog on Cloudbeds.\nFrom there, the primary Cloudbeds experience will show the authorization dialog and handle the authorization on behalf of your App.\nYour users will be able to authorize or decline.\nAfter the user makes their choice, Cloudbeds will redirect the user to your App, where you can exchange the authorization code for an access token (if the user authorized your App), or handle a rejection (if the user did not authorize your App).\n\nIf using a cloudbeds API key, you can pass it as a header with the following format: `X-API-KEY: <your_api_key>`\n\n###### Cloudbeds implements the [OAuth 2.0](https://integrations.cloudbeds.com/hc/en-us/articles/360006450433-OAuth-2-0) authorization framework."
      }
    },
    "schemas": {
      "ErrorContent": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "description": "Error code"
          },
          "status": {
            "type": "string",
            "description": "Error status"
          },
          "description": {
            "type": "string",
            "description": "Error description"
          },
          "message": {
            "type": "object",
            "description": "Error message"
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ErrorContent"
          }
        }
      },
      "StockReportData": {
        "type": "object",
        "properties": {
          "headers": {
            "type": "array",
            "readOnly": true,
            "description": "Column headers that list columns names. The order of headers is the same as those specified in the request through the columns property. The number of headers is the number of columns.",
            "items": {}
          },
          "index": {
            "type": "array",
            "readOnly": true,
            "description": "List of index distinct names",
            "items": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "group_rows": {
            "type": "array",
            "readOnly": true,
            "description": "List of CDF names of group rows",
            "items": {
              "type": "string"
            }
          },
          "group_columns": {
            "type": "array",
            "readOnly": true,
            "description": "List of CDF names of group columns",
            "items": {
              "type": "string"
            }
          },
          "periods": {
            "type": "array",
            "readOnly": true,
            "description": "List of names of the periods being compared",
            "items": {
              "type": "string"
            }
          },
          "records": {
            "type": "object",
            "readOnly": true,
            "description": "Dictionary of records of column value combinations and metric values in the report"
          },
          "subtotals": {
            "type": "object",
            "readOnly": true,
            "description": "Dictionary of subtotals in the report"
          },
          "totals": {
            "type": "object",
            "readOnly": true,
            "description": "Dictionary of totals in the report"
          },
          "type": {
            "type": "string",
            "readOnly": true,
            "example": "List",
            "description": "Type of the report generated"
          },
          "comparisons": {
            "type": "array",
            "readOnly": true,
            "description": "List of names of the comparisons being made",
            "items": {
              "type": "string"
            }
          },
          "aggregated_count": {
            "type": "integer",
            "readOnly": true,
            "description": "Number of rows included in aggregations in the report"
          }
        },
        "required": [
          "group_columns",
          "group_rows",
          "headers",
          "index",
          "records",
          "subtotals",
          "totals",
          "type"
        ]
      }
    },
    "responses": {
      "BAD_REQUEST": {
        "description": "Bad Request",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    }
  },
  "paths": {
    "/datainsights/v1.1/stock_reports/{stock_report_id}/data": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "stock_report_id",
            "required": true,
            "description": "Stock report id of the resource",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "in": "query",
            "name": "format",
            "required": false,
            "description": "Select the format of the numbers in the records. The \"raw\" values are sent unmodified from the database. The \"formatted\" records as are cast to a string. Currency type CDFs are defined in the property settings and other numbers are formatted with commas to separate every third digit and a decimal to separate the fractional portion.",
            "schema": {
              "type": "string",
              "default": "raw",
              "enum": [
                "raw",
                "formatted"
              ],
              "example": "formatted"
            }
          },
          {
            "in": "query",
            "name": "property_ids",
            "required": true,
            "explode": false,
            "style": "form",
            "description": "Stock report property ids",
            "schema": {
              "type": "array",
              "minItems": 1,
              "items": {
                "type": "integer",
                "minimum": 1,
                "description": "Property id",
                "example": "1"
              }
            }
          },
          {
            "in": "header",
            "name": "X-PROPERTY-ID",
            "required": true,
            "description": "Property id of the client",
            "schema": {
              "type": "integer",
              "writeOnly": true,
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockReportData"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BAD_REQUEST"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "summary": "Get stock report data by id",
        "description": "Based on the report `type` generated while creating a stock report the data structure returned may have multiple formats.\n\n## Types\n#### List\n```\n{\n    ...\n    \"columns\": ...\n    \"settings\": {\n        ...\n        \"totals\": false,\n        \"transpose\": false,\n    }\n}\n```\n\n#### List (Totals)\n```\n{\n    ...\n    \"columns\": ...\n    \"settings\": {\n        ...\n        \"totals\": true,\n        \"transpose\": false,\n\n    }\n}\n```\n#### PeriodList\n```\n{\n    ...\n    \"columns\": ...\n    \"periods\": ...\n    \"settings\": {\n        ...\n        \"totals\": false,\n        \"transpose\": true|false,\n    }\n}\n```\n\n\n#### Summary\n```\n{\n    ...\n    \"columns\": ...\n    \"group_rows\": ...\n    \"settings\": {\n        ...\n        \"totals\": false,\n        \"transpose\": true|false,\n\n    }\n}\n```\n\n#### Summary (Totals)\n```\n{\n    ...\n    \"columns\": ...\n    \"group_rows\": ...\n    \"settings\": {\n        ...\n        \"totals\": true\n        \"transpose: true|false,\n    }\n}\n```\n#### PeriodSummary\n```\n{\n    ...\n    \"columns\": ...\n    \"group_rows\": ...\n    \"periods\": ...\n    \"settings\": {\n        ...\n        \"totals\": false,\n        \"transpose\": true|false,\n    }\n}\n```\n\n\n#### Pivot\n```\n{\n    ...\n    \"columns\": ...\n    \"group_rows\": ...\n    \"group_columns\": ...\n    \"settings\": {\n        ...\n        \"totals\": false,\n        \"transpose\": true|false\n    }\n}\n```\n\n#### Pivot (Totals)\n```\n{\n    ...\n    \"columns\": ...\n    \"group_rows\": ...\n    \"group_columns\": ...\n    \"settings\": {\n        ...\n        \"totals\": true,\n        \"transpose\": true|false,\n    }\n}\n```\n\n## Data\n\n| Type                  | Headers | Index  | Records | Group Rows | Group Columns | Totals | Periods | Transpose |\n| --------------------  | ------- | ------ | ------- | ---------- | ------------- | ------ | ------- | --------- |\n| **List**              | Yes     | No     | Yes     | No         | No            | No     | No      | No        |\n| **List (Totals)**     | Yes     | No     | Yes     | No         | No            | Yes    | No      | No        |\n| **PeriodList**        | Yes     | Yes    | Yes     | No         | No            | No     | Yes     | Yes       |\n| **Summary**           | Yes     | Yes    | Yes     | Yes        | No            | No     | No      | Yes       |\n| **Summary (Details)** | Yes     | Yes    | Yes     | Yes        | No            | Yes    | No      | No        |\n| **Summary (Totals)**  | Yes     | Yes    | Yes     | Yes        | No            | Yes    | No      | Yes       |\n| **PeriodSummary**     | Yes     | Yes    | Yes     | Yes        | No            | No     | Yes     | Yes       |\n| **Pivot**             | Yes     | Yes    | Yes     | Yes        | Yes           | No     | No      | Yes       |\n| **Pivot (Totals)**    | Yes     | Yes    | Yes     | Yes        | Yes           | Yes    | No      | Yes       |",
        "tags": [
          "Stock reports"
        ],
        "security": [
          {
            "Authorization": []
          }
        ]
      },
      "parameters": [
        {
          "in": "path",
          "name": "stock_report_id",
          "required": true,
          "schema": {
            "type": "integer",
            "minimum": 0
          }
        }
      ]
    }
  },
  "tags": [
    {
      "name": "Stock reports",
      "description": "Operations on stock reports"
    }
  ],
  "openapi": "3.0.2",
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
````