Start here

Use ContentGenius from scripts, the CLI and AI agents.

The ContentGenius Public API (/api/v1, version 1.0.0) exposes the app's features over HTTP, for scripts, the cgenius CLI and AI agents. This site is written for both people and agents. An agent can read all of it as plain text at /documentation/llms.txt.

What exists today

PieceState
Public API65 Operations in this build. The API reference lists each one. The machine-readable contract is GET /api/v1/openapi.json.
Capability coverage65 of 150 app capabilities have an Operation; 80 are planned; 5 are excluded on purpose.
cgenius CLINot released yet. The command names are fixed; see CLI. Use HTTP until then.
Agent skillA SKILL.md for the v1 API: /documentation/skill.md. See Agent skill.

Workspaces. Operations that work on content (blogs, offers, ideas, Jobs) run in the caller's Workspace: one per LeadGenius company the user owns or belongs to, or a personal Workspace when they have none. GET /api/v1/me lists them; send X-Workspace-Id to pick one (default: the first). If LeadGenius cannot be reached, these Operations answer 503 upstream_unavailable; retry later. The reference marks each Operation that needs a Workspace.

Quick start (five calls)

  1. Get a token. In the app, open Settings → API Tokens → Create Token. Pick the Scopes and keep AI access on if the agent will generate content. Copy the cg_… token; it is shown once. (A CLI or agent can also use the login flow.)
  2. Configure.
export CGENIUS_API_URL="https://app.cgenius.app"
export CGENIUS_API_TOKEN="cg_…"   # never print or log it
  1. Check who you are.
curl -sS "$CGENIUS_API_URL/api/v1/me" -H "Authorization: Bearer $CGENIUS_API_TOKEN"

The answer names the owner, the token's Scopes, whether it has AI access, the Workspaces, the rate limits and the remaining credits.

  1. Start work. Generation is a Job: the call answers 202 with {job} and a Location header.
curl -sS -X POST "$CGENIUS_API_URL/api/v1/blogs/v3/pipelines" \
  -H "Authorization: Bearer $CGENIUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"requestData":{"topic":"How AI changes B2B sales","blogSize":"medium","tone":"professional"},
       "agentConfiguration":{"defaultAgentId":"<assistant id>"}}'
  1. Wait for the result. Read GET /api/v1/jobs/{jobId} every few seconds until status is COMPLETED, FAILED or CANCELLED. Reading also moves the Job forward, and Jobs started with an API token keep running on the server even when nobody reads them. A finished Job lists what it made in result.resources.

Rules for agents

  • Keep the token secret: never echo it, log it, write it to a file the user did not ask for, or put it in a URL.
  • Send an Idempotency-Key (a new UUID per intended action) on every call that starts a Job, so a retry after a network error does not start a second one.
  • Decide on error.code, not on the message. The codes table says what to do for each.
  • On 429, wait Retry-After seconds. Do not poll faster than every 2 seconds.
  • Ask the user before deleting, publishing, or anything that sends content outside the app.
  • Quote correlationId (also the X-Request-Id response header) when you report a failure.
  • Use only /api/v1. The app's own routes (/api/... outside /api/v1) check no Scope, so they refuse API tokens with limited Scopes (403) and can change without notice.

What an agent can do

GoalOperationsRecipe
Check the setup and find the agents to useme.get, assistants.listFind your agents
Write a blogblogs.v3.create (or v2, v1), then jobs.getWrite a blog
Ideas from the user's LeadGenius leadsleadApp.companies.list, ideation.leadIdeas.createIdeas from LeadGenius leads
Write and save a social post, then send it to Buffergenerate.socialPost, jobs.get, publish.bufferWrite a social post
Write an email, a presentation or a research reportgenerate.email, generate.presentation, generate.research, then jobs.getWrite a social post (same steps)
Make a video ad from an idea and post itgenerate.videoAd, generate.videoAd.get, publish.bufferMake a video ad
Size a social post for a channelsocial.channels.list, social.fitSize a social post
Find saved content and send it to the user's sitescontentItems.list, contentItems.get, integrationEndpoints.list, contentItems.sendSend content to your sites
Publish or schedule through Bufferconnections.buffer.channels, publish.bufferPublish through Buffer
Keep a generated imagemedia.generatedImages.import, media.images.getKeep a generated image
Generate an offergenerate.offerGenerate an offer
Check credits and buy more (pay as you go)billing.get, billing.checkout, billing.portalCredits and buying
Read or change preferencessettings.get, settings.updateSettings

The Agent skill page chains these into complete workflows.

All EpsimoAI product documentation: doc.epsimoai.com.

ProductDocumentationWhat ContentGenius uses it for
EpsimoAgentshttps://backend2.epsimoagents.com/guide/indexthe assistants (agents) that write ContentGenius content, projects, threads and credits
LeadGeniushttps://app.leadgenius.app/docs#/the companies and leads that lead ideas are written from; ContentGenius uses the same sign-in