v1

latestOpenAPI 3.0.02026-07-2455104.8 MB
Report

Create report

Creates a new report and returns the new record

post/api/v1/analytics/report

Request body

Example request

{
  "report": {
    "title": "My report",
    "description": "This is my report",
    "userId": 1,
    "sqlString": "SELECT * FROM users",
    "isFavorite": true,
    "isReadOnly": false,
    "collectionId": 1,
    "parameters": [
      {
        "name": "date",
        "type": "string",
        "defaultValue": "2021-01-01"
      }
    ]
  }
}

Response

Report response

Example response

{
  "data": [
    {
      "id": 1,
      "title": "My report",
      "description": "This is my report",
      "userId": 1,
      "sqlString": "SELECT * FROM users",
      "isFavorite": true,
      "collectionId": 1,
      "lastEditedBy": "John Doe",
      "tags": [
        {
          "id": 1,
          "name": "Official",
          "description": "This is my tag",
          "palette": "default",
          "isOfficial": true,
          "createdAt": "2023-01-01T00:00:00+00:00",
          "updatedAt": "2023-01-01T00:00:00+00:00"
        }
      ],
      "parameters": [
        {
          "name": "date",
          "type": "string",
          "defaultValue": "2021-01-01"
        }
      ],
      "createdAt": "2023-01-01T00:00:00+00:00",
      "updatedAt": "2023-01-01T00:00:00+00:00"
    }
  ]
}