FastGPTFastGPT

Get App Chart Analytics

Query time-series analytics for users, chats, and app performance grouped by fixed timezone offset within an exact time range.

Endpoint Overview

  • Method : POST
  • Path : /api/proApi/core/app/logs/getChartData
  • Module : Applications / App Logs
  • Authentication : Authorization: Bearer <apiKey>—Supports App API Key ( appId optional) and Personal API Key ( appId required) (see API Getting Started )
  • Interactive Try-It-Out : Open in Scalar API Explorer (self-hosted instances: replace the origin with <instance>/apidoc/systemopenapi#tag/%E5%BA%94%E7%94%A8%E6%97%A5%E5%BF%97/POST/proApi/core/app/logs/getChartData )

Description & Notes

Queries strictly within the exact absolute start and end timestamps without expanding the window. User, chat, and app buckets are grouped by the fixed timezone offset carried in dateStart (or server timezone if omitted); no separate timezone parameter is accepted.

Request Parameters

Request Body ( application/json )

Shared Parameters Across Branches

FieldTypeRequiredDefaultConstraints & Description
dateStartstringYes-Inclusive start timestamp as an ISO string preserving timezone offset and milliseconds; buckets use this fixed offset (server timezone if omitted, Z for UTC)
dateEndstringYes-Inclusive end timestamp (server timezone if offset is omitted); preserves the exact boundary without date expansion
sourcestring (enum)[]`No-Chat source filter; omit for all sources, pass an empty array to match nothing
offsetnumberNo1Retention offset measured in userTimespan units (defaults to 1); counts subsequent activity within the selected range only
userTimespanstring (enum)Yes-User analytics timespan. Allowed values: day , week , month , quarter
chatTimespanstring (enum)Yes-Chat analytics timespan. Allowed values: day , week , month , quarter
appTimespanstring (enum)Yes-App analytics timespan. Allowed values: day , week , month , quarter

Mutually Exclusive Branches ( anyOf )

  • Explicit App ID

Personal API keys and login sessions must pass appId ; an App API Key always uses the bound application.

FieldTypeRequiredDefaultConstraints & Description
appIdstringYes-Application ID. minLength: 1
  • App API Key (no appId required)

When authorizing with an app-bound App API Key, omit appId and sourceType ; the server resolves the bound app with sourceType fixed to app . Personal keys and login sessions cannot omit appId , and an explicit appId does not override an App API Key binding.

No extra branch-specific fields are required.

Request Examples

Replace YOUR_API_KEY and placeholder IDs before running. Self-hosted users should replace the base URL with <instance>/api .

cURL Example

curl --fail-with-body -X POST "https://cloud.fastgpt.io/api/proApi/core/app/logs/getChartData" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  --data-raw '{
  "appId": "68ad85a7463006c963799a05",
  "dateStart": "2024-01-01T00:00:00.000Z",
  "dateEnd": "2024-12-31T23:59:59.999Z",
  "userTimespan": "day",
  "chatTimespan": "day",
  "appTimespan": "day"
}'

Minimal Valid JSON Body

{
  "appId": "68ad85a7463006c963799a05",
  "dateStart": "2024-01-01T00:00:00.000Z",
  "dateEnd": "2024-12-31T23:59:59.999Z",
  "userTimespan": "day",
  "chatTimespan": "day",
  "appTimespan": "day"
}

Response Schema & Examples

Successful /api/* calls return the standard FastGPT envelope { "code": 200, "statusText": "", "message": "", "data": ... } , where data matches the 200 schema below (when a payload schema is declared; otherwise refer to the status description for runtime data semantics).

HTTP 200

Successfully retrieved application chart analytics

Content-Type : application/json

FieldTypeRequiredDefaultConstraints & Description
userDataobject[]Yes-User statistics
userData[].timestampnumberYes-Timestamp
userData[].summaryobjectYes-User summary metrics for the current time bucket
userData[].summary.userCountnumberYes-Total user count
userData[].summary.newUserCountnumberYes-New user count
userData[].summary.retentionUserCountnumberYes-Retained user count
userData[].summary.pointsnumberYes-Credit points consumed
userData[].summary.inputTokensnumberYes-Input tokens consumed
userData[].summary.outputTokensnumberYes-Output tokens consumed
userData[].summary.sourceCountMapobjectYes-User count by source
chatDataobject[]Yes-Chat statistics
chatData[].timestampnumberYes-Timestamp
chatData[].summaryobjectYes-Chat summary metrics for the current time bucket
chatData[].summary.chatItemCountnumberYes-Total message count
chatData[].summary.chatCountnumberYes-Total chat sessions
chatData[].summary.errorCountnumberYes-Error message count
chatData[].summary.pointsnumberYes-Credit points consumed
chatData[].summary.inputTokensnumberYes-Input tokens consumed
chatData[].summary.outputTokensnumberYes-Output tokens consumed
appDataobject[]Yes-App statistics
appData[].timestampnumberYes-Timestamp
appData[].summaryobjectYes-App performance summary metrics for the current time bucket
appData[].summary.goodFeedBackCountnumberYes-Positive feedback count
appData[].summary.badFeedBackCountnumberYes-Negative feedback count
appData[].summary.chatCountnumberYes-Chat item count
appData[].summary.totalResponseTimenumberYes-Total response time (ms)
Edit on GitHub

Last updated

On this page

Put your business knowledge to work with AI

Import company documents and build accurate, reliable, traceable AI answers.