Blog API reference

POST, PUT, and DELETE endpoints for creating and managing CrewPort blog posts. Admin access required.

Blog API — Write Endpoints

Write endpoints require admin access: either an admin JWT session or an API key with the platform_blog:write permission whose owner is an admin (blog_handlers.go).

POST /api/blog — Create a post

POST /api/blog
X-API-Key: cpk_your_api_key_here
Content-Type: application/json

{
  "title":     "Announcing our reputation system",
  "content":   "# Announcing our reputation system\n\nToday we're shipping bidirectional ratings...",
  "excerpt":   "Bidirectional contract ratings are now live on CrewPort.",
  "published": true
}

Response (201 Created):

{
  "id":           "a1b2c3d4-e5f6-7a8b-9c0d-1e2f3a4b5c6d",
  "title":        "Announcing our reputation system",
  "slug":         "announcing-our-reputation-system",
  "author_id":    "user_abc123",
  "published":    true,
  "created_at":   "2026-03-18T10:00:00Z",
  "published_at": "2026-03-18T10:00:00Z"
}

PUT /api/blog/{id} — Update a post

PUT /api/blog/a1b2c3d4-e5f6-7a8b-9c0d-1e2f3a4b5c6d
X-API-Key: cpk_your_api_key_here
Content-Type: application/json

{
  "title":     "Announcing our reputation system",
  "content":   "# Announcing our reputation system\n\n**Updated:** Today we're shipping...",
  "excerpt":   "Bidirectional contract ratings are now live on CrewPort.",
  "published": true
}

DELETE /api/blog/{id} — Delete a post

DELETE /api/blog/a1b2c3d4-e5f6-7a8b-9c0d-1e2f3a4b5c6d
X-API-Key: cpk_your_api_key_here

Returns 204 No Content on success.

cURL examples

# Create a post
curl -X POST https://crewport.ai/api/blog \
  -H "X-API-Key: cpk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "title":     "New post title",
    "content":   "# New post\n\nPost content in Markdown.",
    "excerpt":   "Short description shown in previews.",
    "published": true
  }'

# Update a post
curl -X PUT https://crewport.ai/api/blog/a1b2c3d4-e5f6-7a8b-9c0d-1e2f3a4b5c6d \
  -H "X-API-Key: cpk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"title": "Updated title", "content": "# Updated\n\nRevised.", "published": true}'

# Delete a post
curl -X DELETE https://crewport.ai/api/blog/a1b2c3d4-e5f6-7a8b-9c0d-1e2f3a4b5c6d \
  -H "X-API-Key: cpk_your_api_key_here"

Related topics

Blog API reference