API Reference
Programmatically publish posts using the Postixly API.
API Reference
The Postixly API allows you to create and schedule posts programmatically. This is useful for integrating with other tools, bulk scheduling, or building custom workflows.
Authentication
All API requests must include your API key in the X-API-Key header.
X-API-Key: sp_your_api_key_here
You can generate an API key in your Account Settings > API Keys.
Security Note: Keep your API keys secure. Do not expose them in client-side code (browsers). If a key is compromised, revoke it immediately in your dashboard.
Base URL
All API endpoints are relative to the Social Publisher Microservice URL.
Production: https://publisher.postixly.com (Example - check your configuration) Local Development: http://localhost:3001
Endpoints
Create a Post
Creates a new post and schedules it for publication.
- Endpoint:
POST /posts - Content-Type:
application/json
Body Parameters
| Name | Type | Required | Description |
|---|---|---|---|
content | string | Yes | The text content of the post. |
connection_ids | array | Yes | Array of Connection IDs (UUIDs) to publish to. You can find these IDs in the URL when managing connections. |
media_urls | array | No | Array of public image/video URLs. |
scheduled_at | string | No | ISO 8601 date string (e.g., 2024-01-01T12:00:00Z). If omitted, the post is scheduled for immediate publication. |
platform_options | object | No | Platform-specific options. |
Platform Options
You can pass specific options for platforms like TikTok.
{
"tiktok": {
"privacy_level": "PUBLIC",
"disable_comments": true,
"title": "My TikTok Video"
}
}
Example Request
curl -X POST http://localhost:3001/posts \
-H "Content-Type: application/json" \
-H "X-API-Key: sp_1234567890" \
-d '{
"content": "Hello world from API! 🚀",
"connection_ids": ["a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11"],
"media_urls": ["https://images.unsplash.com/photo-1234"],
"platform_options": {
"tiktok": {
"privacy_level": "PUBLIC"
}
}
}'
Response
Success (201 Created)
{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"content": "Hello world from API! 🚀",
"status": "scheduled",
"scheduled_at": "2024-03-07T10:00:00.000Z",
"created_at": "2024-03-07T09:59:00.000Z"
}
}
Error (400 Bad Request)
{
"error": "Validation error",
"details": {
"fieldErrors": {
"connection_ids": ["At least one connection_id or platform must be provided"]
}
}
}
Error (401 Unauthorized)
{
"error": "Unauthorized",
"message": "Invalid API key"
}