---
name: cgenius
description: Create and publish ContentGenius content through its Public API (v1): content ideas from the user's LeadGenius leads, blogs (v1, v2, v3 engines) and their sections, offers, social posts sized for each channel (LinkedIn, X, Facebook, Instagram, Threads) with an optional illustration, emails, presentations, cited web research reports, short video ads rendered from the user's ideas in social formats, the saved content and its sends to the user's own sites, Buffer publishing and scheduling (with threads), generated images, settings, and the resulting Jobs. Use when the user asks to produce, size, schedule or publish marketing content, blogs, social posts, emails, presentations, research reports, video ads, offers or content ideas with ContentGenius, or to check ContentGenius content, jobs, tokens or credits.
---

# ContentGenius (Public API v1.0.0)

ContentGenius is a content platform. This skill drives it over HTTP with an API token. Full reference: https://app.cgenius.app/documentation (plain text: https://app.cgenius.app/documentation/llms.txt; contract: https://app.cgenius.app/api/v1/openapi.json). All EpsimoAI product docs: https://doc.epsimoai.com/ (EpsimoAgents: https://backend2.epsimoagents.com/guide/index; LeadGenius: https://app.leadgenius.app/docs#/).

## Setup

The user provides, in the environment (never in the chat):

- `CGENIUS_API_URL`: `https://app.cgenius.app` unless told otherwise
- `CGENIUS_API_TOKEN`: a `cg_…` token from Settings → API Tokens, with the Scopes the task needs and AI access for generation

Never print, log or store the token anywhere else. Send it as `Authorization: Bearer $CGENIUS_API_TOKEN`.

## Before the first task

Call `GET $CGENIUS_API_URL/api/v1/me`. Check:

- `token.scopes` covers the task (Scopes: `content:read`, `content:write`, `publish:read`, `publish:write`, `connections:manage`, `media:read`, `media:write`, `settings:read`, `settings:write`, `jobs:read`, `jobs:write`, `tokens:manage`, `maintenance:read`, `maintenance:write`; starting a Job needs the write Scope plus `jobs:write`);
- `token.aiAccess` is `active` for generation (otherwise ask the user for a token with AI access);
- `credits` is not exhausted (`GET /api/v1/billing` gives `creditsLeft`; a research report needs about 7, a video ad in two formats 3, a post 1);
- `workspaces`: the user's LeadGenius companies (or a personal Workspace). Send `X-Workspace-Id` only when the user names another one than the first.

Then `GET $CGENIUS_API_URL/api/v1/assistants` lists the agents a generation can use (`assistant_id`, `name`).

## Main Operations

| Call | Does | Scopes |
|---|---|---|
| GET `/api/v1/me` | The caller: identity, token Scopes and AI access, Workspaces, limits and credits | `settings:read` |
| GET `/api/v1/assistants` | The caller's EpsimoAgents assistants (the agents generations and lead ideation use) | `content:read` |
| GET `/api/v1/lead-app/companies` | The LeadGenius companies the caller owns or is an active member of, and the one lead ideation uses | `content:read` |
| POST `/api/v1/ideation/lead-ideas` | Content ideas from a LeadGenius company's leads, written by an agent (lead_ideation Job) | `content:write` `jobs:write` |
| POST `/api/v1/blogs/v3/pipelines` | Write a blog with the v3 engine (research, outline, sections, assembly) | `content:write` `jobs:write` |
| POST `/api/v1/blogs/v2/tasks` | Write a blog with the v2 engine | `content:write` `jobs:write` |
| POST `/api/v1/blogs/v1/jobs` | Write a blog with the v1 engine | `content:write` `jobs:write` |
| POST `/api/v1/blogs/v3/pipelines/{id}/sections/{index}/regenerate` | Regenerate one section of a completed v3 blog (then reassemble) | `content:write` `jobs:write` |
| POST `/api/v1/ideation/analyze` | Suggest content ideas from Lead App leads (content_analysis Job) | `content:write` `jobs:write` |
| POST `/api/v1/generate/offer` | Generate an offer (HTML and PDF) with the offer pipelines | `content:write` `jobs:write` |
| POST `/api/v1/generate/social-posts` | Write a social post sized for its platform, with an optional illustration (social_post Job) | `content:write` `jobs:write` |
| POST `/api/v1/generate/emails` | Write an email (email Job) | `content:write` `jobs:write` |
| POST `/api/v1/generate/presentations` | Write a slide deck (presentation Job) | `content:write` `jobs:write` |
| POST `/api/v1/generate/research` | Research the web and write a cited report (research Job) | `content:write` `jobs:write` |
| POST `/api/v1/generate/video-ads` | Make a short video ad from a content idea and render it in social formats (video_ad Job) | `content:write` `jobs:write` |
| GET `/api/v1/generate/video-ads/{id}` | Read a video ad Job; a completed one has a 7-day link on each video | `content:read` |
| GET `/api/v1/content` | List your saved content, newest first | `content:read` |
| GET `/api/v1/content/{id}` | Read one of your saved content records: its body, fields and send history | `content:read` |
| GET `/api/v1/publish/endpoints` | List your publishing endpoints (Settings › Integrations), without their tokens | `publish:read` |
| POST `/api/v1/content/{id}/send` | Send saved content to one of your sites (a publishing endpoint) and record the send | `publish:write` |
| GET `/api/v1/social/channels` | Size and structure rules of each social channel (length, structure, hashtags, threads, image size) | `content:read` |
| POST `/api/v1/social/fit` | Check a post against a channel and get a version that fits it (and a thread where the channel has threads) | `content:read` |
| GET `/api/v1/connections/buffer/channels` | The channels of the caller's Buffer account | `publish:read` |
| POST `/api/v1/publish/buffer` | Send a post to Buffer channels: publish now, queue, schedule or save as a draft | `publish:write` |
| POST `/api/v1/media/generated-images` | Copy an image an EpsimoAgents agent generated (its temporary URL) to the publish bucket | `media:write` |
| GET `/api/v1/billing` | Your credits (plan remaining, packs), plan, purchases, and the plans and packs for sale | `settings:read` |
| POST `/api/v1/billing/checkout` | Start a Stripe Checkout for a credit pack (pay as you go) or a monthly plan; answers the URL the user pays at | `settings:write` |
| GET `/api/v1/settings/{key}` | One of the caller's settings; `data` is null when nothing is saved | `settings:read` |
| GET `/api/v1/jobs/{id}` | Read a Job; also advances it a little when nothing else is (no browser needed) | `jobs:read` |
| GET `/api/v1/jobs` | List the caller's Jobs (offers, content analysis, PDF, blog v1), newest first | `jobs:read` |
| POST `/api/v1/jobs/{id}/cancel` | Cancel a PENDING or RUNNING Job | `jobs:write` |
| POST `/api/v1/jobs/{id}/resume` | Resume a FAILED Job from its failed Step | `jobs:write` |
| GET `/api/v1/tokens` | List the caller's API tokens | `tokens:manage` |

