> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zapnito.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Content API

> List and view content in your Zapnito community through the API, and publish, unpublish or schedule it with example requests.

List and view your community's content, and change when it's published.

Before you start, read the [API overview](/api/v1/overview) for how authentication, headers, pagination and errors work.

## List contents

Return a paginated list of your published content.

```bash title="List contents" theme={null}
curl "https://your-community.zapnito.com/api/v1/contents" \
  -H "Authorization: Token token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json; charset=utf-8"
```

`GET https://your-community.zapnito.com/api/v1/contents`

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "contents": [
      {
        "type": "Post",
        "title": "Preparing for an audit",
        "introduction": "A practical checklist for getting ready for your first audit.",
        "url": "https://your-community.zapnito.com/posts/2-preparing-for-an-audit",
        "canonical_url": "https://your-community.zapnito.com/users/3-maya-patel/posts/2-preparing-for-an-audit",
        "thumbnail_url": null,
        "published_at": "2026-03-10T09:00:00Z",
        "created_at": "2026-03-09T16:30:00Z"
      }
    ]
  }
  ```
</ResponseExample>

## Get content

Return a single piece of content.

<ParamField path="id" type="string" required>
  The ID or slug of the content.
</ParamField>

<ParamField path="doi" type="string">
  The URL-encoded DOI, if one has been allocated to the content.
</ParamField>

```bash title="Get content" theme={null}
curl "https://your-community.zapnito.com/api/v1/contents/2-preparing-for-an-audit" \
  -H "Authorization: Token token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json; charset=utf-8"
```

`GET https://your-community.zapnito.com/api/v1/contents/:id`

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "content": {
      "type": "Post",
      "title": "Preparing for an audit",
      "introduction": "A practical checklist for getting ready for your first audit.",
      "url": "https://your-community.zapnito.com/posts/2-preparing-for-an-audit",
      "canonical_url": "https://your-community.zapnito.com/users/3-maya-patel/posts/2-preparing-for-an-audit",
      "thumbnail_url": null,
      "published_at": "2026-03-10T09:00:00Z",
      "created_at": "2026-03-09T16:30:00Z"
    }
  }
  ```
</ResponseExample>

## Publish content

Publish a draft or scheduled piece of content. This endpoint doesn't accept a `published_at` date and time. Zapnito sets `published_at` to the time it receives the request.

<ParamField path="id" type="string" required>
  The ID or slug of the content.
</ParamField>

```bash title="Publish content" theme={null}
curl -X POST "https://your-community.zapnito.com/api/v1/contents/2-preparing-for-an-audit/publish" \
  -H "Authorization: Token token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json; charset=utf-8"
```

`POST https://your-community.zapnito.com/api/v1/contents/:id/publish`

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "contents": [
      {
        "type": "Post",
        "title": "Preparing for an audit",
        "introduction": "A practical checklist for getting ready for your first audit.",
        "url": "https://your-community.zapnito.com/posts/2-preparing-for-an-audit",
        "canonical_url": "https://your-community.zapnito.com/users/3-maya-patel/posts/2-preparing-for-an-audit",
        "thumbnail_url": null,
        "published_at": "2026-03-10T09:00:00Z",
        "scheduled_at": null,
        "created_at": "2026-03-09T16:30:00Z"
      }
    ]
  }
  ```
</ResponseExample>

## Unpublish content

Move a published piece of content back to draft.

<Warning>
  Unpublishing removes access to the content across your community until you publish it again.
</Warning>

<ParamField path="id" type="string" required>
  The ID or slug of the content.
</ParamField>

```bash title="Unpublish content" theme={null}
curl -X POST "https://your-community.zapnito.com/api/v1/contents/2-preparing-for-an-audit/unpublish" \
  -H "Authorization: Token token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json; charset=utf-8"
```

`POST https://your-community.zapnito.com/api/v1/contents/:id/unpublish`

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "contents": [
      {
        "type": "Post",
        "title": "Preparing for an audit",
        "introduction": "A practical checklist for getting ready for your first audit.",
        "url": "https://your-community.zapnito.com/posts/2-preparing-for-an-audit",
        "canonical_url": "https://your-community.zapnito.com/users/3-maya-patel/posts/2-preparing-for-an-audit",
        "thumbnail_url": null,
        "published_at": null,
        "scheduled_at": null,
        "created_at": "2026-03-09T16:30:00Z"
      }
    ]
  }
  ```
</ResponseExample>

## Schedule content

Schedule a piece of content to be published at a future time.

<ParamField path="id" type="string" required>
  The ID or slug of the content.
</ParamField>

<ParamField body="scheduled_at" type="string" required>
  When to publish the content, as an ISO 8601 formatted string, for example `2026-03-10T09:00:00Z`.
</ParamField>

```bash title="Schedule content" theme={null}
curl -X POST "https://your-community.zapnito.com/api/v1/contents/2-preparing-for-an-audit/schedule" \
  -H "Authorization: Token token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json; charset=utf-8" \
  -d '{"scheduled_at": "2026-03-10T09:00:00Z"}'
```

`POST https://your-community.zapnito.com/api/v1/contents/:id/schedule`

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "contents": [
      {
        "type": "Post",
        "title": "Preparing for an audit",
        "introduction": "A practical checklist for getting ready for your first audit.",
        "url": "https://your-community.zapnito.com/posts/2-preparing-for-an-audit",
        "canonical_url": "https://your-community.zapnito.com/users/3-maya-patel/posts/2-preparing-for-an-audit",
        "thumbnail_url": null,
        "published_at": null,
        "scheduled_at": "2026-03-10T09:00:00Z",
        "created_at": "2026-03-09T16:30:00Z"
      }
    ]
  }
  ```
</ResponseExample>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.