/Docs
Search docs or ask a question⌘K
DocsAgent
Changelog
API Reference Export Insights

Export Insights

Download a project's insights for a time window as CSV or JSON.

GET/v1/projects/{projectId}/analytics/exportTry it
Session token

Downloads one report for the window: summary totals, top pages, popular and zero-result searches, and open documentation gaps. CSV opens straight in a spreadsheet; JSON carries the same data nested.

Note

Session JWT and org membership required. Any role can export — an API key gets 401, a non-member 403. Any plan.

Path Parameters

NameDescription
projectId:stringpathRequired
The project ID.

Query Parameters

NameDescription
days:integerquery
Time window in days, 1–365.
Default30
format:stringquery
csv or json.
Default"csv"

The summary response's exportUrl is this endpoint with days already set.

Example

-OJ saves the file under the name the server suggests.

Response — 200 OK

The body is the file itself, not a { data } envelope. Headers:

HeaderValue
Content-Typetext/csv; charset=utf-8 or application/json; charset=utf-8
Content-Dispositionattachment; filename="<project-slug>-insights-<days>d-<YYYY-MM-DD>.csv" (.json for JSON)
Cache-Controlno-store

CSV

Three columns, section,label,value, so you can filter by section:

Sectionlabelvalue
metadays, generated_atThe window and when the file was made
summarypage_views, unique_visitors, avg_duration_seconds, searches, zero_result_searches, assistant_questions, assistant_avg_confidence (0–1), assistant_thumbs_up, assistant_thumbs_downThe total
top_pagesPage pathViews
popular_searchesSearch textTimes searched
zero_result_searchesSearch textTimes searched with no results
open_gapsGap topicTimes asked

Each list section has at most 100 rows. Search text and gap topics are typed by your visitors, so any cell that starts with =, +, -, @, a tab or a carriage return is prefixed with ' — a spreadsheet shows it as text instead of running it as a formula. Cells containing commas, quotes, line breaks or ' are quoted.

JSON

openGaps lists the gaps open now, whatever the window; frequency counts since each gap was created.

Error Responses

400 Bad Request

days is not a whole number from 1 to 365, or format is not csv or json:

json
{
"error": {
"code": "validation_error",
"message": "days must be 1–365 and format csv or json",
"details": {
"issues": [{ "path": ["days"], "code": "too_big", "message": "Number must be less than or equal to 365" }],
"target": "query",
"traceId": "6f1c2a9e-3b7d-4c11-9a0e-2d5f8b4c7e10"
}
}
}

401 Unauthorized

Missing, invalid or expired session JWT, or an API key.

403 Forbidden

You are not a member of the organization that owns the project.

404 Not Found

The project does not exist or has been deleted.

Was this page helpful? Yes No
Request
cURLJavaScriptPythonGoRubyPHPJavaC#cURL
curl -OJ "https://api.syntext.dev/v1/projects/3f2a9c1e-8b4d-4e7a-9c21-5d6e7f8a9b0c/analytics/export?days=30&format=csv" \
-H "Authorization: Bearer $SYNTEXT_JWT"
Responseapplication/json
200OK
section,label,value
meta,days,30
meta,generated_at,2026-11-08T10:00:00.000Z
summary,page_views,48210
summary,unique_visitors,12034
summary,avg_duration_seconds,94
summary,searches,3921
summary,zero_result_searches,212
summary,assistant_questions,1287
summary,assistant_avg_confidence,0.81
summary,assistant_thumbs_up,344
summary,assistant_thumbs_down,41
top_pages,/guides/quickstart,9120
popular_searches,webhooks,311
zero_result_searches,rotate api key,28
open_gaps,how do i rotate an api key without downtime,41
Responseapplication/json
200OK
{
"projectId": "3f2a9c1e-8b4d-4e7a-9c21-5d6e7f8a9b0c",
"days": 30,
"generatedAt": "2026-11-08T10:00:00.000Z",
"summary": {
"pageViews": { "total": 48210, "uniqueVisitors": 12034, "avgDuration": 94.2 },
"search": { "total": 3921, "zeroResults": 212 },
"chat": {
"total": 1287,
"avgConfidence": 0.81,
"satisfaction": { "thumbsUp": 344, "thumbsDown": 41 }
}
},
"topPages": [{ "pagePath": "/guides/quickstart", "views": 9120, "uniqueVisitors": 4410 }],
"popularSearches": [{ "query": "webhooks", "count": 311 }],
"zeroResultSearches": [{ "query": "rotate api key", "count": 28 }],
"openGaps": [{ "topic": "how do i rotate an api key without downtime", "frequency": 41, "avgConfidence": 0.32 }]
}
Product
Resources
Company
© 2026 SyntextBuilt with Syntext