Skip to content
Rello edited this page Aug 25, 2026 · 24 revisions

REST API

The REST API is for Internal Database datasets. Authenticate as the dataset owner. For scripts and integrations, use an application password from Personal settings → Security rather than the account password.

All examples use Basic authentication and JSON:

curl --user 'user:app-password' \
  --header 'Content-Type: application/json' \
  --data '{"data":[{"dimension1":"2026-08-25","dimension2":"server-a","value":"42"}]}' \
  'https://cloud.example/apps/analytics/api/4.0/data/10/add'

Current API: v4

Add data

POST /nextcloud/apps/analytics/api/4.0/data/{datasetId}/add

Pass a data array. Every record needs dimension1, dimension2, and value, either by those technical names or by the matching dataset column labels.

{
  "data": [
    {"dimension1": "%currentDate%", "dimension2": "server-a", "value": "42"},
    {"Date": "2026-08-25", "Host": "server-b", "Load": "38"}
  ]
}

In v4, %currentDate% uses the ISO Y-m-d format. The endpoint creates or updates matching records.

v3 read and delete endpoints

These endpoints remain available:

Purpose Endpoint
Add data POST /api/3.0/data/{datasetId}/add
Delete data POST /api/3.0/data/{datasetId}/delete
Read report data GET /api/3.0/data/{reportId}
List datasets GET /api/3.0/datasets
List reports GET /api/3.0/reports
Read report metadata GET /api/3.0/report/{reportId}

Delete requests use a delete array. * is a wildcard:

{"delete":[{"dimension1":"2026-08-*","dimension2":"server-a"}]}

Legacy v1 and v2

Use v4 for new integrations. v1 and v2 are retained for compatibility only.

  • POST /api/1.0/adddata/{datasetId} accepts one top-level record with dimension1, dimension2, and dimension3.
  • POST /api/2.0/adddata/{datasetId} and POST /api/2.0/deletedata/{datasetId} use the v3 data and delete payload shapes.
  • v3 uses localized %currentDate%; migrate date-sensitive writers to v4.

Errors use the standard response form with codes 9001 (unknown), 9002 (missing parameter), 9003 (not found or unauthorized), and 9004 (not allowed).

Clone this wiki locally