Batch Posts

Batch post generation allows you to create multiple blog posts at once and schedule them to publish over time. This is perfect for content campaigns, maintaining consistent publishing schedules, or building up a content library. On this page, we'll explore how to create batches, monitor their progress, and manage scheduled posts.


POST/v1/posts/batch-generate

Create a batch

This endpoint allows you to create multiple posts with a publishing schedule. Posts are generated progressively and published according to your specified strategy.

Required attributes

  • Name
    schedule
    Type
    object
    Description

    Configuration for how posts should be scheduled.

    • Name
      strategy
      Type
      string
      Description

      Scheduling strategy: distribute (spread evenly) or burst (fixed rate).

    • Name
      startTime
      Type
      string
      Description

      ISO 8601 datetime when to start publishing posts.

  • Name
    posts
    Type
    array
    Description

    Array of posts to generate (maximum 100 per batch).

    • Name
      topic
      Type
      string
      Description

      The topic for the blog post.

Optional schedule attributes

  • Name
    endTime
    Type
    string
    Description

    ISO 8601 datetime when to end publishing (for distribute strategy).

  • Name
    postsPerHour
    Type
    number
    Description

    How many posts to publish per hour (for burst strategy).

Optional default attributes

  • Name
    defaults
    Type
    object
    Description

    Default values applied to all posts unless overridden.

    • Name
      authorId
      Type
      string
      Description

      Default author for posts.

    • Name
      category
      Type
      string
      Description

      Default category.

    • Name
      tags
      Type
      array
      Description

      Default tags array.

    • Name
      isDraft
      Type
      boolean
      Description

      Whether posts remain as drafts after generation.

    • Name
      style
      Type
      string
      Description

      Writing style (professional, casual, technical).

    • Name
      length
      Type
      string
      Description

      Post length (short, medium, long).

    • Name
      tone
      Type
      string
      Description

      Writing tone (informative, conversational, formal).

    • Name
      includeExamples
      Type
      boolean
      Description

      Whether to include examples.

    • Name
      targetAudience
      Type
      string
      Description

      Target audience description.

    • Name
      useKnowledge
      Type
      boolean
      Description

      Whether to use knowledge base.

    • Name
      selectedFileIds
      Type
      array
      Description

      Knowledge file IDs to reference.

    • Name
      model
      Type
      string
      Description

      AI model to use for generation.

Per-post attributes

Each post in the posts array can override any default value by including the same property.

Request

POST
/v1/posts/batch-generate
curl -X POST https://api.waldium.com/api/v1/posts/batch-generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "schedule": {
      "strategy": "distribute",
      "startTime": "2025-01-20T14:00:00Z",
      "endTime": "2025-01-20T19:00:00Z"
    },
    "defaults": {
      "category": "Technology",
      "tags": ["AI", "Tutorial"],
      "tone": "professional"
    },
    "posts": [
      { "topic": "Introduction to Machine Learning" },
      { "topic": "Understanding Neural Networks" },
      { "topic": "Natural Language Processing Basics" },
      { "topic": "Computer Vision Applications" },
      { "topic": "AI Ethics and Best Practices" }
    ]
  }'

Response

{
  "message": "Batch created successfully",
  "batch": {
    "id": "batch_abc123",
    "status": "pending",
    "totalPosts": 5,
    "scheduleStrategy": "distribute",
    "startTime": "2025-01-20T14:00:00Z",
    "endTime": "2025-01-20T19:00:00Z"
  },
  "scheduledPosts": [
    {
      "id": "sched_1",
      "topic": "Introduction to Machine Learning",
      "scheduledFor": "2025-01-20T14:00:00Z",
      "status": "pending"
    },
    {
      "id": "sched_2",
      "topic": "Understanding Neural Networks",
      "scheduledFor": "2025-01-20T15:00:00Z",
      "status": "pending"
    },
    {
      "id": "sched_3",
      "topic": "Natural Language Processing Basics",
      "scheduledFor": "2025-01-20T16:00:00Z",
      "status": "pending"
    },
    {
      "id": "sched_4",
      "topic": "Computer Vision Applications",
      "scheduledFor": "2025-01-20T17:00:00Z",
      "status": "pending"
    },
    {
      "id": "sched_5",
      "topic": "AI Ethics and Best Practices",
      "scheduledFor": "2025-01-20T18:00:00Z",
      "status": "pending"
    }
  ],
  "site": {
    "id": "site_123",
    "name": "Your Site Name"
  }
}

