Okube Analytics API Documentation (1.45.11)

Download OpenAPI specification:

License: Proprietary

This document provides definitions for GeoMarketing, Conversion & Presence modules Analytics Api.

Try it out feature is available through Swagger UI.

The Okube API is designed around the REST architectural style, ensuring a consistent and predictable interface. Key features include:

  • Resource-oriented URLs: Organized for simplicity and clarity.
  • Data encoding: Supports JSON-encoded responses and form-encoded request bodies.
  • HTTP standards: Utilizes standard HTTP methods, response codes, and authentication mechanisms.

Errors

The Okube API uses standard HTTP status codes to indicate the success or failure of requests. This consistent approach allows for straightforward error handling in your applications.

Status Code Categories

  • 2xx Success: Request was received, understood, and processed successfully.
  • 4xx Client Errors: Request contains invalid syntax or cannot be fulfilled due to client-side issues.
  • 5xx Server Errors: Server failed to fulfill a valid request due to internal issues.

Common Response Codes

Success Responses

  • 200 OK: Request succeeded. Response contains requested data.
  • 201 Created: Resource was successfully created.
  • 204 No Content: Request succeeded, but no content is returned.

Client Error Responses

  • 400 Bad Request: The request contains invalid parameters or malformed syntax.
  • 401 Unauthorized: Authentication credentials are missing or invalid.
  • 403 Forbidden: Authentication succeeded, but the authenticated user lacks permission.
  • 404 Not Found: The requested resource does not exist.
  • 422 Unprocessable Entity: Request is well-formed but contains semantic errors.
  • 429 Too Many Requests: You've exceeded the rate limit for API calls.

Server Error Responses

  • 500 Internal Server Error: An unexpected error occurred on the server.
  • 503 Service Unavailable: Server is temporarily unavailable, typically due to maintenance.

All error responses include a JSON body with detailed information to help diagnose the issue.

Pagination

Resource Pagination

The Okube API implements efficient pagination for all list endpoints that return collections of resources (e.g., applications, sites, campaigns). This approach optimizes performance and response times when working with large datasets.

Request Parameters

All paginated endpoints require the following query parameters:

  • page: Integer specifying the page number (starting from 1)
  • per_page: Integer specifying the number of items per page (typically 10-100)

Response Format

Paginated responses consist of two primary components:

  1. documents: An array containing the requested resources for the current page
  2. _$paginated: Metadata object with the following properties:
    • total: Total number of resources matching the query
    • page: Current page number
    • per_page: Number of items per page
    • page_count: Total number of pages available
    • has_more: Boolean indicating whether additional pages exist

Example Usage

GET /applications?page=2&per_page=25

This request will return the second page of applications, with 25 items per page.

CSV Export Option

Many list endpoints support an additional accept: text/csv header to download results in CSV format, bypassing pagination for complete data export.

For detailed schema information, see the PaginatedResponse schemas section.

Routing for Applications and Sites

Resource Hierarchy

The Okube API organizes resources hierarchically, with most endpoints scoped under either an Application (client account) or a Site (physical location or digital property). This structure is reflected in the URL patterns used throughout the API.

Flexible Resource Identification

The API supports multiple ways to identify resources:

  • Using unique MongoDB identifiers (UUID format)
  • Using human-readable keys (URL-friendly slugs)

Application Routes

Applications serve as top-level containers for most resources and can be referenced in two ways:

  • /applications/{id}: Using the application's unique identifier
  • /applications/{key}: Using the application's unique key

Site Routes

Sites represent business locations or digital properties and can be accessed through several URL patterns:

  • Direct access: /sites/{id}
  • Within application context:
    • /applications/{id}/sites/{id}
    • /applications/{id}/sites/{key}
    • /applications/{key}/sites/{id}
    • /applications/{key}/sites/{key}

Best Practices

  • When creating integrations, prefer using stable keys rather than IDs when possible
  • For performance-critical operations, direct ID-based routes typically offer better performance
  • For exploratory API use, key-based routes provide better readability and debuggability

Authentication

The Okube API secures all requests using JSON Web Tokens (JWT). Two authentication methods are available:

  1. Revocable API Keys: Ideal for long-term integrations and automated systems.
  2. 48-hour Access Tokens: Short-lived tokens suitable for user sessions and temporary access.

Security Notice: JSON Web Tokens grant access privileges to your data. Always store them securely and never expose them in client-side code, public repositories, or insecure communications channels.

To obtain a 48-hour access token, submit your credentials to the Authentication Endpoint.

Authentication Header Example:

-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

Important Requirements:

  • All API requests must use HTTPS protocol. Unencrypted HTTP requests will be rejected.
  • Unauthenticated requests will receive a 401 Unauthorized response.

Authenticate and retrieve JSON Web Token

Authorizations:
bearerAuth
Request Body schema: application/json
required

Provide username and password to authenticate.

Returned Jwt is valid for 48 hours

login
required
string

User email.

password
required
string

User password.

captchaPayload
string

internal use: to unlock usr account.

setCookie
boolean

True to set cookie.

Responses

Request samples

Content type
application/json
{
  • "login": "my@email.com",
  • "password": "mypassword"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "Authentication succeeded.",
  • "auth": {
    }
}

General Query Workflow

The Analytics endpoints utilize a structured query language that leverages both query parameters and request body for comprehensive configuration.

Query Parameters

Query parameters are used to:

  • Define the data period with from and to parameters.
  • Enable or disable specific features, such as uplift analysis.

Request Body

The request body accepts only application/json content and allows configuration through:

  • Optional filters to refine data selection.
  • Mandatory params to specify analytical operations.

Detailed specifications for filters and params can be found in each module's documentation.

Filters

Filters allow you to select data based on specific scope values. These filters are applied globally across all queries within the request (refer to params for additional details).

Params

The params section defines the core of an analytics query. Each parameter specifies:

  • The kpi (Key Performance Indicator) to analyze.
  • The statistical mode, which can be either:
    • histogram for time-series analysis
    • aggregation for consolidated metrics
  • The time granularity, which can be:
    • day for daily analysis
    • week for weekly analysis
    • month for monthly analysis
    • year for yearly analysis

For each kpi query, projections can be configured for specific scopes as follows:

  • all: When set to false, excludes aggregated data by scope.
  • temporals: When set to false, excludes data aggregated by both scope and granularity.

