Content Blocks API

API reference for content blocks. Create typed newsletter sections (CEO updates, team spotlights, event announcements), use AI drafting, and manage content status.

Content blocks are the building blocks of newsletters. Each block has a type, title, rich text body, and status.

Block types

Type Description
general General update or announcement
ceo_update Message from leadership
team_spotlight Highlight a team or individual
new_starter Welcome a new team member
policy_change Policy or process update
event_announcement Upcoming event details
wins_milestones Celebrate achievements
poll Employee poll or survey
learning_development Training or development opportunity

Block sources

Every block tracks where it came from:

Source Description
manual Created by a user in the UI
submission Submitted via a public submission form
ai_draft Generated by AI
agent Created by an API agent
webhook Pushed via the webhook ingest endpoint

List content blocks

GET /api/v1/content_blocks
Parameter Type Description
block_type string Filter by type
status string Filter: draft, ready, used
source string Filter: manual, submission, ai_draft, agent, webhook
page integer Page number
per_page integer Items per page

Create a content block

POST /api/v1/content_blocks
Field Type Required Description
title string Yes Block title
body string Yes HTML or plain text content
block_type string No Default: general
status string No draft or ready (default: draft)
image_size string No small, medium, or full_width
event_slug string No Associate with an event

Blocks created via the API are automatically tagged with source: "agent".

AI draft generation

POST /api/v1/content_blocks/ai_draft
Field Type Required Description
context string Yes Prompt describing what to write

The AI generates a complete content block with an appropriate type, title, and formatted body. The block is saved to your content library as a draft.

curl -X POST https://your-app.com/api/v1/content_blocks/ai_draft \\
  -H "Authorization: Bearer inl_your_key" \\
  -H "Content-Type: application/json" \\
  -d '{"context": "Write a wins and milestones block celebrating the sales team closing 50 deals in March"}'

Note: AI drafts count against your plan's monthly generation limit. Check GET /api/v1/team for current usage.

Update a content block

PATCH /api/v1/content_blocks/:id

Delete a content block

DELETE /api/v1/content_blocks/:id