Change a unit
curl --request PATCH \
--url https://api.getlurk.com/v1/units/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"name": "<string>",
"singular": "<string>",
"switches": {
"goes_up": true,
"goes_down": true,
"spendable": true,
"usable": true,
"sendable": true,
"send_cap_per_day": 500000,
"resets": true,
"starts_at": 1,
"held_by": "<string>",
"cap": 123,
"min_balance": -1,
"visible": true,
"supply": 123,
"expires_after_days": 1825,
"expires_at": "2023-11-07T05:31:56Z"
}
}
'const options = {
method: 'PATCH',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
singular: '<string>',
switches: {
goes_up: true,
goes_down: true,
spendable: true,
usable: true,
sendable: true,
send_cap_per_day: 500000,
resets: true,
starts_at: 1,
held_by: '<string>',
cap: 123,
min_balance: -1,
visible: true,
supply: 123,
expires_after_days: 1825,
expires_at: '2023-11-07T05:31:56Z'
}
})
};
fetch('https://api.getlurk.com/v1/units/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.getlurk.com/v1/units/{id}"
payload = {
"name": "<string>",
"singular": "<string>",
"switches": {
"goes_up": True,
"goes_down": True,
"spendable": True,
"usable": True,
"sendable": True,
"send_cap_per_day": 500000,
"resets": True,
"starts_at": 1,
"held_by": "<string>",
"cap": 123,
"min_balance": -1,
"visible": True,
"supply": 123,
"expires_after_days": 1825,
"expires_at": "2023-11-07T05:31:56Z"
}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"id": "unit_01m1e34qm0ejgrs7g7pf9fb9m1",
"key": "points",
"name": "Points",
"singular": "Point",
"group": "points",
"shows_as": "amount",
"color": "amber",
"switches": {
"goes_up": true,
"goes_down": true,
"spendable": true,
"usable": false,
"sendable": true,
"send_cap_per_day": 100,
"resets": false,
"starts_at": 0,
"held_by": null,
"cap": null,
"min_balance": 0,
"visible": true,
"supply": null,
"expires_after_days": null,
"expires_at": null
},
"stats": {
"held": 294,
"holders": 3,
"given_30d": 294,
"spent_30d": 0,
"issued": 0
},
"created_at": "2026-09-01T09:00:00.000Z",
"updated_at": "2026-10-15T08: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>"
}
}Units
Change a unit
Changes what you send. A setting applies to changes from now on and changes nobody’s balance: lowering a cap below what people hold leaves their balances, and stops further additions.
PATCH
/
v1
/
units
/
{id}
Change a unit
curl --request PATCH \
--url https://api.getlurk.com/v1/units/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"name": "<string>",
"singular": "<string>",
"switches": {
"goes_up": true,
"goes_down": true,
"spendable": true,
"usable": true,
"sendable": true,
"send_cap_per_day": 500000,
"resets": true,
"starts_at": 1,
"held_by": "<string>",
"cap": 123,
"min_balance": -1,
"visible": true,
"supply": 123,
"expires_after_days": 1825,
"expires_at": "2023-11-07T05:31:56Z"
}
}
'const options = {
method: 'PATCH',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
singular: '<string>',
switches: {
goes_up: true,
goes_down: true,
spendable: true,
usable: true,
sendable: true,
send_cap_per_day: 500000,
resets: true,
starts_at: 1,
held_by: '<string>',
cap: 123,
min_balance: -1,
visible: true,
supply: 123,
expires_after_days: 1825,
expires_at: '2023-11-07T05:31:56Z'
}
})
};
fetch('https://api.getlurk.com/v1/units/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.getlurk.com/v1/units/{id}"
payload = {
"name": "<string>",
"singular": "<string>",
"switches": {
"goes_up": True,
"goes_down": True,
"spendable": True,
"usable": True,
"sendable": True,
"send_cap_per_day": 500000,
"resets": True,
"starts_at": 1,
"held_by": "<string>",
"cap": 123,
"min_balance": -1,
"visible": True,
"supply": 123,
"expires_after_days": 1825,
"expires_at": "2023-11-07T05:31:56Z"
}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"id": "unit_01m1e34qm0ejgrs7g7pf9fb9m1",
"key": "points",
"name": "Points",
"singular": "Point",
"group": "points",
"shows_as": "amount",
"color": "amber",
"switches": {
"goes_up": true,
"goes_down": true,
"spendable": true,
"usable": false,
"sendable": true,
"send_cap_per_day": 100,
"resets": false,
"starts_at": 0,
"held_by": null,
"cap": null,
"min_balance": 0,
"visible": true,
"supply": null,
"expires_after_days": null,
"expires_at": null
},
"stats": {
"held": 294,
"holders": 3,
"given_30d": 294,
"spent_30d": 0,
"issued": 0
},
"created_at": "2026-09-01T09:00:00.000Z",
"updated_at": "2026-10-15T08: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>"
}
}Authorizations
Headers
Body
application/json
Response
Change a unit