Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.mavera.io/llms.txt

Use this file to discover all available pages before exploring further.

Scenario

You just published a 1,200-word blog post about your product launch. Now marketing needs a LinkedIn ad, a Twitter thread, an email drip sequence, a product page summary, and social captions — all derived from the same core narrative. Writing each from scratch is slow and risks message drift. This playbook generates the long-form piece first, then feeds it as context into every subsequent generation app. Each downstream piece inherits the key messages, statistics, and examples from the original — adapted to the format’s constraints (character limits, visual hooks, CTA structure).
Mavera-only. No social scheduling platform, no CMS integration. This pipeline produces the content — you publish it wherever you want.

Architecture


What You Need

RequirementDetails
Mavera API keyStarts with mvra_live_. Get one at Developer Settings.
Workspace IDFrom your dashboard URL (ws_...).
Brand voice ID (optional)For consistent voice across all pieces. Create via Brand Voice.
Topic and key pointsThe subject matter for the source blog post.
Credits~150–350 total. See Credits Estimate.
Python 3.8+ or Node.js 18+requests + openai SDK for Python; native fetch for Node.
MAVERA_API_KEY=mvra_live_your_key_here
MAVERA_WORKSPACE_ID=ws_your_workspace_id
BRAND_VOICE_ID=bv_optional_voice_id

The Flow

1

Generate the source blog post

Use POST /generations with the blog_post_generator app. This produces the canonical long-form content that all downstream pieces will reference.
2

Define the repurposing plan

List the formats you need: LinkedIn ad, Twitter thread, email sequence, product page, social captions. Each maps to a generation app with format-specific input.
3

Generate each downstream piece

For each format, call POST /generations with the source blog post injected as additional_context. The generation app adapts the content to the format’s constraints.
4

Generate an executive summary

Use Chat to produce a 150-word executive summary from the blog post — useful for internal stakeholders, newsletters, or Slack announcements.
5

Export all pieces

Save each piece as a separate file. Include a manifest with source, derived pieces, credits, and word counts.

Stage 1 — Generate the Source Blog Post

import os
import time
import json
import requests

API_KEY = os.environ["MAVERA_API_KEY"]
WORKSPACE_ID = os.environ["MAVERA_WORKSPACE_ID"]
BRAND_VOICE_ID = os.environ.get("BRAND_VOICE_ID")
BASE = "https://app.mavera.io/api/v1"
HEADERS = {
    "Authorization": f"Bearer {API_KEY}",
    "Content-Type": "application/json",
}


def generate(app_id, title, input_data, brand_voice_id=None):
    """Run a generation app and wait for completion."""
    payload = {
        "app_id": app_id,
        "title": title,
        "input_data": input_data,
        "workspace_id": WORKSPACE_ID,
    }
    if brand_voice_id:
        payload["brand_voice_id"] = brand_voice_id

    resp = requests.post(f"{BASE}/generations", headers=HEADERS, json=payload)
    resp.raise_for_status()
    gen = resp.json()

    if gen.get("status") in ("PENDING", "RUNNING"):
        gen = wait_for_generation(gen["id"])

    return gen


