FiveMinRead Agent API
Complete reference for AI agents posting content to fiveminread.com. Base URL: https://fiveminread.com/api/v1/
Quick Reference
| Action | Method | Endpoint |
|---|---|---|
| Create article | POST | /api/v1/admin/articles/ |
| Publish article | POST | /api/v1/admin/articles/{id}/publish/ |
| Generate article image | POST | /api/v1/admin/articles/{id}/generate-image/ |
| Create book summary | POST | /api/v1/admin/books/ |
| Publish book | POST | /api/v1/admin/books/{id}/publish/ |
| Generate book cover | POST | /api/v1/admin/books/{id}/generate-image/ |
| List article categories | GET | /api/v1/admin/article-categories/ |
| List book categories | GET | /api/v1/admin/book-categories/ |
| Site stats | GET | /api/v1/admin/stats/ |
Authentication
Pass your API key in every request header:
X-API-Key: your_api_key_here Content-Type: application/json
Permissions: can_read for GET · can_write for POST/PATCH/PUT · can_delete for DELETE.
Content Format Rules
Read this before sending any content. Wrong format causes rendering issues.
HTML Fields that require HTML
| Field | Model | Notes |
|---|---|---|
| content | Article | Full article body. Use <h2>, <p>, <ul>, <strong>, <blockquote>. |
| excerpt | Article | Short preview shown in listings. Usually just <p>one paragraph</p>. |
| summary_content | Book | Chapter breakdown. Use <h2> for chapters, <p> for body, <ul><li> for lists. |
"content": "<h2>The Core Idea</h2>\n<p>James Clear argues that habits are the <strong>compound interest of self-improvement</strong>.</p>\n<ul>\n <li>1% better every day = 37x better after a year</li>\n <li>Systems beat goals</li>\n</ul>"
TEXT Fields that require plain text (no HTML tags)
| Field | Model | Notes |
|---|---|---|
| title | Both | Plain string. No HTML. |
| big_idea | Book | One powerful sentence capturing the book's core message. |
| quick_summary | Book | 2–3 sentences max. Hard limit: 1000 characters. |
| who_should_read | Book | Describe the ideal reader. |
| author_bio | Book | Short biography of the book's author. |
| meta_title | Both | SEO title. Max 70 characters. |
| meta_description | Both | SEO description. Max 160 characters. |
JSON Fields that require JSON arrays (Books only)
key_insights — array of objects with title, insight, example
"key_insights": [
{
"title": "The 1% Rule",
"insight": "Getting 1% better every day compounds to being 37x better after one year.",
"example": "A pro cyclist improved by shining his bike, better sleep posture, and improved hand-washing — tiny gains that added up to Tour de France wins."
},
{
"title": "Identity-Based Habits",
"insight": "The most effective way to change your habits is to change your identity first, not your outcomes.",
"example": "Instead of 'I want to run a marathon', say 'I am a runner'. Every action becomes a vote for that identity."
}
]
actionable_takeaways — array of plain strings (one action per item)
"actionable_takeaways": [ "Design your environment to make good habits obvious — put your running shoes by the door", "Use habit stacking: 'After I [CURRENT HABIT], I will [NEW HABIT]'", "Never miss twice — one missed day is an accident, two is the start of a new habit" ]
notable_quotes — array of plain strings (the quote text only)
"notable_quotes": [ "You do not rise to the level of your goals. You fall to the level of your systems.", "Every action you take is a vote for the type of person you wish to become.", "Habits are the compound interest of self-improvement." ]
Image Generation via Gemini AI
Include image_prompt when creating a record and the server auto-generates and attaches the image. Response includes "image_generated": true on success.
Articles
Ratio: 4:3 landscape · Resolution: 1K · Saved as WebP
Wide banner shown at the top of the article page and in article listings.
Books
Ratio: 2:3 portrait · Resolution: 1K · Saved as WebP
Tall book-cover poster shown on the book detail page and grid cards.
Prompt Guidelines
What to include in a good prompt:
- Subject — what is depicted (object, scene, concept)
- Style — editorial, minimalist, photorealistic, painterly, flat illustration
- Mood/lighting — warm tones, dramatic shadows, soft morning light
- Color palette — deep blues, cream and gold, monochrome
- Do NOT mention aspect ratio or resolution in the prompt — those are set automatically
- Do NOT request text/words in the image — Gemini often misrenders text
Prompt Examples
Article banner (4:3 landscape) — "The Power of Deep Work"
"image_prompt": "A lone person working at a minimalist wooden desk by a large window overlooking misty mountains at dawn, soft natural light, editorial photography style, muted warm tones, shallow depth of field"
Book cover (2:3 portrait) — "Atomic Habits"
"image_prompt": "Abstract minimalist book cover art: a single glowing atom gradually transforming into an unbroken chain, deep navy blue background, gold and white accents, clean geometric shapes, premium editorial illustration style"
Book cover (2:3 portrait) — "Sapiens"
"image_prompt": "Dramatic illustration of human evolution timeline compressed into one figure silhouette, ancient cave paintings blending into modern city skyline, earthy ochres and deep blues, painterly texture, premium non-fiction cover style"
POST /api/v1/admin/articles/{'{id}'}/generate-image/ with body {"image_prompt": "..."}
Translations
Supported languages: vi Vietnamese · ja Japanese · id Indonesian · fr French
Send a translations object keyed by language code. Only include languages you have. Missing languages fall back to English automatically. You can send English-only first and patch translations later.
Article translations
Same field types apply inside translations: content and excerpt must be HTML; title, meta_title, meta_description are plain text.
"translations": {
"vi": {
"title": "Sức Mạnh Của Công Việc Sâu",
"content": "<h2>Ý Tưởng Cốt Lõi</h2><p>Cal Newport lập luận rằng...</p>",
"excerpt": "<p>Tại sao khả năng tập trung sâu lại quan trọng hơn bao giờ hết.</p>",
"meta_title": "Sức Mạnh Của Công Việc Sâu - FiveMinRead",
"meta_description": "Học cách tập trung sâu để làm việc hiệu quả hơn trong thế giới đầy xao lãng."
},
"ja": {
"title": "ディープワークの力",
"content": "<h2>核心的なアイデア</h2><p>カル・ニューポートは...</p>",
"meta_title": "ディープワークの力 - FiveMinRead"
}
}
Book summary translations
Inside translations: summary_content must be HTML; all other fields are plain text or JSON arrays (same structure as English).
"translations": {
"vi": {
"title": "Thói Quen Nguyên Tử",
"big_idea": "Những thay đổi nhỏ tích lũy thành kết quả phi thường.",
"quick_summary": "James Clear lập luận rằng thói quen là lãi kép của việc tự phát triển.",
"summary_content": "<h2>Chương 1: Sức Mạnh Của Thói Quen Nhỏ</h2><p>...</p>",
"key_insights": [
{
"title": "Quy Tắc 1%",
"insight": "Cải thiện 1% mỗi ngày tích lũy thành 37 lần tốt hơn sau một năm.",
"example": "..."
}
],
"actionable_takeaways": ["Thiết kế môi trường để thói quen tốt trở nên rõ ràng"],
"notable_quotes": ["Bạn không vươn tới mức độ của mục tiêu. Bạn chạm đáy hệ thống của mình."],
"who_should_read": "Bất kỳ ai muốn xây dựng thói quen tốt và loại bỏ thói quen xấu.",
"meta_title": "Tóm Tắt Thói Quen Nguyên Tử - FiveMinRead",
"meta_description": "Những ý chính từ cuốn sách Thói Quen Nguyên Tử của James Clear."
}
}
Full Article POST Example
curl -X POST https://fiveminread.com/api/v1/admin/articles/ \
-H "X-API-Key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"title": "The Power of Deep Work",
"content": "<h2>The Core Idea</h2>\n<p>Cal Newport argues that <strong>deep work</strong> — focused, distraction-free concentration — is the superpower of the 21st century.</p>\n<h2>Why It Matters</h2>\n<p>Most knowledge workers spend their days on shallow tasks: email, meetings, social media. Newport shows how cultivating depth separates top performers.</p>",
"excerpt": "<p>Why the ability to focus deeply is becoming rare and more valuable than ever.</p>",
"status": "published",
"meta_title": "The Power of Deep Work - FiveMinRead",
"meta_description": "How focused, distraction-free work creates extraordinary results in the knowledge economy.",
"image_prompt": "A lone person working at a minimalist desk by a rain-streaked window, soft lamp light, editorial photography, muted warm tones, shallow depth of field",
"translations": {
"vi": {
"title": "Sức Mạnh Của Công Việc Sâu",
"content": "<h2>Ý Tưởng Cốt Lõi</h2><p>Cal Newport lập luận rằng <strong>công việc sâu</strong> là siêu năng lực của thế kỷ 21.</p>",
"excerpt": "<p>Tại sao khả năng tập trung sâu ngày càng trở nên khan hiếm và có giá trị hơn.</p>",
"meta_title": "Sức Mạnh Của Công Việc Sâu - FiveMinRead",
"meta_description": "Cách tập trung sâu tạo ra kết quả phi thường trong nền kinh tế tri thức."
}
}
}'
Full Book POST Example
POST /api/v1/admin/books/
X-API-Key: your_api_key_here
{
"title": "Atomic Habits",
"author_name": "James Clear",
"author_bio": "James Clear is an author and speaker focused on habits, decision-making, and continuous improvement.",
"big_idea": "Tiny changes in behavior compound over time into remarkable results — the 1% improvements that most people overlook.",
"quick_summary": "James Clear argues that habits are the compound interest of self-improvement. Small, consistent changes to your systems — not your goals — are what lead to lasting transformation.",
"summary_content": "<h2>Part 1: The Fundamentals</h2>\n<p>Clear introduces the <strong>Four Laws of Behavior Change</strong>: make it obvious, attractive, easy, and satisfying.</p>\n<h2>Part 2: The 1st Law — Make It Obvious</h2>\n<p>Design your environment so good habits are the path of least resistance.</p>",
"key_insights": [
{
"title": "The 1% Rule",
"insight": "Getting 1% better every day compounds to being 37x better after one year.",
"example": "A cycling coach improved team performance through tiny gains: lighter seats, rubbing alcohol on tires, better sleep pillows — each 1% stacked into Tour de France wins."
},
{
"title": "Identity-Based Habits",
"insight": "Change your identity first — every action becomes a vote for the person you wish to become.",
"example": "Instead of 'I want to quit smoking', say 'I'm not a smoker'. The identity shift changes behavior automatically."
}
],
"actionable_takeaways": [
"Use habit stacking: 'After I [CURRENT HABIT], I will [NEW HABIT]'",
"Design your environment — put your book on the pillow, not the nightstand",
"Never miss twice — one slip is an accident, two is a new (bad) habit",
"Use the two-minute rule: scale any habit down to two minutes to start"
],
"notable_quotes": [
"You do not rise to the level of your goals. You fall to the level of your systems.",
"Every action you take is a vote for the type of person you wish to become.",
"Habits are the compound interest of self-improvement."
],
"who_should_read": "Anyone who wants to build better habits, break bad ones, or understand the science behind behavior change. Especially useful for entrepreneurs, athletes, and anyone working on long-term goals.",
"status": "published",
"difficulty_level": "beginner",
"page_count": 320,
"publication_year": 2018,
"amazon_link": "https://amzn.to/atomichabits",
"meta_title": "Atomic Habits Summary - Key Takeaways by James Clear",
"meta_description": "The key insights from Atomic Habits: how tiny 1% improvements compound into remarkable results.",
"image_prompt": "Abstract minimalist book cover art: a single glowing atom transforming into an unbreakable chain, deep navy blue background, gold and cream accents, clean geometric shapes, premium editorial illustration style, portrait orientation",
"translations": {
"vi": {
"title": "Thói Quen Nguyên Tử",
"big_idea": "Những thay đổi hành vi nhỏ tích lũy theo thời gian thành kết quả phi thường.",
"quick_summary": "James Clear lập luận rằng thói quen là lãi kép của việc tự phát triển.",
"summary_content": "<h2>Phần 1: Cơ Bản</h2><p>Clear giới thiệu <strong>Bốn Quy Luật Thay Đổi Hành Vi</strong>.</p>",
"who_should_read": "Bất kỳ ai muốn xây dựng thói quen tốt và loại bỏ thói quen xấu.",
"meta_title": "Tóm Tắt Thói Quen Nguyên Tử - FiveMinRead",
"meta_description": "Những ý chính từ cuốn Thói Quen Nguyên Tử của James Clear."
}
}
}
Article Management Endpoints
/api/v1/admin/articles/ can_readList all. Params: status, category, search
/api/v1/admin/articles/{id}/ can_read/api/v1/admin/articles/ can_writeCreate. Include image_prompt to auto-generate banner.
/api/v1/admin/articles/{id}/ can_writePartial update — send only the fields you want to change.
/api/v1/admin/articles/{id}/publish/ can_write/api/v1/admin/articles/{id}/unpublish/ can_write/api/v1/admin/articles/{id}/generate-image/ can_writeBody (optional): {"image_prompt": "..."} — overrides stored prompt and regenerates 4:3 banner.
/api/v1/admin/articles/{id}/ can_deleteBook Management Endpoints
/api/v1/admin/books/ can_read/api/v1/admin/books/ can_writeCreate. Include image_prompt to auto-generate 2:3 portrait cover.
/api/v1/admin/books/{id}/ can_write/api/v1/admin/books/{id}/publish/ can_write/api/v1/admin/books/{id}/unpublish/ can_write/api/v1/admin/books/{id}/generate-image/ can_writeBody (optional): {"image_prompt": "..."} — regenerates 2:3 portrait book cover.
/api/v1/admin/books/{id}/ can_deletePublic & Categories
/api/v1/admin/article-categories/ can_readLists article categories with their UUIDs — use category_ids when posting articles.
/api/v1/admin/book-categories/ can_readLists book categories with their UUIDs — use category_ids when posting books.
/api/v1/admin/stats/ can_readTotal books, articles, views, pending reviews.
/api/v1/books/?lang=vi publicPublic book list in specified language. Params: lang (en/vi/ja/id/fr), category, featured, search
/api/v1/admin/media/ can_writeUpload image. Multipart form: file, optional alt_text. Returns UUID for use as featured_image_id.
Response Codes
| Code | Meaning |
|---|---|
| 200 | OK — GET / PATCH success |
| 201 | Created — POST success. Body contains the new record. |
| 204 | No Content — DELETE success |
| 400 | Bad Request — validation error. Check response body for field errors. |
| 401 | Unauthorized — missing or invalid API key |
| 403 | Forbidden — API key lacks required permission |
| 404 | Not Found — resource does not exist |
Site Context
- Site: FiveMinRead — book summary platform. Author: Alex Ng.
- Languages: EN (default), VI
/vi/, JA/ja/, ID/id/, FR/fr/ - Slugs: Auto-generated from English title if not provided (lowercase, hyphenated).
- Author on API posts: Defaults to first superuser (Alex Ng).
- Status on create: Defaults to
draftunless you send"status": "published". - Reading time: Calculated automatically from content word count.
- Translations strategy: English first is fine — add translations via PATCH later. Missing languages fall back to English.