Skip to main content

Posts

ap posts create

Create one or more posts — with media, per-platform overrides, per-account targeting, scheduling, threads, or in bulk from a file.
ap posts create --brand my-brand --text "Hello world!" --platforms x,linkedin
Core flags
FlagDescription
--brand <slug>Brand slug. Falls back to the saved context (ap config set-context); required if neither is set.
--text <text>Post text content (required unless --from)
--platforms <list>Comma-separated (required unless --from): x,linkedin,instagram,threads,youtube
--at <iso>ISO 8601 datetime to schedule at create. A past time is rejected.
--thread <text...>Extra posts appended after --text to form a thread (X/Threads, max 25)
--from <file>Create posts in bulk from a CSV or JSON file (one post per row)
--dry-run / --previewPrint the resolved request body without uploading media or creating the post
Media & per-platform
FlagDescription
--media <path...>Media files to attach (max 10)
--alt-text <text...>Alt text for --media files, aligned by index
--platform-media <pairs...>Per-platform media, e.g. instagram=photo.jpg x=banner.png
--platform-text <pairs...>Per-platform text, e.g. x=Hello linkedin=World
--account <p=handle|id...>Target a specific account per platform — see Per-account targeting
Platform-specific options
--yt-title <t>             # Video title
--yt-description <d>       # Video description
--yt-tags <list>           # Comma-separated tags
--yt-privacy <v>           # public | unlisted | private
--yt-category <id>         # Category ID
--yt-made-for-kids         # Mark as made for kids

Per-account targeting

--account <platform>=<handle|id> selects which connected account to post from when a brand has more than one on a platform. Repeat it per platform.
  • --account x=@handle — match by handle (case-insensitive, leading @ optional) or platform user ID.
  • --account linkedin=all (or =*) — fan out to every connected account on that platform. A fan-out over 5 accounts asks for confirmation on an interactive terminal.
  • On a TTY with 2+ accounts and no --account, the CLI shows an interactive checkbox picker.
  • Non-interactive (piped/CI) with 2+ accounts and no --account errors out and lists the accounts — pass --account to choose.
  • Save a default per brand+platform with ap brands set-default-account to skip the picker.

ap posts list

ap posts list [--brand <slug>] [--status <status>] [--limit <n>] [--page <n>]
FlagDescription
--brand <slug>Filter by brand slug (defaults to the saved context)
--status <status>draft, scheduled, published, or failed
--limit <n>Max results per page (default 20)
--page <n>Page number (default 1)

ap posts get

ap posts get <post-id>

ap posts update

ap posts update <post-id> --text "Updated copy"

ap posts publish

Publish a draft post immediately.
ap posts publish <post-id>

ap posts schedule

Schedule a post for a specific time, or unschedule it back to draft with --cancel.
ap posts schedule <post-id> --at "2026-07-01T10:00:00Z"
ap posts schedule <post-id> --cancel
FlagDescription
--at <iso>ISO 8601 datetime to schedule (must be in the future)
--cancelUnschedule the post (return it to draft). Mutually exclusive with --at.

ap posts retry

Retry a failed post on specific or all platforms.
ap posts retry <post-id> [--platforms x,linkedin]

ap posts delete

Requires --force to confirm.
ap posts delete <post-id> --force

ap posts rewrite

AI-rewrite a post for better engagement.
ap posts rewrite <post-id>

ap posts score

Get an AI score and feedback for a post.
ap posts score <post-id>

Config

CLI defaults are stored in ~/.config/autoposting/config.json (sibling to credentials, 0600 permissions).

ap config set-context

Set the default brand applied whenever --brand is omitted.
ap config set-context --brand my-brand

ap config get-context

ap config get-context

ap config unset-context

ap config unset-context
Brand resolution: an explicit --brand flag wins, then the saved context, then the command errors. Set a context once to drop --brand from every command.

Brands

ap brands create

ap brands create --name "My Brand" --timezone "America/New_York"

ap brands list

ap brands list [--json]

ap brands get

ap brands get <slug>

ap brands update

ap brands update <slug> --name "New Name"

ap brands delete

ap brands delete <slug>
Brand deletion also removes all associated platform tokens. Posts are not deleted.

ap brands auth-status

Check which platforms are connected for a brand.
ap brands auth-status <slug>

ap brands set-default-account

Save the default target account(s) for a brand, used when posts create --account is omitted. Local-only (stored in config.json).
ap brands set-default-account my-brand x=@myhandle linkedin=all

ap brands get-default-account

ap brands get-default-account my-brand

ap brands clear-default-account

Remove all saved default accounts for a brand.
ap brands clear-default-account my-brand

Agents

ap agents create

ap agents create --name "Daily News" --type publish --frequency daily --time "09:00"

ap agents list

ap agents list [--json]