Projections for specific scopes are determined based on the data module:

  • Global Scopes:
    • globals: When set to false, excludes data aggregated by no-scope.
  • Application-Specific Scopes:
    • sites: When set to true, includes data aggregated by site (available in all application queries).
  • Conversion Module Scopes:
    • campaigns for campaign-level metrics
    • levers for marketing lever analysis
  • GeoMarketing Module Scopes:
    • homes (IRIS statistical areas)
    • works (IRIS statistical areas)
    • (depreacted) zones (IRIS statistical areas)
  • Presence Module Scopes:
    • equipments for device-level analysis

Additionally, for certain scopes, you can specify which property (key, name, etc.) should be projected alongside the data. Detailed information is available in the respective schema documentation.

Response Structure

The API response is an array, where each element includes:

  • kpi: The Key Performance Indicator that was analyzed
  • scope: The scope level of the analysis
  • granularity: The time granularity used
  • data: The resulting dataset

Data Organization

The data object contains query results organized by scope and granularity:

  • Global Scope:
    • all: Contains metrics aggregated across the entire time period.
    • temporals: Contains metrics organized by time granularity.
  • Other Scopes:
    • Each scope-specific object includes both all and temporals sections.

Temporal Data Behavior

The structure of temporals data depends on the selected mode:

  • histogram Mode:
    • Keys represent sequential time increments (e.g., day, week, month, year).
    • Example: For granularity: day and from: 2023-01-02, key 0 corresponds to 2023-01-02, key 1 to 2023-01-03, and so on.
  • aggregation Mode:
    • Keys represent categorical time periods (e.g., day of week, month of year).
    • Example: For granularity: day, key 1 aggregates all Mondays, key 2 aggregates all Tuesdays, within the specified time period.

GeoMarketing Analytics

Module KPIs

kpi
acquisition
attendance
returning
posSessions
poiSessions
timespent
timespentPerScope
uniqUsers
returningPerScope
returningFrequencyPerScope
os
model
manufacturer
visitorVsPedestrian
perPoiSessions
posAffinity
homeDistanceVisitsPerScope
workDistanceVisitsPerScope

Available Scopes

The GeoMarketing module provides location-based analytics across:

  • homes: Residential areas defined by geographical regions (IRIS statistical divisions)
  • works: Workplace locations defined by geographical regions (IRIS statistical divisions)

The module also provides insights across:

  • sites: Retail and business locations

For additional information about query structure, parameters, and response formats, please refer to the Analytics documentation.

[app] Analytics query

Authorizations:
bearerAuth
path Parameters
required
string or string
Examples:
  • 5e1834b0e12d62a85b388a1b -
  • customer-external-id -

Application unique identifier (_id) or external identifier

studyId
required
string^[a-fA-F0-9]{24}$
Example: 5e1834b0e12d62a85b388a1b

Study unique identifier (_id)

query Parameters
from
string <date>
Example: from=2022-01-15

Analytics period start day (included), formated as YYYY-MM-DD

to
string <date>
Example: to=2022-02-15

Analytics period end day (included), formated as YYYY-MM-DD

uplift
boolean
Default: true
Example: uplift=false

Set to false to disable data uplift

Request Body schema: application/json
required

See Analytics documentation for more informations.

object (body-filters)
Array of objects (Geo Marketing Analytics App Body Param) non-empty

Responses

Request samples

Content type
application/json
Example
{
  • "filters": {
    },
  • "params": [
    ]
}

Response samples

Content type
application/json
[
  • {
    }
]

[site] Analytics query

Route aliases

  • /sites/{siteId}/studies/{studyId}/geo-marketing/analytics
  • /applications/{appIdOrKey}/sites/{siteIdOrKey}/studies/{studyId}/geo-marketing/analytics
  • /s/{siteId}/studies/{studyId}/geo-marketing/analytics
  • /a/{appIdOrKey}/s/{siteIdOrKey}/studies/{studyId}/geo-marketing/analytics
Authorizations:
bearerAuth
path Parameters
siteId
required
string^[a-fA-F0-9]{24}$
Example: 5e1834b0e12d62a85b388a1b

Site unique identifier (_id)

studyId
required
string^[a-fA-F0-9]{24}$
Example: 5e1834b0e12d62a85b388a1b

Study unique identifier (_id)

query Parameters
from
string <date>
Example: from=2022-01-15

Analytics period start day (included), formated as YYYY-MM-DD

to
string <date>
Example: to=2022-02-15

Analytics period end day (included), formated as YYYY-MM-DD

uplift
boolean
Default: true
Example: uplift=false

Set to false to disable data uplift

Request Body schema: application/json
required

See Analytics documentation for more informations.

object (body-filters-2)
Array of objects (Geo Marketing Analytics Site Body Param) non-empty

Responses

Request samples

Content type
application/json
Example
{
  • "filters": {
    },
  • "params": [
    ]
}

Response samples

Content type
application/json
[
  • {
    }
]

Conversion Analytics

Module KPIs

kpi
costByVisit
costByOfflineVisit
costByOnlineVisit
costByConversion
costByOfflineConversion
costByOnlineConversion
ctr
globalLeverPerformance
offlineVisitsAndConversions
onlineVisitsAndConversions
offlineVisits
onlineVisits
offlineVisitsAttributions
onlineVisitsAttributions
offlineVisitsLinear
offlineVisitsShapley
offlineVisitsFC
offlineVisitsLC
onlineVisitsLinear
prints
clicks
openings
cost
printVsClick
printVsClickVsOpenings
timeBeforeOfflineVisitPerScope
timeBeforeOnlineVisitPerScope
offlineRoi
offlineRevenues
offlineConversions
offlineConversionRate
onlineRoi
onlineRevenues
onlineConversions
onlineConversionRate
roi
revenues
revenueByOfflineVisit
revenueByOnlineVisit
offlineRevenueByOfflineVisit
onlineRevenueByOnlineVisit
venueRate
printsByOfflineVisit
comparisonOfflineVisits
cohortCostByConversion
cohortCostByOfflineConversion
cohortCostByOnlineConversion
cohortOfflineVisitsAndConversions
cohortOnlineVisitsAndConversions
cohortOfflineRoi
cohortOfflineRevenues
cohortOfflineConversions
cohortOfflineConversionRate
cohortOnlineRoi
cohortOnlineRevenues
cohortOnlineConversions
cohortOnlineConversionRate
cohortRoi
cohortRevenues
costByPurchase
costByOfflinePurchase
costByOnlinePurchase
offlineConversionPurchases
onlineConversionPurchases
offlineVisitsPerCampaign
onlineVisitsPerCampaign