## How to run a generation

1. Build the body from the user's request (see the fields below). Take the assistant id from `GET /api/v1/assistants`; ask the user when several fit.
2. POST it with a new `Idempotency-Key: <uuid>`. The answer is `202 {job}`.
3. Poll `GET /api/v1/jobs/{jobId}` every 3 seconds. Report `progress` and `currentStep` to the user now and then, not on every poll.
4. On `COMPLETED`, give the user `job.result` and the ids in `job.result.resources`. On `FAILED`, explain `job.error.code` and `job.error.message`; offer `POST /api/v1/jobs/{jobId}/resume` when the cause is fixed.
5. If the user changes their mind, `POST /api/v1/jobs/{jobId}/cancel`.

## Workflows

**Ideas from leads, then a blog.** `GET /api/v1/lead-app/companies` (use `selectedCompanyId`, or ask), then `POST /api/v1/ideation/lead-ideas` with `assistantId`, `companyId` and `mode` (`quick`: about a minute; `deep`: a few minutes). Show the ideas in `job.result.suggestions`; when the user picks one, `POST /api/v1/blogs/v3/pipelines` with its `topic` as `requestData.topic` and its `keywords`.

**A social post sized per channel.** `POST /api/v1/generate/social-posts` with `assistantId`, `topic`, `platform` and `length` (`short`, `medium`, `long`; `GET /api/v1/social/channels` gives each range). For an illustration add `illustration: true` and an `imageAssistantId` whose assistant has the DALL-E tool; a missing image leaves a `note` in `job.result.image` and the post still completes. Check `job.result.fit`. To send it, `POST /api/v1/publish/buffer` with `job.result.text`, `contentId` and `imageUrl: job.result.image.path` (the saved image's `s3://` path works); to adjust a text yourself, `POST /api/v1/social/fit` (`{"channel","text"}`) and fix `status: "over"` or `hashtagsOk: false`. For X and Threads, `thread` splits a long message into numbered posts.

**Emails, presentations and research reports.** `POST /api/v1/generate/emails` (`recipient`, `subject`, `context`), `POST /api/v1/generate/presentations` (`topic`, `slideCount`, `style`) and `POST /api/v1/generate/research` (`query`, `reportType`, `domains`; its `assistantId` needs a web search tool, and a research Job takes a few minutes). Each takes an optional `brandVoiceId` and saves the result unless `save: false`; `job.result.contentId` names the saved record.

**A video ad from an idea, posted per channel.** `POST /api/v1/generate/video-ads` with `assistantId`, `ideationId` (or `idea`), `formats` (`["9:16","1:1"]`), `lengthSeconds` and `brand` colours. Follow it with `GET /api/v1/generate/video-ads/{jobId}`; `job.result.videos` lists each format's `path` and a 7-day `url`. Show the user the videos and the `caption`, then `POST /api/v1/publish/buffer` with `versions.<channelId>.videoUrl` set to the 9:16 path for Instagram, TikTok and YouTube and the 1:1 path for LinkedIn, Facebook and X.

**Saved content and the user's own sites.** `GET /api/v1/content` (`type` filter, newest first) and `GET /api/v1/content/{id}` read what the user saved. To send a record to one of their sites, `GET /api/v1/publish/endpoints`, confirm the endpoint with the user, then `POST /api/v1/content/{id}/send` with `endpointId` and an `Idempotency-Key`. The default `simple` format sends the title, the HTML content and the featured image link; `options.format: "full"` sends every section and field. Report `ok`, `httpStatus` and `message`: a refusal by the site is `ok: false`, not an error.

**Publish through Buffer.** `GET /api/v1/connections/buffer/channels` (`409 conflict`: ask the user to connect Buffer in Settings → Integrations). Confirm channels, text and timing with the user, then `POST /api/v1/publish/buffer` with `channelIds`, `mode` (`addToQueue`, `shareNow`, `customScheduled` + `dueAt`, `draft`), `versions` per channel (`{"<channelId>": {"text", "thread"?}}`) and an `Idempotency-Key`. Report each `results[]` entry; retry only failed channels, with a new key. Instagram needs an image (`imageUrl`) or a video (`videoUrl`); set `versions.<channelId>.postType` to `story` or `reel` when the user asks for one.

**Keep a generated image.** `POST /api/v1/media/generated-images` with the agent's temporary `/generated-images/` URL; store the returned `path` (`s3://…`); read it with `GET /api/v1/media/images?path=…`.

## Errors

Every error is `{"error": {"code", "message", "correlationId", "fields"?, "details"?}}`. Decide on `code`:

- `validation_failed`: fix `error.fields`, retry.
- `insufficient_scope` / `ai_access_unavailable` / `unauthenticated`: stop; ask the user for a suitable token.
- `credits_exhausted`: stop; tell the user how many credits the task needs (`error.details`) and offer a pack: with their yes, `POST /api/v1/billing/checkout` `{"kind":"pack","itemId":"pack_100"}` and give them the `url` to pay. Never pay for them.
- `rate_limited`: wait `Retry-After` seconds.
- `upstream_unavailable`, `internal`: retry once after a few seconds, then report the `correlationId`.
- `not_found`, `conflict`, `forbidden`: do not retry; tell the user.

## Rules

- Confirm with the user before publishing or scheduling (Buffer, their sites), deleting anything or revoking tokens.
- Use only `/api/v1` paths; the app's other routes refuse tokens with limited Scopes.
- One Idempotency-Key per intended action; reuse it only when retrying that same request.
- Do not poll faster than every 2 seconds.

## Operation details

### GET /api/v1/me

`me.get`: The caller: identity, token Scopes and AI access, Workspaces, limits and credits

- Scopes: `settings:read`
- CLI: `cgenius me`
- Responses: 200 Me, 400 ErrorEnvelope, 401 ErrorEnvelope, 403 ErrorEnvelope, 429 ErrorEnvelope, 500 ErrorEnvelope, 503 ErrorEnvelope

```bash
curl -sS -X GET "https://app.cgenius.app/api/v1/me" \
  -H "Authorization: Bearer $CGENIUS_API_TOKEN"
```

### GET /api/v1/assistants

`assistants.list`: The caller's EpsimoAgents assistants (the agents generations and lead ideation use)

- Scopes: `content:read`
- needs AI access
- CLI: `cgenius assistants list`
- Responses: 200 AssistantList, 400 ErrorEnvelope, 401 ErrorEnvelope, 403 ErrorEnvelope, 429 ErrorEnvelope, 500 ErrorEnvelope, 503 ErrorEnvelope

```bash
curl -sS -X GET "https://app.cgenius.app/api/v1/assistants" \
  -H "Authorization: Bearer $CGENIUS_API_TOKEN"
```

### GET /api/v1/lead-app/companies

`leadApp.companies.list`: The LeadGenius companies the caller owns or is an active member of, and the one lead ideation uses

- Scopes: `content:read`
- CLI: `cgenius lead-app companies`
- Responses: 200 LeadAppCompanies, 400 ErrorEnvelope, 401 ErrorEnvelope, 403 ErrorEnvelope, 429 ErrorEnvelope, 500 ErrorEnvelope, 503 ErrorEnvelope

```bash
curl -sS -X GET "https://app.cgenius.app/api/v1/lead-app/companies" \
  -H "Authorization: Bearer $CGENIUS_API_TOKEN"
```

### POST /api/v1/ideation/lead-ideas

`ideation.leadIdeas.create`: Content ideas from a LeadGenius company's leads, written by an agent (lead_ideation Job)

- Scopes: `content:write`, `jobs:write`
- starts a Job (202), Idempotency-Key, needs AI access, needs a Workspace
- CLI: `cgenius ideas from-leads`
- Body (LeadIdeasRequest):
  - `assistantId` string (required): The EpsimoAgents agent that writes the ideas (see assistants.list)
  - `companyId` string (required): A LeadGenius company of the caller (see leadApp.companies.list)
  - `mode` "deep" | "quick": deep: themes per group of 25 leads, then the ideas; quick: statistics and 40 leads
  - `leadIds` string[]: Hand-picked leads; without them, the newest leads of the company
  - `filters` object
  - `filters.minScore` number
  - `filters.statuses` string[]
  - `filters.keyword` string
  - `filters.since` string: ISO date: leads created on or after it
  - `maxLeads` integer
  - `ideaCount` integer
  - `focus` string: What the company offers or wants to be known for
- Responses: 202 JobAccepted, 400 ErrorEnvelope, 401 ErrorEnvelope, 403, 409 ErrorEnvelope, 413 ErrorEnvelope, 429 ErrorEnvelope, 500 ErrorEnvelope, 503 ErrorEnvelope

```bash
curl -sS -X POST "https://app.cgenius.app/api/v1/ideation/lead-ideas" \
  -H "Authorization: Bearer $CGENIUS_API_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"assistantId":"…","companyId":"…"}'
```

### POST /api/v1/blogs/v3/pipelines

`blogs.v3.create`: Write a blog with the v3 engine (research, outline, sections, assembly)

- Scopes: `content:write`, `jobs:write`
- starts a Job (202), Idempotency-Key, needs AI access, needs a Workspace
- CLI: `cgenius blog create`
- Body (CreateBlogV3Request):
  - `requestData` object (required)
  - `requestData.topic` string (required)
  - `requestData.title` string
  - `requestData.keywords` string | string[]
  - `requestData.tone` string
  - `requestData.wordCount` integer
  - `requestData.blogSize` string
  - `requestData.includeFAQ` boolean
  - `requestData.brandVoice` any
  - `requestData.templateId` string
  - `agentConfiguration` object (required)
  - `agentConfiguration.defaultAgentId` string (required)
  - `agentConfiguration.researchAgentId` string
  - `agentConfiguration.outlineAgentId` string
  - `agentConfiguration.writingAgentId` string
- Responses: 202 JobAccepted, 400 ErrorEnvelope, 401 ErrorEnvelope, 403 ErrorEnvelope, 409 ErrorEnvelope, 413 ErrorEnvelope, 429 ErrorEnvelope, 500 ErrorEnvelope, 503 ErrorEnvelope

```bash
curl -sS -X POST "https://app.cgenius.app/api/v1/blogs/v3/pipelines" \
  -H "Authorization: Bearer $CGENIUS_API_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"requestData":{"topic":"…"},"agentConfiguration":{"defaultAgentId":"…"}}'
```

### POST /api/v1/blogs/v2/tasks

`blogs.v2.create`: Write a blog with the v2 engine

- Scopes: `content:write`, `jobs:write`
- starts a Job (202), Idempotency-Key, needs AI access, needs a Workspace
- CLI: `cgenius blog create`
- Body (CreateBlogV2Request):
  - `requestData` object (required)
  - `requestData.topic` string (required)
  - `requestData.wordCount` integer (required)
  - `requestData.blogSize` "single" | "small" | "medium" | "big" | "huge" (required)
  - `requestData.assistantId` string (required)
- Responses: 202 JobAccepted, 400 ErrorEnvelope, 401 ErrorEnvelope, 403 ErrorEnvelope, 409 ErrorEnvelope, 413 ErrorEnvelope, 429 ErrorEnvelope, 500 ErrorEnvelope, 503 ErrorEnvelope

```bash
curl -sS -X POST "https://app.cgenius.app/api/v1/blogs/v2/tasks" \
  -H "Authorization: Bearer $CGENIUS_API_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"requestData":{"topic":"…","wordCount":1,"blogSize":"single","assistantId":"…"}}'
```

### POST /api/v1/blogs/v1/jobs

`blogs.v1.create`: Write a blog with the v1 engine

- Scopes: `content:write`, `jobs:write`
- starts a Job (202), Idempotency-Key, needs AI access, needs a Workspace
- CLI: `cgenius blog create`
- Body (CreateBlogV1Request):
  - `assistant_id` string (required)
  - `topic` string (required)
  - `blogSize` "single" | "small" | "medium" | "big" | "huge" (required)
- Responses: 202 JobAccepted, 400 ErrorEnvelope, 401 ErrorEnvelope, 403 ErrorEnvelope, 409 ErrorEnvelope, 413 ErrorEnvelope, 429 ErrorEnvelope, 500 ErrorEnvelope, 503 ErrorEnvelope

```bash
curl -sS -X POST "https://app.cgenius.app/api/v1/blogs/v1/jobs" \
  -H "Authorization: Bearer $CGENIUS_API_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"assistant_id":"…","topic":"…","blogSize":"single"}'
```

### POST /api/v1/blogs/v3/pipelines/{id}/sections/{index}/regenerate

`blogs.v3.regenerateSection`: Regenerate one section of a completed v3 blog (then reassemble)

- Scopes: `content:write`, `jobs:write`
- starts a Job (202), Idempotency-Key, needs AI access, needs a Workspace
- CLI: `cgenius blog regenerate-section`
- Path:
  - `id` string (required)
  - `index` integer (required)
- Responses: 202 JobAccepted, 400 ErrorEnvelope, 401 ErrorEnvelope, 403 ErrorEnvelope, 404, 409, 429 ErrorEnvelope, 500 ErrorEnvelope, 503 ErrorEnvelope

```bash
curl -sS -X POST "https://app.cgenius.app/api/v1/blogs/v3/pipelines/<id>/sections/<index>/regenerate" \
  -H "Authorization: Bearer $CGENIUS_API_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)"
```

### POST /api/v1/ideation/analyze

`ideation.analyze`: Suggest content ideas from Lead App leads (content_analysis Job)

- Scopes: `content:write`, `jobs:write`
- starts a Job (202), Idempotency-Key, needs AI access + Lead App access, needs a Workspace
- CLI: `cgenius ideas analyze`
- Body (AnalyzeLeadsRequest):
  - `leadIds` string[] (required)
  - `assistantId` string: EpsimoAgents assistant that writes the ideas. Default: the configured content analysis assistant
- Responses: 202 JobAccepted, 400 ErrorEnvelope, 401 ErrorEnvelope, 403 ErrorEnvelope, 409 ErrorEnvelope, 413 ErrorEnvelope, 429 ErrorEnvelope, 500 ErrorEnvelope, 503 ErrorEnvelope

```bash
curl -sS -X POST "https://app.cgenius.app/api/v1/ideation/analyze" \
  -H "Authorization: Bearer $CGENIUS_API_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"leadIds":["…"]}'
```

### POST /api/v1/generate/offer

`generate.offer`: Generate an offer (HTML and PDF) with the offer pipelines

- Scopes: `content:write`, `jobs:write`
- starts a Job (202), Idempotency-Key, needs AI access, needs a Workspace
- CLI: `cgenius offer create`
- Body (GenerateOfferRequest):
  - `variant` "batch" | "basic" | "zero" | "mid" | "full" (required): batch: one section per subject (offer_batch); the others: the new-batch pipeline variants
  - `client_name` string (required)
  - `subjects` string[]
  - `offerRecord` any (required)
  - `assistantsId` any[] | object: batch: the assistant per subject (array or map); other variants: an object, `{assistantsId: "<assistant id>"}` for mid and full
- Responses: 202 JobAccepted, 400 ErrorEnvelope, 401 ErrorEnvelope, 403 ErrorEnvelope, 409 ErrorEnvelope, 413 ErrorEnvelope, 429 ErrorEnvelope, 500 ErrorEnvelope, 503 ErrorEnvelope

```bash
curl -sS -X POST "https://app.cgenius.app/api/v1/generate/offer" \
  -H "Authorization: Bearer $CGENIUS_API_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"variant":"batch","client_name":"…","offerRecord":{}}'
```

### POST /api/v1/generate/social-posts

`generate.socialPost`: Write a social post sized for its platform, with an optional illustration (social_post Job)

- Scopes: `content:write`, `jobs:write`
- starts a Job (202), Idempotency-Key, needs AI access, needs a Workspace
- CLI: `cgenius social create`
- Body (GenerateSocialPostRequest):
  - `assistantId` string (required): EpsimoAgents assistant that writes the post
  - `topic` string (required): What the post is about
  - `platform` "linkedin" | "twitter" | "facebook" | "instagram" | "threads" (required)
  - `length` "short" | "medium" | "long": Default medium; `social.channels.list` gives the character range of each length
  - `tone` string: For example "friendly" or "expert"
  - `hashtags` string: Hashtags to use
  - `callToAction` string: What the reader should do
  - `brandVoiceId` string: One of your brand voices; the writing follows it
  - `illustration` boolean: Also draw an illustration (needs `imageAssistantId`)
  - `imageAssistantId` string: An assistant with the DALL-E tool, for the illustration
  - `imageIdea` string: What the illustration should show; default: drawn from the post
  - `save` boolean: Save the result to your content (default true); `result.contentId` names the record
- Responses: 202 JobAccepted, 400 ErrorEnvelope, 401 ErrorEnvelope, 403 ErrorEnvelope, 409 ErrorEnvelope, 413 ErrorEnvelope, 422, 429 ErrorEnvelope, 500 ErrorEnvelope, 503 ErrorEnvelope

```bash
curl -sS -X POST "https://app.cgenius.app/api/v1/generate/social-posts" \
  -H "Authorization: Bearer $CGENIUS_API_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"assistantId":"…","topic":"…","platform":"linkedin"}'
```

### POST /api/v1/generate/emails

`generate.email`: Write an email (email Job)

- Scopes: `content:write`, `jobs:write`
- starts a Job (202), Idempotency-Key, needs AI access, needs a Workspace
- CLI: `cgenius email create`
- Body (GenerateEmailRequest):
  - `assistantId` string (required): EpsimoAgents assistant that writes the email
  - `recipient` string (required): Who it is for, for example "a prospect who downloaded our guide"
  - `subject` string (required)
  - `context` string: What the email must say or achieve
  - `tone` string: For example "warm" or "formal"
  - `length` "100" | "200" | "400": About how many words (default 200)
  - `brandVoiceId` string: One of your brand voices; the writing follows it
  - `save` boolean: Save the result to your content (default true); `result.contentId` names the record
- Responses: 202 JobAccepted, 400 ErrorEnvelope, 401 ErrorEnvelope, 403 ErrorEnvelope, 409 ErrorEnvelope, 413 ErrorEnvelope, 422, 429 ErrorEnvelope, 500 ErrorEnvelope, 503 ErrorEnvelope

```bash
curl -sS -X POST "https://app.cgenius.app/api/v1/generate/emails" \
  -H "Authorization: Bearer $CGENIUS_API_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"assistantId":"…","recipient":"…","subject":"…"}'
```

### POST /api/v1/generate/presentations

`generate.presentation`: Write a slide deck (presentation Job)

- Scopes: `content:write`, `jobs:write`
- starts a Job (202), Idempotency-Key, needs AI access, needs a Workspace
- CLI: `cgenius presentation create`
- Body (GeneratePresentationRequest):
  - `assistantId` string (required): EpsimoAgents assistant that writes the slides
  - `topic` string (required)
  - `audience` string: Who the presentation is for
  - `slideCount` integer (required)
  - `style` "professional" | "creative" | "minimal" | "bold": Default professional
  - `brandVoiceId` string: One of your brand voices; the writing follows it
  - `save` boolean: Save the result to your content (default true); `result.contentId` names the record
- Responses: 202 JobAccepted, 400 ErrorEnvelope, 401 ErrorEnvelope, 403 ErrorEnvelope, 409 ErrorEnvelope, 413 ErrorEnvelope, 422, 429 ErrorEnvelope, 500 ErrorEnvelope, 503 ErrorEnvelope

```bash
curl -sS -X POST "https://app.cgenius.app/api/v1/generate/presentations" \
  -H "Authorization: Bearer $CGENIUS_API_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"assistantId":"…","topic":"…","slideCount":1}'
```

### POST /api/v1/generate/research

`generate.research`: Research the web and write a cited report (research Job)

- Scopes: `content:write`, `jobs:write`
- starts a Job (202), Idempotency-Key, needs AI access, needs a Workspace
- CLI: `cgenius research create`
- Body (GenerateResearchRequest):
  - `assistantId` string (required): EpsimoAgents assistant that plans and researches; give it a web search tool (Tavily or DuckDuckGo)
  - `writerAssistantId` string: Assistant that writes the report; default `assistantId`
  - `query` string (required): The research task
  - `reportType` "research_report" | "outline_report" | "resource_report" | "custom_report": Default research_report (a summary report of about 1,200 words)
  - `customPrompt` string: How to write a custom_report (required for it)
  - `tone` "objective" | "formal" | "analytical" | "persuasive" | "informative" | "explanatory" | "descriptive" | "critical" | "comparative" | "speculative" | "reflective" | "narrative" | "humorous" | "optimistic" | "pessimistic" | "simple" | "casual": Default objective
  - `language` string: For example "French"; default: the language of the query
  - `domains` string[]: Only search and cite these sites, for example ["europa.eu"]
  - `questionCount` integer: Search questions to plan (default 4); the query itself is researched too
  - `brandVoiceId` string: One of your brand voices; the writing follows it
  - `save` boolean: Save the result to your content (default true); `result.contentId` names the record
- Responses: 202 JobAccepted, 400 ErrorEnvelope, 401 ErrorEnvelope, 403 ErrorEnvelope, 409 ErrorEnvelope, 413 ErrorEnvelope, 422, 429 ErrorEnvelope, 500 ErrorEnvelope, 503 ErrorEnvelope

```bash
curl -sS -X POST "https://app.cgenius.app/api/v1/generate/research" \
  -H "Authorization: Bearer $CGENIUS_API_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"assistantId":"…","query":"…"}'
```

### POST /api/v1/generate/video-ads

`generate.videoAd`: Make a short video ad from a content idea and render it in social formats (video_ad Job)

- Scopes: `content:write`, `jobs:write`
- starts a Job (202), Idempotency-Key, needs AI access, needs a Workspace
- CLI: `cgenius video ad`
- Body (GenerateVideoAdRequest):
  - `assistantId` string: EpsimoAgents assistant that writes the script and the caption (not needed with `script`)
  - `ideationId` string: One of your saved ideas (from ideation.leadIdeas or ideation.analyze); it is linked to the saved ad
  - `idea` object: The idea itself, instead of `ideationId` (for example a suggestion from ideation.leadIdeas)
  - `idea.topic` string (required)
  - `idea.description` string
  - `idea.targetAudience` string
  - `idea.angles` string[]
  - `idea.keywords` string[]
  - `formats` "9:16" | "1:1" | "4:5" | "16:9"[]: One render per format; default ["9:16"] (Reels, TikTok, Shorts, Stories)
  - `lengthSeconds` integer: About how long the ad lasts: 15, 30, 45, 60 (default 30)
  - `platform` string: The network the caption is written for (default instagram)
  - `url` string: Shown on the call-to-action scene, for example "acme.com/demo"
  - `brand` object: Colours as #rrggbb, and the name or logo shown in a corner
  - `brand.name` string
  - `brand.primary` string
  - `brand.accent` string
  - `brand.background` string
  - `brand.text` string
  - `brand.logoUrl` string
  - `brandVoiceId` string: One of your brand voices; the writing follows it
  - `language` string
  - `images` boolean: Draw a photo behind up to three scenes (needs `imageAssistantId`, an assistant with the DALL-E tool)
  - `imageAssistantId` string
  - `musicUrl` string: Background music (an https audio file you may use); it loops and fades out at the end
  - `musicVolume` number: Music volume, 0 to 1 (default 0.35)
  - `script` object: A script to render as is (`job.result.script` of an earlier Job with `render: false`, edited); the agent is not asked again
  - `script.scenes` object[] (required): Scenes as in job.result.script.scenes: {kind: hook|point|stat|cta, durationInSeconds, text, sub, title, body, value, label, button, url, imageUrl}
  - `script.caption` string
  - `script.hashtags` string[]
  - `render` boolean: Render the videos (default true); false stops after the script so it can be checked
  - `save` boolean: Save the result to your content (default true); `result.contentId` names the record
- Responses: 202 JobAccepted, 400 ErrorEnvelope, 401 ErrorEnvelope, 403 ErrorEnvelope, 409 ErrorEnvelope, 413 ErrorEnvelope, 422, 429 ErrorEnvelope, 500 ErrorEnvelope, 503 ErrorEnvelope

```bash
curl -sS -X POST "https://app.cgenius.app/api/v1/generate/video-ads" \
  -H "Authorization: Bearer $CGENIUS_API_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"idea":{"topic":"…"},"script":{"scenes":[{}]}}'
```

### GET /api/v1/generate/video-ads/{id}

`generate.videoAd.get`: Read a video ad Job; a completed one has a 7-day link on each video

- Scopes: `content:read`
- needs a Workspace
- CLI: `cgenius video ad get`
- Path:
  - `id` string (required)
- Responses: 200 JobEnvelope, 400 ErrorEnvelope, 401 ErrorEnvelope, 403 ErrorEnvelope, 404, 429 ErrorEnvelope, 500 ErrorEnvelope, 503 ErrorEnvelope

```bash
curl -sS -X GET "https://app.cgenius.app/api/v1/generate/video-ads/<id>" \
  -H "Authorization: Bearer $CGENIUS_API_TOKEN"
```

### GET /api/v1/content

`contentItems.list`: List your saved content, newest first

- Scopes: `content:read`
- CLI: `cgenius content list`
- Query:
  - `limit` integer: Page size, 1 to 100
  - `cursor` string: Opaque cursor from the previous page
  - `type` string: Only this content type, for example social_post
- Responses: 200 ContentPage, 400 ErrorEnvelope, 401 ErrorEnvelope, 403 ErrorEnvelope, 429 ErrorEnvelope, 500 ErrorEnvelope, 503 ErrorEnvelope

```bash
curl -sS -X GET "https://app.cgenius.app/api/v1/content" \
  -H "Authorization: Bearer $CGENIUS_API_TOKEN"
```

### GET /api/v1/content/{id}

`contentItems.get`: Read one of your saved content records: its body, fields and send history

- Scopes: `content:read`
- CLI: `cgenius content get`
- Path:
  - `id` string (required)
- Responses: 200 ContentItemEnvelope, 400 ErrorEnvelope, 401 ErrorEnvelope, 403 ErrorEnvelope, 404, 429 ErrorEnvelope, 500 ErrorEnvelope, 503 ErrorEnvelope

```bash
curl -sS -X GET "https://app.cgenius.app/api/v1/content/<id>" \
  -H "Authorization: Bearer $CGENIUS_API_TOKEN"
```

### GET /api/v1/publish/endpoints

`integrationEndpoints.list`: List your publishing endpoints (Settings › Integrations), without their tokens

- Scopes: `publish:read`
- CLI: `cgenius endpoints list`
- Responses: 200 IntegrationEndpoints, 400 ErrorEnvelope, 401 ErrorEnvelope, 403 ErrorEnvelope, 429 ErrorEnvelope, 500 ErrorEnvelope, 503 ErrorEnvelope

```bash
curl -sS -X GET "https://app.cgenius.app/api/v1/publish/endpoints" \
  -H "Authorization: Bearer $CGENIUS_API_TOKEN"
```

### POST /api/v1/content/{id}/send

`contentItems.send`: Send saved content to one of your sites (a publishing endpoint) and record the send

- Scopes: `publish:write`
- Idempotency-Key
- CLI: `cgenius content send`
- Path:
  - `id` string (required)
- Body (SendContentRequest):
  - `endpointId` string (required): From integrationEndpoints.list
  - `options` object
  - `options.format` "simple" | "full": simple (default): title, content, featured image; full: every section, block and field
  - `options.status` "publish" | "draft": What the receiving site should do: publish (default) or draft
  - `options.formats` "html" | "markdown" | "text"[]: Full format: the body formats to include (default all three)
  - `options.images` "link" | "inline" | "none": link (default): 30-day download links; inline: base64 inside the content (full format); none
  - `options.includeFields` boolean: Full format: include the type's own fields
- Responses: 200 SendContentResult, 400 ErrorEnvelope, 401 ErrorEnvelope, 403 ErrorEnvelope, 404, 409, 413 ErrorEnvelope, 429 ErrorEnvelope, 500 ErrorEnvelope, 503 ErrorEnvelope

```bash
curl -sS -X POST "https://app.cgenius.app/api/v1/content/<id>/send" \
  -H "Authorization: Bearer $CGENIUS_API_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"endpointId":"…"}'
```

### GET /api/v1/social/channels

`social.channels.list`: Size and structure rules of each social channel (length, structure, hashtags, threads, image size)

- Scopes: `content:read`
- CLI: `cgenius social channels`
- Responses: 200 ChannelProfiles, 400 ErrorEnvelope, 401 ErrorEnvelope, 403 ErrorEnvelope, 429 ErrorEnvelope, 500 ErrorEnvelope, 503 ErrorEnvelope

```bash
curl -sS -X GET "https://app.cgenius.app/api/v1/social/channels" \
  -H "Authorization: Bearer $CGENIUS_API_TOKEN"
```

### POST /api/v1/social/fit

`social.fit`: Check a post against a channel and get a version that fits it (and a thread where the channel has threads)

- Scopes: `content:read`
- CLI: `cgenius social fit`
- Body (FitSocialPostRequest):
  - `text` string (required)
  - `channel` string (required): linkedin, twitter (or x), facebook, instagram, threads, or another Buffer service
- Responses: 200 SocialFit, 400 ErrorEnvelope, 401 ErrorEnvelope, 403 ErrorEnvelope, 413 ErrorEnvelope, 429 ErrorEnvelope, 500 ErrorEnvelope, 503 ErrorEnvelope

```bash
curl -sS -X POST "https://app.cgenius.app/api/v1/social/fit" \
  -H "Authorization: Bearer $CGENIUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"text":"…","channel":"…"}'
```

### GET /api/v1/connections/buffer/channels

`connections.buffer.channels`: The channels of the caller's Buffer account

- Scopes: `publish:read`
- CLI: `cgenius buffer channels`
- Responses: 200 BufferChannels, 400 ErrorEnvelope, 401 ErrorEnvelope, 403 ErrorEnvelope, 409, 429 ErrorEnvelope, 500 ErrorEnvelope, 503 ErrorEnvelope

```bash
curl -sS -X GET "https://app.cgenius.app/api/v1/connections/buffer/channels" \
  -H "Authorization: Bearer $CGENIUS_API_TOKEN"
```

### POST /api/v1/publish/buffer

`publish.buffer`: Send a post to Buffer channels: publish now, queue, schedule or save as a draft

- Scopes: `publish:write`
- Idempotency-Key
- CLI: `cgenius buffer send`
- Body (PublishBufferRequest):
  - `text` string (required)
  - `channelIds` string[] (required)
  - `mode` "shareNow" | "addToQueue" | "customScheduled" | "draft" (required): shareNow, addToQueue, customScheduled (needs dueAt), draft
  - `dueAt` string (date-time)
  - `imageUrl` string: A public https URL, or the `s3://` path of one of your saved images (for example `job.result.image.path` of generate.socialPost, or media.generatedImages.import); a path is sent to Buffer as a 30-day download link
  - `videoUrl` string: A video instead of an image: an https URL, or the `s3://` path of one of your rendered videos (`job.result.videos[].path` of generate.videoAd), sent as a 7-day link
  - `contentId` string: GeneratedContent record; the posts are recorded on it
  - `versions` object: Channel id → its own text (see social.fit), or a thread on X, Threads, Bluesky and Mastodon
- Responses: 200 PublishBufferResult, 400 ErrorEnvelope, 401 ErrorEnvelope, 403 ErrorEnvelope, 409, 413 ErrorEnvelope, 429 ErrorEnvelope, 500 ErrorEnvelope, 503 ErrorEnvelope

```bash
curl -sS -X POST "https://app.cgenius.app/api/v1/publish/buffer" \
  -H "Authorization: Bearer $CGENIUS_API_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"text":"…","channelIds":["…"],"mode":"shareNow"}'
```

### POST /api/v1/media/generated-images

`media.generatedImages.import`: Copy an image an EpsimoAgents agent generated (its temporary URL) to the publish bucket

- Scopes: `media:write`
- CLI: `cgenius media import-generated`
- Body (ImportGeneratedImageRequest):
  - `url` string (required): https URL on the EpsimoAgents host under /generated-images/
- Responses: 201 StoredImage, 400 ErrorEnvelope, 401 ErrorEnvelope, 403 ErrorEnvelope, 404, 413 ErrorEnvelope, 429 ErrorEnvelope, 500 ErrorEnvelope, 503 ErrorEnvelope

```bash
curl -sS -X POST "https://app.cgenius.app/api/v1/media/generated-images" \
  -H "Authorization: Bearer $CGENIUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"…"}'
```

### GET /api/v1/billing

`billing.get`: Your credits (plan remaining, packs), plan, purchases, and the plans and packs for sale

- Scopes: `settings:read`
- needs AI access
- CLI: `cgenius billing status`
- Responses: 200 Billing, 400 ErrorEnvelope, 401 ErrorEnvelope, 403 ErrorEnvelope, 429 ErrorEnvelope, 500 ErrorEnvelope, 503 ErrorEnvelope

```bash
curl -sS -X GET "https://app.cgenius.app/api/v1/billing" \
  -H "Authorization: Bearer $CGENIUS_API_TOKEN"
```

### POST /api/v1/billing/checkout

`billing.checkout`: Start a Stripe Checkout for a credit pack (pay as you go) or a monthly plan; answers the URL the user pays at

- Scopes: `settings:write`
- needs AI access
- CLI: `cgenius billing buy`
- Body (BillingCheckoutRequest):
  - `kind` "pack" | "plan" (required)
  - `itemId` string (required): A pack or plan id from billing.get, for example pack_100 or pro
  - `returnUrl` string (uri): Where Stripe returns (an allowed https origin of ContentGenius); default the Credits & Billing page
- Responses: 200 BillingCheckout, 400 ErrorEnvelope, 401 ErrorEnvelope, 403 ErrorEnvelope, 409, 413 ErrorEnvelope, 429 ErrorEnvelope, 500 ErrorEnvelope, 503 ErrorEnvelope

```bash
curl -sS -X POST "https://app.cgenius.app/api/v1/billing/checkout" \
  -H "Authorization: Bearer $CGENIUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"kind":"pack","itemId":"…"}'
```

### GET /api/v1/settings/{key}

`settings.get`: One of the caller's settings; `data` is null when nothing is saved

- Scopes: `settings:read`
- CLI: `cgenius settings get`
- Path:
  - `key` "epsimoagents" | "integrations" | "ideation" (required): epsimoagents: publish module preferences; integrations: publishing endpoints; ideation: lead ideation choices
- Responses: 200 Setting, 400 ErrorEnvelope, 401 ErrorEnvelope, 403 ErrorEnvelope, 429 ErrorEnvelope, 500 ErrorEnvelope, 503 ErrorEnvelope

```bash
curl -sS -X GET "https://app.cgenius.app/api/v1/settings/<key>" \
  -H "Authorization: Bearer $CGENIUS_API_TOKEN"
```

### GET /api/v1/jobs/{id}

`jobs.get`: Read a Job; also advances it a little when nothing else is (no browser needed)

- Scopes: `jobs:read`
- needs a Workspace
- CLI: `cgenius job status`
- Path:
  - `id` string (required)
- Responses: 200 JobEnvelope, 400 ErrorEnvelope, 401 ErrorEnvelope, 403 ErrorEnvelope, 404, 429 ErrorEnvelope, 500 ErrorEnvelope, 503 ErrorEnvelope

```bash
curl -sS -X GET "https://app.cgenius.app/api/v1/jobs/<id>" \
  -H "Authorization: Bearer $CGENIUS_API_TOKEN"
```

### GET /api/v1/jobs

`jobs.list`: List the caller's Jobs (offers, content analysis, PDF, blog v1), newest first

- Scopes: `jobs:read`
- needs a Workspace
- CLI: `cgenius job list`
- Query:
  - `limit` integer: Page size, 1 to 100
  - `cursor` string: Opaque cursor from the previous page
  - `type` "blog_v3" | "blog_v2" | "blog_v1" | "offer_batch" | "offer_new_batch" | "content_analysis" | "lead_ideation" | "pdf_conversion" | "questionnaire" | "social_post" | "email" | "presentation" | "research" | "video_ad"
- Responses: 200 JobPage, 400 ErrorEnvelope, 401 ErrorEnvelope, 403 ErrorEnvelope, 429 ErrorEnvelope, 500 ErrorEnvelope, 503 ErrorEnvelope

```bash
curl -sS -X GET "https://app.cgenius.app/api/v1/jobs" \
  -H "Authorization: Bearer $CGENIUS_API_TOKEN"
```

### POST /api/v1/jobs/{id}/cancel

`jobs.cancel`: Cancel a PENDING or RUNNING Job

- Scopes: `jobs:write`
- needs a Workspace
- CLI: `cgenius job cancel`
- Path:
  - `id` string (required)
- Responses: 200 JobEnvelope, 400 ErrorEnvelope, 401 ErrorEnvelope, 403 ErrorEnvelope, 404, 409, 429 ErrorEnvelope, 500 ErrorEnvelope, 503 ErrorEnvelope

```bash
curl -sS -X POST "https://app.cgenius.app/api/v1/jobs/<id>/cancel" \
  -H "Authorization: Bearer $CGENIUS_API_TOKEN"
```

### POST /api/v1/jobs/{id}/resume

`jobs.resume`: Resume a FAILED Job from its failed Step

- Scopes: `jobs:write`
- needs a Workspace
- CLI: `cgenius job resume`
- Path:
  - `id` string (required)
- Responses: 200 JobEnvelope, 400 ErrorEnvelope, 401 ErrorEnvelope, 403 ErrorEnvelope, 404, 409, 429 ErrorEnvelope, 500 ErrorEnvelope, 503 ErrorEnvelope

```bash
curl -sS -X POST "https://app.cgenius.app/api/v1/jobs/<id>/resume" \
  -H "Authorization: Bearer $CGENIUS_API_TOKEN"
```

### GET /api/v1/tokens

`tokens.list`: List the caller's API tokens

- Scopes: `tokens:manage`
- CLI: `cgenius token list`
- Responses: 200 TokenList, 400 ErrorEnvelope, 401 ErrorEnvelope, 403 ErrorEnvelope, 429 ErrorEnvelope, 500 ErrorEnvelope, 503 ErrorEnvelope

```bash
curl -sS -X GET "https://app.cgenius.app/api/v1/tokens" \
  -H "Authorization: Bearer $CGENIUS_API_TOKEN"
```

