Skip to Content
API ReferenceAI Generation

AI Generation

VoxBurst provides a set of AI endpoints for generating and improving post content. The main endpoint most developers use is POST /v1/ai/generate-post-content, which produces voice-consistent post text from a persona prompt. Bulk generation jobs let you schedule up to 50 posts in a single API call.

Base URL

https://api.voxburst.io/v1

Credits

AI features that consume cloud model calls use a credit balance tied to your AI subscription.

ActionCost
Content enhancement (enhance-content, generate-post-content, build-image-prompt)1 credit
Hashtag suggestion1 credit
Bulk enhancement (per item in the batch)1 credit
Best time analysis1 credit
Thread creation2 credits
Image generation (flat rate regardless of size or style)5 credits
  • Credits are deducted when generation completes successfully. Failed generations are not charged.
  • For bulk jobs, credits are reserved up front when the job is submitted and refunded for any posts that are skipped or fail.
  • Use POST /v1/bulk-generate/validate to check your balance before submitting a job.

The POST /v1/ai/enhance endpoint uses your workspace-configured AI key and does not consume VoxBurst credits.


Generate Post Content

POST /v1/ai/generate-post-content

Generates post text from an assembled persona prompt. This is the primary generation endpoint — the Personas API POST /v1/personas/:id/runtime/assemble endpoint produces the systemPrompt and userPrompt values required here.

Consumes: 1 credit

Requires: AI access on your plan (Starter or higher, or an active AI add-on subscription)

Request body:

FieldTypeRequiredDescription
systemPromptstringYesAssembled persona system prompt (max 100,000 chars)
userPromptstringYesGeneration instruction (max 50,000 chars)
topicstringNoTopic hint (max 500 chars)
platformstringNoTarget platform — enforces platform character limits
previousPostsInBatchstring[]NoPosts already generated in this session (max 30) — improves content diversity
batchIndexintegerNo0-based index of this post within a batch
batchSizeintegerNoTotal posts in the batch

If platform is set and the generated text exceeds that platform’s character limit, the output is truncated at the last sentence or word boundary and truncated: true is returned.

curl -X POST https://api.voxburst.io/v1/ai/generate-post-content \ -H "Authorization: Bearer vb_live_xxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "systemPrompt": "<assembled persona system prompt>", "userPrompt": "Write a post about our new product launch.", "platform": "linkedin" }'

Response (200):

{ "content": "Excited to announce our latest product...", "provider": "anthropic", "model": "claude-3-5-sonnet", "truncated": false }

Typical Integration Pattern

// 1. Assemble the persona prompt const assembled = await fetch( `https://api.voxburst.io/v1/personas/${personaId}/runtime/assemble`, { method: 'POST', headers: { 'Authorization': 'Bearer vb_live_xxxxxxxxxxxxx', 'Content-Type': 'application/json', }, body: JSON.stringify({ platform: 'linkedin', generationType: 'POST_GENERATION', ideaInput: 'quarterly sustainability report results', }), } ).then(r => r.json()) // 2. Generate post content const generated = await fetch( 'https://api.voxburst.io/v1/ai/generate-post-content', { method: 'POST', headers: { 'Authorization': 'Bearer vb_live_xxxxxxxxxxxxx', 'Content-Type': 'application/json', }, body: JSON.stringify({ systemPrompt: assembled.systemPrompt, userPrompt: assembled.userPrompt, platform: 'linkedin', }), } ).then(r => r.json()) console.log(generated.content)

Enhance Content

POST /v1/ai/enhance-content

Enhances existing text using AI add-on credits. Supports optional persona context to stay on-brand.

Consumes: 1 credit

Requires: AI access on your plan (Starter or higher, or an active AI add-on subscription)

Request body:

FieldTypeRequiredDescription
textstringYesContent to enhance (1–10,000 chars)
tonestringNoDesired tone
platformstringNoTarget platform
personaobjectNo{ name, voice, bio } persona context
curl -X POST https://api.voxburst.io/v1/ai/enhance-content \ -H "Authorization: Bearer vb_live_xxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "text": "We launched something new today.", "tone": "enthusiastic", "platform": "twitter" }'

Response (200):

{ "enhanced": "Big news — we just launched something new today! 🚀", "provider": "anthropic", "model": "claude-3-5-sonnet", "credits_used": 1, "credits_remaining": 149 }

