Create a unit
curl --request POST \
--url https://api.getlurk.com/v1/units \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"name": "Coffee vouchers",
"key": "coffee-voucher",
"singular": "Coffee voucher",
"group": "perk",
"color": "teal",
"switches": {
"usable": true,
"cap": 5
}
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Coffee vouchers',
key: 'coffee-voucher',
singular: 'Coffee voucher',
group: 'perk',
color: 'teal',
switches: {usable: true, cap: 5}
})
};
fetch('https://api.getlurk.com/v1/units', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.getlurk.com/v1/units"
payload = {
"name": "Coffee vouchers",
"key": "coffee-voucher",
"singular": "Coffee voucher",
"group": "perk",
"color": "teal",
"switches": {
"usable": True,
"cap": 5
}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "unit_01m5ch6kp0eps8v3rprkhtfdwj",
"key": "coffee-voucher",
"name": "Coffee vouchers",
"singular": "Coffee voucher",
"group": "perk",
"shows_as": "amount",
"color": "teal",
"switches": {
"goes_up": true,
"goes_down": true,
"spendable": true,
"usable": true,
"sendable": false,
"send_cap_per_day": 100,
"resets": false,
"starts_at": 0,
"held_by": null,
"cap": 5,
"min_balance": 0,
"visible": true,
"supply": null,
"expires_after_days": null,
"expires_at": null
},
"stats": {
"held": 0,
"holders": 0,
"given_30d": 0,
"spent_30d": 0,
"issued": 0
},
"created_at": "2026-10-20T11:30:00.000Z",
"updated_at": "2026-10-20T11:30: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>"
}
}Units
Create a unit
Sets up a unit: a name, a group and switches for what it can do (goes down, cap, supply, expiry, spend, use, send). The key defaults to a slug of the name and must be new. Owners, admins and developers, or a project key. Units
POST
/
v1
/
units
Create a unit
curl --request POST \
--url https://api.getlurk.com/v1/units \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"name": "Coffee vouchers",
"key": "coffee-voucher",
"singular": "Coffee voucher",
"group": "perk",
"color": "teal",
"switches": {
"usable": true,
"cap": 5
}
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Coffee vouchers',
key: 'coffee-voucher',
singular: 'Coffee voucher',
group: 'perk',
color: 'teal',
switches: {usable: true, cap: 5}
})
};
fetch('https://api.getlurk.com/v1/units', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.getlurk.com/v1/units"
payload = {
"name": "Coffee vouchers",
"key": "coffee-voucher",
"singular": "Coffee voucher",
"group": "perk",
"color": "teal",
"switches": {
"usable": True,
"cap": 5
}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "unit_01m5ch6kp0eps8v3rprkhtfdwj",
"key": "coffee-voucher",
"name": "Coffee vouchers",
"singular": "Coffee voucher",
"group": "perk",
"shows_as": "amount",
"color": "teal",
"switches": {
"goes_up": true,
"goes_down": true,
"spendable": true,
"usable": true,
"sendable": false,
"send_cap_per_day": 100,
"resets": false,
"starts_at": 0,
"held_by": null,
"cap": 5,
"min_balance": 0,
"visible": true,
"supply": null,
"expires_after_days": null,
"expires_at": null
},
"stats": {
"held": 0,
"holders": 0,
"given_30d": 0,
"spent_30d": 0,
"issued": 0
},
"created_at": "2026-10-20T11:30:00.000Z",
"updated_at": "2026-10-20T11:30: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 unit