Lektava
Legal

API guide

Last updated

Your catalogue is yours to work with. A personal access token lets your own scripts, spreadsheets and tools read and update it through the same API the Lektava apps use.

01 Create a token

On Pro, open Profile, then Security, then Personal access tokens. Name the token, choose its access and how long it lasts, up to a year. Copy it straight away, because it is only shown once.

  • Read only tokens can only make GET requests.
  • Read and write tokens can also change what you could change in the app.

A token acts as you, so it reaches your books and libraries with your permissions. It can't reach sign-in, billing, your profile or other tokens. It also can't export your account, delete or publish a library, or change who has access to one. Treat it like a password, and revoke it from the same page if it leaks.

02 Make a request

Send the token as a Bearer header:

curl https://lektava.com/api/views/sidebar \
  -H "Authorization: Bearer lkt_your_token"

Responses are JSON. GET /api/views/sidebar lists your libraries, and GET /api/views/workspace/{libraryId}?per=120&page=1 pages through one.

03 Routes

The route index is an OpenAPI document generated from the API itself, listing every route. Some routes serve the apps and may change, so check it when something stops working, and prefer the views, libraries and books routes.

04 Limits

Tokens share your account's request budget. Reads allow 600 requests a minute, and costly routes such as search allow 60. A 429 response carries a Retry-After header, so wait that long before trying again. Exports stay available on every plan from Settings, without a token.

05 When a token stops working

A token ends when it expires, when you revoke it, when you sign out everywhere or reset your password, and when your account is scheduled for deletion. It stops working if the account leaves Pro, and starts again if the account returns before it expires.

Questions are welcome at support@latenari.com.