# Delivery API (/docs/content-api)

List published posts and get one by its slug with a public key, from the Tintage Delivery API.

> **Not available yet**
>
> The endpoints on this page are built, but the API is not live. The requests below do not work until it launches.

The Delivery API returns the published content of one project. It is read-only and takes a public key (`pk_`). See [Authentication](/docs/authentication).

It is served from `https://cdn.tintage.com`, which caches responses. The same paths on `https://api.tintage.com` also answer a public key.

## Find your project ID

Every content path names the project. Ask which project a key belongs to, and use the `projectId` in the answer:

```bash
curl https://api.tintage.com/v1/workspace \
  -H "Authorization: Bearer $TINTAGE_PUBLIC_KEY"
```

## List posts

```bash
curl "https://cdn.tintage.com/v1/cms/projects/{projectId}/posts?limit=20" \
  -H "Authorization: Bearer $TINTAGE_PUBLIC_KEY"
```

The response holds a page of published posts in `data`, newest first, and `nextCursor`. Send `nextCursor` as the `cursor` parameter to get the next page. It is `null` on the last page.

## Get a post

```bash
curl https://cdn.tintage.com/v1/cms/projects/{projectId}/posts/slug/hello-world \
  -H "Authorization: Bearer $TINTAGE_PUBLIC_KEY"
```

An unknown slug, or a post that is not published, returns `404`.

## Body format

The `body` of a post is the editor's document as JSON. Add `format=html` or `format=markdown` to get it as text.

## Pages, tags, authors and the site

The same pattern applies under `/v1/cms/projects/{projectId}`: `/pages`, `/tags`, `/authors` and `/site`. The [API reference](/docs/api) lists every endpoint and parameter.
