> ## 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.

# Zapnito API overview

> Authenticate with an API token, then call the Zapnito API to manage users, groups, content and badges. Covers headers, pagination and errors.

The API lets your systems read and manage data in your Zapnito community, such as users, groups, organisations, content and badges. Every request goes to your community's domain and is authenticated with an API token.

<Note>
  To be notified when something happens in your community instead of polling for changes, use [webhooks](/webhooks/overview).
</Note>

## How it works

<Steps>
  <Step title="Send your API token">
    Include your API token in the `Authorization` header of every request.
  </Step>

  <Step title="Validate your key">
    Send a `GET` request to the [ping endpoint](/api/v1/ping) to confirm Zapnito accepts your token.
  </Step>

  <Step title="Call an endpoint">
    Pick a resource from the [resources list](#resources) and send a request to it.
  </Step>
</Steps>

## Base URL

All endpoints live under `/api/v1` on your community's domain:

```text theme={null}
https://your-community.zapnito.com/api/v1
```

Replace `https://your-community.zapnito.com` with your community's domain.

## Authentication

Authenticate every request by sending your API token in the `Authorization` header:

```text theme={null}
Authorization: Token token=YOUR_API_TOKEN
```

A request with a missing, invalid or expired token is rejected with `401 Unauthorized`.

## Validate your API key

Send a `GET` request to the ping endpoint to check that your token is valid. See [Validate your API key](/api/v1/ping) for the request and responses.

## Request headers

Send these headers with every request.

| Header | Value | Notes |
| - | - | - |
| `Authorization` | `Token token=YOUR_API_TOKEN` | Required. |
| `Content-Type` | `application/json; charset=utf-8` | Required. Request bodies are JSON. |

## Pagination

List endpoints return results a page at a time. Where an endpoint supports pagination, it accepts these query parameters:

| Parameter | Type | Description |
| - | - | - |
| `page` | integer | The page of results to return. |
| `per_page` | integer | The number of results to return per page. |

## Responses and errors

Zapnito uses standard HTTP status codes. The codes you're most likely to meet are:

| Status | Meaning |
| - | - |
| `200 OK` | The request succeeded. Some endpoints also return `200 OK` when there was nothing to change, such as adding a user who is already in a group. |
| `201 Created` | The request created a record. |
| `401 Unauthorized` | Your API token is missing, invalid, expired or badly formatted. |
| `403 Forbidden` | The account making the request doesn't have permission to do this. |
| `404 Not Found` | No record matches the ID, slug, UUID or email address in the request. |
| `409 Conflict` | The record you're creating already exists. |
| `422 Unprocessable Entity` | A required parameter is missing or invalid. The response lists the problems under `errors`, keyed by parameter name. |

Error response formats aren't yet consistent across endpoints. Some return a JSON object with an `errors` key, and others return a plain text message. Check the endpoint page for the response you're handling.

## Resources

| Resource | Use it to |
| - | - |
| [Users](/api/v1/users) | Find users and update their profile details. |
| [Invitations](/api/v1/invitations) | Send invitation emails and place invitees in a group. |
| [Groups](/api/v1/groups) | Create groups. |
| [Group users](/api/v1/group-users) | Search a group's users, and add or remove users. |
| [Organisations](/api/v1/organisations) | List, create and update organisations. |
| [Organisation users](/api/v1/organisation-users) | Add or remove users in an organisation. |
| [Content](/api/v1/contents) | List, view, publish, unpublish and schedule content. |
| [Tags](/api/v1/tags) | Find and create tags. |
| [Tag content](/api/v1/tag-contents) | Assign content to a tag. |
| [Third-party resources](/api/v1/third-party-resources) | Manage links to resources held in your external systems. |
| [Channels](/api/v1/channels) | List the channels in your community. |
| [Channel content](/api/v1/channel-contents) | List the content in a channel. |
| [Rooms](/api/v1/rooms) | List, view and create rooms. |
| [Badges](/api/v1/badges) | List, create, update and delete badges. |
| [Badge assignments](/api/v1/badge-assignments) | Assign badges to content and users, or remove them. |


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