API Reference
Complete reference for the Postally REST API. All endpoints require authentication and return JSON responses.
Base URL
https://app.postally.io/api/v1Authentication
All API requests require a valid API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Accounts
GET
/accountsRetrieve all connected social media accounts.
Response
{
"accounts": [
{
"id": "acc_123456",
"platform": "twitter",
"username": "@yourhandle",
"status": "connected",
"created_at": "2024-01-01T00:00:00Z"
}
]
}POST
/accountsConnect a new social media account.
Request Body
{
"platform": "twitter",
"oauth_token": "your_oauth_token",
"oauth_secret": "your_oauth_secret"
}Posts
GET
/postsRetrieve all posts (scheduled and published).
Query Parameters
statusFilter by status: scheduled, published, failedplatformFilter by platform: twitter, instagram, etc.POST
/postsCreate and schedule a new post.
Request Body
{
"content": "Your post content here",
"platforms": ["twitter", "instagram"],
"schedule_time": "2024-01-01T12:00:00Z",
"media": ["image_url_1", "image_url_2"],
"hashtags": ["#social", "#marketing"]
}Analytics
GET
/analyticsGet analytics data for your posts and accounts.
Query Parameters
date_fromStart date (ISO 8601)date_toEnd date (ISO 8601)AI Content Generation
POST
/ai/generateGenerate AI-powered content for social media posts.
Request Body
{
"prompt": "Create a post about sustainable fashion",
"platform": "instagram",
"tone": "professional",
"include_hashtags": true,
"max_length": 280
}Rate Limits
API requests are limited to 1000 requests per hour per API key. Rate limit headers are included in all responses.