Przejdź do zawartości głównej

Content Endpoints

The Content module manages website pages, sections, elements, blocks, blog posts, redirects, sermons, playlists, streaming services, events, curated calendars, files, galleries, Bible translations and verse lookups, songs, arrangements, global styles, stock photos, and settings. It is the largest module in the API and powers the CMS, media/streaming, worship planning, and Bible features across all ChurchApps applications.

Base path: /content

Pages​

Base path: /content/pages

MethodPathAuthPermissionDescription
GET/:churchId/tree?url=&id=Public—Load full page tree (sections, elements, blocks) by URL or ID. Strips internal IDs when fetched by URL. URL-based fetches enforce pages.visibility — a gated page returns { restricted: true, visibility } unless the (optional) JWT satisfies the gate
GET/public/:churchIdPublic—List public pages (url, title, metaDescription); only visibility = everyone
GET/:idJWT—Get a page by ID
GET/JWT—List all pages for the church
POST/duplicate/:idJWTContent.EditDuplicate a page with all sections and elements
POST/temp/aiJWTContent.EditSave an AI-generated page (page, sections, and elements in one call)
POST/importTreeJWTContent.EditCreate a page from a nested tree (title, url, sections[].elements[]…). Always inserts under the caller's church; ids in the body are ignored. Rows must include their column children. Max 30 sections / 500 elements
POST/JWTContent.EditCreate or update pages (batch)
DELETE/:idJWTContent.EditDelete a page

Example: Load Page Tree​

GET /content/pages/abc-church-id/tree?url=/about
{
"name": "About",
"url": "/about",
"sections": [
{
"background": "#FFFFFF",
"textColor": "dark",
"elements": [
{ "elementType": "textWithPhoto", "answers": { "text": "Welcome" } }
]
}
]
}

Sections​

Base path: /content/sections

MethodPathAuthPermissionDescription
GET/:idJWT—Get a section by ID
POST/duplicate/:id?convertToBlock=JWTContent.EditDuplicate a section or convert it to a reusable block
POST/JWTContent.EditCreate or update sections (batch). Auto-updates sort order
DELETE/:idJWTContent.EditDelete a section (auto-updates sort order)

Elements​

Base path: /content/elements

MethodPathAuthPermissionDescription
GET/:idJWT—Get an element by ID
POST/duplicate/:idJWTContent.EditDuplicate an element with all children
POST/JWTContent.EditCreate or update elements (batch). Auto-manages row columns and carousel slides
DELETE/:idJWTContent.EditDelete an element

Blocks​

Base path: /content/blocks

Extends standard CRUD (GET /:id, GET /, POST /, DELETE /:id from base class with Content.Edit permission for writes).

MethodPathAuthPermissionDescription
GET/:idJWT—Get a block by ID
GET/JWT—List all blocks
GET/:churchId/tree/:idPublic—Load full block tree with sections and elements
GET/blockType/:blockTypeJWT—Load blocks by type (e.g. footerBlock, elementBlock)
GET/public/footer/:churchIdPublic—Load footer block tree for a church
POST/JWTContent.EditCreate or update blocks
DELETE/:idJWTContent.EditDelete a block

Base path: /content/links

Extends standard CRUD (GET /:id, GET /, POST /, DELETE /:id from base class with Content.Edit permission for writes).

MethodPathAuthPermissionDescription
GET/:idJWT—Get a link by ID
GET/JWT—List all links. Optional ?category= filter. Auto-sorts after save
GET/church/:churchId/filtered?category=JWT—Load links filtered by visibility (everyone, visitors, members, staff, groups)
GET/church/:churchId?category=Public—Load links for a church by category (public)
POST/JWTContent.EditCreate or update links (batch). Auto-sorts by category
DELETE/:idJWTContent.EditDelete a link

Global Styles​

Base path: /content/globalStyles

Extends standard CRUD (POST /, DELETE /:id from base class with Content.Edit permission for writes).

MethodPathAuthPermissionDescription
GET/church/:churchIdPublic—Load global styles for a church (returns defaults if none set)
GET/JWT—Load global styles for the authenticated church
POST/JWTContent.EditCreate or update global styles
DELETE/:idJWTContent.EditDelete global styles

Page History​

Base path: /content/pageHistory

MethodPathAuthPermissionDescription
GET/page/:pageIdJWTContent.EditList history entries for a page
GET/block/:blockIdJWTContent.EditList history entries for a block
GET/:idJWTContent.EditGet a history entry by ID
POST/JWTContent.EditSave a page/block snapshot. Periodically cleans up entries older than 30 days
POST/restore/:idJWTContent.EditRestore a page/block from a history snapshot (deletes current content and recreates from snapshot)
POST/restoreSnapshotJWTContent.EditRestore from an inline snapshot object. Body: { pageId, blockId, snapshot }