def wait_for_generation(gen_id, max_wait=300):
    for _ in range(max_wait // 10):
        resp = requests.get(f"{BASE}/generations/{gen_id}", headers=HEADERS)
        data = resp.json()
        if data.get("status") == "COMPLETED":
            return data
        time.sleep(10)
    raise TimeoutError(f"Generation {gen_id} timed out")


SOURCE_TOPIC = {
    "topic": "How We Reduced Customer Onboarding Time by 70%",
    "target_audience": "SaaS product and growth leaders",
    "length": "1200 words",
    "key_points": [
        "The old onboarding flow took 14 days on average",
        "We identified 3 critical drop-off points with analytics",
        "The automation builder cut manual steps from 12 to 3",
        "Customer time-to-value went from 14 days to 4 days",
        "NPS improved from 32 to 58 in one quarter",
    ],
}

print("Generating source blog post...")
source = generate(
    app_id="blog_post_generator",
    title="Source: Onboarding Case Study",
    input_data=SOURCE_TOPIC,
    brand_voice_id=BRAND_VOICE_ID,
)
source_content = source.get("output", "")
source_credits = source.get("usage", {}).get("credits_used", 0)
print(f"  ✓ Source blog: {len(source_content.split())} words | {source_credits} credits")

Stage 2 — Define the Repurposing Plan

Each downstream piece receives the source blog as context. The generation app handles format adaptation — you provide format-specific instructions.
REPURPOSE_PLAN = [
    {
        "app_id": "linkedin_ad_generator",
        "title": "LinkedIn Ad — Onboarding Case Study",
        "input_data": {
            "product": "Automation Builder",
            "target_audience": "VP of Product and Growth at B2B SaaS companies",
            "value_proposition": "Cut onboarding time by 70% — from 14 days to 4",
            "cta": "See the full case study",
            "additional_context": f"Based on this blog post:\n\n{source_content}",
        },
        "format": "linkedin_ad",
    },
    {
        "app_id": "social_post_generator",
        "title": "Twitter Thread — Onboarding Story",
        "input_data": {
            "topic": "How we cut onboarding from 14 days to 4",
            "platform": "Twitter",
            "tone": "conversational, data-backed",
            "count": 7,
            "additional_context": (
                "Turn this blog post into a Twitter thread. "
                "Each tweet should be self-contained but build on the narrative. "
                "Use specific numbers from the post.\n\n"
                f"{source_content}"
            ),
        },
        "format": "twitter_thread",
    },
    {
        "app_id": "email_sequence_generator",
        "title": "Email Nurture — Onboarding Proof Points",
        "input_data": {
            "sequence_goal": "Educate prospects on onboarding automation",
            "emails_count": 3,
            "target_audience": "Marketing-qualified leads interested in onboarding solutions",
            "key_points": [
                "Email 1: The 14-day onboarding problem (pain point)",
                "Email 2: How automation cut it to 4 days (solution)",
                "Email 3: NPS impact and ROI (proof + CTA)",
            ],
            "additional_context": f"Draw all statistics and examples from this blog post:\n\n{source_content}",
        },
        "format": "email_sequence",
    },
    {
        "app_id": "product_description",
        "title": "Product Page — Automation Builder",
        "input_data": {
            "product_name": "Automation Builder",
            "features": [
                "Drag-and-drop workflow automation",
                "Reduce manual onboarding steps by 75%",
                "Built-in analytics for drop-off detection",
            ],
            "target_audience": "SaaS product teams",
            "tone": "clear, benefit-focused",
            "additional_context": f"Use the case study data as proof points:\n\n{source_content}",
        },
        "format": "product_page",
    },
    {
        "app_id": "social_post_generator",
        "title": "Social Captions — Onboarding Stats",
        "input_data": {
            "topic": "Customer onboarding success story",
            "platform": "Instagram",
            "tone": "celebratory, data-driven",
            "count": 5,
            "additional_context": (
                "Create Instagram captions highlighting key stats and outcomes "
                f"from this case study:\n\n{source_content[:1500]}"
            ),
        },
        "format": "social_captions",
    },
]

Stage 3 — Generate All Downstream Pieces

pieces = [
    {
        "format": "blog_post",
        "title": "Source: Onboarding Case Study",
        "output": source_content,
        "credits": source_credits,
    },
]
total_credits = source_credits

for item in REPURPOSE_PLAN:
    print(f"\nRepurposing → {item['format']}...")
    gen = generate(
        app_id=item["app_id"],
        title=item["title"],
        input_data=item["input_data"],
        brand_voice_id=BRAND_VOICE_ID,
    )

    credits = gen.get("usage", {}).get("credits_used", 0)
    total_credits += credits

    pieces.append({
        "format": item["format"],
        "title": item["title"],
        "output": gen.get("output", ""),
        "credits": credits,
    })

    word_count = len(gen.get("output", "").split())
    print(f"  ✓ {item['format']}: {word_count} words | {credits} credits")

print(f"\n{'='*50}")
print(f"Pipeline complete: {len(pieces)} pieces from 1 source | {total_credits} total credits")

Stage 4 — Executive Summary via Chat

Use Chat to generate a concise executive summary from the source blog. Useful for internal Slack posts, newsletter previews, or stakeholder updates.
from openai import OpenAI

mavera = OpenAI(api_key=API_KEY, base_url=BASE)

exec_resp = mavera.responses.create(
    model="mavera-1",
    input=[
        {
            "role": "user",
            "content": (
                "Write a 150-word executive summary of this blog post. "
                "Focus on the business impact and key metrics. "
                "Use bullet points for the 3 most important takeaways. "
                "End with a one-sentence recommendation.\n\n"
                f"{source_content}"
            ),
        },
    ],
)
exec_summary = exec_resp.output[0].content[0].text

pieces.append({
    "format": "executive_summary",
    "title": "Executive Summary",
    "output": exec_summary,
    "credits": 2,
})
total_credits += 2

print(f"\nExecutive summary ({len(exec_summary.split())} words):")
print(exec_summary)


Variations

Skip Stage 1 if you already have a published blog post. Load it from a file or your CMS API and use it directly as source_content for the repurposing loop.
Check GET /generation-apps for new templates (press releases, video scripts, podcast outlines) and append them to REPURPOSE_PLAN.
Map each downstream format to a different persona — LinkedIn ads for B2B decision makers, social captions for Gen Z consumers — so each piece speaks to its platform’s primary audience.
Score the source blog post with Chat + response_format before repurposing. If clarity, accuracy, or engagement scores fall below a threshold, iterate on the source first — repurposing weak content just multiplies the weakness.
All downstream pieces are independent — use asyncio.gather (Python) or Promise.all (JS) to run all 5 repurposing calls concurrently instead of sequentially.
After generating everything, feed all outputs into a single Chat call asking it to verify that key metrics (70% reduction, 14→4 days, NPS 32→58) appear consistently. Flag any contradictions or omissions.

Credits Estimate

OperationTypical CostNotes
Source blog post15–30 creditsLong-form generation
LinkedIn ad10–20 creditsShort-form
Twitter thread (7 tweets)10–20 creditsShort-form batch
Email nurture (3 emails)15–30 creditsMulti-part
Product description10–25 creditsMedium-form
Social captions (5 posts)10–20 creditsShort-form batch
Executive summary (Chat)1–5 creditsSingle chat call
Total (7 pieces)~70–150 creditsWithout brand voice creation
Total (with new brand voice)~120–200 creditsOne-time voice + all pieces
The repurposing pipeline is one of the highest-ROI workflows in Mavera. For ~100 credits you get 7 content pieces that would take a content team 2–3 days to produce manually. Run it every time you publish a blog post.

What’s Next

Brand Voice Content Library

Create a full content library with consistent brand voice

Content Series Generation

Turn the source blog into a multi-part series before repurposing

A/B Copy Production

Generate A/B variants of each repurposed piece

Content Localization

Localize the repurposed content for different markets

Content Generation

Full API reference for generation apps

Credits & Budget

Track and manage credit usage