Available Scopes

The Conversion module provides analytics across the following scopes:

  • levers: Marketing channels and mechanisms
  • campaigns: Marketing campaigns and initiatives
  • extras: Campaign attributes in Key:Value format

The module also provides insights across:

  • sites: Retail and business locations

For additional information about query structure, parameters, and response formats, please refer to the Analytics documentation.

[app] Analytics query

Authorizations:
bearerAuth
path Parameters
required
string or string
Examples:
  • 5e1834b0e12d62a85b388a1b -
  • customer-external-id -

Application unique identifier (_id) or external identifier

query Parameters
from
string <date>
Example: from=2022-01-15

Analytics period start day (included), formated as YYYY-MM-DD

to
string <date>
Example: to=2022-02-15

Analytics period end day (included), formated as YYYY-MM-DD

uplift
boolean
Default: true
Example: uplift=false

Set to false to disable data uplift

Request Body schema: application/json
required

See Analytics documentation for more informations.

object (body-filters-3)
Array of objects (Conversion Analytics App Body Param) non-empty

Responses

Request samples

Content type
application/json
{
  • "filters": {
    },
  • "params": [
    ]
}

Response samples

Content type
application/json
[
  • {
    }
]

[site] Analytics query

Route aliases

  • /sites/{siteId}/conversions/levers/analytics
  • /applications/{appIdOrKey}/sites/{siteIdOrKey}/conversions/levers/analytics
  • /s/{siteId}/conversions/levers/analytics
  • /a/{appIdOrKey}/s/{siteIdOrKey}/conversions/levers/analytics
Authorizations:
bearerAuth
path Parameters
siteId
required
string^[a-fA-F0-9]{24}$
Example: 5e1834b0e12d62a85b388a1b

Site unique identifier (_id)

query Parameters
from
string <date>
Example: from=2022-01-15

Analytics period start day (included), formated as YYYY-MM-DD

to
string <date>
Example: to=2022-02-15

Analytics period end day (included), formated as YYYY-MM-DD

uplift
boolean
Default: true
Example: uplift=false

Set to false to disable data uplift

Request Body schema: application/json
required

See Stats queries documentation for more informations

object (body-filters-4)
Array of objects (Conversion Analytics Site Body Param) non-empty

Responses

Request samples

Content type
application/json
{
  • "filters": {
    },
  • "params": [
    ]
}

Response samples

Content type
application/json
[
  • {
    }
]

Presence Analytics

Module KPIs

kpi
acquisition
areaMatching
attendance
dropouts
entering
leaving
rangeAmplitude
returning
sessions
timespent
timespentPerScope
uniqUsers
visitOrder

Available Scopes

The Presence module provides customer flow analytics across:

  • Device-Level Scopes:
    • equipments: Connected devices and tracking systems

Multi-Level Insights

The module supports hierarchical analysis through:

  • Application-Level Scopes:
    • sites: Retail and business locations
  • Site-Level Scopes:
    • equipments: Connected devices within specific locations

For additional information about query structure, parameters, and response formats, please refer to the Analytics documentation.

[app] Analytics query

Authorizations:
bearerAuth
path Parameters
required
string or string
Examples:
  • 5e1834b0e12d62a85b388a1b -
  • customer-external-id -

Application unique identifier (_id) or external identifier

query Parameters
from
string <date>
Example: from=2022-01-15

Analytics period start day (included), formated as YYYY-MM-DD

to
string <date>
Example: to=2022-02-15

Analytics period end day (included), formated as YYYY-MM-DD

Request Body schema: application/json
required

See Analytics documentation for more informations.

object (body-filters-5)
Array of objects (Presence Analytics App Body Param) non-empty

Responses

Request samples

Content type
application/json
{
  • "filters": {
    },
  • "params": [
    ]
}

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

[site] Analytics query

Authorizations:
bearerAuth
path Parameters
required
string or string
Examples:
  • 5e1834b0e12d62a85b388a1b -
  • customer-external-id -

Application unique identifier (_id) or external identifier

required
string or string
Examples:
  • 5e1834b0e12d62a85b388a12 -
  • customer-external-id -

Site unique identifier (_id) or external identifier

query Parameters
from
string <date>
Example: from=2022-01-15

Analytics period start day (included), formated as YYYY-MM-DD

to
string <date>
Example: to=2022-02-15

Analytics period end day (included), formated as YYYY-MM-DD

Request Body schema: application/json
required

See Analytics documentation for more informations.

object (body-filters-6)
Array of objects (Presence Analytics Site Body Param) non-empty

Responses

Request samples

Content type
application/json
{
  • "filters": {
    },
  • "params": [
    ]
}

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Sites

Sites represent physical locations or digital properties managed within the Okube Analytics platform. The Site endpoints provide comprehensive functionality for creating, retrieving, updating, and listing all sites associated with your applications.

Key Features

  • Site Creation: Register new physical locations or online properties with detailed attributes
  • Site Retrieval: Access comprehensive information about specific sites
  • Site Updates: Modify site details, geographical data, and operational parameters
  • Site Listing: Browse all sites with powerful filtering and pagination options
  • Bulk CSV Import: Efficiently import multiple sites via CSV upload

Site Types

The API supports two distinct site types:

  • Offline Sites: Physical locations with geographical coordinates and address information
  • Online Sites: Digital properties without physical location data

Site Properties

Sites include essential attributes such as:

  • Identifying information (name, key, reference codes)
  • Location data (coordinates, address) for offline sites
  • Operational details (opening hours, capacity)
  • Categorization (tags, type)
  • Custom attributes for specialized analysis

Resource Relationships

Sites are linked to:

  • Applications: The client account that owns the site
  • Campaigns: Marketing initiatives targeting the site
  • Equipment: Tracking devices installed at the site

Analytics Integration

Sites serve as fundamental organizational units for:

  • Geo-marketing analysis
  • Conversion tracking
  • Customer presence monitoring
  • Multi-site performance comparison

Get paginated list of sites or CSV export

