Skip to content

Foleon API (1.0.0)

The Foleon API enables you to quickly and easily develop functional applications or integrations. In fact, this is the same API that powers the Foleon platform itself.

The API follows RESTful principles, so if you've worked with a RESTful API before, many of its concepts will be familiar to you. It leverages standard HTTP features, making it compatible with most HTTP clients. Most responses, including errors, are returned in JSON format.

Designed for clarity and ease of use, the API adheres to standard HTTP response codes, providing detailed error messages when necessary.

Download OpenAPI description
Overview
License
Languages
Servers
EU cluster
https://api.foleon.com/
US cluster
https://api.us.foleon.com/

Authentication

Authenticate your requests using your api credentials by creating a bearer token.

Operations

Docs

All endpoints related to creating, retrieving or deleting Docs (editions), or updating their settings.

Operations

Projects

All endpoints related to Projects (titles).

Operations

Users

All endpoints related to Users.

Operations

Workspaces

All endpoints related to Workspaces (accounts).

Operations

Personalization Categories

All endpoints related to Personalization Categories.

Operations

Personalization Options

All endpoints related to Personalization Options.

Operations

Personalization Properties

All endpoints related to Personalization Properties.

Operations

Personalization Values

All endpoints related to Personalization Values.

Operations

Personalization Tokens

All endpoints related to Personalization Tokens.

Operations

Editing Content

All endpoints related to editing the content of you Foleon Docs.

Operations

Exporting Gzipped Docs

Export tar.gz webpackages to host Foleon Docs on your own server.

Operations

Foleon Analytics

All endpoints related to Foleons native analytics.

Operations

Get analytics data based on a query

Request

Fetches detailed analytics data. The request body specifies the dimensions, measures, time dimensions, and filters for the query.

Note: Always include pageviews.account_id in filters for better performance, as data is chunked on workspace/account_id.

Bodyapplication/jsonrequired

Analytics query parameters

queryobject(AnalyticsQueryBodySchema)required
query.​totalboolean

Whether to include a total count.

query.​dimensionsArray of stringsrequired

A list of dimensions to group the data by (e.g., pageviews.account_id).

query.​timeDimensionsArray of objects(AnalyticsTimeDimensionSchema)required

A list of time dimensions for date-based slicing.

query.​timeDimensions[].​granularitystringrequired

The aggregation period (e.g., day).

Enum"day""week""month""year"
query.​timeDimensions[].​dimensionstringrequired

The time dimension member (e.g., pageviews.timestamp).

query.​timeDimensions[].​dateRangeArray of strings(date)= 2 itemsrequired

The start and end dates for the query (e.g., ["2025-07-01", "2025-08-01"]).

query.​measuresArray of stringsrequired

A list of measures (metrics) to calculate (e.g., pageviews.unique_clients).

query.​limitinteger

The maximum number of results to return.

Default 5000
query.​filtersArray of objects(AnalyticsFilterSchema)

A list of filters to apply to the data.

curl -i -X POST \
  https://api.foleon.com/analytics \
  -H 'Content-Type: application/json' \
  -d '{
    "query": {
      "total": true,
      "dimensions": [
        "pageviews.account_id",
        "pageviews.foleon_doc_id",
        "pageviews.foleon_doc_name",
        "projects.id",
        "projects.name"
      ],
      "timeDimensions": [
        {
          "granularity": "day",
          "dimension": "pageviews.timestamp",
          "dateRange": [
            "2025-07-01",
            "2025-08-01"
          ]
        }
      ],
      "measures": [
        "pageviews.unique_clients",
        "pageviews.unique_visits",
        "pageviews.total_visits",
        "pageviews.bounced"
      ],
      "limit": 5000,
      "filters": [
        {
          "member": "pageviews.account_id",
          "operator": "equals",
          "values": [
            48900
          ]
        },
        {
          "member": "pageviews.foleon_doc_id",
          "operator": "equals",
          "values": [
            324375
          ]
        }
      ]
    }
  }'

Responses

JSON response for retrieving Foleon Analytics

Bodyapplication/json
queryobject

The final query object used by the server (may include defaults/modifications).

dataArray of arrays

The resulting analytics data rows.

lastRefreshTimestring(date-time)

Timestamp of the last data refresh.

annotationobject

Metadata and annotations about the dimensions and measures.

totalinteger

The total number of rows.

Response
application/json
{ "query": { "dimensions": [], "filters": [], "timezone": "UTC", "limit": 5000, "total": true, "timeDimensions": [], "measures": [], "rowLimit": 5000 }, "data": [], "lastRefreshTime": "2025-07-15T12:24:11.163Z", "annotation": {}, "dataSource": "default", "dbType": "bigquery", "extDbType": "cubestore", "external": false, "slowQuery": false, "total": 0 }

Media Library

All endpoints related to managing media in Foleon's media library.

Operations