# Quickstart

> Create a token, make your first Management API call, publish a post and read it back from the Content Delivery API in about ten minutes.

> Markdown version of https://kanorio.com/en/developers/quickstart. Append `.md` to any developer docs URL for this format. Index: https://kanorio.com/llms.txt · MCP: https://app.kanorio.com/api/mcp

This quickstart takes you from nothing to a published blog post you created with code and read back from your site's public API.

## Before you start

- A Kanorio account with at least one site. A blank site is fine.
- `curl`, or Node.js 20 or later if you want to use the SDK.

## 1. Create a personal access token

Personal access tokens start with `knr_pat_` and act as you, limited to the sites and permissions you pick.

1. Open [Account settings › API access](https://app.kanorio.com/account/api-access) and select **Create key**.
2. Choose **Other tools**, select the site you want to use, and pick the **Edit content** permission preset. Publishing needs **Full access** or the publish permission.
3. Copy the token. It is shown once.

```bash
export KANORIO_TOKEN="knr_pat_..."
```

Keep the token on the server. Never put it in browser code or a public repository. See [Authentication](https://kanorio.com/en/developers/authentication) for the other token types.

## 2. List your sites

Every Management API request goes to `https://app.kanorio.com/api/v1` with the token as a Bearer credential.

```bash
curl https://app.kanorio.com/api/v1/sites \
  -H "Authorization: Bearer $KANORIO_TOKEN"
```

Lists come back in the same envelope everywhere. Note the site `id` and its `publicUrl`.

```json
{
  "data": [
    {
      "id": "ws_example123",
      "name": "Sourdough Studio",
      "role": "OWNER",
      "isPublished": true,
      "publicUrl": "https://sourdough.kanorio.com"
    }
  ],
  "hasMore": false,
  "nextCursor": null
}
```

## 3. Create a draft post

Writes create drafts. Nothing changes on the live site until you publish.

```bash
curl -X POST https://app.kanorio.com/api/v1/sites/ws_example123/posts \
  -H "Authorization: Bearer $KANORIO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "How we feed our sourdough starter",
    "excerpt": "The first thing we do every morning.",
    "contentMarkdown": "## Flour and water\n\nEqual weights, twice a day."
  }'
```

The response is the post itself, with `"status": "DRAFT"` and an `id` such as `post_example01`.

## 4. Publish it

```bash
curl -X POST https://app.kanorio.com/api/v1/sites/ws_example123/posts/post_example01/publish \
  -H "Authorization: Bearer $KANORIO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
```

If the response is an error with code `SITE_NOT_PUBLISHED`, publish the site once with `POST /sites/{id}/publish` and try again. Errors always have the same shape, described in [Errors](https://kanorio.com/en/developers/basics/errors).

## 5. Read it from the Content Delivery API

Published content is readable without a token from your site's own address. Use the `publicUrl` from step 2, or the permanent system URL shown under [Site settings › Developer](https://app.kanorio.com/settings/developer).

```bash
curl "https://sourdough.kanorio.com/api/v1/collections/blog/items?limit=1&fields=title,excerpt"
```

```json
{
  "data": [
    {
      "id": "post_example01",
      "slug": "how-we-feed-our-starter",
      "publishedAt": "2026-11-02T08:00:00.000Z",
      "fieldData": {
        "title": "How we feed our sourdough starter",
        "excerpt": "The first thing we do every morning."
      }
    }
  ],
  "hasMore": false,
  "nextCursor": null,
  "assets": {}
}
```

## Do the same with the SDK

```bash
npm install @kanorio/sdk
```

```ts
import { createDeliveryClient, createManagementClient } from "@kanorio/sdk";

const management = createManagementClient({ token: process.env.KANORIO_TOKEN! });
const sites = await management.get("/sites");
const site = sites.data[0]!;

const post = await management.post("/sites/{id}/posts", {
  params: { id: site.id },
  body: { title: "How we feed our sourdough starter", contentMarkdown: "## Flour and water" },
});
await management.post("/sites/{id}/posts/{postId}/publish", { params: { id: site.id, postId: post.id }, body: {} });

const delivery = createDeliveryClient({ siteUrl: site.publicUrl! });
const latest = await delivery.get("/collections/{key}/items", { params: { key: "blog" }, query: { limit: 1 } });
console.log(latest.data[0]?.slug);
```

## Next steps

- [Read pages, posts and collections](https://kanorio.com/en/developers/guides/read-content) from your own front end.
- Learn the shared rules for [errors](https://kanorio.com/en/developers/basics/errors), [pagination](https://kanorio.com/en/developers/basics/pagination) and [rate limits](https://kanorio.com/en/developers/basics/rate-limits).
- Browse the [Management API reference](https://kanorio.com/en/developers/management-api) or the [products](https://kanorio.com/en/developers/products) Kanorio exposes.
- Connect an AI assistant over [MCP](https://kanorio.com/en/developers/mcp).