2 modes depending on Accept header

  • application/json: paginated list of sites
  • text/csv: CSV export of sites

Route aliases

  • /sites
  • /applications/{appIdOrKey}/sites
Authorizations:
bearerAuth
query Parameters
page
integer >= 0
Example: page=2

Page offset

per_page
integer [ 0 .. 100 ]
Example: per_page=5

Items count per page

app
string
Example: app=app_1

Application _id or key

q
string

query per name/key/address

name
string

has name (boolean)

active
string
Example: active=true

is active (boolean)

online
string
Example: online=true

is online (boolean)

inProd
string
Example: inProd=false

is in production (boolean)

hasDraft
string
Example: hasDraft=false

has plan in draft (boolean)

keys
Array of strings non-empty [ items non-empty ]
Example: keys=site_key_1&keys=site_key_2

keys to filter from

tags
Array of strings non-empty [ items non-empty ]
Example: tags=tag1&tags=tag2

List of tags to filter from

encoding
string
Enum: "utf8" "iso-8859-1" "windows-1252"

CSV export specific parameter, to set CSV file encoding (utf-8, etc.)

header Parameters
Accept
string

Default to application/json

Set one of the follow values to export data as csv:

  • text/csv
  • text/comma-separated-values
  • application/csv
  • application/excel
  • application/vnd.ms-excel
  • application/vnd.msexcel

Responses

Response samples

Content type
{
  • "documents": [
    ],
  • "_$paginated": {
    }
}

Create a site

application/json and multipart/form-data accepted

multipart/form-data should be used when uploading a thumbnail. application/json should be used in most cases.

Route aliases

  • /sites
  • /applications/{appIdOrKey}/sites (without app as body params)
Authorizations:
bearerAuth
Request Body schema:
One of
required
Internal Identifier (string) or Application Key (string) (id-or-key)

Application id - MUST not be provided when route is prefixed by /applications

key
string (key) [ 1 .. 250 ] characters

Site external identifier. Accepts any character format, including spaces, but control characters are not allowed.

keys
Array of strings (Site Key) [ 1 .. 10 ] items unique [ items [ 1 .. 250 ] characters ]

Alternative site keys (for multiple references, should be unique per application)

active
boolean

Is site active (displayed in stats, computed in analytics etc.)

description
string non-empty

Description

level
integer

Number of floors

name
required
string

Site name

tags
Array of strings (tags) non-empty

Contextual metadata

timezone
string (timezone) non-empty

Location timezone

phoneNumber
string

Site phone number

object
object
online
required
boolean
Value: true

Is site online (no geographical address)

Responses

Request samples

Content type
Example
{
  • "app": "5e1834b0e12d62a85b388a1b",
  • "key": "my-site",
  • "keys": [
    ],
  • "active": true,
  • "description": "My description",
  • "level": 1,
  • "name": "My site",
  • "tags": [
    ],
  • "timezone": "Europe/Paris",
  • "phoneNumber": "+33123456789",
  • "deliveryContact": {
    },
  • "modules": {
    },
  • "online": true
}

Response samples

Content type
{
  • "_id": "5e1834b0e12d62a85b388a1b",
  • "key": "my-site",
  • "keys": [
    ],
  • "createdAt": "2019-03-28T09:25:15.000Z",
  • "updatedAt": "2019-03-28T09:25:15.000Z",
  • "application": "5e1834b0e12d62a85b388a1b",
  • "name": "My site",
  • "description": "My site description",
  • "active": true,
  • "address": {
    },
  • "coordinates": [
    ],
  • "tags": [
    ],
  • "openings": {
    }
}

Get a site

Route aliases

  • /sites/{siteId}
  • /applications/{appIdOrKey}/sites/{siteIdOrKey}
Authorizations:
bearerAuth
path Parameters
siteId
required
string^[a-fA-F0-9]{24}$
Example: 5e1834b0e12d62a85b388a1b

Site unique identifier (_id)

Responses

Response samples

Content type
application/json
{
  • "_id": "5e1834b0e12d62a85b388a1b",
  • "key": "my-site",
  • "keys": [
    ],
  • "createdAt": "2019-03-28T09:25:15.000Z",
  • "updatedAt": "2019-03-28T09:25:15.000Z",
  • "application": "5e1834b0e12d62a85b388a1b",
  • "name": "My site",
  • "description": "My site description",
  • "active": true,
  • "address": {
    },
  • "coordinates": [
    ],
  • "tags": [
    ],
  • "openings": {
    }
}

Update a site

application/json and multipart/form-data accepted

multipart/form-data should be used when uploading a thumbnail. application/json should be used in most cases.

Route aliases

  • /sites/{siteId}
  • /applications/{appIdOrKey}/sites/{siteIdOrKey}
Authorizations:
bearerAuth
path Parameters
siteId
required
string^[a-fA-F0-9]{24}$
Example: 5e1834b0e12d62a85b388a1b

Site unique identifier (_id)

Request Body schema:
One of
key
string (key) [ 1 .. 250 ] characters

Site external identifier. Accepts any character format, including spaces, but control characters are not allowed.

keys
Array of strings (Site Key) [ 1 .. 10 ] items unique [ items [ 1 .. 250 ] characters ]

Alternative site keys (for multiple references, should be unique per application)

boolean or null

Is site active (displayed in stats, computed in analytics etc.)

string or null non-empty

Description

level
integer

Number of floors

name
string

Site name

Array of Tags (strings) or null

Site metadata

timezone
string (timezone) non-empty

Location timezone

string or null

Site phone number

object
object
online
boolean
Value: true

Is site online (no geographical address)

Responses

Request samples

Content type
Example
{
  • "key": "my-site",
  • "keys": [
    ],
  • "active": true,
  • "description": "My description",
  • "level": 1,
  • "name": "My site",
  • "tags": [
    ],
  • "timezone": "Europe/Paris",
  • "phoneNumber": "+33123456789",
  • "deliveryContact": {
    },
  • "modules": {
    },
  • "online": true
}

Response samples

Content type
{
  • "_id": "5e1834b0e12d62a85b388a1b",
  • "key": "my-site",
  • "keys": [
    ],
  • "createdAt": "2019-03-28T09:25:15.000Z",
  • "updatedAt": "2019-03-28T09:25:15.000Z",
  • "application": "5e1834b0e12d62a85b388a1b",
  • "name": "My site",
  • "description": "My site description",
  • "active": true,
  • "address": {
    },
  • "coordinates": [
    ],
  • "tags": [
    ],
  • "openings": {
    }
}