Posts (Blog)​

Base path: /content/posts

Blog posts are standalone rows: title, slug (unique per church), excerpt, content (markdown body), authorId, photoUrl, publishDate, category, and tags. A post is published once publishDate is set and in the past. Read endpoints enrich each post with authorName resolved from authorId. See Website Builder Architecture.

MethodPathAuthPermissionDescription
GET/public/:churchId?category=&tag=&page=&pageSize=Public—List published posts, paginated (max 50 per page)
GET/public/:churchId/categoriesPublic—Distinct categories across published posts
GET/public/:churchId/slug/:slugPublic—Get a published post by slug
GET/rss/:churchId?siteUrl=Public—RSS 2.0 feed of published posts (links built as {siteUrl}/blog/{slug})
GET/:idJWT—Get a post by ID
GET/JWT—List all posts for the church
POST/JWTContent.EditCreate or update posts (batch)
DELETE/:idJWTContent.EditDelete a post

Redirects​

Base path: /content/redirects

Per-church URL redirects (fromPath → toPath), capped at 200 per church. Paths are normalized (lowercased, leading slash, no trailing slash) and fromPath is unique per church. B1App resolves these on would-be 404s and issues an HTTP 308.

MethodPathAuthPermissionDescription
GET/public/:churchId?path=Public—Resolve a path (or list all redirects when path is omitted)
GET/:idJWT—Get a redirect by ID
GET/JWT—List all redirects for the church
POST/JWTContent.EditCreate or update redirects. Rejects fromPath = toPath and enforces the 200-row cap
DELETE/:idJWTContent.EditDelete a redirect

Sermons​

Base path: /content/sermons

MethodPathAuthPermissionDescription
GET/public/freeshowSampleJWT—Get a sample FreeShow playlist structure
GET/public/tvWrapper/:churchIdJWT—Get TV app wrapper with sermon, lesson, and FreeShow sources
GET/public/tvFeed/:churchId/:sermonIdPublic—Get a single sermon as a TV feed playlist
GET/public/tvFeed/:churchIdPublic—Get all public playlists/sermons as a TV feed
GET/public/:churchIdPublic—List all public sermons for a church
GET/timeline?sermonIds=JWT—Load timeline data for sermons
GET/lookup?videoType=&videoData=Public—Look up sermon metadata from YouTube or Vimeo
GET/socialSuggestions?youtubeVideoId=JWT—Generate AI social media post suggestions from sermon subtitles
GET/outline?url=&title=&author=JWT—Generate AI lesson outline from a URL
GET/youtubeImport/:channelIdJWT—Import videos from a YouTube channel
GET/vimeoImport/:channelIdJWT—Import videos from a Vimeo channel
GET/:idJWT—Get a sermon by ID
GET/JWT—List all sermons
POST/JWTStreamingServices.EditCreate or update sermons (batch, supports base64 thumbnail upload)
DELETE/:idJWTStreamingServices.EditDelete a sermon

Example: Look Up a YouTube Sermon​

GET /content/sermons/lookup?videoType=youtube&videoData=dQw4w9WgXcQ
{
"title": "Sunday Service - Faith in Action",
"description": "Pastor John speaks about faith...",
"thumbnail": "https://img.youtube.com/vi/dQw4w9WgXcQ/default.jpg",
"duration": 2400,
"publishDate": "2025-01-15T10:00:00Z"
}

Playlists​

Base path: /content/playlists

Extends standard CRUD (GET /:id, GET /, DELETE /:id from base class with StreamingServices.Edit permission for writes).

MethodPathAuthPermissionDescription
GET/:idJWT—Get a playlist by ID
GET/JWT—List all playlists
GET/public/:churchIdPublic—List all public playlists for a church
POST/JWTStreamingServices.EditCreate or update playlists (batch, supports base64 thumbnail upload)
DELETE/:idJWTStreamingServices.EditDelete a playlist

Streaming Services​

Base path: /content/streamingServices

MethodPathAuthPermissionDescription
GET/:id/hostChatJWTChat.HostGet encrypted host chat room ID for a service
GET/JWT—List all streaming services. Auto-cleans expired non-recurring services and advances recurring ones
POST/JWTStreamingServices.EditCreate or update streaming services (batch)
DELETE/:idJWTStreamingServices.EditDelete a streaming service (also clears blocked IPs)

