APG PayAPG Paydocs

Reporting

Create report conversations

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

Start a conversation with Ask with its first message. An agent reads the datasets and asks the semantic layer as the caller, then answers in words, proposes questions, a chart or a dashboard, which nothing saves, or asks a question back. Answered as server-sent events: message, text and progress, then a proposal or an error, then done. The conversation is the caller's alone. 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 message, at most 2000 characters. The first message of a conversation is its title.

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