Import sites as CSV

Authorizations:
bearerAuth
path Parameters
required
string or string
Examples:
  • 5e1834b0e12d62a85b388a1b -
  • customer-external-id -

Application unique identifier (_id) or external identifier

Request Body schema: multipart/form-data
encoding
string
Enum: "utf8" "iso-8859-1" "windows-1252"
delimiter
string
mapper[id]
boolean
mapper[key]
string
mapper[additional_keys]
string
mapper[name]
string
mapper[street_number]
string
mapper[street]
string
mapper[postal_code]
string
mapper[city]
string
mapper[country]
string
mapper[latitude]
string
mapper[longitude]
string
mapper[timezone]
string
mapper[contact_name]
string
mapper[contact_email]
string
mapper[contact_phone]
string
mapper[presence]
string
mapper[tracking]
string
mapper[conversion]
string
file
string

Responses

Points of Interest

Points of Interest (POIs) represent specific geographical locations that are relevant for geo-marketing analysis. The POI endpoints allow you to create, retrieve, update, and list locations that are important for your business analysis.

Key Features

  • POI Creation: Register new geographical points with precise coordinates and classification
  • POI Retrieval: Access detailed information about specific locations
  • POI Updates: Modify location details, categorization, and associated properties
  • POI Listing: Browse all points of interest with filtering and pagination options
  • Geographical Filtering: Search POIs by proximity, region, or relation to other elements

POI Properties

Points of Interest include essential attributes such as:

  • Geographical coordinates (latitude/longitude)
  • Descriptive information (name, description)
  • Categorization (type, tags)
  • Custom attributes for specialized analysis

Resource Relationships

Points of Interest can be linked to:

  • Applications: The client account that manages the POI
  • Sites: Physical locations related to the POI
  • Geo-Marketing Studies: Analysis projects incorporating the POI data

Analytical Applications

POIs serve as crucial reference points for:

  • Catchment area analysis
  • Competition mapping
  • Footfall correlation studies
  • Site potential evaluation

Get paginated list of Points of Interest or CSV export

2 modes depending on Accept header

  • application/json: paginated list of Points of Interest
  • text/csv: CSV export of Points of Interest

Route aliases

  • /pois (with app as body params)
  • /applications/{appIdOrKey}/pois
Authorizations:
bearerAuth
query Parameters
page
integer >= 0
Example: page=2

Page offset

per_page
integer [ 0 .. 100 ]
Example: per_page=5

Items count per page

app
string
Example: app=app_1

Application _id or key

q
string

query per name/key/address

name
string

has name (boolean)

active
string
Example: active=true

is active (boolean)

keys
Array of strings non-empty [ items non-empty ]
Example: keys=poi_ke_1&keys=poi_ke_2

List of Point of Interest keys to filter from

tags
Array of strings non-empty [ items non-empty ]
Example: tags=tag1&tags=tag2

List of tags to filter from

encoding
string
Enum: "utf8" "iso-8859-1" "windows-1252"

CSV export specific parameter, to set CSV file encoding (utf-8, etc.)

header Parameters
Accept
string

Default to application/json

Set one of the follow values to export data as csv:

  • text/csv
  • text/comma-separated-values
  • application/csv
  • application/excel
  • application/vnd.ms-excel
  • application/vnd.msexcel

Responses

Response samples

Content type
{
  • "documents": [
    ],
  • "_$paginated": {
    }
}

Create a point of interest

Allows to create a single Point of Interest through a JON Payload, or create/update several Points of Interest at once using a csv payload (as multipart/form-data)

Route aliases

  • /pois
  • /applications/{appIdOrKey}/pois (without app as body params)
Authorizations:
bearerAuth
Request Body schema: application/json
required
Internal Identifier (string) or Application Key (string) (id-or-key)

Application unique identifier (_id) or external identifier

key
string (key-5) [ 1 .. 250 ] characters

Point of interest external identifier. Accepts any character format, including spaces, but control characters are not allowed.

active
boolean

Is point of interest active (displayed in stats, computed in analytics etc.)

description
string non-empty

Description

name
required
string

Point of interest name

tags
Array of strings (tags) non-empty

Point of interest metadata

coordinates
required
Array of numbers (coordinates) = 2 characters

Point of interest geographical coordinates

object (address)

Point of interest local address

timezone
string (timezone) non-empty

Location timezone

radius
number [ 1 .. 300 ]

Geoloc data capture radius

object (h3-indexes)

Indoors H3 cells

object (h3-indexes)

Outdoors H3 cells

Responses

Request samples

Content type
application/json
{
  • "app": "5e1834b0e12d62a85b388a1b",
  • "key": "my-poi",
  • "active": true,
  • "description": "My description",
  • "name": "My point of interest",
  • "tags": [
    ],
  • "coordinates": [
    ],
  • "address": {
    },
  • "timezone": "Europe/Paris",
  • "radius": 1,
  • "indoorIndexes": {
    },
  • "outdoorIndexes": {
    }
}

Response samples

Content type
application/json
{
  • "_id": "5e1834b0e12d62a85b388a1b",
  • "key": "my-poi",
  • "createdAt": "2019-03-28T09:25:15.000Z",
  • "updatedAt": "2019-03-28T09:25:15.000Z",
  • "application": "5e1834b0e12d62a85b388a1b",
  • "name": "My Point of interest",
  • "description": "My Point of interest description",
  • "active": true,
  • "address": {
    },
  • "coordinates": [
    ],
  • "timezone": "Europe/Paris",
  • "tags": [
    ],
  • "radius": 70,
  • "indoorIndexes": {
    },
  • "outdoorIndexes": {
    }
}

Get a point of interest

Route aliases

  • /pois/{poiId}
  • /applications/{appIdOrKey}/pois/{poiIdOrKey}
Authorizations:
bearerAuth
path Parameters
poiId
required
string^[a-fA-F0-9]{24}$
Example: 5e1834b0e12d62a85b388a1b

POI unique identifier (_id)

Responses

Response samples

