The three calls
Receipts take
limit (1 to 200), cursor, unit, cause (spend, use, send or receive), since and until. A receipt shows each unit it changed, the change and the balance after. since never goes earlier than the point from which the person’s receipts are shown: see Linking people.
An event has an event name, optional properties and a required idempotency_key (1 to 255 characters) in the body. The same key with the same request returns the first answer and changes nothing. The answer lists the receipts the event made, if any.
Headers
The API address is
https://api.getlurk.com, for projects made at app.getlurk.com, both Staging and Production. Lurk-Project picks the project.
Read the balances of the signed-in person
- Only
Authorization: Beareris read. Never the query, the body or a cookie. - A project key (a bearer that starts with
lurk_) is refused here. So is a request that has a member’s session cookie next to a bearer. - No call names a person. The person comes from the token, and the project from
Lurk-Project. - Lurk never sets a cookie on this surface.
Browsers and CORS
A browser can call the client API from any origin. Lurk echoes the request’sOrigin, and never sends Access-Control-Allow-Credentials, because the bearer is the credential and no cookie is used. Preflight requests are answered and are not counted against the limits.
A request body can be at most 16 KB.
What an event may carry
- The name must be on the project’s list. The list is empty by default, and an owner or admin saves it in the dashboard, under Settings > Sign-in, in Events people’s apps may send. Some names can never be on it, such as names for payments or for a chat connector.
- Each name lists the properties it takes, and each has a type and a clamp (text up to a length, a number in a range, or true or false). The list is empty by default, so a device sends the name and nothing else. A property that is not on the list, or a value outside its clamp, refuses the event with 422
validation_failed. So does a null, a list or an object. Properties are at most 4,096 bytes in all, and no rule reads them. - The event is recorded for the signed-in person only, with
untrustedas its source and the server’s clock. - The project sets a daily cap per person, a daily cap for the project and a limit on new people per hour.
Limits
Counted by each API instance.
An IPv6 address counts as its /64. Device traffic has its own limits and does not use up the ones your server’s key has. A response carries
RateLimit headers.
Errors
Every error has the shape of the errors page.
A 401 is the same whether the token is expired, signed by the wrong key or aimed at another audience. To learn which, test the token with the token test or see Troubleshooting.
A 429 and a 503 are safe to retry. For an event, retry with the same
idempotency_key.
The client package
@getlurk/client is a small typed client for these three calls. It is not published. It is a private package in the Lurk repository, and you cannot install it from a registry. Use fetch and the table of calls on this page until it is.