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/v1Credits
AI features that consume cloud model calls use a credit balance tied to your AI subscription.
| Action | Cost |
|---|---|
Content enhancement (enhance-content, generate-post-content, build-image-prompt) | 1 credit |
| Hashtag suggestion | 1 credit |
| Bulk enhancement (per item in the batch) | 1 credit |
| Best time analysis | 1 credit |
| Thread creation | 2 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/validateto 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:
| Field | Type | Required | Description |
|---|---|---|---|
systemPrompt | string | Yes | Assembled persona system prompt (max 100,000 chars) |
userPrompt | string | Yes | Generation instruction (max 50,000 chars) |
topic | string | No | Topic hint (max 500 chars) |
platform | string | No | Target platform — enforces platform character limits |
previousPostsInBatch | string[] | No | Posts already generated in this session (max 30) — improves content diversity |
batchIndex | integer | No | 0-based index of this post within a batch |
batchSize | integer | No | Total 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:
| Field | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Content to enhance (1–10,000 chars) |
tone | string | No | Desired tone |
platform | string | No | Target platform |
persona | object | No | { 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:
| Field | Type | Required | Description |
|---|---|---|---|
content | string | Yes | Original post text (1–10,000 chars) |
platform | string | No | Target platform |
style | string | No | professional, casual, engaging, formal, or humorous |
tone | string | No | Free-form tone descriptor (max 200 chars) |
maxLength | integer | No | Target 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:
| Field | Type | Required | Description |
|---|---|---|---|
content | string | Yes | Post text |
platform | string | No | Target platform |
platforms | string[] | No | Alternative 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:
- Validates and reserves credits up front.
- Assembles the persona prompt from the specified
personaId. - Generates post text (and optionally images) for each scheduled date.
- Creates scheduled
Postrecords in your workspace. - 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:
| Field | Type | Required | Description |
|---|---|---|---|
accountId | string | Yes | Connected account ID |
totalPosts | integer | Yes | 1–50 |
creditsPerPost | integer | No | Default: 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:
| Field | Type | Required | Description |
|---|---|---|---|
accountId | string | Yes | Connected account ID |
platform | string | Yes | Target platform |
totalPosts | integer | Yes | 1–50 |
scheduledDates | ISO datetime[] | Yes | Must match totalPosts length |
personaId | string | No | Persona to apply for voice and style |
topicHint | string | No | Topic guidance (max 500 chars) |
generateImages | boolean | No | Also generate an AI image per post (default: false) |
creditsPerPost | integer | No | Default: 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
| Code | HTTP | Description |
|---|---|---|
AI_SUBSCRIPTION | 402/403 | No active AI subscription or credit balance exhausted |
INSUFFICIENT_CREDITS | 402 | Not enough credits for the requested job; includes required and available counts |
AI_RESPONSE_INCOMPLETE | 400 | AI response was truncated or could not be parsed |
NOT_FOUND | 404 | Job ID not found or does not belong to this workspace |