Base URL, versioning and compatibility
The version is part of the path. Inside v1 Lectern adds things and does not take them away, so an integration you write today keeps working.
Base URL#
Every route is under your Lectern API address and the version prefix, followed by your church:
{base}/v1/api/o/{slug}/...| Part | Meaning |
|---|---|
{base} | The scheme and host your Lectern API is served from, for example https://your-lectern-host.example. Use the address your Lectern account gives you and keep it in configuration. |
/v1/api | The machine API, version 1. The version is in the path. |
/o/{slug} | Your church. A key works for exactly one church. |
Always use HTTPS. The address is the same for the API reference at /v1/api/docs and the OpenAPI document at /v1/api/openapi.json.
What is stable in v1#
- Routes, parameter names and the meaning of fields.
- The response envelope:
status,message,data,meta. - Error
codevalues. A code keeps its meaning; new codes can appear. - Webhook event names, the event envelope, and the signature scheme.
- Scopes and what each one allows.
What can be added without notice#
Within v1 Lectern only adds. Write your client so these never break it:
- New routes, and new optional request parameters.
- New fields in responses and in webhook payloads. Ignore fields you do not recognise.
- New values in lists that are not closed, such as new
kindvalues on a message, new teaching statuses or new webhook event types. Handle an unknown value as “something I do not understand yet”, not as an error. - New error codes on existing status codes. Fall back on the HTTP status when you do not know the code.
- Changes in the wording of
messageanddetail. Match oncode, never on the text.
Breaking changes#
Removing a field, changing what a field means, or making an optional parameter required would be a breaking change. A breaking change ships under a new path prefix, such as /v2, and v1 keeps its own behaviour. Changes are listed in the changelog.
Every webhook event carries api_version (currently v1). Branch on it if you ever receive more than one version.
A compatibility checklist#
- Parse JSON with a tolerant parser that ignores unknown fields.
- Use enums as open sets: have a default branch for values you do not know.
- Do not depend on key order or whitespace in JSON, including webhook bodies.
- Store ids as opaque strings. Do not parse the prefix or length.
- Read the
RateLimit-*andRetry-Afterheaders instead of hard-coding limits. - Read upload limits from
GET /uploads/policyinstead of hard-coding them.
If you generate a client from /v1/api/openapi.json, regenerate it when the changelog lists a new release.