Agent API Portal

Agent API Port Enabled

External agents can manage articles, page content and system settings via API. All write operations require API Key authentication.

API Endpoints

Article Management

  • POST /api/agent/articles — Create article
  • PUT /api/agent/articles/[slug] — Update article
  • DELETE /api/agent/articles/[slug] — Delete article

Page Content

  • POST /api/agent/page/[pageKey] — Update page content

System Settings

  • PUT /api/agent/settings/[key] — Update settings

Authentication

All write operations require API Key in request header:

x-api-key: your_agent_api_key

Request Examples

// Create article
POST /api/agent/articles
Headers: x-api-key: fundao_agent_xxx
Body: {
  "titleZh": "Article Title ZH",
  "titleEn": "Article Title EN",
  "slug": "article-slug",
  "category": "news",
  "contentZh": "Chinese content",
  "contentEn": "English content",
  "published": true
}

// Update page content
POST /api/agent/page/home
Headers: x-api-key: fundao_agent_xxx
Body: {
  "lang": "zh",
  "content": {
    "hero": {
      "title": "New Title",
      "subtitle": "New Subtitle"
    }
  }
}

Data Model

Article

  • titleZh / titleEn — Chinese/English titles
  • slug — URL identifier (unique)
  • category — Category (news/industry)
  • contentZh / contentEn — Chinese/English content
  • excerptZh / excerptEn — Chinese/English excerpts
  • coverImage — Cover image URL
  • tags — Tags array
  • published — Whether published