Content type
application/json
{
  • "_id": "5e1834b0e12d62a85b388a1b",
  • "key": "my-poi",
  • "createdAt": "2019-03-28T09:25:15.000Z",
  • "updatedAt": "2019-03-28T09:25:15.000Z",
  • "application": "5e1834b0e12d62a85b388a1b",
  • "name": "My Point of interest",
  • "description": "My Point of interest description",
  • "active": true,
  • "address": {
    },
  • "coordinates": [
    ],
  • "timezone": "Europe/Paris",
  • "tags": [
    ],
  • "radius": 70,
  • "indoorIndexes": {
    },
  • "outdoorIndexes": {
    }
}

Update a point of interest

Route aliases

  • /pois (with app as body params)
  • /applications/{appIdOrKey}/pois
Authorizations:
bearerAuth
path Parameters
poiId
required
string^[a-fA-F0-9]{24}$
Example: 5e1834b0e12d62a85b388a1b

POI unique identifier (_id)

Request Body schema: application/json
key
string (key-5) [ 1 .. 250 ] characters

Point of interest external identifier. Accepts any character format, including spaces, but control characters are not allowed.

active
boolean

Is point of interest active (displayed in stats, computed in analytics etc.)

string or null non-empty

Description

string or null

Point of interest name

Array of Tags (strings) or null

Point of interest medatada

Array of Coordinates (numbers) or null

Point of interest geographical coordinates

Address (object) or null

Point of interest local address

timezone
string (timezone) non-empty

Location timezone

number or null [ 1 .. 300 ]

Geoloc data capture radius

H3 Indexes (object) or null

Indoors H3 cells

H3 Indexes (object) or null

Outdoors H3 cells

Responses

Request samples

Content type
application/json
{
  • "key": "my-poi",
  • "active": true,
  • "description": "My description",
  • "name": "My point of interest",
  • "tags": [
    ],
  • "coordinates": [
    ],
  • "address": {
    },
  • "timezone": "Europe/Paris",
  • "radius": 0,
  • "indoorIndexes": {
    },
  • "outdoorIndexes": {
    }
}

Response samples

Content type
application/json
{
  • "_id": "5e1834b0e12d62a85b388a1b",
  • "key": "my-poi",
  • "createdAt": "2019-03-28T09:25:15.000Z",
  • "updatedAt": "2019-03-28T09:25:15.000Z",
  • "application": "5e1834b0e12d62a85b388a1b",
  • "name": "My Point of interest",
  • "description": "My Point of interest description",
  • "active": true,
  • "address": {
    },
  • "coordinates": [
    ],
  • "timezone": "Europe/Paris",
  • "tags": [
    ],
  • "radius": 70,
  • "indoorIndexes": {
    },
  • "outdoorIndexes": {
    }
}

Campaigns

Campaigns represent marketing activities and promotions tracked within the Okube Analytics platform. The Campaign endpoints allow you to create, retrieve, update, and list all marketing campaigns associated with your applications.

Key Features

  • Campaign Creation: Define new marketing campaigns with start/end dates, targeting parameters, and attribution settings
  • Campaign Retrieval: Access detailed information about specific campaigns
  • Campaign Updates: Modify campaign parameters, timing, and associated properties
  • Campaign Listing: Browse all campaigns with powerful filtering and pagination options
  • Bulk CSV Import: Efficiently import multiple campaigns via CSV upload

Campaign Properties

Campaigns include essential attributes such as:

  • Descriptive information (name, description)
  • Time period definitions (start/end dates)
  • Categorization (tags, marketing lever)
  • Attribution settings
  • Associated sites and application

Resource Relationships

Campaigns are linked to:

  • Applications: The client account that owns the campaign
  • Sites: Physical locations or digital properties targeted by the campaign
  • Marketing Levers: Channel or mechanism used for campaign delivery

Get paginated list of campaigns or CSV export

2 modes depending on Accept header

  • application/json: paginated list of Points of Interest
  • text/csv: CSV export of Points of Interest

Route aliases

  • /campaigns (with app as body params)
  • /applications/{appIdOrKey}/campaigns
Authorizations:
bearerAuth
query Parameters
page
integer >= 0
Example: page=2

Page offset

per_page
integer [ 0 .. 100 ]
Example: per_page=5

Items count per page

period
string
Enum: "computed" "direct"

Period mode to filter campaigns (computed|direct)

sb
string <epoch>
Example: sb=1577836800

Start before

sa
string <epoch>
Example: sa=1577836800

Start after

eb
string <epoch>
Example: eb=1577836800

End before

ea
string <epoch>
Example: ea=1577836800

End after

encoding
string
Enum: "utf8" "iso-8859-1" "windows-1252"

CSV export specific parameter, to set CSV file encoding (utf-8, etc.)

tz
string
Example: tz=Europe/Paris

Timezone to use for the defined period (from/to)

from
string <date>
Example: from=2019-01-01

Start date of the period to filter campaigns

to
string <date>
Example: to=2019-01-31

End date of the period to filter campaigns

keys
Array of strings non-empty [ items non-empty ]
Example: keys=324400784&keys=campaign_id-1234

List of campaign keys to select

g
boolean
Default: false

select only globals campaigns (not attached to a site or a storeset)

q
string non-empty
Example: q=My campaign

Search query (in name/key/lever name/tags/provider/agency/format fields)

sites
Array of strings non-empty [ items non-empty ]
Example: sites=site_ke_1&sites=58a9b9e0e4b0e8b2b8e9b9e0

List of site ids|keys to select campaigns from

tags
Array of strings non-empty [ items non-empty ]
Example: tags=tag1&tags=tag2

List of tags to filter from

lever
string non-empty
Example: lever=display-in-app&lever=58a9b9e0e4b0e8b2b8e9b9e0

Lever to select campaigns from

levers
Array of strings non-empty [ items non-empty ]
Example: levers=display-in-app&levers=58a9b9e0e4b0e8b2b8e9b9e0

List of levers to select campaigns from

provider
string non-empty
Example: provider=Provider1

Provider to select campaigns from

agency
string non-empty
Example: agency=Agency1

Agency to select campaigns from

format
string non-empty
Example: format=Format1

Format to select campaigns from

string or string or string

Extra fields to select campaigns from

with_extra
boolean
Default: false

Map extra field to campaign response body

extra_mode
string
Default: "or"
Enum: "and" "or"

Extra fields mode (AND or OR) to filter by extra fields

trigger
boolean
Default: false

