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/articlesCreate 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 / titleEnChinese/English titles
  • slugURL identifier (unique)
  • categoryCategory (news/industry)
  • contentZh / contentEnChinese/English content
  • excerptZh / excerptEnChinese/English excerpts
  • coverImageCover image URL
  • tagsTags array
  • publishedWhether published