Skip to main content

posts:create

Create and schedule a new post to one or more social media platforms.

Usage

postiz posts:create [options]

Options

--content, -c
string
required
Post or comment content. Can be used multiple times for threads/comments.
# Single post
-c "Hello World!"

# Thread (multiple tweets)
-c "First tweet" -c "Second tweet" -c "Third tweet"
--media, -m
string
Comma-separated media URLs. Can be used multiple times to pair with corresponding content.
# Single image
-m "https://cdn.postiz.com/img1.jpg"

# Multiple images for one post
-m "img1.jpg,img2.jpg,img3.jpg"

# Different media for each content
-c "Main post" -m "img1.jpg" -c "Comment" -m "img2.jpg"
--integrations, -i
string
required
Comma-separated list of integration IDs. Get IDs from integrations:list.
# Single platform
-i "twitter-123"

# Multiple platforms
-i "twitter-123,linkedin-456,facebook-789"
--date, -s
string
required
Schedule date in ISO 8601 format. Required even for drafts.
-s "2024-12-31T12:00:00Z"
--type, -t
string
default:"schedule"
Post type: schedule or draft.
-t schedule  # Schedule for publication
-t draft     # Save as draft
--delay, -d
number
default:"5000"
Delay in milliseconds between comments/thread items.
-d 2000  # 2 second delay
Use short links in post content.
--shortLink false  # Disable short links
--settings
string
Platform-specific settings as JSON string.
--settings '{"subreddit":[{"value":{"subreddit":"programming"}}]}'
--json, -j
string
Path to JSON file with full post structure. Overrides all other options.
--json ./post.json

Examples

postiz posts:create \
  -c "Hello World!" \
  -s "2024-12-31T12:00:00Z" \
  -i "twitter-123"

posts:list

List scheduled and published posts within a date range.

Usage

postiz posts:list [options]

Options

--startDate
string
Start date in ISO 8601 format. Default: 30 days ago.
--startDate "2024-01-01T00:00:00Z"
--endDate
string
End date in ISO 8601 format. Default: 30 days from now.
--endDate "2024-12-31T23:59:59Z"
--customer
string
Filter by customer ID (for multi-tenant setups).
--customer "customer-123"

Examples

# Lists posts from last 30 days to next 30 days
postiz posts:list

posts:delete

Delete a scheduled or draft post by ID.

Usage

postiz posts:delete <id>

Arguments

id
string
required
Post ID to delete. Get from posts:list.

Examples

postiz posts:delete post-123

integrations:list

List all connected social media integrations.

Usage

postiz integrations:list

Examples

postiz integrations:list

integrations:settings

Get platform-specific settings schema for an integration.

Usage

postiz integrations:settings <id>

Arguments

id
string
required
Integration ID. Get from integrations:list.

Examples

postiz integrations:settings reddit-123

integrations:trigger

Trigger an integration tool to fetch additional data (e.g., subreddits, playlists).

Usage

postiz integrations:trigger <id> <method> [options]

Arguments

id
string
required
Integration ID. Get from integrations:list.
method
string
required
Method name from the integration’s available tools. Get from integrations:settings.

Options

--data, -d
string
Data to pass to the tool as JSON string.
-d '{"query":"programming"}'

Examples

postiz integrations:trigger reddit-123 getSubreddits

upload

Upload a media file (image, video, document).

Usage

postiz upload <file>

Arguments

file
string
required
Path to the file to upload.

Examples

postiz upload ./photo.jpg

Global Options

—help, -h

Display help information for any command.
postiz --help
postiz posts:create --help
postiz integrations:list --help

—version, -v

Display CLI version.
postiz --version

Exit Codes

The CLI uses standard exit codes:
  • 0 - Success
  • 1 - Error (invalid arguments, API error, authentication failure, etc.)
Use exit codes in scripts:
postiz posts:create -c "Test" -s "2024-12-31T12:00:00Z" -i "twitter-123"

if [ $? -eq 0 ]; then
  echo "✅ Post created successfully"
else
  echo "❌ Failed to create post"
  exit 1
fi

Environment Variables

POSTIZ_API_KEY
string
required
Your Postiz API key. Required for all commands.
export POSTIZ_API_KEY="your_api_key_here"
POSTIZ_API_URL
string
Custom API URL for self-hosted instances. Default: https://api.postiz.com
export POSTIZ_API_URL="https://your-domain.com"

Next Steps

CLI Overview

Learn more about the CLI

API Reference

Full API documentation

Node.js SDK

Use the programmatic SDK

API Overview

View API documentation

Build docs developers (and LLMs) love