is campaign associated to a trigger lever (form step)

Responses

Response samples

Content type
{
  • "documents": [
    ],
  • "_$paginated": {
    }
}

Create campaign(s)

Create campaign(s)

Authorizations:
bearerAuth
Request Body schema:
required
Internal Identifier (string) or Application Key (string) (id-or-key)

Application id - MUST not be provided when route is prefixed by /applications

key
required
string (key-3) [ 1 .. 250 ] characters

Campaign external identifier. Accepts any character format, including spaces, but control characters are not allowed.

Internal Identifier (string) or Lever Key (string) (id-or-key-2)

Ignored value, only used for legacy purposes

name
string

Campaign name

description
string

Campaign description

provider
string

Campaign provider ref

agency
string

Campaign agency ref

format
string

Campaign format ref

from
string <date>

Campaign start date

to
string <date>

Campaign end date

extra
object

Campaign extra fields

Array of Internal Identifier (string) or Site Key (string) (Site Id or Key)
Array of objects (Cost)

Responses

Request samples

Content type
{
  • "app": "5e1834b0e12d62a85b388a1b",
  • "key": "my-campaign",
  • "lever": "5e1834b0e12d62a85b388a1b",
  • "name": "Campaign name",
  • "description": "Campaign description",
  • "provider": "Provider1",
  • "agency": "Agency1",
  • "format": "Format1",
  • "from": "2019-03-20",
  • "to": "2019-03-20",
  • "extra": {
    },
  • "sites": [
    ],
  • "costs": [
    ]
}

Response samples

Content type
application/json
{
  • "_id": "5e1834b0e12d62a85b388a1b",
  • "key": "my-campaign",
  • "application": "5e1834b0e12d62a85b388a1b",
  • "lever": "5e1834b0e12d62a85b388a1b",
  • "_cachedLeverName": "Display in app",
  • "sites": [
    ],
  • "name": "Campaign display name",
  • "description": "Campaign description",
  • "from": "2019-03-28",
  • "to": "2019-03-28",
  • "computedFrom": "2019-03-28",
  • "computedTo": "2019-03-28",
  • "tags": [
    ],
  • "flag": 2,
  • "_cachedLeverTrigger": false,
  • "provider": "Provider1",
  • "agency": "Agency1",
  • "format": "Format1",
  • "extra": [
    ],
  • "costs": [
    ]
}

Get a campaign

Get a campaign by id or key.

Route aliases

  • /campaigns/{campaignId}
  • /applications/{appIdOrKey}/campaigns/{campaignId}
Authorizations:
bearerAuth
path Parameters
campaignId
required
string^[a-fA-F0-9]{24}$
Example: 5e1834b0e12d62a85b388a1b

Campaign unique identifier (_id)

Responses

Response samples

Content type
application/json
{
  • "_id": "5e1834b0e12d62a85b388a1b",
  • "key": "my-campaign",
  • "application": "5e1834b0e12d62a85b388a1b",
  • "lever": "5e1834b0e12d62a85b388a1b",
  • "_cachedLeverName": "Display in app",
  • "sites": [
    ],
  • "name": "Campaign display name",
  • "description": "Campaign description",
  • "from": "2019-03-28",
  • "to": "2019-03-28",
  • "computedFrom": "2019-03-28",
  • "computedTo": "2019-03-28",
  • "tags": [
    ],
  • "flag": 2,
  • "_cachedLeverTrigger": false,
  • "provider": "Provider1",
  • "agency": "Agency1",
  • "format": "Format1",
  • "extra": [
    ],
  • "costs": [
    ]
}

Update a campaign

Update a campaign by id or key.

Route aliases

  • /campaigns/{campaignId}
  • /applications/{appIdOrKey}/campaigns/{campaignId}
Authorizations:
bearerAuth
path Parameters
campaignId
required
string^[a-fA-F0-9]{24}$
Example: 5e1834b0e12d62a85b388a1b

Campaign unique identifier (_id)

Request Body schema: application/json
key
string (key-3) [ 1 .. 250 ] characters

Campaign external identifier. Accepts any character format, including spaces, but control characters are not allowed.

string or null

Campaign name

string or null

Campaign description

string or null

Campaign provider ref

string or null

Campaign agency ref

string or null

Campaign format ref

string or null <date>

Campaign start date

string or null <date>

Campaign end date

object or null

Campaign extra fields

Array of Tags (strings) or null

Campaign metadata

(Array of Site Id or Key (Internal Identifier (string) or Site Key (string))) or null
Array of Cost (objects) or null

Responses

Request samples

Content type
application/json
{
  • "key": "my-campaign",
  • "name": "Campaign name",
  • "description": "Campaign description",
  • "provider": "Provider1",
  • "agency": "Agency1",
  • "format": "Format1",
  • "from": "2019-03-20",
  • "to": "2019-03-20",
  • "extra": {
    },
  • "tags": [
    ],
  • "sites": [
    ],
  • "costs": [
    ]
}

Response samples

Content type
application/json
{
  • "_id": "5e1834b0e12d62a85b388a1b",
  • "key": "my-campaign",
  • "application": "5e1834b0e12d62a85b388a1b",
  • "lever": "5e1834b0e12d62a85b388a1b",
  • "_cachedLeverName": "Display in app",
  • "sites": [
    ],
  • "name": "Campaign display name",
  • "description": "Campaign description",
  • "from": "2019-03-28",
  • "to": "2019-03-28",
  • "computedFrom": "2019-03-28",
  • "computedTo": "2019-03-28",
  • "tags": [
    ],
  • "flag": 2,
  • "_cachedLeverTrigger": false,
  • "provider": "Provider1",
  • "agency": "Agency1",
  • "format": "Format1",
  • "extra": [
    ],
  • "costs": [
    ]
}

Geomarketing Studies

Geomarketing Studies are analytical projects that evaluate geographic data to optimize business decisions. The Study endpoints enable you to create, retrieve, update, and list all geomarketing analyses associated with your applications.

Key Features

  • Study Creation: Define new analytical projects with specified geographical scope and parameters
  • Study Retrieval: Access detailed information about specific studies and their configurations
  • Study Updates: Modify study parameters, targeting criteria, and analysis settings
  • Study Listing: Browse all studies with comprehensive filtering and pagination options
  • Bulk Operations: Efficiently create or update multiple studies via batch endpoints

