Send an event
curl --request POST \
--url https://api.getlurk.com/v1/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"event": "order.paid",
"user": "ana@example.com",
"properties": {
"order_id": "ord_1042",
"total_cents": 4900,
"currency": "USD"
},
"idempotency_key": "order-1042-paid"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
event: 'order.paid',
user: 'ana@example.com',
properties: {order_id: 'ord_1042', total_cents: 4900, currency: 'USD'},
idempotency_key: 'order-1042-paid'
})
};
fetch('https://api.getlurk.com/v1/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.getlurk.com/v1/events"
payload = {
"event": "order.paid",
"user": "ana@example.com",
"properties": {
"order_id": "ord_1042",
"total_cents": 4900,
"currency": "USD"
},
"idempotency_key": "order-1042-paid"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"activity": "act_01m6jxa1q0eq98wwe0n7sr9cb0",
"user": "ana@example.com",
"event": "order.paid",
"receipts": [
{
"by": "rule:order-points",
"unit": "points",
"change": 49,
"balance": 169
}
],
"skipped": [],
"held": []
}{
"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>"
}
}Events
Send an event
Sends something a user did. Lurk runs your live rules on it and returns the receipts: what changed and the balance after. A retry with the same idempotency_key returns the first answer. timestamp may be in the past, not over 5 minutes ahead. profile and alias ride along. Events
POST
/
v1
/
events
Send an event
curl --request POST \
--url https://api.getlurk.com/v1/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"event": "order.paid",
"user": "ana@example.com",
"properties": {
"order_id": "ord_1042",
"total_cents": 4900,
"currency": "USD"
},
"idempotency_key": "order-1042-paid"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
event: 'order.paid',
user: 'ana@example.com',
properties: {order_id: 'ord_1042', total_cents: 4900, currency: 'USD'},
idempotency_key: 'order-1042-paid'
})
};
fetch('https://api.getlurk.com/v1/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.getlurk.com/v1/events"
payload = {
"event": "order.paid",
"user": "ana@example.com",
"properties": {
"order_id": "ord_1042",
"total_cents": 4900,
"currency": "USD"
},
"idempotency_key": "order-1042-paid"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"activity": "act_01m6jxa1q0eq98wwe0n7sr9cb0",
"user": "ana@example.com",
"event": "order.paid",
"receipts": [
{
"by": "rule:order-points",
"unit": "points",
"change": 49,
"balance": 169
}
],
"skipped": [],
"held": []
}{
"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
Another identifier this person was known by, such as the anonymous visitor ID they had before this sign-in: their history also reads its events from now on. Nothing moves, and the alias can be removed (DELETE /v1/users/{id}/aliases). Made with the event, once. A refused alias is not made and the event is recorded all the same: alias in the answer says which, and why
Required string length:
1 - 256Response
Send an event