ap agents get

ap agents get <agent-id>

ap agents update

ap agents update <agent-id> --name "Weekly Digest"

ap agents run

Trigger an immediate agent run.
ap agents run <agent-id>

ap agents toggle

Enable or disable an agent.
ap agents toggle <agent-id>

ap agents runs

View run history for an agent.
ap agents runs <agent-id>

ap agents delete

ap agents delete <agent-id>

Knowledge Base

ap kb create

ap kb create --name "Product Docs"

ap kb list

ap kb list [--json]

ap kb get

ap kb get <kb-id>
Search knowledge base content.
ap kb search <kb-id> --query "pricing"

ap kb ingest

Ingest a URL into a knowledge base.
ap kb ingest <kb-id> --url "https://docs.example.com"

ap kb docs

List documents in a knowledge base.
ap kb docs <kb-id>

ap kb delete

ap kb delete <kb-id>

Ideas

ap ideas generate

AI-generate content ideas from a topic.
ap ideas generate --topic "product launch" --count 10

ap ideas list

ap ideas list [--json]

ap ideas enrich

Enrich an idea into platform-ready drafts (async — returns a job ID).
ap ideas enrich --title "<title>" --hook "<hook>" --angle "<angle>" --platforms twitter,linkedin [--kb <id>]
FlagDescription
--titleIdea title (required)
--hookIdea hook (required)
--angleIdea angle (required)
--platformsComma-separated, max 5: twitter,linkedin,instagram,youtube,threads (required)
--kbKnowledge base ID for extra context (optional)

ap ideas delete

ap ideas delete <idea-id>

Clips

ap clips upload

Upload a local video file as a clip.
ap clips upload ./video.mp4 [--name "My Clip"]

ap clips import

Import a video from a URL for AI clipping.
ap clips import --url "https://youtube.com/watch?v=..."

ap clips list

ap clips list [--json]

ap clips get

ap clips get <clip-id>

ap clips render

Render a clip for publishing.
ap clips render <clip-id>

ap clips delete

ap clips delete <clip-id>

Carousels

ap carousels generate

AI-generate a carousel from a topic.
ap carousels generate --topic "5 Growth Tips" --brand my-brand --slides 5

ap carousels create

Create a carousel manually.
ap carousels create --brand my-brand --title "My Carousel"

ap carousels list

ap carousels list [--json]

ap carousels get

ap carousels get <carousel-id>

ap carousels draft

Convert a carousel into a post draft.
ap carousels draft <carousel-id>

ap carousels delete

ap carousels delete <carousel-id>

Webhooks

ap webhooks create

ap webhooks create --url "https://api.example.com/hook" --events "post.published,post.failed"

ap webhooks list

ap webhooks list [--json]

ap webhooks get

ap webhooks get <webhook-id>

ap webhooks update

ap webhooks update <webhook-id> --url "https://new-url.com/hook"

ap webhooks test

Send a test event to a webhook endpoint.
ap webhooks test <webhook-id>

ap webhooks delete

ap webhooks delete <webhook-id>

Billing & Usage

ap billing status

Show current plan and subscription details.
ap billing status

ap billing credits

Show AI credit balance.
ap billing credits

ap usage summary

Show publishing statistics.
ap usage summary

Workspaces

ap workspaces list

ap workspaces list

ap workspaces switch

Switch to a different workspace (session auth only).
ap workspaces switch <workspace-id>

Auth

ap auth login

Log in via browser device-code flow, or store an API key directly.
ap auth login
ap auth login --api-key sk-social-your-key --profile work
FlagDescription
--api-key <key>Store a key directly (skips the device-code flow)
--profile <name>Profile to save under (default default)
--base-url <url>API base URL (overrides AUTOPOSTING_BASE_URL)

ap auth logout

Remove the active profile, or all profiles with --all.
ap auth logout [--all]

ap auth switch

Switch the active profile.
ap auth switch <profile>

ap auth whoami / ap auth status

Show the current auth method and identity (status is an alias).
ap auth whoami

Utility

ap doctor

Health check — verifies CLI version, Node.js, authentication, and API connectivity.
ap doctor

ap whoami

Show the current auth source and workspace.
ap whoami

ap open

Open a resource in your browser.
ap open posts
ap open brands

ap update

Check for CLI updates.
ap update

ap completion

Generate shell completions.
ap completion zsh >> ~/.zshrc
ap completion bash >> ~/.bashrc
ap completion fish > ~/.config/fish/completions/ap.fish

ap mcp

Start the built-in MCP server for AI agents.
ap mcp
See MCP Server for full details.

Installation

Install and configure the CLI.

MCP Tools

Same operations as MCP tool calls for AI agents.

API Reference

Underlying REST endpoints.

TypeScript SDK

Programmatic API access in Node.js.