Study Properties

Geomarketing Studies include essential attributes such as:

  • Descriptive information (name, description)
  • Geographical scope definitions
  • Analysis parameters and preferences
  • Processing status and results summary
  • Time period definitions (creation date, update timestamp)

Resource Relationships

Studies are linked to:

  • Applications: The client account that owns the study
  • Sites: Physical locations analyzed within the study
  • Points of Interest: Geographical landmarks relevant to the analysis

Analytical Applications

Geomarketing Studies facilitate critical business insights for:

  • Trade area definition and optimization
  • Customer flow analysis
  • Competitive landscape evaluation
  • Site selection and expansion planning
  • Network optimization and rationalization

Get paginated list of studies or CSV export

2 modes depending on Accept header

  • application/json: paginated list of Points of Interest
  • text/csv: CSV export of Points of Interest

Route aliases

  • /studies (with app as body params)
  • /applications/{appIdOrKey}/studies
Authorizations:
bearerAuth
query Parameters
page
integer >= 0
Example: page=2

Page offset

per_page
integer [ 0 .. 100 ]
Example: per_page=5

Items count per page

sb
string <epoch>
Example: sb=1577836800

Start before

sa
string <epoch>
Example: sa=1577836800

Start after

eb
string <epoch>
Example: eb=1577836800

End before

ea
string <epoch>
Example: ea=1577836800

End after

encoding
string
Enum: "utf8" "iso-8859-1" "windows-1252"

CSV export specific parameter, to set CSV file encoding (utf-8, etc.)

tz
string
Example: tz=Europe/Paris

Timezone to use for the defined period (from/to)

from
string <date>
Example: from=2019-01-01

Start date of the period to filter studies

to
string <date>
Example: to=2019-01-31

End date of the period to filter studies

keys
Array of strings non-empty [ items non-empty ]
Example: keys=324400784&keys=study_id-1234

List of study keys to select

g
boolean
Default: false

select only globals studies (not attached to a site or a storeset)

q
string non-empty
Example: q=My study

Search query (in name/key/lever name/tags/provider/agency/format fields)

sites
Array of strings non-empty [ items non-empty ]
Example: sites=site_key_1&sites=58a9b9e0e4b0e8b2b8e9b9e0

List of site ids|keys to select studies from

pois
Array of strings non-empty [ items non-empty ]
Example: pois=poi_key_1&pois=58a9b9e0e4b0e8b2b8e9b9e0

List of POI ids|keys to select studies from

tags
Array of strings non-empty [ items non-empty ]
Example: tags=tag1&tags=tag2

List of tags to filter from

Responses

Response samples

Content type
{
  • "documents": [
    ],
  • "_$paginated": {
    }
}

Create study(ies)

Create study(ies)

Authorizations:
bearerAuth
Request Body schema:
required
Internal Identifier (string) or Application Key (string) (id-or-key)

Application id - MUST not be provided when route is prefixed by /applications

key
required
string (key-6) [ 1 .. 250 ] characters

Study external identifier. Accepts any character format, including spaces, but control characters are not allowed.

name
string

Study name

description
string

Study description

from
string <date>

Study start date

to
string <date>

Study end date

extra
object

Study extra fields

Array of Internal Identifier (string) or Site Key (string) (Site Id or Key)

List of associated site ids|keys

Array of Internal Identifier (string) or POI Key (string) (Point of interest Id or Key)

List of associated POI ids|keys

Responses

Request samples

Content type
{
  • "app": "5e1834b0e12d62a85b388a1b",
  • "key": "my-study",
  • "name": "Study name",
  • "description": "Study description",
  • "from": "2019-03-20",
  • "to": "2019-03-20",
  • "extra": {
    },
  • "sites": [
    ],
  • "pois": [
    ]
}

Response samples

Content type
application/json
{
  • "_id": "5e1834b0e12d62a85b388a1b",
  • "application": "5e1834b0e12d62a85b388a1b",
  • "sites": [
    ],
  • "pois": [
    ],
  • "key": "my-study",
  • "name": "Study display name",
  • "description": "Study description",
  • "from": "2019-03-28",
  • "to": "2019-03-28",
  • "tags": [
    ],
  • "flag": 2
}

Get a study

Get a study by id or key

Authorizations:
bearerAuth
path Parameters
studyId
required
string^[a-fA-F0-9]{24}$
Example: 5e1834b0e12d62a85b388a1b

Study unique identifier (_id)

Responses

Response samples

Content type
application/json
{
  • "_id": "5e1834b0e12d62a85b388a1b",
  • "application": "5e1834b0e12d62a85b388a1b",
  • "sites": [
    ],
  • "pois": [
    ],
  • "key": "my-study",
  • "name": "Study display name",
  • "description": "Study description",
  • "from": "2019-03-28",
  • "to": "2019-03-28",
  • "tags": [
    ],
  • "flag": 2
}

Update a study

Update a study by id or key

Authorizations:
bearerAuth
path Parameters
studyId
required
string^[a-fA-F0-9]{24}$
Example: 5e1834b0e12d62a85b388a1b

Study unique identifier (_id)

Request Body schema: application/json
key
string (key-6) [ 1 .. 250 ] characters

Study external identifier. Accepts any character format, including spaces, but control characters are not allowed.

string or null

Study name

string or null

Study description

string or null <date>

Study start date

string or null <date>

Study end date

Array of Tags (strings) or null

Study metadata

(Array of Site Id or Key (Internal Identifier (string) or Site Key (string))) or null
(Array of Point of interest Id or Key (Internal Identifier (string) or POI Key (string))) or null

Responses

Request samples

Content type
application/json
{
  • "key": "my-study",
  • "name": "Study name",
  • "description": "Study description",
  • "from": "2019-03-20",
  • "to": "2019-03-20",
  • "tags": [
    ],
  • "sites": [
    ],
  • "pois": [
    ]
}

Response samples

Content type
application/json
{
  • "_id": "5e1834b0e12d62a85b388a1b",
  • "application": "5e1834b0e12d62a85b388a1b",
  • "sites": [
    ],
  • "pois": [
    ],
  • "key": "my-study",
  • "name": "Study display name",
  • "description": "Study description",
  • "from": "2019-03-28",
  • "to": "2019-03-28",
  • "tags": [
    ],
  • "flag": 2
}