Get a published document by slug
- Sandbox: available
- Staging: available
- Production: unknown
Returns one published document of a CMS collection by its slug. Use it for stable public pages and deep links, such as terms and conditions or a privacy policy.
Auth: one of the following, checked in this order:
- The CMS public API key, in the
x-api-keyheader, asAuthorization: Bearer <key>, or as theapiKeyquery parameter. - No key, for collections configured as keyless (by default
legal-pagesandtranslations). - A signed-in Ovok session (bearer token), which may only read its own tenant.
Scope: the tenant you name, by tenant code (x-ovok-tenant-code header or tenant query parameter) or by project id (x-ovok-medplum-project-id header or projectId query parameter). Headers win over query parameters, and a tenant code wins over a project id. If you name neither, a signed-in session reads its own tenant. Each Ovok deployment has one set of content; there is no environment to choose.
Behaviour
- Any collection except the
usersandtenantssystem collections can be read. - Only a document with status
publishedis returned. The response is the document itself, with the fields its collection defines. slugmust start with a lowercase letter or digit and contain only lowercase letters, digits,-,_and., up to 128 characters.localeis a language tag such asdeoren-US. Without it, the CMS default locale is used. Missing translations fall back as configured in the CMS.- If the tenant has no published document with this slug, Ovok returns the shared tenant's document with that slug, when one exists.
- Responses are cached by Ovok for up to 60 seconds. A request that names a tenant gets
Cache-Control: public, s-maxage=60, stale-while-revalidate=300and aVaryon the tenant and API key headers. A request that names no tenant getsCache-Control: no-store. Error responses carry neither.
Example
curl -X GET 'https://api.sandbox.ovok.com/v1/public/cms/collections/legal-pages/items/terms-and-conditions?tenant=my-medical-project&locale=en-US'api-keyx-api-key<token>collectionSlug*stringSlug of a collection (any but users and tenants), e.g. "legal-pages".
slug*stringDocument slug, e.g. "terms-and-conditions" or "data-privacy".
tenant?unknownTenant code identifying the project (alternative to the x-ovok-tenant-code header).
locale?stringResponse language as a language tag (e.g. "de", "en-US"). Omit for the CMS default locale; missing translations fall back per the CMS localization config. Malformed tags are rejected with 400.
The published document (fields as defined by the collection).
application/json- response
[key: string]?anycurl -X GET 'https://api.sandbox.ovok.com/v1/public/cms/collections/string/items/string'{}List published documents of a public collection GET
Lists the published documents of a CMS collection for one tenant, in one language, one page at a time. Use it to show content such as release notes or articles in an app or website. **Auth:** one of the following, checked in this order: - The CMS public API key, in the `x-api-key` header, as `Authorization: Bearer <key>`, or as the `apiKey` query parameter. - No key, for collections configured as keyless (by default `legal-pages` and `translations`). - A signed-in Ovok session (bearer token), which may only read its own tenant. **Scope:** the tenant you name, by tenant code (`x-ovok-tenant-code` header or `tenant` query parameter) or by project id (`x-ovok-medplum-project-id` header or `projectId` query parameter). Headers win over query parameters, and a tenant code wins over a project id. If you name neither, a signed-in session reads its own tenant. Each Ovok deployment has one set of content; there is no environment to choose. ## Behaviour - Any collection except the `users` and `tenants` system collections can be read. - Only documents with status `published` are returned. The response is the CMS list envelope (`docs`, `totalDocs`, `page`, `limit`, and so on). - `locale` is a language tag such as `de` or `en-US`. Without it, the CMS default locale is used. Missing translations fall back as configured in the CMS. - `page` defaults to `1` and is limited to 1 to 100. `limit` defaults to `20` and is limited to 1 to 50. Values outside those ranges are clamped; values that are not whole numbers fall back to the default. - `sort` is a top-level field name, optionally prefixed with `-` for descending order, for example `-publishedAt`. Without it, the CMS default order is used. - Ovok also has a shared tenant whose published documents are added to every tenant's list. Where both have a document with the same `slug`, the tenant's own document wins. If either tenant has more than 200 published documents in the collection, only the tenant's own documents are returned. - Responses are cached by Ovok for up to 60 seconds. A request that names a tenant gets `Cache-Control: public, s-maxage=60, stale-while-revalidate=300` and a `Vary` on the tenant and API key headers. A request that names no tenant gets `Cache-Control: no-store`. Error responses carry neither. ## Example ```bash curl -X GET 'https://api.sandbox.ovok.com/v1/public/cms/collections/release-notes/items?tenant=my-medical-project&locale=de&sort=-publishedAt&limit=10' \ -H 'x-api-key: <cms public api key>' ```
List published items of a content type GET
Lists the published items of a user-defined content type for one tenant. First-class collections are read with `GET /v1/public/cms/collections/{collectionSlug}/items` instead. **Auth:** one of the following: - The CMS public API key, in the `x-api-key` header, as `Authorization: Bearer <key>`, or as the `apiKey` query parameter. - A signed-in Ovok session (bearer token), which may only read its own tenant. **Scope:** the tenant you name, by tenant code (`x-ovok-tenant-code` header or `tenant` query parameter) or by project id (`x-ovok-medplum-project-id` header or `projectId` query parameter). Headers win over query parameters, and a tenant code wins over a project id. If you name neither, a signed-in session reads its own tenant. Each Ovok deployment has one set of content; there is no environment to choose. ## Behaviour - Returns the CMS `content-items` whose content type has the slug `contentTypeSlug` and whose status is `published`, in the CMS list envelope. - At most 100 items are returned. There is no paging, sorting or locale selection on this route. - Responses are cached by Ovok for up to 60 seconds. A request that names a tenant gets `Cache-Control: public, s-maxage=60, stale-while-revalidate=300` and a `Vary` on the tenant and API key headers. A request that names no tenant gets `Cache-Control: no-store`. Error responses carry neither. ## Example ```bash curl -X GET 'https://api.sandbox.ovok.com/v1/public/cms/faq/items?tenant=my-medical-project' \ -H 'x-api-key: <cms public api key>' ```