Home Pricing login Dashboard

REST API

Programmatically generate content using the Content Zen API.

Authentication

All API requests require an API key. Get your key from Settings → API Keys in your dashboard.

Include your API key in the request header:

Authorization: Bearer YOUR_API_KEY

Base URL

https://www.content-zen.com/api/public/

Generate Article

Generate a new article using a content flow:

POST /api/public/generate-article/

{
  "friendly_id": "flow_abc123xyz",
  "keywords": "best productivity tips for remote workers",
  "model_type": "gpt-4o",
  "language": "en",
  "use_external_links": false,
  "use_internal_links": false,
  "use_real_serp": true,
  "ranking_country": "United States",
  "ranking_language": "English"
}

Parameters

Parameter Type Required Description
friendly_id string Yes The friendly ID of the content flow to use (found in flow settings)
keywords string Yes Target keyword or topic for the article
model_type string No AI model to use: gpt-4o, gpt-4o-mini, gpt-4.1-nano (default: gpt-4)
language string No Language code (e.g., en, es, fr, de)
urls array No List of reference URLs to use for content research
use_external_links boolean No Include external links in the article (default: false)
use_internal_links boolean No Include internal links to your existing content (default: false)
use_real_serp boolean No Use real SERP data for content research (default: true)
ranking_country string No Target country for SERP research (default: "United States")
ranking_language string No Target language for SERP research (default: "English")
system_prompt string No Custom instructions attached to all AI prompts for this generation. Use this to define brand voice, audience, or content rules. If not provided, the domain-level system prompt from Settings is used.
run_at string No ISO datetime to schedule the article generation (e.g., 2024-12-25T10:00:00Z)

Response

On success, the API returns a 201 Created status. The article will be generated asynchronously and delivered according to your flow's configured integrations (WordPress, webhook, email, etc.).

Example Request

curl -X POST https://www.content-zen.com/api/public/generate-article/ \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "friendly_id": "flow_abc123xyz",
    "keywords": "how to improve SEO in 2024",
    "model_type": "gpt-4o",
    "language": "en",
    "use_real_serp": true
  }'

Finding Your Flow ID

To find your flow's friendly_id:

  1. Go to Flows in your dashboard
  2. Click on the flow you want to use
  3. The friendly ID is displayed in the flow header (e.g., flow_abc123xyz)
  4. Click the copy button next to it to copy to clipboard

Rate Limits

API requests are limited based on your subscription plan. If you exceed your rate limit, you'll receive a 429 Too Many Requests response.

Error Handling

The API returns appropriate HTTP status codes and error messages:

Status Code Description
201 Article generation started successfully
400 Bad request - Invalid parameters or no quota remaining
403 Forbidden - Invalid or missing API key

Example error response:

"You already used all your quota"
"Article Flow flow_xyz does not exist in your company"