Events​

Base path: /content/events

MethodPathAuthPermissionDescription
GET/timeline/group/:groupId?eventIds=JWT—Load timeline events for a group
GET/timeline?eventIds=JWT—Load timeline events for the current user's groups
GET/subscribe?churchId=&groupId=&curatedCalendarId=Public—Subscribe to events as ICS calendar feed
GET/group/:groupIdJWT—Get events for a group (includes exception dates)
GET/public/group/:churchId/:groupIdPublic—Get public events for a group
GET/:idJWT—Get an event by ID
POST/JWT—Create or update events (batch)
DELETE/:idJWTContent.EditDelete an event

Event Exceptions​

Base path: /content/eventExceptions

MethodPathAuthPermissionDescription
GET/:idJWT—Get an event exception by ID
POST/JWTContent.EditCreate or update event exceptions (batch)
DELETE/:idJWTContent.EditDelete an event exception

Curated Calendars​

Base path: /content/curatedCalendars

MethodPathAuthPermissionDescription
GET/:idJWT—Get a curated calendar by ID
GET/JWT—List all curated calendars
POST/JWTContent.EditCreate or update curated calendars (batch)
DELETE/:idJWTContent.EditDelete a curated calendar

Curated Events​

Base path: /content/curatedEvents

MethodPathAuthPermissionDescription
GET/calendar/:curatedCalendarId?withoutEventsJWT—Get curated events for a calendar (includes event details and exception dates unless ?withoutEvents is set)
GET/public/calendar/:churchId/:curatedCalendarIdPublic—Get public curated events for a calendar
GET/:idJWT—Get a curated event by ID
GET/JWT—List all curated events
POST/JWTContent.EditCreate or update curated events. Supports eventIds array to add specific group events
DELETE/:idJWTContent.EditDelete a curated event
DELETE/calendar/:curatedCalendarId/event/:eventIdJWTContent.EditRemove a specific event from a curated calendar
DELETE/calendar/:curatedCalendarId/group/:groupIdJWTContent.EditRemove all events for a group from a curated calendar

Files​

Base path: /content/files

MethodPathAuthPermissionDescription
GET/:contentType/:contentIdJWT—Get files by content type and content ID
GET/JWT—List all files for the church website
GET/:idJWT—Get a file by ID
POST/JWTContent.Edit*Upload files (base64). *Also allowed if user is a member of the group matching contentId
POST/postUrlJWTContent.Edit*Get a pre-signed S3 upload URL. *Also allowed for group members. Max 100MB per content item
DELETE/:idJWTContent.Edit*Delete a file and remove from storage. *Also allowed for group members

Base path: /content/gallery

MethodPathAuthPermissionDescription
GET/stock/:folderPublic—List stock photos in a folder
GET/:folderJWTContent.EditList gallery images in a folder
POST/requestUploadJWTContent.EditGet a pre-signed S3 upload URL for a gallery image
DELETE/:folder/:imageJWTContent.EditDelete a gallery image

Bibles​

Base path: /content/bibles

All Bible endpoints are public (no authentication required). Data is fetched from external sources and cached locally.

MethodPathAuthPermissionDescription
GET/Public—List all Bible translations (fetches from source if cache is empty)
GET/stats?startDate=&endDate=Public—Get Bible lookup statistics for a date range
GET/availableTranslations/:sourcePublic—List available translations from a source (e.g. api.bible)
GET/updateTranslationsPublic—Sync all translations from all sources
GET/updateTranslations/:sourcePublic—Sync translations from a specific source
GET/updateCopyrightsPublic—Update copyright info for translations missing it
GET/:translationKey/updateCopyrightPublic—Update copyright for a specific translation
GET/:translationKey/search?query=&limit=Public—Search verses in a translation
GET/:translationKey/booksPublic—Get books for a translation (caches locally)
GET/:translationKey/:bookKey/chaptersPublic—Get chapters for a book (caches locally)
GET/:translationKey/chapters/:chapterKey/versesPublic—Get verses for a chapter (caches locally)
GET/:translationKey/verses/:startVerseKey-:endVerseKeyPublic—Get verse text for a range. Logs lookups. Some translations bypass caching for licensing

Example: Get Verse Text​

GET /content/bibles/de4e12af7f28f599-02/verses/GEN.1.1-GEN.1.3
[
{ "verseKey": "GEN.1.1", "content": "In the beginning God created the heavens and the earth.", "bookKey": "GEN", "chapterNumber": 1, "verseNumber": 1 },
{ "verseKey": "GEN.1.2", "content": "Now the earth was formless and empty...", "bookKey": "GEN", "chapterNumber": 1, "verseNumber": 2 },
{ "verseKey": "GEN.1.3", "content": "And God said, \"Let there be light,\" and there was light.", "bookKey": "GEN", "chapterNumber": 1, "verseNumber": 3 }
]

