AI

Generate AI Report

Required scopes: ai.provider (Read only).

Generation is asynchronous and takes three requests. This one starts it and returns the report identifier. Then poll Check AI Report Generation Status until its status is finished; progress counts up to 100 meanwhile. Finally Download AI Report returns a short-lived url. Fetch that url to get the report file itself.

post/users/{userId}/ai/reports

Request

Path parameters

userIdinteger required

User Identifier

Request body

OR

Example request

{
  "type": "tokens-usage-raw-data",
  "schema": {
    "dateFrom": "2024-01-23T07:00:14+00:00",
    "dateTo": "2024-09-27T07:00:14+00:00",
    "format": "json",
    "projectIds": [
      22
    ],
    "promptIds": [
      18
    ],
    "userIds": [
      1
    ],
    "languageIds": [
      "uk"
    ]
  }
}

Response

AI Report generation was successfully started

Example response

{
  "data": {
    "identifier": "50fb3506-4127-4ba8-8296-f97dc7e3e0c3",
    "status": "finished",
    "progress": 100,
    "attributes": {
      "format": "json",
      "reportType": "tokens-usage-raw-data"
    },
    "createdAt": "2024-01-23T11:26:54+00:00",
    "updatedAt": "2024-09-23T11:26:54+00:00",
    "startedAt": "2024-05-23T11:26:54+00:00",
    "finishedAt": "2024-05-23T11:26:54+00:00",
    "eta": "1 second"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.