---
title: API documentation
canonical: https://dkcli.com/docs/api
---

# DesignKit API Documentation

DesignKit exposes runtime design-analysis endpoints, CLI authentication helpers, and a DkCms proxy surface.

## Discovery

- API catalog: https://dkcli.com/.well-known/api-catalog
- OpenAPI service description: https://dkcli.com/openapi.json
- OAuth authorization server metadata: https://dkcli.com/.well-known/oauth-authorization-server
- OAuth protected resource metadata: https://dkcli.com/.well-known/oauth-protected-resource
- Health endpoint: https://dkcli.com/api/health

## Public Runtime Endpoints

- `POST /api/dk/saliency`: Analyze importance and saliency for a `DesignDocument`.
- `POST /api/dk/layout`: Solve layout with runtime importance priors and deterministic composition scoring.
- `POST /api/dk/compose`: Score balance, rhythm, density, and order from rectangles.
- `POST /api/dk/audit/rendered`: Audit rendered HTML, CSS, or URL snapshots.
- `POST /api/dk/future/embedding-topology`: Analyze semantic topology for content items.
- `POST /api/dk/future/semantic-typeset`: Analyze sentence and clause cohesion for typesetting.
- `POST /api/dk/future/refine`: Refine content topology through deterministic or runtime-backed iterations.

## Auth And CMS Endpoints

- DkCms uses OAuth/OIDC bearer tokens issued by `https://mere.world`.
- `GET /api/dkcms/content-types`: List supported typed publishing adapters. Beta supports `email-campaign` and keeps `landing-page` planned.
- `POST /api/dkcms/sites/{siteId}/pages`: Create an `email-campaign` page with `{ slug, title, summary, contentType, content }`.
- `PATCH /api/dkcms/sites/{siteId}/pages/{pageId}`: Update a typed page payload.
- `GET /api/dkcms/sites/{siteId}/pages/{pageId}/builds`: Read build history for rollback and publish state.
- `POST /api/dkcms/sites/{siteId}/pages/{pageId}/builds`: Queue a build for a typed page.
- `/api/dkcms/*`: Proxy protected DkCms requests. Send `Authorization: Bearer <token>`.
- Legacy `/api/cli/v1/auth/*` endpoints remain for compatibility while the CLI moves to OIDC device flow.

## Request Shape

Most `/api/dk/*` analysis endpoints accept JSON with a `document` object and optional `mode` set to `heuristic`, `ml`, or `auto`. DkCms page endpoints accept typed `content` payloads and return stable JSON errors shaped as `{ "error": { "code": "...", "message": "..." } }`.

## Useful Links

- [Homepage](https://dkcli.com/)
- [Components](https://dkcli.com/components)
- [Foundations](https://dkcli.com/foundations)
- [API docs](https://dkcli.com/docs/api)
