Requests and responses
Every response has the same shape, every request has an id, and the same few headers behave the same way on every route.
The envelope#
Successful responses are JSON objects with four fields:
| Field | Meaning |
|---|---|
status | true when the request succeeded. |
message | ok on success. |
data | The thing you asked for: an object, or an array on list routes. |
meta | Metadata about the request. meta.request_id is always present. Lists add meta.total and meta.has_next when they have a value. |
{
"status": true,
"message": "ok",
"data": [
{
"id": "tch_01m4h8h1jvebqa45vpxtet0ame",
"title": "YouTube aqz-KE-bpKQ",
"duration_s": 0,
"status": "awaiting_transcript",
"progress_pct": 10,
"visibility": "church",
"branch": {
"id": "brn_01m4h7y09deqtamqgs56j3gmb5",
"name": "Grace Community Church",
"slug": "hq",
"address": {}
},
"kind": "teaching",
"standing": {
"state": "current"
}
},
{
"id": "tch_01m4h7yekxfnbbnw5gp570b9gy",
"title": "YouTube dQw4w9WgXcQ",
"duration_s": 0,
"status": "awaiting_transcript",
"progress_pct": 10,
"visibility": "church",
"branch": {
"id": "brn_01m4h7y09deqtamqgs56j3gmb5",
"name": "Grace Community Church",
"slug": "hq",
"address": {}
},
"kind": "teaching",
"standing": {
"state": "current"
}
},
{
"id": "tch_01m4h7zbsve4ybxjarahd3fpkh",
"title": "Forgiveness that frees",
"recorded_at": "2026-09-27T00:00:00Z",
"duration_s": 242,
"status": "done",
"progress_pct": 100,
"visibility": "church",
"branch": {
"id": "brn_01m4h7y09deqtamqgs56j3gmb5",
"name": "Grace Community Church",
"slug": "hq",
"address": {}
},
"kind": "teaching",
"standing": {
"state": "current"
}
}
],
"meta": {
"request_id": "req_01m4h8nry7eq2bfwf822ry0vwm",
"total": 3
}
}meta.total and meta.has_next are left out when they are zero or false, so treat a missing value as zero or false.
Request ids#
Every response, success or error, carries an X-Request-Id header, and successful bodies repeat it as meta.request_id. Log it with your own request log. It is the one thing support needs to find what happened.
Sending requests#
- Send
Content-Type: application/jsonon requests with a body. Form-encoded bodies (application/x-www-form-urlencoded) are refused with415. - Send
Accept: application/json, or nothing. Transcripts also come astext/vttandapplication/x-subripwhen you ask forformat=vttorformat=srt. - Send
Idempotency-Keyon routes that start work. See Idempotency. - Send
Accept-Encoding: gzip. Responses are compressed when the client allows it, which matters for transcripts. Most HTTP clients do this for you. - Use UTF-8. Names, titles and transcripts contain accents and non-Latin scripts.
Ids and times#
| Kind | Prefix | Example |
|---|---|---|
Teaching | tch_ | tch_01m4h7zbsve4ybxjarahd3fpkh |
Note | nte_ | nte_01m4h83v9rejdvxnkpsh0wjxzk |
Conversation | cnv_ | cnv_01m4h87fpyerrr62f654bpj1dc |
Message | msg_ | msg_01m4h87fqjf0h8g1xqg16mvsh9 |
Upload | upl_ | upl_01m4h8mp8teepr7edaphqggw14 |
| Webhook endpoint | whk_ | whk_01m4h8mp75fw3vegabgcc7ad7k |
| Webhook delivery | whd_ | whd_01m4h8mq29f2va9jxhxnd07w72 |
| Webhook event | evt_ | evt_01m4h8mq26ebwtb83nc7wnrhah |
| Branch (campus) | brn_ | brn_01m4h7y09deqtamqgs56j3gmb5 |
| Series, teacher | srs_, spk_ | srs_..., spk_... |
Ids are strings. Treat them as opaque, and compare them exactly. A malformed id answers 400 invalid_id. Timestamps are UTC in RFC 3339 (2026-09-27T00:00:00Z). Durations and transcript times are whole seconds.
Headers you will see#
| Header | Where | Meaning |
|---|---|---|
X-Request-Id | Every response | The request id. |
| RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset | Every authenticated response | Your allowance. See Rate limits. |
Retry-After | 429 responses | Seconds to wait before retrying. |
Location | 201 responses | The path of the thing you created. |
WWW-Authenticate | 401 responses | Bearer realm="lectern" |
Browsers and CORS#
The API answers cross-origin preflight requests so that tools can read it, but it is designed to be called from a server. The key is a secret, and a key in browser code is visible to everyone who opens the page. Build a small endpoint on your own server that calls Lectern and returns only what your page needs.
File bytes go straight from the browser to storage, never through the API. The key still stays on your server. See Uploads.
What an error looks like#
{
"title": "Not Found",
"status": 404,
"detail": "That teaching is not in this church.",
"code": "not_found"
}Errors are covered in full in Errors.