Songs​

Base path: /content/songs

MethodPathAuthPermissionDescription
GET/search?q=JWT—Search songs by query
GET/:idJWT—Get a song by ID
GET/JWTContent.EditList all songs
POST/JWTContent.EditCreate or update songs (batch)
POST/importJWT—Import songs from FreeShow (batch)
DELETE/:idJWTContent.EditDelete a song

Song Details​

Base path: /content/songDetails

Song details are global (not church-scoped). These represent canonical song metadata shared across churches.

MethodPathAuthPermissionDescription
GET/:idJWT—Get a song detail by ID (global)
GET/JWT—List song details for the church
POST/createJWT—Create a song detail from PraiseCharts ID (returns existing if already created). Auto-fetches metadata from PraiseCharts and MusicBrainz
POST/JWT—Create or update song details (batch)

Base path: /content/songDetailLinks

MethodPathAuthPermissionDescription
GET/:idJWT—Get a song detail link by ID
GET/songDetail/:songDetailIdJWT—Get all links for a song detail
POST/JWT—Create or update song detail links (batch). Auto-fetches MusicBrainz data if linked
DELETE/:idJWT—Delete a song detail link

Arrangements​

Base path: /content/arrangements

MethodPathAuthPermissionDescription
GET/:idJWT—Get an arrangement by ID
GET/song/:songIdJWTContent.EditGet arrangements for a song
GET/songDetail/:songDetailIdJWTContent.EditGet arrangements for a song detail
GET/JWTContent.EditList all arrangements
POST/JWTContent.EditCreate or update arrangements (batch)
POST/freeShow/missingJWT—Find FreeShow IDs that don't exist in the church. Body: { freeShowIds: string[] }
DELETE/:idJWTContent.EditDelete an arrangement (also deletes keys; deletes the song if no arrangements remain)

Arrangement Keys​

Base path: /content/arrangementKeys

MethodPathAuthPermissionDescription
GET/presenter/:churchId/:idPublic—Get arrangement key with full song data for presenter view
GET/:idJWT—Get an arrangement key by ID
GET/arrangement/:arrangementIdJWTContent.EditGet keys for an arrangement
GET/JWTContent.EditList all arrangement keys
POST/JWTContent.EditCreate or update arrangement keys (batch)
DELETE/:idJWTContent.EditDelete an arrangement key

Settings​

Base path: /content/settings

MethodPathAuthPermissionDescription
GET/myJWT—Get current user's settings
GET/JWTSettings.EditGet all settings for the church
GET/public/:churchIdPublic—Get public settings for a church (returned as key-value pairs)
POST/myJWT—Save user-level settings (supports base64 image upload)
POST/JWTSettings.EditSave church-level settings (supports base64 image upload)
DELETE/my/:idJWT—Delete a user setting

Preview​

Base path: /content/preview

MethodPathAuthPermissionDescription
GET/data/:keyPublic—Load streaming preview data for a church by subdomain key (tabs, links, services, sermons)

Base path: /content/stock

MethodPathAuthPermissionDescription
POST/searchPublic—Search Pexels stock photos. Body: { term: "church" }

PraiseCharts​

Base path: /content/praiseCharts

Integration with PraiseCharts for worship song discovery and sheet music downloads.

MethodPathAuthPermissionDescription
GET/raw/:idJWT—Get raw PraiseCharts data for a song
GET/hasAccountJWT—Check if the user has a linked PraiseCharts account
GET/search?q=JWT—Search the PraiseCharts catalog
GET/products/:id?keys=JWT—Get products for a song (from library if authenticated, otherwise catalog)
GET/arrangement/raw/:id?keys=JWT—Get raw arrangement data from library
GET/download?skus=&keys=&file_name=JWT—Download a file from PraiseCharts (PDF or ZIP). Returns { redirectUrl }
GET/authUrl?returnUrl=Public—Get OAuth authorization URL for PraiseCharts
GET/access?verifier=&token=&secret=JWT—Exchange OAuth verifier for access token and save to user settings
GET/libraryJWT—Browse the user's PraiseCharts library

Support​

Base path: /content/support

MethodPathAuthPermissionDescription
POST/createAudioPublic—Convert SSML to MP3 audio using AWS Polly. Body: { ssml: "<speak>...</speak>" }