> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mallary.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Commands

> The main Mallary CLI commands for authentication, health, uploads, drafts, posts, comments, jobs, analytics, audience counts, webhooks, settings, and platforms.

## Authentication

```bash theme={null}
mallary auth login
mallary auth status
mallary auth logout
```

One OAuth login gives the CLI access to view data, publish posts, reply to comments, and manage settings and connections. Users do not choose scopes or sign in again for another capability. Login itself does not post or change anything. A clear later request to publish, schedule, edit a scheduled post, upload media for a requested post, or send a supplied reply is enough authorization; do not ask for a second confirmation.

## Health

```bash theme={null}
mallary health
mallary health --json
```

## Upload

```bash theme={null}
mallary upload ./image.png
mallary upload ./image.png ./video.mp4 --json
```

This command:

1. calls Mallary to create a presigned upload URL
2. uploads the local bytes for you
3. returns the final Mallary media URL

Use the returned URL as `media[].url` for media, or as `media[].thumbnail_url` for video thumbnails in file-mode post payloads.

## Posts

```bash theme={null}
mallary posts list
mallary posts list --profile-id AbC123xYz90
mallary posts list --page 2 --per-page 25 --json
mallary posts get 123 --profile-id AbC123xYz90 --json
mallary posts edit 123 --message "Updated text" --scheduled-at 2026-10-15T15:00:00Z
mallary posts edit 123 --target-profile-id NewProfile123 --platform instagram --platform linkedin
mallary posts delete 123
```

After publishing, grouped post results include the per-platform post IDs and public post URLs that the provider makes available.

## Comments

```bash theme={null}
mallary comments list --post-id 123
mallary comments list --post-id 123 --platform instagram --limit 50 --json
mallary comments reply --post-id 123 --comment-id "1789..." --message "Thanks for checking this out."
```

Comments commands are available on all plans. They list comments from Mallary-published posts and post the exact reply text you provide.

## Jobs

```bash theme={null}
mallary jobs get 123
mallary jobs get 123 --json
```

Completed jobs include `platform_post_id` and `platform_post_url` in JSON mode, and print `Post ID` / `Post URL` in normal output when available.

## Analytics

```bash theme={null}
mallary analytics list
mallary analytics list --profile-id AbC123xYz90
mallary analytics list --post-id 123
```

Browse all saved post analytics with filters and page through the results:

```bash theme={null}
mallary analytics posts
mallary analytics posts --profile-id AbC123xYz90 --platform instagram --sort views --limit 25
mallary analytics posts --start-date 2026-09-01 --end-date 2026-09-29 --cursor <next_cursor>
```

You can also use `--status`, `--media-type`, `--search`, and `--json`. The JSON result includes each post's platform metrics, `total`, and `next_cursor`.

## Audience

Get the latest follower or subscriber count for every connected account in a profile:

```bash theme={null}
mallary audience list
mallary audience list --profile-id AbC123xYz90
mallary audience list --json
```

Mallary updates supported counts once every 24 hours. TikTok returns followers when the connection includes audience stats access. LinkedIn shows `permission_required` until Mallary adds the permission it needs.

## Profiles

```bash theme={null}
mallary profiles list
mallary profiles list --json
```

## Webhooks

List:

```bash theme={null}
mallary webhooks list
```

Create:

```bash theme={null}
mallary webhooks create \
  --url https://example.com/mallary \
  --event post.published \
  --event post.failed
```

Delete:

```bash theme={null}
mallary webhooks delete 12
```

## Settings

```bash theme={null}
mallary settings get
mallary settings get --profile-id AbC123xYz90
mallary settings update --file ./settings.partial.json
mallary settings update --file ./settings.partial.json --profile-id AbC123xYz90
```

## Platforms

```bash theme={null}
mallary platforms list
mallary platforms list --profile-id AbC123xYz90
mallary platforms disconnect facebook
mallary platforms disconnect facebook --profile-id AbC123xYz90
```

`platforms list` includes each destination's selectable `post_types`. Platforms whose format is chosen from the content and media report automatic selection.

## Drafts

Requires CLI 0.2.18 or later. Saved drafts are available to all users. Draft saves use no posting allowance. They never publish or assign a date.

```bash theme={null}
mallary drafts create --message "An unfinished idea" --profile-id <profile-id> --json
mallary drafts list --profile-id <profile-id> --page 1 --per-page 20 --json
mallary drafts get <draft-id> --json
mallary drafts edit <draft-id> --expected-revision 1 --message "Ready for review" --platform linkedin --json
mallary drafts delete <draft-id> --expected-revision 2 --json
```

Use the draft UUID and current revision returned by Mallary. The numbers above are examples; read the actual revision before each write. A `409` means you must read again. Supplied lists and platform settings replace their saved values; omitted fields stay unchanged. Use `--file changes.json` with empty arrays to clear media, comments, or destinations.

Create and edit support `--message`, repeated `--platform`, `--profile-id`, repeated `--media`, `--thumbnail`, repeated `--comment`, `--post-type`, `--auto-reply-enabled`, or `--file`. File mode supports the draft API content fields. `--expected-revision` is required for edits and can be supplied with file mode. Local media files upload to Mallary before saving. A saved draft does not make uploaded media private.

## Publish or Schedule

Only use these commands when the user asks to publish or schedule the saved post:

```bash theme={null}
mallary drafts submit <draft-id> --expected-revision 2 --json
mallary drafts submit <draft-id> --expected-revision 2 --scheduled-at 2030-01-01T12:00:00Z --json
mallary drafts submit <draft-id> --expected-revision 2 --scheduled-at 2030-01-01T09:00 --scheduled-timezone America/New_York --json
```

Omit the date to publish now. Normal plan, account, content, and platform checks apply. Validation failures leave the draft saved. Repeating the exact revision and schedule returns the original publishing jobs. After an uncertain response, read the draft; a submitted draft includes `submission`. Do not create a new post as a retry.

Draft saves reject schedule fields, webhook URLs, and publishing idempotency keys. List and get use read scope. Save, edit, delete, and submit use publish scope. For reads, deletes, and submissions, `--profile-id` optionally verifies the source profile. For edits, it changes the saved profile. A draft uses one connection profile.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.