Full REST API

AI agents & LLMs: read this documentation as Markdown at nextblog.ai/docs/api-v1.md or browse the per-section Markdown index.
https://nextblog.ai/api/v1 is the complete public API: every dashboard action, implemented once in the same service layer as the MCP server. JSON in, JSON out.
Base URL: https://nextblog.ai/api/v1
OpenAPI 3.1: https://nextblog.ai/api/v1/openapi.json
The OpenAPI document is public, CORS-enabled and needs no authentication. The older /api/blog and /api/manage bases keep working as legacy aliases (see Blog Display API and Post Management API).

Authentication

  • Account API key — Authorization: Bearer nb_u_...; every project the account owns, with an optional read-only mode that refuses every write with 403 READ_ONLY_KEY. Created at /agents, shown once.
  • OAuth access token — whole account, including project create/delete and account key management.
  • Project API key (legacy) — Authorization: Bearer nb_...; one project, its posts, integrations, connections and analytics.
  • Account-level calls over a project key return 403 ACCOUNT_SCOPE_REQUIRED; use an account key or OAuth. Billing URLs are allowed for all three.
curl -H "Authorization: Bearer nb_u_your_account_api_key" \
  https://nextblog.ai/api/v1/me

Errors

Every failure uses { error: { code, message, details? } }:
  • AUTH_REQUIRED 401 · INVALID_API_KEY 401
  • FORBIDDEN 403 · PROJECT_SCOPE_VIOLATION 403 · ACCOUNT_SCOPE_REQUIRED 403 · READ_ONLY_KEY 403 · UPGRADE_REQUIRED 403
  • NOT_FOUND 404 · METHOD_NOT_ALLOWED 405 · CONFLICT 409
  • VALIDATION_ERROR 400/413 · INSUFFICIENT_CREDITS 402 · RATE_LIMITED 429
  • PROVIDER_NOT_CONFIGURED 503 · UPSTREAM_ERROR 502 · INTERNAL_ERROR 500
  • CONFIRMATION_REQUIRED exists only on MCP; an HTTP call is its own confirmation

Pagination, limits and idempotency

  • limit default 50, max 100; offset default 0; post lists also return total
  • 120 requests/minute and 1,000/hour per credential; generation and video 10/hour; billing links 20/hour
  • 429 carries Retry-After and X-RateLimit-*
  • Idempotency-Key on any POST/PATCH/DELETE replays the first 2xx for 24 hours (X-Idempotent-Replay: true); a different action with the same key is 409
  • 200 KB markdown, 200-character title, 500-character description, 200 KB JSON body

Endpoints

MethodPathWhat it does
GET/meAccount, plan, credits, key identity and accessible projects
GET/keysList account API keys (OAuth or session only)
POST/keysCreate an account API key, shown once (OAuth or session only)
DELETE/keys/{keyId}Revoke an account API key immediately (OAuth or session only)
GET/analytics?days=7|30|90Dashboard analytics report
GET/billing/statusPlan, credits, limits and renewal
POST/billing/checkoutStripe Checkout URL (never charges)
POST/billing/portalStripe Customer Portal URL (never charges)
GET/voices?provider=all|elevenlabs|xaiElevenLabs and xAI voices
GET/projectsList accessible projects with post counts
POST/projectsCreate a project (account key or OAuth)
GET/projects/{projectId}One project, secrets redacted
PATCH/projects/{projectId}Update project settings
DELETE/projects/{projectId}Delete a project and its posts (account key or OAuth)
POST/projects/{projectId}/api-keyRotate the API key (account key or OAuth)
POST/projects/{projectId}/generate-descriptionGenerate a project description
GET/projects/{projectId}/backlinksBacklink Network given/received counts
GET/projects/{projectId}/generation-runsRecent generation runs
POST/projects/{projectId}/generateQueue one AI post generation (credits)
GET/projects/{projectId}/postsList posts without markdown
POST/projects/{projectId}/postsCreate a post
GET/projects/{projectId}/posts/{postId}One post with markdown and integration URLs
PATCH/projects/{projectId}/posts/{postId}Update a post
DELETE/projects/{projectId}/posts/{postId}Delete a post
POST/projects/{projectId}/posts/{postId}/approvePublish and push to every integration
POST/projects/{projectId}/posts/{postId}/declineDecline a post
POST/projects/{projectId}/posts/{postId}/unpublishRevert to draft and unpublish from CMSs
POST/projects/{projectId}/posts/{postId}/generate-videoQueue a YouTube video (credits)
GET/projects/{projectId}/posts/{postId}/videoLatest video job for a post
GET/projects/{projectId}/integrationsIntegration settings, secrets redacted
PATCH/projects/{projectId}/integrationsUpdate integration settings
POST/projects/{projectId}/integrations/{provider}/testTest a CMS connection
GET/projects/{projectId}/integrations/{provider}/connect-urlBrowser URL for an OAuth connection
POST/projects/{projectId}/gsc/testVerify a Search Console property
GET/connections/youtubeList YouTube connections
DELETE/connections/youtube/{connectionId}Remove a YouTube connection
GET/connections/shopifyList Shopify connections
DELETE/connections/shopify/{connectionId}Remove a Shopify connection
GET/gsc/statusSearch Console status
GET/gsc/sitesSearch Console properties
POST/gsc/disconnectDisconnect Search Console (account key or OAuth)
GET/openapi.jsonThis OpenAPI 3.1 document (public)

Examples

# List posts (account key)
curl -H "Authorization: Bearer nb_u_your_account_api_key" \
  "https://nextblog.ai/api/v1/projects/123/posts?limit=10"

# Create a draft
curl -X POST https://nextblog.ai/api/v1/projects/123/posts \
  -H "Authorization: Bearer nb_u_your_account_api_key" \
  -H "Content-Type: application/json" \
  -d '{"title":"My post","markdown":"# Hello","status":"draft"}'

# Create a project (account key or OAuth)
curl -X POST https://nextblog.ai/api/v1/projects \
  -H "Authorization: Bearer nb_u_your_account_api_key" \
  -H "Content-Type: application/json" \
  -d '{"name":"My site","url":"https://example.com","extract":true}'

# A legacy project key works in the same examples for its one project
Canonical Markdown: /docs/api-v1.md. Machine-readable: /api/v1/openapi.json.