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
| Piece | State |
|---|---|
| Public API | 65 Operations in this build. The API reference lists each one. The machine-readable contract is GET /api/v1/openapi.json. |
| Capability coverage | 65 of 150 app capabilities have an Operation; 80 are planned; 5 are excluded on purpose. |
cgenius CLI | Not released yet. The command names are fixed; see CLI. Use HTTP until then. |
| Agent skill | A 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/melists them; sendX-Workspace-Idto pick one (default: the first). If LeadGenius cannot be reached, these Operations answer503 upstream_unavailable; retry later. The reference marks each Operation that needs a Workspace.
Quick start (five calls)
- 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.) - Configure.
export CGENIUS_API_URL="https://app.cgenius.app"
export CGENIUS_API_TOKEN="cg_…" # never print or log it
- 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.
- Start work. Generation is a Job: the call answers
202with{job}and aLocationheader.
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>"}}'
- Wait for the result. Read
GET /api/v1/jobs/{jobId}every few seconds untilstatusisCOMPLETED,FAILEDorCANCELLED. 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 inresult.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, waitRetry-Afterseconds. 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 theX-Request-Idresponse 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
| Goal | Operations | Recipe |
|---|---|---|
| Check the setup and find the agents to use | me.get, assistants.list | Find your agents |
| Write a blog | blogs.v3.create (or v2, v1), then jobs.get | Write a blog |
| Ideas from the user's LeadGenius leads | leadApp.companies.list, ideation.leadIdeas.create | Ideas from LeadGenius leads |
| Write and save a social post, then send it to Buffer | generate.socialPost, jobs.get, publish.buffer | Write a social post |
| Write an email, a presentation or a research report | generate.email, generate.presentation, generate.research, then jobs.get | Write a social post (same steps) |
| Make a video ad from an idea and post it | generate.videoAd, generate.videoAd.get, publish.buffer | Make a video ad |
| Size a social post for a channel | social.channels.list, social.fit | Size a social post |
| Find saved content and send it to the user's sites | contentItems.list, contentItems.get, integrationEndpoints.list, contentItems.send | Send content to your sites |
| Publish or schedule through Buffer | connections.buffer.channels, publish.buffer | Publish through Buffer |
| Keep a generated image | media.generatedImages.import, media.images.get | Keep a generated image |
| Generate an offer | generate.offer | Generate an offer |
| Check credits and buy more (pay as you go) | billing.get, billing.checkout, billing.portal | Credits and buying |
| Read or change preferences | settings.get, settings.update | Settings |
The Agent skill page chains these into complete workflows.
Related documentation
All EpsimoAI product documentation: doc.epsimoai.com.
| Product | Documentation | What ContentGenius uses it for |
|---|---|---|
| EpsimoAgents | https://backend2.epsimoagents.com/guide/index | the assistants (agents) that write ContentGenius content, projects, threads and credits |
| LeadGenius | https://app.leadgenius.app/docs#/ | the companies and leads that lead ideas are written from; ContentGenius uses the same sign-in |