Error (402/403): AI_SUBSCRIPTION — no active subscription or credits exhausted.


Enhance Post (Workspace AI)

POST /v1/ai/enhance

Enhances post content using your workspace-configured AI key (set in workspace AI settings). Does not consume VoxBurst credits.

Requires: AI access on your plan (Starter or higher, or an active AI add-on subscription)

Request body:

FieldTypeRequiredDescription
contentstringYesOriginal post text (1–10,000 chars)
platformstringNoTarget platform
stylestringNoprofessional, casual, engaging, formal, or humorous
tonestringNoFree-form tone descriptor (max 200 chars)
maxLengthintegerNoTarget character limit override

Response (200):

{ "original": "raw text", "enhanced": "improved text", "suggestions": ["..."], "changes": ["Added emojis", "Shortened sentences"], "platform": "instagram" }

Generate Hashtags

POST /v1/ai/hashtags

Generates relevant hashtags for post content.

Consumes: 1 credit

Requires: AI access on your plan (Starter or higher, or an active AI add-on subscription)

Request body:

FieldTypeRequiredDescription
contentstringYesPost text
platformstringNoTarget platform
platformsstring[]NoAlternative to platform; first entry is used
curl -X POST https://api.voxburst.io/v1/ai/hashtags \ -H "Authorization: Bearer vb_live_xxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "content": "Just published our 2026 sustainability report.", "platform": "linkedin" }'

Response (200):

{ "hashtags": ["#sustainability", "#ESG", "#corporateresponsibility"], "relevanceScores": { "#sustainability": 0.95, "#ESG": 0.91 }, "suggestions": [ { "tag": "sustainability", "relevance": 0.95, "trending": false } ] }

Best Post Time Heatmap

POST /v1/ai/best-time

Returns a 7×24 engagement heatmap and a concrete posting time recommendation. Results are based on evidence-based engagement weights per platform.

Consumes: 1 credit

Requires: AI access on your plan (Starter or higher, or an active AI add-on subscription)

Request body:

{ "platforms": ["twitter", "linkedin"] }

Response (200):

{ "heatmap": [ { "day": 0, "hour": 0, "score": 20 }, { "day": 2, "hour": 9, "score": 80 } ], "recommendation": { "date": "2026-04-29", "time": "09:00", "dayName": "Tuesday", "engagement": "high", "reason": "Tuesdays at 9am consistently show the highest engagement window for LinkedIn." } }

score is 0–100. day is 0 (Sunday) through 6 (Saturday). engagement is "high" (score ≥ 75), "medium" (≥ 50), or "low".


Suggest Posting Time (Account-Based)

GET /v1/ai/suggest-time/:accountId

Suggests an optimal posting time for a specific connected account based on historical engagement data.

curl https://api.voxburst.io/v1/ai/suggest-time/acc_abc123 \ -H "Authorization: Bearer vb_live_xxxxxxxxxxxxx"

Response (200):

{ "accountId": "acc_abc123", "platform": "twitter", "suggestedTime": "2026-04-29T09:00:00Z", "timezone": "America/Chicago", "confidence": 0.82, "reasoning": "Your audience is most active on Tuesday mornings.", "alternatives": [{ "time": "2026-04-30T14:00:00Z", "score": 0.74 }] }

Check AI Status

GET /v1/ai/status

Returns the workspace AI configuration state (provider, model, and whether it is enabled).

Response (200):

{ "configured": true, "enabled": true, "provider": "anthropic", "model": "claude-3-5-sonnet", "lastUpdated": "2026-04-10T08:00:00Z" }

Bulk Generation

The bulk generation API creates a background job that sequentially generates posts for a set of scheduled dates. Each job:

  1. Validates and reserves credits up front.
  2. Assembles the persona prompt from the specified personaId.
  3. Generates post text (and optionally images) for each scheduled date.
  4. Creates scheduled Post records in your workspace.
  5. Consumes credits per completed post and refunds credits for failures.

Job Lifecycle

QUEUED → PROCESSING → COMPLETED PAUSED (insufficient credits mid-run) PROCESSING (after resume) CANCELLED (user cancel) / FAILED (unrecoverable error)

Validate Credit Balance

POST /v1/bulk-generate/validate

Pre-flight check — does not create a job or reserve credits.

Request body:

FieldTypeRequiredDescription
accountIdstringYesConnected account ID
totalPostsintegerYes1–50
creditsPerPostintegerNoDefault: 1 (text only). Pass 6 when generateImages: true (1 text + 5 image).

Response (200):

{ "valid": true, "error": null, "creditBalance": 200, "estimatedCredits": 20 }

When the balance is insufficient:

{ "valid": false, "error": "Insufficient credits", "creditBalance": 5, "estimatedCredits": 20 }

Submit Bulk Generation Job

POST /v1/bulk-generate

Requires: Bulk scheduling feature (Starter plan or higher)

Creates a job and reserves credits. Returns immediately with QUEUED status.

Request body:

FieldTypeRequiredDescription
accountIdstringYesConnected account ID
platformstringYesTarget platform
totalPostsintegerYes1–50
scheduledDatesISO datetime[]YesMust match totalPosts length
personaIdstringNoPersona to apply for voice and style
topicHintstringNoTopic guidance (max 500 chars)
generateImagesbooleanNoAlso generate an AI image per post (default: false)
creditsPerPostintegerNoDefault: 1 (text only). Pass 6 when generateImages: true (1 text + 5 image).
curl -X POST https://api.voxburst.io/v1/bulk-generate \ -H "Authorization: Bearer vb_live_xxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "accountId": "acc_abc123", "personaId": "pp_xyz456", "platform": "linkedin", "totalPosts": 5, "scheduledDates": [ "2026-04-28T09:00:00Z", "2026-04-29T09:00:00Z", "2026-04-30T09:00:00Z", "2026-05-01T09:00:00Z", "2026-05-02T09:00:00Z" ], "topicHint": "product updates and sustainability" }'

Response (201):

{ "jobId": "bgjob_abc123", "status": "QUEUED", "message": "Bulk generation job created successfully" }

Error (402): INSUFFICIENT_CREDITS:

{ "error": { "code": "INSUFFICIENT_CREDITS", "message": "Insufficient credits: need 20, have 5 usable", "required": 20, "available": 5 } }

Poll Job Status

GET /v1/bulk-generate/:jobId

Poll for completion. Recommended polling interval: 2–5 seconds.

Response (200):

{ "job": { "id": "bgjob_abc123", "status": "PROCESSING", "totalPosts": 10, "completedPosts": 4, "failedPosts": 0, "skippedPosts": 0, "credits": { "reserved": 20, "consumed": 8, "refunded": 0, "remaining": 12 }, "progress": { "percentage": 40, "current": 4, "total": 10 }, "posts": [ { "id": "post_abc", "status": "SCHEDULED", "scheduledFor": "2026-04-28T09:00:00Z" } ], "queuedAt": "2026-04-23T12:00:00Z", "startedAt": "2026-04-23T12:00:05Z", "completedAt": null } }

Cancel Job

POST /v1/bulk-generate/:jobId/cancel

Cancels a QUEUED or PROCESSING job and refunds all remaining reserved credits.

Response (200):

{ "jobId": "bgjob_abc123", "status": "CANCELLED", "message": "Job cancelled and credits refunded." }

Resume Job

POST /v1/bulk-generate/:jobId/resume

Resumes a PAUSED job. A job is paused automatically when credits run out mid-run. Top up your credit balance before calling this endpoint.

Response (200):

{ "jobId": "bgjob_abc123", "status": "PROCESSING", "message": "Job resumed." }

Error (402): INSUFFICIENT_CREDITS if the balance is still too low.

List Jobs

GET /v1/bulk-generate

Returns the 20 most recent bulk generation jobs for the workspace.

Response (200):

{ "jobs": [ { "id": "bgjob_abc123", "status": "COMPLETED", "totalPosts": 10, "completedPosts": 10, "failedPosts": 0, "progress": { "percentage": 100, "current": 10, "total": 10 }, "credits": { "reserved": 20, "consumed": 20 }, "createdAt": "2026-04-23T12:00:00Z", "completedAt": "2026-04-23T12:04:30Z" } ] }

Error Codes

CodeHTTPDescription
AI_SUBSCRIPTION402/403No active AI subscription or credit balance exhausted
INSUFFICIENT_CREDITS402Not enough credits for the requested job; includes required and available counts
AI_RESPONSE_INCOMPLETE400AI response was truncated or could not be parsed
NOT_FOUND404Job ID not found or does not belong to this workspace
Last updated on