Take a rule live
curl --request POST \
--url https://api.getlurk.com/v1/rules/{id}/live \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.getlurk.com/v1/rules/{id}/live', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.getlurk.com/v1/rules/{id}/live"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "rule_01m2z44880ev18z457tkgkpp00",
"key": "order-points",
"name": "Points for orders",
"status": "live",
"version": 2,
"live_version": 2,
"definition": {
"when": {
"event": "order.paid"
},
"if": [
{
"property": {
"name": "currency",
"equals": "USD"
}
}
],
"limit": [
{
"max": 3,
"per": "day",
"by": "user"
}
],
"do": [
{
"unit": "points",
"add": {
"from": "total_cents",
"per": 100
}
}
]
}
}{
"error": {
"status": 403,
"code": "approval_required",
"message": "This needs a person: an owner or admin approves it in Lurk.",
"next_step": "A person has to approve this in the dashboard (an owner or admin). Do not retry and do not try to get around it: ask them.",
"request_id": "req_9f3b1c7ae2d84c0b8a56e1d07f42c9ab",
"doc_url": "https://docs.getlurk.com/errors#approval_required"
}
}{
"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>"
}
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}Rules
Take a rule live
Takes the newest version live. Only an owner or admin, in person. Agents and keys get approval_required and should create a proposal.
POST
/
v1
/
rules
/
{id}
/
live
Take a rule live
curl --request POST \
--url https://api.getlurk.com/v1/rules/{id}/live \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.getlurk.com/v1/rules/{id}/live', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.getlurk.com/v1/rules/{id}/live"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "rule_01m2z44880ev18z457tkgkpp00",
"key": "order-points",
"name": "Points for orders",
"status": "live",
"version": 2,
"live_version": 2,
"definition": {
"when": {
"event": "order.paid"
},
"if": [
{
"property": {
"name": "currency",
"equals": "USD"
}
}
],
"limit": [
{
"max": 3,
"per": "day",
"by": "user"
}
],
"do": [
{
"unit": "points",
"add": {
"from": "total_cents",
"per": 100
}
}
]
}
}{
"error": {
"status": 403,
"code": "approval_required",
"message": "This needs a person: an owner or admin approves it in Lurk.",
"next_step": "A person has to approve this in the dashboard (an owner or admin). Do not retry and do not try to get around it: ask them.",
"request_id": "req_9f3b1c7ae2d84c0b8a56e1d07f42c9ab",
"doc_url": "https://docs.getlurk.com/errors#approval_required"
}
}{
"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>"
}
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}Authorizations
Body
application/json
The body is of type object.
Response
Take a rule live