APG PayAPG Paydocs

Reporting

Create report asks

POST/report-asks
Request
POSThttps://api.tst.au.apgpay.dev/report-asks
curl -X POST https://api.tst.au.apgpay.dev/report-asks \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt":"string","context":{"dashboardId":"string","tab":"string","proposal":{}}}'

Ask the caller's reporting a question in words. An agent reads the datasets and asks the semantic layer as the caller, then proposes questions, a chart or a dashboard, which nothing saves. Answered as server-sent events: progress, then a proposal or an error, then done. Off for a tenant until it is opted in.

Permissions

Required permission
reports:query

Requires the `query` action on `reports` for the supplied runtime context

Request body

promptstringrequired

The question, at most 2000 characters.

Where the person is asking from.

Example request
{
  "prompt": "string",
  "context": {
    "dashboardId": "string",
    "tab": "string",
    "proposal": {}
  }
}

Responses

The response is a typed union.

Discriminated by event
event = "done"

The run has ended. Always the last event.

Example
{
  "event": "done",
  "data": {
    "usage": {
      "inputTokens": 1250,
      "outputTokens": 1250
    }
  }
}

Error responses