Create a view
curl --request POST \
--url https://api.getlurk.com/v1/views \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"name": "Top earners",
"key": "top-earners",
"description": "Who earned the most points this month",
"definition": {
"who": "everyone",
"what": [
{
"measure": "given",
"unit": "points"
}
],
"over": "this_month",
"shape": {
"type": "list",
"by": "user",
"size": 10
}
}
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Top earners',
key: 'top-earners',
description: 'Who earned the most points this month',
definition: {
who: 'everyone',
what: [{measure: 'given', unit: 'points'}],
over: 'this_month',
shape: {type: 'list', by: 'user', size: 10}
}
})
};
fetch('https://api.getlurk.com/v1/views', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.getlurk.com/v1/views"
payload = {
"name": "Top earners",
"key": "top-earners",
"description": "Who earned the most points this month",
"definition": {
"who": "everyone",
"what": [
{
"measure": "given",
"unit": "points"
}
],
"over": "this_month",
"shape": {
"type": "list",
"by": "user",
"size": 10
}
}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "view_01m6gqxf40ermrwm4d7fx1w909",
"key": "top-earners",
"name": "Top earners",
"shape": "list",
"visibility": "team",
"conversion": false,
"updated_at": "2026-11-03T13:00:00.000Z",
"description": "Who earned the most points this month",
"definition": {
"who": "everyone",
"what": [
{
"measure": "given",
"unit": "points"
}
],
"over": "this_month",
"shape": {
"type": "list",
"by": "user",
"size": 10
}
},
"endpoint": "/v1/views/top-earners",
"made_by": "key",
"template": null,
"dashboards": [],
"created_at": "2026-11-03T13:00:00.000Z"
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}Views
Create a view
Saves a question about the project: who, what, over which range, as which shape (number, chart, ranked list). A member, key, brand agent or Lurky may; not a viewer. Audience and units must exist. key defaults to a slug of the name (view- first if a digit leads). Views
POST
/
v1
/
views
Create a view
curl --request POST \
--url https://api.getlurk.com/v1/views \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"name": "Top earners",
"key": "top-earners",
"description": "Who earned the most points this month",
"definition": {
"who": "everyone",
"what": [
{
"measure": "given",
"unit": "points"
}
],
"over": "this_month",
"shape": {
"type": "list",
"by": "user",
"size": 10
}
}
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Top earners',
key: 'top-earners',
description: 'Who earned the most points this month',
definition: {
who: 'everyone',
what: [{measure: 'given', unit: 'points'}],
over: 'this_month',
shape: {type: 'list', by: 'user', size: 10}
}
})
};
fetch('https://api.getlurk.com/v1/views', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.getlurk.com/v1/views"
payload = {
"name": "Top earners",
"key": "top-earners",
"description": "Who earned the most points this month",
"definition": {
"who": "everyone",
"what": [
{
"measure": "given",
"unit": "points"
}
],
"over": "this_month",
"shape": {
"type": "list",
"by": "user",
"size": 10
}
}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "view_01m6gqxf40ermrwm4d7fx1w909",
"key": "top-earners",
"name": "Top earners",
"shape": "list",
"visibility": "team",
"conversion": false,
"updated_at": "2026-11-03T13:00:00.000Z",
"description": "Who earned the most points this month",
"definition": {
"who": "everyone",
"what": [
{
"measure": "given",
"unit": "points"
}
],
"over": "this_month",
"shape": {
"type": "list",
"by": "user",
"size": 10
}
},
"endpoint": "/v1/views/top-earners",
"made_by": "key",
"template": null,
"dashboards": [],
"created_at": "2026-11-03T13:00:00.000Z"
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}Authorizations
Headers
Body
application/json
Response
Create a view