Scheduling strategies

Understanding the two scheduling strategies helps you choose the right approach for your content campaign.

Distribute strategy

The distribute strategy spreads posts evenly across a time window. This is ideal for maintaining consistent content flow throughout a period.

How it works:

  • Calculates even intervals between start and end times
  • Spaces posts equally throughout the window
  • Adapts to any time range

Best for:

  • Daily content distribution
  • Maintaining steady engagement
  • Content marketing campaigns
  • SEO consistency

Example: 10 posts over 5 hours

{
  "schedule": {
    "strategy": "distribute",
    "startTime": "2025-01-20T09:00:00Z",
    "endTime": "2025-01-20T14:00:00Z"
  }
}
// Posts at: 9:00, 9:33, 10:06, 10:40, 11:13, 11:46, 12:20, 12:53, 13:26, 14:00

Burst strategy

The burst strategy publishes posts at a fixed rate from the start time. This is perfect for content drops or rapid publishing.

How it works:

  • Publishes at a consistent rate (posts per hour)
  • Starts from the specified time
  • Continues until all posts are scheduled

Best for:

  • Content series launches
  • Event coverage
  • Topic saturation for SEO
  • News or time-sensitive content

Example: 20 posts at 10/hour

{
  "schedule": {
    "strategy": "burst",
    "startTime": "2025-01-20T09:00:00Z",
    "postsPerHour": 10
  }
}
// Posts every 6 minutes starting at 9:00

GET/v1/batches/:id

Check batch status

Monitor the progress of your batch generation and publishing. This endpoint provides detailed status information about posts in various stages.

Status values

  • Name
    pending
    Type
    string
    Description

    Posts waiting to be processed.

  • Name
    generating
    Type
    string
    Description

    Posts currently being generated.

  • Name
    generated
    Type
    string
    Description

    Posts generated and waiting to publish.

  • Name
    publishing
    Type
    string
    Description

    Posts currently being published.

  • Name
    published
    Type
    string
    Description

    Successfully published posts.

  • Name
    failed
    Type
    string
    Description

    Posts that failed to generate or publish.

Request

GET
/v1/batches/:id
curl -X GET https://api.waldium.com/api/v1/batches/batch_abc123 \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "id": "batch_abc123",
  "status": "processing",
  "progress": {
    "total": 20,
    "pending": 8,
    "generating": 2,
    "generated": 4,
    "publishing": 1,
    "published": 5,
    "failed": 0
  },
  "nextPublishTime": "2025-01-20T15:30:00Z",
  "createdAt": "2025-01-20T09:00:00Z",
  "updatedAt": "2025-01-20T14:25:00Z"
}

DELETE/v1/batches/:id

Cancel a batch

Cancel a batch to stop processing any remaining posts. This will prevent pending posts from being generated or published, but won't affect posts that have already been published.

What happens when you cancel

  • Pending posts are marked as failed
  • Currently generating posts may complete
  • Published posts remain published
  • The batch status changes to failed

Request

DELETE
/v1/batches/:id
curl -X DELETE https://api.waldium.com/api/v1/batches/batch_abc123 \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "message": "Batch cancelled successfully",
  "cancelledPosts": 15
}

Processing timeline

Understanding how batch processing works helps you plan your content campaigns effectively.

Posts are processed by an hourly job that generates content 2 hours in advance and publishes posts when they're due. This means posts may publish within the hour of their scheduled time, not exactly at the scheduled minute.

Example timeline

For a batch created at 9:00 AM with 20 posts distributed over 4 hours:

  1. 9:00 AM - Batch created, first cron run

    • Generates posts scheduled for 9:00-11:00 AM
    • Publishes any due immediately
  2. 10:00 AM - Second cron run

    • Generates posts scheduled for 11:00-12:00 PM
    • Publishes posts due by 10:00 AM
  3. 11:00 AM - Third cron run

    • Generates posts scheduled for 12:00-1:00 PM
    • Publishes posts due by 11:00 AM
  4. 12:00 PM - Fourth cron run

    • All posts already generated
    • Publishes remaining posts

Best practices

  • Schedule on the hour for most predictable publishing times
  • Use 2+ hour lead time to ensure smooth generation
  • Monitor batch status to track progress
  • Set reasonable rates to avoid overwhelming your audience
  • Use defaults to maintain consistency across posts

Was this page helpful?