Open API Documentation
1. General Conventions
1.1 Overview
The Ptengine Open API provides RESTful endpoints for programmatic access to heatmap and analytics data. You can hand this document to an AI Agent — the agent reads natural-language requests, builds the right query, and calls the API directly.
Base URL:
https://xbackend.ptengine.com/1.2 Authentication
All requests must include the x-api-key header with your API Key.
x-api-key: pt-your-api-key-hereHow to get an API Key:
Permission: Only Admin and Owner roles can create and manage API Keys.
Log in to Ptengine
Open the Experience module
Click the settings icon (⚙) in the top-right and choose "External App Integration"
Switch to the "API Keys" tab
Click "Create API Key", enter a name and choose the permission scope (data upload / data query)
Copy and store the key safely (it is shown only once)
1.3 Rate Limits
Limits vary by plan:
Free
3
100
Free Trial
10
1,000
Growth
30
3,000
Rate-limit info is returned via response headers:
1.4 Response Format
All endpoints return JSON in a uniform wrapper:
Success (HTTP 200):
{ "code": 200, "message": "OK", "data": ... }Failure (HTTP 4xx):
{ "code": 4xxx, "message": "..." }
See Appendix — Error Codes for the full list.
2. Insight
This chapter covers four query endpoints: Heatmap, Event, Data Center, and Conversion.
2.1 Common Rules
All four endpoints share two request fields: conversionNames and filters. Where to look up conversion goal names; how to write filters and where to find the values inside them — all covered here. Read this first, then each endpoint chapter is ready to use.
Conversion Goals
When querying conversion data (e.g. "how many purchases completed", "what's the signup conversion rate"), you need to tell the system which conversion goal to query. This endpoint returns all goal names configured in Ptengine — copy a name into your query request.
Request example:
Response example:
After getting name, write it into the conversionNames field of any query endpoint (/event/query, /datacenter/query, /conversion/query, /heatmap/query) to query data for that goal. For example: "conversionNames": ["Purchase complete"].
Filter
Add conditions to the filters field of your request body to narrow the data scope. For example: Mobile only, Japan only, a specific campaign source only.
Fields:
name
The field to filter on (see the categories below)
op
include or exclude; no other operators
value
The value(s), must be an array (even a single value: ["Japan"])
Custom-property filters (filter by event property) need extra
eventName/eventVariantfields — see "Custom-property filter (advanced)" below.
Fields fall into two categories:
Fixed-value fields
The four fields below accept fixed enumerated values — copy them verbatim:
deviceType
Device Type
PC, Mobile, Tablet
sourceType
Source Type
Direct, Search, Social, Referral, Campaign, AISearch
visitType
Visit Type
New visits, Returning visits
exitType
Exit Type
Bounce visits, Non-bounce visits
Dynamic-value fields
Values vary by data. Query them via the filter-values endpoint below.
Device
os
Operating system
["Windows", "Mac OS X"]
Device
osVersion
OS version
["Windows 10", "Mac OS X 10.15.7", "iOS 17.0"]
Device
browser
Browser
["Chrome", "Mobile Safari", "Edge"]
Device
browserVersion
Browser version
["Chrome 124.0.0", "Edge 146.0.0", "Mobile Safari 13.0.3"]
Device
screenResolution
Screen resolution
["1920x1080", "1440x900"]
Device
deviceBrand
Device brand
["Apple", "Samsung"]
Geo
country
Country / Area
["Japan", "China", "United States"]
Geo
region
State / Region
["Tokyo", "Beijing", "Hong Kong"]
Source
searchEngine
Search engine
["google"]
Source
socialNetwork
Social network
["facebook"]
Source
socialUrl
Social URL
["https://www.facebook.com/"]
Source
aiName
AI search
["ChatGPT", "Perplexity"]
Source
referralSource
Referral website
["www.muji.com"]
Source
referralUrl
Referral URL
["https://www.muji.com/"]
Ad
campaignUrl
Campaign URL
["https://www.google.com/"]
Ad
utmCampaign
Campaign name
["summer_sale"]
Ad
utmSource
Source (UTM)
["google", "facebook"]
Ad
utmMedium
Medium (UTM)
["cpc", "email"]
Ad
utmTerm
Term (UTM)
["heatmap tool"]
Ad
utmContent
Content (UTM)
["banner_a"]
Page
combinedPages
Entry page (combined)
["https://ptengine.jp/app/login"]
Page
originalPages
Original pages (full URL)
["https://ptengine.jp/app/select_project?from=login"]
Event
eventName
Event name
["checkout_completed", "product_viewed"]
Event
dimension
Custom dimension (cross-event)
Requires eventVariant
Event
eventDimension
Custom dimension (event-bound)
Requires eventName and eventVariant
Conversion
conversionName
Conversion name
["Purchase complete"]
Value examples are illustrative. For actual available values, call the filter-values endpoint.
Custom-property filter (advanced)
Use this only when your events carry custom properties (e.g. the purchase event has a price property) and you want to filter by those values. Two forms:
Bound to a specific event:
{ "name": "eventDimension", "eventName": "purchase", "eventVariant": "price", "op": "include", "value": ["100"] }— sessions where thepurchaseevent hasprice=100Cross-event lookup:
{ "name": "dimension", "eventVariant": "price", "op": "include", "value": ["100"] }— any event whereprice=100
filter-values
Returns the list of available values for a given filter field (e.g. all countries with data, all OS values, etc.). The returned values can be used directly as the value field of any query endpoint's filter.
Request parameters
profileId
yes
string
Site ID (8 chars). Must match the profile bound to the API Key. Find it in the Ptengine URL, e.g. https://www.ptengine.jp/app/{profileId}/home contains 566d12f9
startDate
no
string
Start date: YYYY-MM-DD or YYYY/MM/DD. Defaults to last 30 days
endDate
no
string
End date: YYYY-MM-DD or YYYY/MM/DD. Defaults to last 30 days
search
no
string
Fuzzy-search keyword
eventName
conditional
string
Only when name="eventDimension" (see Example 5 step 2)
eventVariant
conditional
string
Only when name="eventDimension" (see Example 5 step 2)
Example 1: regular field (e.g. country / os / browser)
Request:
Response:
Example 2: fuzzy search (search)
To filter the values list by a keyword, pass search. For example, country names containing "Ja" (matches Japan, Jamaica, etc.):
Request:
Response:
Example 3: list all event names (name="eventName")
Returns all event names that have data under the profile.
Request:
Response:
Example 4: list all custom event property names
Returns all custom event property names under the profile.
Request:
Response:
Example 5: values of a property under a specific event (eventDimension, two steps)
eventDimension requires two steps: first use name="eventDimension" to fetch the list of "event + property" pairs, then pass the chosen eventName + eventVariant to fetch actual values.
Step 1 — list (event, property) pairs:
Request:
Response:
Step 2 — pass the chosen eventName + eventVariant to fetch values:
Request:
Response:
2.2 Heatmap
Heatmap analytics — clicks and views on pages, blocks, and elements.
Request parameters
queryType
yes
string
Query type: page_metrics (page basic metrics), page_insight (page insight by dimension), block_metrics (block metrics), element_metrics (element metrics)
profileId
yes
string
Site ID (8 chars). Must match the profile bound to the API Key. Find it in the Ptengine URL, e.g. https://www.ptengine.jp/app/{profileId}/home contains 566d12f9
url
yes
string
Target page URL
startDate
yes
string
Start date: YYYY-MM-DD or YYYY/MM/DD
endDate
yes
string
End date: YYYY-MM-DD or YYYY/MM/DD
rangeType
no
string
URL matching mode. MERGE_URL (default) merges query params, ignoring URL differences; URL does exact match; PAGE_GROUP page-group dimension (requires pageGroupId, fetch via Page groups)
historyHeatmap
no
string
History heatmap snapshot ID. When provided, the query uses the config frozen at that snapshot; otherwise the latest config is used. For block_metrics / element_metrics: it affects all block/element metrics. For page_metrics / page_insight: only CTA metrics (ctaClicks / ctaClickRate) are affected — PV/UV/visits/bounce and other traffic metrics are unaffected. Fetch IDs via Heatmap snapshots
pageGroupId
no
string
Page group ID. Required when rangeType=PAGE_GROUP; fetch via Page groups. In that case pass the page group base URL (the defaultUrl returned by page groups) as url
engageConfig
no
object
Filter heatmap traffic by experiment (A/B test) version. { engageId, versionId, isControlGroup? }: get engageId / versionId from id / versions[].id of POST /v1/experience/list; isControlGroup is optional. Omit engageConfig to count all traffic
metrics
no
string[]
If omitted, returns all metrics; if passed, only the specified ones. See Available metrics
lang
no
string
Language for labels: EN (default), ZH, JP. Invalid values fall back to EN
funName
conditional
string
Required when queryType=page_insight. Allowed: terminalType (device), sourceType (traffic source), visitType (new/returning), aiName (AI source), utmCampaign, utmSource, utmMedium, utmTerm, utmContent, week, day
Query types
page_metrics — Page basic metrics
Returns traffic, behavior, and conversion metrics for a specified page.
Device types: ALL, PC, MOBILE, TABLET
metrics parameter: if omitted, returns all metrics; if passed, only those specified.
Conversion queries: All query types support conversion. Add completions (count) and/or conversionRate (rate) to metrics — they can be passed individually or together — and pass conversion names via conversionNames.
Request example:
Response example:
Note:
conversionsonly returns the conversion metrics requested inmetrics. The example above only hasconversionRate, soconversionsonly contains that. To also return completion counts, addcompletionstometrics.
page_insight — Page insight (grouped by dimension)
Returns page metrics grouped by a specified dimension.
Device types: ALL, PC, MOBILE, TABLET
Required: funName (if metrics is omitted, returns all metrics)
Allowed funName values:
terminalType
Group by device type (PC/Smart phone/Tablet)
sourceType
Group by source type (Direct/Search/Social/...)
visitType
Group by visit type (New visits/Returning visits)
aiName
Group by AI name
utmCampaign
Group by UTM Campaign
utmSource
Group by UTM Source
utmMedium
Group by UTM Medium
utmTerm
Group by UTM Term
utmContent
Group by UTM Content
week
Group by week
day
Group by day
Request example (group by device type):
Response example:
block_metrics — Block metrics
Returns metrics and screenshot URLs for each block (section) on a page. Requires that the page has been scanned and blocks configured in the product.
Device types: Must be PC, MOBILE, or TABLET. ALL is not supported.
metrics parameter: optional. If omitted, returns all metrics; if passed, only those specified. blockName and screenshotUrl are always returned.
Available metrics: impression, impressionRate, avgDuration, dropoff, dropoffRate, completions, conversionRate
stayTimeFilter: optional, block dwell time filter (seconds), default 5 seconds.
Request example:
Response example:
element_metrics — Element metrics
Returns metrics for each tracked element on a page. Requires page scanning and element configuration in the product.
Device types: Must be PC, MOBILE, or TABLET. ALL is not supported.
metrics parameter: optional. If omitted, returns all metrics; if passed, only those specified. elementName is always returned.
Available metrics: impression, impressionRate, click, clickRate, completions, conversionRate
Request example:
Response example:
Advanced query examples
The examples below show the three optional fields historyHeatmap, PAGE_GROUP, and engageConfig (combinable with any queryType).
Example 1 — Metrics for a history heatmap snapshot (historyHeatmap; snapshot IDs from Heatmap snapshots)
Example 2 — Query by page group (rangeType=PAGE_GROUP + pageGroupId; page groups from Page groups; pass the group's defaultUrl as url)
Example 3 — Query by experiment version (engageConfig; engageId / versionId from POST /open-api/v1/experience/list)
Available metrics
Page metrics (for page_metrics and page_insight)
Use the field names below in the metrics array.
Traffic
visits
Number of visits that viewed the page
value
pv
Number of times the page was viewed
value
uv
Number of unique visitors who viewed the page
value
newVisitsRate
Percentage of new visits that viewed the page
rate
entrances
Number of visits where this page was the landing page
value
Behavior
fvRate
Percentage of visitors who didn't scroll, convert, or navigate after entering. High value = hero doesn't engage
rate
timeOnPage
Average time spent on the page. Measures how long content keeps visitors engaged
time
clicks
Total clicks on the page, regardless of whether the target is a link
value
clickRate
Clicks per PV. Use it to gauge engagement
rate
ctaClicks
Clicks on key CTAs on the page. Set key elements as CTAs in the heatmap
value
ctaClickRate
CTA click rate = CTA clicks / PV
rate
bounceRate
Percentage of visitors who entered through this page and left without visiting any other page
rate
avgPageViews
Average number of pages viewed by visitors who landed on this page
decimal
Conversion
completions
Number of visits that viewed this page and completed a conversion
value
conversionRate
Percentage of visits that completed a conversion after viewing this page. Higher = greater conversion impact of this page
rate
Note: Conversion queries must also pass conversion goal names via
conversionNames.
Block metrics (for block_metrics)
If metrics is omitted, all are returned; if passed, only the specified ones. blockName and screenshotUrl are always returned.
blockName
Block name
text
screenshotUrl
Block screenshot URL
text
impression
PVs where users started seeing the current block
value
impressionRate
Share of PVs where users started seeing the current block
rate
dropoff
PVs that left the current block without clicking through or converting
value
dropoffRate
Share of PVs that left the current block without clicking through or converting
rate
avgDuration
Average dwell time on this block after users stop scrolling. Longer dwell typically means greater interest
time
completions
Visits that stayed on a content block for a specific time and completed a conversion
value
conversionRate
Share of visits with conversion among visits that stayed on a block for a specific time
rate
Element metrics (for element_metrics)
If metrics is omitted, all are returned; if passed, only the specified ones. elementName is always returned.
elementName
Element name
text
impression
PVs where users started seeing the current element
value
impressionRate
Share of PVs where users started seeing the current element
rate
click
Number of clicks on the current element
value
clickRate
Clicks ÷ impressions. Higher click rate = more engaging element
rate
completions
Visits that clicked an element and completed a conversion
value
conversionRate
Share of visits with conversion among visits that clicked the element
rate
Device type rules
page_metrics
ALL, PC, MOBILE, TABLET
ALL returns all-device aggregates
page_insight
ALL, PC, MOBILE, TABLET
ALL returns all-device aggregates
block_metrics
PC, MOBILE, TABLET
ALL not supported
element_metrics
PC, MOBILE, TABLET
ALL not supported
Block & element prerequisites
Before querying block_metrics or element_metrics, you must scan the page in the Ptengine product:
Open the target page in Ptengine Heatmap
Enable block / element detection
Save the configuration
If a page is not configured, the API returns 4008 (block not configured) or 4016 (element not configured).
Request examples
Example 1: page traffic overview
Example 2: page insight grouped by device type
Example 3: mobile block analytics with Japan filter
Example 4: page metrics for a specific conversion goal
Example 5: PC element click analytics
Notes
Time-type fields (e.g. page
timeOnPage, blockavgDuration) are returned as readable strings with units (e.g."5s","1m 30s").Rate-type values are decimals (e.g.
bounceRate: 0.45means 45%).The API's data source matches the Ptengine product UI; results should match.
If the requested URL has never been captured under the profile, the API returns
200but all metric values are0. No error.
Heatmap snapshots
List all available history heatmap snapshots (successfully saved; manual + auto-saved) under a given profileId + url. The returned id can be passed back to the heatmap query as historyHeatmap to query metrics tied to that frozen configuration.
Request example:
Request fields:
profileId
yes
string
Profile ID; must match the API key
url
conditional
string
Required unless PAGE_GROUP (PAGE_GROUP queries by pageGroupId, no url needed)
rangeType
no
string
URL / MERGE_URL (default) / PAGE_GROUP
pageGroupId
conditional
string
Required when rangeType=PAGE_GROUP
Response example:
Field meanings:
id
Snapshot ID (pass as historyHeatmap in heatmap query)
name
Snapshot name
note
Note
createTime
Creation time (milliseconds)
Page groups
List all page groups under the given profileId (shared by heatmap / insight). Use the returned id (page group ID) for page-group queries: in heatmap query pass rangeType=PAGE_GROUP + pageGroupId; for history heatmap snapshots pass rangeType=PAGE_GROUP + pageGroupId.
Request example:
Request fields:
profileId
yes
string
Profile ID; must match the API key
Response example:
Field meanings:
id
Page group ID (pass as pageGroupId when querying with PAGE_GROUP)
name
Page group name
defaultUrl
Page group default base URL (pass as url when querying with PAGE_GROUP)
2.3 Event
Event analytics. Query events by dimension, metric, and segment (the filters field in your request).
Request parameters
profileId
yes
string
Site ID (8 chars). Must match the profile bound to the API Key. Find it in the Ptengine URL, e.g. https://www.ptengine.jp/app/{profileId}/home contains 566d12f9
startDate
yes
string
Start date: YYYY-MM-DD or YYYY/MM/DD
endDate
yes
string
End date: YYYY-MM-DD or YYYY/MM/DD
dimensions
yes
(string | object)[]
Group-by dimensions array; must include "eventName". Up to 3 non-time dimensions + at most 1 time dimension (day / hour / week / month), matching the Event > Segment product page. Each item is a string (standard dimension name) or an object { name: "eventDimension", eventVariant: "<propName>" } (custom event property)
metrics
no
string[]
Metric field names, defaults to ["eventCount"]. Allowed: eventCount, sessions
Custom event properties
If your events carry custom properties (e.g. the purchase event has a price property), you can group by or segment on those properties.
Group by property — add to
dimensions:Results aggregate by
pricevalue.Segment by property — add to
filters:Only sessions where
purchaseevent hasprice=100.Always lock the event when segmenting — when segmenting by property, add an extra eventName filter, otherwise the query doesn't know which event to anchor on:
Request example:
Response example:
More examples
a) Simplest — count by event name
Request example:
b) Time series — by day
Request example:
c) Filter by conversion goal (fuzzy name match)
Request example:
conversionNamematches all goals whose names contain"ptmind". If nothing matches, returns4012.
d) Custom event property — group + filter
Request example:
Both filters are required and serve different purposes: the standalone
eventNamefilter locks the query togallery_item_impression(aggregation scope); theeventDimensionfilter further segments byposition == "home".
e) Source distribution — UTM + source type
Request example:
f) New visitors + PC + Japan/China
Request example:
g) Exclude bounce sessions
Request example:
Metadata
Returns all available metrics and dimensions (multi-language labels, optional lang switch).
Request example:
Response example (excerpt):
Available metrics
eventCount
Number of times the event was triggered
INTEGER
sessions
Number of sessions in which the event was triggered
INTEGER
Available dimensions (for dimensions[] group-by)
eventName
Event Name
visitType
Visit type
exitType
Exit type
combinedPages
Entry page
conversionName
Conversion Name
day
Date
hour
Hour
week
Week
month
Month
sourceType
Source type
campaignUrl
Campaign URL
referralSource
Referral Website
referralUrl
Referral URL
searchEngine
Search
socialNetwork
Social Media
socialUrl
Social URL
aiName
AI Search
utmCampaign
Campaign name
utmSource
Source
utmMedium
Medium
utmContent
Content
utmTerm
Term
deviceType
Device Type
deviceBrand
Brand
os
OS
osVersion
OS Version
browser
Browser
browserVersion
Browser Version
screenResolution
Resolution
country
Country / Area
region
State / City
Notes
dimensionsis required and must include the string"eventName"— event queries must group by event name. You can include other dimensions andeventDimensionobjects alongside.Dimension count limit: up to 3 non-time dimensions + at most 1 time dimension (
day/hour/week/month). Exceeding either limit returns4018.When
eventNamefilter is required: if any of the following:dimensionscontains a non-eventName, non-time field (e.g.country,sourceType)dimensionscontains aneventDimensionobjectfilterscontains aneventDimensionitem
Form:
{ "name": "eventName", "op": "include", "value": ["<event name>"] }. Missing returns4018.
2.4 Data Center
Site-wide analytics — site metrics / traffic sources / geo distribution / device, OS, browser distribution / view details by dimension.
Request parameters
queryType
yes
string
Query type: overview (summary data by topic), dimension_table (Top-N table grouped by a dimension), metric_curve (time series for a single metric)
profileId
yes
string
Site ID (8 chars). Must match the profile bound to the API Key. Find it in the Ptengine URL, e.g. https://www.ptengine.jp/app/{profileId}/home contains 566d12f9
startDate
yes
string
Start date: YYYY-MM-DD or YYYY/MM/DD
endDate
yes
string
End date: YYYY-MM-DD or YYYY/MM/DD
conversionName
no
string
Filter metrics by a single conversion goal. When omitted, returns metrics aggregated across all conversions. Applies only to dimension_table (any dimension except combinedPages / originalPages / pageGroup) and metric_curve (when metric ∈ conversions / conversionRate / conversionValue); other scenarios return 4018
lang
no
string
Language for labels: EN (default), ZH, JP. Only affects overview with topic = "metrics", and the label / description on metric columns of dimension_table. Invalid values fall back to EN
Query types
overview — Summary data by topic
Returns overview data by topic.
Required: topic. Allowed values: metrics / sources / location / device.
For finer details (specific search engine / referral URL / campaign name, or OS / browser distribution, etc.), use
queryType: "dimension_table"with the correspondingdimension.
topic = "metrics" — Metric overview
Request example:
Response example:
topic = "sources" — Traffic sources
Request example:
Response example:
topic = "location" — Geo distribution
Request example:
Response example:
topic = "device" — Device distribution
Request example:
Response example:
dimension_table — Top-N table grouped by a dimension
Returns a Top-N table grouped by a single dimension.
Required: dimension — see Available dimensions.
Optional: sortBy (string) / sortOrder (asc/desc) / limit (1-1000, default 1000). Response is capped at 1000 rows.
Request example:
Response example:
Each
metriccolumn carrieslabel/description(language controlled by thelangfield, defaults toEN). Metric values are formatted as strings to match the product UI columns: INTEGER with thousands separators ("1,145"), RATE as percentage ("52.18%"),avgVisitDurationas HH:MM:SS ("00:02:49"),avgLoadTimesub-second precision ("2.45s"). Parse the strings if you need the raw numeric values.
Example: page list
Top-N over "entry pages". Without conversionName, returns metrics aggregated across all conversions.
Response example:
Page-URL dimensions (
combinedPages/originalPages/entryCombinedPages/entryOriginalPages) always return the columnsurl+title; thepageGroupdimension returns the group name as a string.About
conversionName:
entryCombinedPages/entryOriginalPages(entry pages) support it: when supplied, theconversionsandconversionRatecolumns are scoped to the selected goal (matching the "Select conversion" dropdown above the entry-page table in the product UI). Other metrics are unchanged.
combinedPages/originalPages/pageGroup(pages / page groups) do not support it: these dimensions do not compute conversion metrics, so passingconversionNamereturns4018.
Example: filter metrics by a single conversion goal
When conversionName is set, metrics (conversions / conversionRate etc.) are computed against the matched conversion only.
Response example:
metric_curve — Time series for a single metric
Returns a time series for a single metric.
Required: metric. Allowed values: see Available metrics; granularity. Allowed values: hour / day / week / month. Response time field format: YYYY-MM-DD (or YYYY-MM-DDTHH for hour granularity).
hourgranularity constraint:startDateandendDatemust be the same day; otherwise4002is returned.day/week/monthhave no such constraint.
Request example:
Response example:
Available metrics
visits
INTEGER
Visits
users
INTEGER
Unique visitors (UV)
pageView
INTEGER
Page views (PV)
newVisitsRate
RATE
% New visits
returnVisitsRate
RATE
% Returning visits
avgVisits
RATE
Visits / UV
avgPageView
RATE
PV / UV
avgVisitDuration
TIME
Visit duration
bounceRate
RATE
% Bounce
avgLoadTime
TIME
Avg. page load time
conversions
INTEGER
# Completions
conversionRate
RATE
% Conversion
conversionValue
NUMBER
Conversion value
Available dimensions (for queryType: "dimension_table")
country
Country / Area
state
State / City
os
OS
osVersion
OS Version
browser
Browser
browserVersion
Browser Version
resolution
Resolution
brand
Brand
sourceType
Source Type
campaign
Campaign
campaignUrl
Campaign URL
referral
Referral
referralUrl
Referral URL
search
Search engine
socialMedia
Social media
socialUrl
Social URL
aiName
AI search source
adSource
UTM source
adName
UTM campaign
adMedium
UTM medium
adTerm
UTM term
adContent
UTM content
combinedPages
Combined pages
originalPages
Original pages
pageGroup
Page group
entryCombinedPages
Entry combined pages
entryOriginalPages
Entry original pages
2.5 Conversion
Conversion goal analytics — completions, value, source distribution, funnel.
Request parameters
queryType
yes
string
Query type: metrics (conversion metrics), metric_curve (time trend), sources_breakdown (distribution by source), ad_name_breakdown (distribution by ad name), ad_source_breakdown (distribution by ad source), funnel (funnel), regular (positive goals list), negative (negative goals list)
profileId
yes
string
Site ID (8 chars). Must match the profile bound to the API Key. Find it in the Ptengine URL, e.g. https://www.ptengine.jp/app/{profileId}/home contains 566d12f9
startDate
yes
string
Start date: YYYY-MM-DD or YYYY/MM/DD
endDate
yes
string
End date: YYYY-MM-DD or YYYY/MM/DD
conversionName
conditional
string
Goal name (must hit exactly 1 goal, otherwise 4012). Only required for funnel; other queryTypes do NOT need conversionName (it will be ignored even if passed)
metric
conditional
string
Required for metric_curve — completions / conversionRate / conversionValue
granularity
conditional
string
Required for metric_curve — hour / day / week / month
lang
no
string
Language for label/description: EN (default), ZH, JP. Currently only applied to queryType = "metrics" response. Invalid values fall back to EN
Query types
metrics — Conversion metrics
Returns 5 metrics: Completions / Conversion rate / Conversion value / Revenue / Loss. Each metric is wrapped as { value, label }; label honors the lang field.
Request example:
Response example:
Field meanings:
conversions
Visits that completed any positive conversion (aggregated across all goals)
conversionRate
conversions / total visits
conversionValue
revenue + loss (may be negative)
revenue
Total revenue from positive conversion goals (cvValue ≥ 0)
loss
Total loss from negative conversion goals (cvValue < 0), negative
metric_curve — Time trend
Returns the time series of a single conversion metric.
Required: metric — completions / conversionRate / conversionValue; granularity — hour / day / week / month.
Request example:
Response example:
sources_breakdown — Distribution by source
Breakdown of conversions by traffic source.
Request example:
Response example:
ad_name_breakdown — Distribution by ad name
Breakdown of conversions by ad name (UTM Campaign).
Request example:
Response example:
ad_source_breakdown — Distribution by ad source
Breakdown of conversions by ad source (UTM Source).
Request example:
Response example:
funnel — Funnel
Returns per-step entries, dropoff, and conversion-to-next rate.
Request example:
Response example:
Field meanings:
entries
Entries to this step (external + convert)
external
Visits that entered this step directly (not from the previous step)
dropoff
Dropoff at this step = entries − next step convert (0 on the last step)
conversionToNextRate
Conversion rate to the next step (null on the last step)
entryPaths
URLs of external entry pages for this step, sorted by visits desc
dropoffPaths
URLs of dropoff pages for this step, sorted by visits desc; untracked → Exit
summary.totalConversions
Final conversions (entries of the last step)
summary.totalConversionRate
Last-step entries / sum of external across all steps
regular — Positive goals list
Returns all "positive" (value ≥ 0) conversion goals with their metrics, one row per goal.
Request example:
Response example:
negative — Negative goals list
Same shape as regular. Returns all "negative" (value < 0, i.e. loss goals) conversion goals, with an extra loss column per row (absolute loss value).
Notes
conversionNameis only required forfunnel; other queryTypes do NOT needconversionName(it will be ignored if passed).For
funnel,conversionNamemust hit exactly one goal. If multiple match (e.g."ptmind"matches both"ptmind signup"and"ptmind purchase"), it returns 4012 with the list of matches — use a more specific name.Use
POST /v1/conversion/goalsto list all goals before constructing your request.
3. Experience
3.1 List experiences
Returns basic info for all experiences in the profile, including goals and version lists. The id, goalId, and versionId used by subsequent endpoints all come from this response.
Request parameters
profileId
yes
string
Site ID (8 chars). Must match the profile bound to the API Key. Find it in the Ptengine URL, e.g. https://www.ptengine.jp/app/{profileId}/home contains 566d12f9
Request example:
Response example:
id
Experience ID, used as id param in report endpoints
name
Experience name
status
Status: DRAFT / RUNNING / PAUSE / SCHEDULED
type
Type: POPUP / STICKY_BAR / INLINE / ADVANCED / REDIRECT
goals
Goal list, used as goalId in A/B test endpoints
versions
Version list, used as versionId in form endpoint
3.2 List user properties
Returns the list of available user properties. When the insight endpoint uses dimension: "userProperty", fetch property from this endpoint.
Request example:
Response example:
3.3 Experience overview metrics
Batch query metrics for multiple experiences.
Request parameters
profileId
yes
string
Site ID (8 chars). Must match the profile bound to the API Key. Find it in the Ptengine URL, e.g. https://www.ptengine.jp/app/{profileId}/home contains 566d12f9
experiences
yes
object[]
Experience list (id + name, from the list endpoint)
metrics
no
string[]
Metric fields to return. If omitted, returns all defaults. Supported fields below
lang
no
string
Response language: EN (default), ZH, JP
Supported metrics fields:
viewedUsers
Number of users who viewed the experience
value
views
Number of times the experience was viewed
value
clickedUsers
Number of users who clicked a button or link in the experience
value
clickRate
Click ratio of users in the experience
rate
closedUsers
Number of users who closed the popup / sticky bar
value
closeRate
Close ratio of users for popup / sticky bar
rate
formSubmittedUsers
Number of users who submitted the form
value
formSubmitRate
Form submit ratio
rate
goalReachedUsers
Users who reached a goal after viewing the experience
value
goalReachRate
Goal-reach ratio of users who viewed the experience
rate
goalStatus
Goal status by user share, property sum, or average
value
avgVisitDuration
Average visit duration of users who viewed the experience
time
avgPagesPerVisit
Average pages per visit
decimal
bounceRate
Bounce rate
rate
lastUpdatedTime
Last updated time
text
lastUpdatedMember
Last updater
text
createdTime
Created time
text
createdMember
Creator
text
runningPeriod
Running period
text
tags
Custom property tags
text
Request example:
Response example:
All metrics return { value, label, description }. label and description follow lang.
3.4 Key metrics
Query overall metrics for a single experience.
Request parameters
profileId
yes
string
Site ID (8 chars). Must match the profile bound to the API Key. Find it in the Ptengine URL, e.g. https://www.ptengine.jp/app/{profileId}/home contains 566d12f9
id
yes
string
Experience ID (from the list endpoint)
startDate
yes
string
Start date: YYYY-MM-DD or YYYY/MM/DD
endDate
yes
string
End date: YYYY-MM-DD or YYYY/MM/DD
lang
no
string
Language for label/description: EN (default), ZH, JP
Request example:
Response example:
Note: Returned metrics are filtered by experience type. For example, INLINE types don't return
clickedUsers/closedUsers; experiences without forms don't returnformSubmittedUsers.
3.5 Segment details
Query single-experience metrics grouped by dimension.
Request parameters
profileId
yes
string
Site ID (8 chars). Must match the profile bound to the API Key. Find it in the Ptengine URL, e.g. https://www.ptengine.jp/app/{profileId}/home contains 566d12f9
id
yes
string
Experience ID (from the list endpoint)
startDate
yes
string
Start date: YYYY-MM-DD or YYYY/MM/DD
endDate
yes
string
End date: YYYY-MM-DD or YYYY/MM/DD
dimension
yes
string
Primary dimension, see table below
subDimension
no
string
Secondary dimension
property
conditional
object
Required when dimension="userProperty". From the user-properties endpoint
lang
no
string
Language for label/description: EN (default), ZH, JP
Allowed dimension values:
visitPage
Page
❌
terminalType
Device type
✅
sourceType
Source type
✅
utmCampaign
Campaign name
✅
utmSource
Campaign source
✅
utmMedium
Campaign medium
✅
utmTerm
Campaign term
✅
utmContent
Campaign content
✅
sourceUrl
Source URL
✅
sourceHost
Source host
✅
aiName
AI name
✅
visitType
New / Returning
✅
country
Country / Area
✅ (cannot combine with region)
region
Region
✅ (cannot combine with country)
userProperty
User property
❌ (requires property)
userProperty example: When dimension is userProperty, you must also pass property:
Request example:
Response example:
3.6 A/B test results
A/B test results comparing each version, including uplift and probability-to-win.
Request parameters
profileId
yes
string
Site ID (8 chars). Must match the profile bound to the API Key. Find it in the Ptengine URL, e.g. https://www.ptengine.jp/app/{profileId}/home contains 566d12f9
id
yes
string
Experience ID (from the list endpoint)
startDate
yes
string
Start date: YYYY-MM-DD or YYYY/MM/DD
endDate
yes
string
End date: YYYY-MM-DD or YYYY/MM/DD
compareBy
yes
string
Comparison baseline metric, see below
goalId
conditional
string
Required when compareBy="goalReached" (from list endpoint goals)
showDeletedVersions
no
boolean
Include deleted versions, default false
lang
no
string
Language for label/description: EN (default), ZH, JP
Allowed compareBy values:
viewedUsers
Users who viewed the experience
clickedUsers
Users who clicked a button or link in the experience
closedUsers
Users who closed the popup / sticky bar
formSubmittedUsers
Users who submitted the form
goalReached
Goal reached (requires goalId)
avgVisitDuration
Average visit duration
avgPagesPerVisit
Average pages per visit
bounceRate
Bounce rate
Request example:
Response example:
Response only contains the metric corresponding to
compareBy, plusuplift+probabilityToBeBest.Baseline
upliftis"Baseline". Other versions get a percentage (e.g."+50.00%"or"-10.00%").
3.7 A/B test results — segment details
A/B test version comparison grouped by dimension.
Request parameters
profileId
yes
string
Site ID (8 chars). Must match the profile bound to the API Key. Find it in the Ptengine URL, e.g. https://www.ptengine.jp/app/{profileId}/home contains 566d12f9
id
yes
string
Experience ID (from the list endpoint)
startDate
yes
string
Start date: YYYY-MM-DD or YYYY/MM/DD
endDate
yes
string
End date: YYYY-MM-DD or YYYY/MM/DD
compareBy
yes
string
Comparison metric (same as 3.6)
goalId
conditional
string
Required when compareBy="goalReached"
dimension
yes
string
Primary dimension (same as 3.5)
subDimension
no
string
Secondary dimension
property
conditional
object
Required when dimension="userProperty"
showDeletedVersions
no
boolean
Include deleted versions, default false
lang
no
string
Language for label/description: EN (default), ZH, JP
Request example:
Response example:
3.8 Form submissions
Detailed form submission data for a specific version.
Request parameters
profileId
yes
string
Site ID (8 chars). Must match the profile bound to the API Key. Find it in the Ptengine URL, e.g. https://www.ptengine.jp/app/{profileId}/home contains 566d12f9
id
yes
string
Experience ID (from the list endpoint)
versionId
yes
string
Version ID (from versions in the list endpoint)
startDate
yes
string
Start date: YYYY-MM-DD or YYYY/MM/DD
endDate
yes
string
End date: YYYY-MM-DD or YYYY/MM/DD
Request example:
Response example:
columnsis dynamic, generated from the actual form fields.Each row in
rowsis a single submission. Empty fields are returned as empty strings.
3.9 Available metrics
Basic metrics (all types)
viewedUsers
number
Viewed users
views
number
Views
avgVisitDuration
duration (MM:SS/HH:MM:SS)
Avg. visit duration
avgPagesPerVisit
decimal ("2.50")
Avg. pages per visit
bounceRate
percentage ("42.86%")
Bounce rate
Popup-class metrics (only POPUP / STICKY_BAR / REDIRECT / ADVANCED with popup)
clickedUsers
number
Clicked users
clickRate
percentage
Click rate
closedUsers
number
Closed users
closeRate
percentage
Close rate
Form-class metrics (only for experiences with forms configured)
formSubmittedUsers
number
Form submitted users
formSubmitRate
percentage
Form submit rate
Goal data
goals[].name
Goal name
goals[].reachedUsers
Reached users
goals[].reachRate
Reach rate
goals[].value
Reached value (null = counted by user share)
Appendix
A. Error codes
4010
401
Missing x-api-key header
4011
401
Invalid API Key
4030
403
profileId does not match the profile bound to the API Key
4031
403
API Key lacks query permission (scope query required)
4001
400
Invalid queryType
4002
400
Invalid date format; must be YYYY-MM-DD or YYYY/MM/DD
4003
400
Query date exceeds the plan's data retention period
4006
400
page_insight type requires funName
4007
400
block_metrics requires specific deviceType (PC/MOBILE/TABLET); ALL not supported
4008
400
Page block not configured. Please scan the page in the product first
4009
400
element_metrics requires specific deviceType (PC/MOBILE/TABLET); ALL not supported
4012
400
No matching conversion goal
4013
400
Missing required field (the response message names the specific field)
4014
400
Invalid deviceType; must be ALL, PC, MOBILE, or TABLET
4015
400
Invalid dimension / subDimension (response message gives details)
4016
400
Page element not configured. Please scan the page in the product first
4017
400
Invalid compareBy (response message lists allowed values)
4018
400
Invalid field (/event/query / /insight/query / /conversion/query: dimension / metric / queryType / topic / granularity not allowed, or dimension count exceeded)
4019
400
Invalid filter operator or value (must be include/exclude; value must be a non-empty array; sortOrder/limit out of range)
4040
404
Experience not found (id does not exist under this profile)
4290
429
Rate limit exceeded (per minute)
4291
429
Rate limit exceeded (per day)
5000
500
Internal server error
The message is returned in the language requested by lang (body or query: EN/ZH/JP). If not specified or invalid, falls back to English.
最終更新