customer-analytics

Embed
Preview of the card
<a href="https://lucidace.com/docs/ref-customer-analytics"><img src="https://lucidace.com/docs/_api/public/orgs/af34862a-c837-4478-8335-0505efe40459/spaces/da916cd3-c0fc-4b63-b971-b3c13623daf3/pages/05c9ea55-7ba1-4278-b43c-25f4631b1402/social-card.svg?v=3e7ae33eec8b" alt="customer-analytics" width="600" height="315"></a>
POSThttps://lucidace.com/v1/projects/{project_id}/usage-metrics/evaluate

Parameters

project_idstringpathrequired

Request body

application/json
entitystringrequired
person (keys are person ids) or group (keys are group keys).
group_type_indexinteger
Required for group.
keysstring[]required
Up to 50 customers: a list page or one profile.
metric_idsarray
Defaults to every metric usable for the entity.
{
  "entity": "string",
  "group_type_index": 0,
  "keys": [
    "string"
  ],
  "metric_ids": [
    "string"
  ]
}

Code samples

cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/usage-metrics/evaluate" \
  -H "Content-Type: application/json" \
  -d '{"entity":"string","group_type_index":0,"keys":["string"],"metric_ids":["string"]}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 {data: MetricUsage[]}
400
404
503
GEThttps://lucidace.com/v1/projects/{project_id}/usage-metrics/{id}Scope insight:read

Parameters

project_idstringpathrequired
idstringpathrequired

Code samples

cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/usage-metrics/{id}"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200
Example
{
  "applies_to": "string",
  "calc": "string",
  "created_at": "2024-01-01T00:00:00Z",
  "created_by": "string",
  "description": "string",
  "display": "string",
  "filters": {},
  "format": "string",
  "group_type_index": 0,
  "id": "string",
  "interval_days": 0,
  "math_property": "string",
  "name": "string",
  "source": {},
  "updated_at": "2024-01-01T00:00:00Z"
}
Schema
applies_tostringrequired
person | group | both
calcstringrequired
count | sum
created_atstringrequired
created_bystring
descriptionstringrequired
displaystringrequired
number | sparkline
filtersobject
formatstringrequired
numeric | currency
group_type_indexinteger
idstringrequired
interval_daysintegerrequired
7, 30 or 90.
math_propertystring
namestringrequired
sourceobjectrequired
{kind: events, matchers: [...]} or {kind: warehouse, table, timestamp_field, key_field}.
updated_atstringrequired
404
PUThttps://lucidace.com/v1/projects/{project_id}/usage-metrics/{id}Scope insight:write

Parameters

project_idstringpathrequired
idstringpathrequired

Request body

application/json
applies_tostring
person, group or both (default).
calcstring
count (default) or sum of math_property.
descriptionstring
displaystring
number (default) or sparkline.
filtersobject
Property group {and|or: [...]} applied to every matcher.
formatstring
numeric (default) or currency.
group_type_indexinteger
Restrict a group metric to one group type (0 to 4).
interval_daysinteger
7, 30 or 90 days (default 30).
math_propertystring
namestringrequired
sourceobjectrequired
{kind: "events", matchers: [{type: "event"|"action", name|id, filters?}]} (matchers are OR-ed) or {kind: "warehouse", table, timestamp_field, key_field}.
{
  "applies_to": "string",
  "calc": "string",
  "description": "string",
  "display": "string",
  "filters": {},
  "format": "string",
  "group_type_index": 0,
  "interval_days": 0,
  "math_property": "string",
  "name": "string",
  "source": {}
}

Code samples

cURL
curl -X PUT "https://lucidace.com/v1/projects/{project_id}/usage-metrics/{id}" \
  -H "Content-Type: application/json" \
  -d '{"applies_to":"string","calc":"string","description":"string","display":"string","filters":{},"format":"string","group_type_index":0,"interval_days":0,"math_property":"string","name":"string","source":{}}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

400
403
404
409
DELETEhttps://lucidace.com/v1/projects/{project_id}/usage-metrics/{id}Scope insight:write

Parameters

project_idstringpathrequired
idstringpathrequired

Code samples

cURL
curl -X DELETE "https://lucidace.com/v1/projects/{project_id}/usage-metrics/{id}"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

204
403
404
Updated