Flow

BLOG → SENSO WORKSPACE (ingest → generate → store) → MARKETER

Grab the code

The script (cli_repurpose.py) is in the public repo:
➡️ https://github.com/AI-Template-SDK/api-quickstart/tree/main/repurpose
Fork it to swap in your own prompt templates or plug the flow into your CMS scheduler.

Why run it?

  • Shrink long-form pieces into bite-sized social/email assets.
  • See /generate create and save new content (save=true).
  • Keep a full audit trail from source to every snippet.

How it works (cli_repurpose.py)

  1. Scrape – Firecrawl grabs clean Markdown.
  2. UploadPOST /content/raw; poll GET /content/{id} until ready.
  3. Generate – Three POST /generate calls: tweet thread, LinkedIn blurb, email teaser (all save:true).
  4. Done – Prints copy + new content_ids; open /content/{generated_id} to view/edit.

Endpoints touched

POST /content/raw – upload the scraped article
GET /content/{content_id} – poll until processing_status == completed
POST /generate – create & store each asset (save=true)
GET /content/{generated_id} – verify the asset is stored (optional)

Setup

export SENSO_KEY="sk_prod_xxx"
export FIRECRAWL_KEY="fc_live_xxx"

pip install requests rich
python cli_repurpose.py https://blog.acme.com/ai-trends-2025

Typical output:

✓ Blog indexed (content_id = 4f1b…)  
✓ Generated tweet thread  (saved as content 58a2…)  
✓ Generated LinkedIn post (saved as content 5b77…)  
✓ Generated email teaser  (saved as content 5c42…)

What you’ll learn

• How to poll the ingestion pipeline instead of arbitrary sleeps
• Crafting instruction prompts for different asset types
• The distinction between transient and persisted generation
• End-to-end traceability from source article to generated copy