Acachy CMS

API Reference

Complete API reference for Acachy CMS

Authentication

Login

POST /api/admin/auth/login

Body:

{
  "email": "admin@acachy.com",
  "password": "admin123"
}

Response:

{
  "accessToken": "eyJhbGciOiJIUzI1NiIs..."
}

Refresh Token

POST /api/admin/auth/refresh

Uses HttpOnly cookie refresh_token.

Logout

POST /api/admin/auth/logout

Content Types

List

GET /api/admin/content-types
Authorization: Bearer <token>

Create

POST /api/admin/content-types
Authorization: Bearer <token>
{
  "name": "Post",
  "slug": "post",
  "fields": [
    { "name": "title", "type": "text", "required": true },
    { "name": "slug", "type": "slug" },
    { "name": "content", "type": "markdown", "required": true }
  ]
}

Update

PUT /api/admin/content-types/:id
Authorization: Bearer <token>

Delete

DELETE /api/admin/content-types/:id
Authorization: Bearer <token>

Entries

List

GET /api/admin/entries/post?page=1&limit=10
Authorization: Bearer <token>

Create

POST /api/admin/entries/post
Authorization: Bearer <token>
{
  "data": {
    "title": "Hello World",
    "content": "# Markdown content"
  }
}

Update

PUT /api/admin/entries/post/:id
Authorization: Bearer <token>
{
  "data": {
    "title": "Updated Title"
  }
}

Publish

POST /api/admin/entries/post/:id/publish
Authorization: Bearer <token>

Unpublish

POST /api/admin/entries/post/:id/unpublish
Authorization: Bearer <token>

Delete

DELETE /api/admin/entries/post/:id
Authorization: Bearer <token>

API Keys

Create

POST /api/admin/api-keys
Authorization: Bearer <token>
{
  "name": "My App",
  "scopes": ["content:read"]
}

List

GET /api/admin/api-keys
Authorization: Bearer <token>

Update

PUT /api/admin/api-keys/:id
Authorization: Bearer <token>
{
  "active": false
}

Delete

DELETE /api/admin/api-keys/:id
Authorization: Bearer <token>

Public API

List Published Entries

GET /api/v1/content/post?page=1&limit=10
x-api-key: ck_live_<token>

Get Entry by ID

GET /api/v1/content/post/:id
x-api-key: ck_live_<token>

Get Entry by Slug

GET /api/v1/content/post/slug/:slug
x-api-key: ck_live_<token>

On this page