Skip to content

Posts API Reference

The Posts API allows you to create, retrieve, and delete social media posts across multiple platforms.

MethodEndpointDescription
GET/api/postsList all posts
GET/api/posts/:idGet a single post
POST/api/postsCreate a new post
POST/api/posts/:id/publishPublish a draft post
DELETE/api/posts/:idDelete a post

GET /api/posts

Retrieves a paginated list of all posts in the current profile group.

NameTypeRequiredDefaultDescription
pageintegerNo0Page number (zero-indexed)
per_pageintegerNo10Number of posts per page
profile_group_idstringNo-Filter by profile group (hashid)
statusstringNo-Filter by status: draft, scheduled, published, failed
platformsarrayNo-Array of platforms (e.g., platforms[]=instagram&platforms[]=tiktok)
scheduled_afterstringNo-ISO 8601 date to filter posts scheduled after that date
Terminal window
curl -X GET "https://api.postproxy.dev/api/posts?page=0&per_page=10" \
-H "Authorization: Bearer YOUR_API_KEY"

Response:

{
"total": 42,
"page": 0,
"per_page": 10,
"data": [
{
"id": "abc123xyz",
"body": "Check out our latest update!",
"status": "processed",
"scheduled_at": null,
"created_at": "2024-01-15T10:30:00.000Z",
"platforms": [
{
"platform": "twitter",
"status": "published",
"params": null,
"error": null,
"attempted_at": "2024-01-15T10:30:01.000Z",
"insights": {
"impressions": 1523,
"on": "2024-01-15T18:00:00.000Z"
}
},
{
"platform": "instagram",
"status": "published",
"params": {
"format": "post",
"first_comment": "Link in bio!"
},
"error": null,
"attempted_at": "2024-01-15T10:30:02.000Z",
"insights": {
"impressions": 3842,
"on": "2024-01-15T18:00:00.000Z"
}
}
]
}
]
}
FieldTypeDescription
totalintegerTotal number of posts
pageintegerCurrent page number
per_pageintegerItems per page
dataarrayArray of post objects

GET /api/posts/:id

Retrieves a single post by its ID.

NameTypeRequiredDescription
idstringYesPost hashid
Terminal window
curl -X GET "https://api.postproxy.dev/api/posts/abc123xyz" \
-H "Authorization: Bearer YOUR_API_KEY"

Response:

{
"id": "abc123xyz",
"body": "Check out our latest update!",
"status": "processed",
"scheduled_at": null,
"created_at": "2024-01-15T10:30:00.000Z",
"platforms": [
{
"platform": "twitter",
"status": "published",
"params": null,
"error": null,
"attempted_at": "2024-01-15T10:30:01.000Z",
"insights": {
"impressions": 1523,
"on": "2024-01-15T18:00:00.000Z"
}
}
]
}
FieldTypeDescription
idstringUnique post identifier (hashid)
bodystringPost body/text content
statusstringPost status: processing, processed, scheduled
scheduled_atstring|nullISO 8601 timestamp if scheduled, null otherwise
created_atstringISO 8601 timestamp of creation
platformsarrayArray of platform-specific posting results
FieldTypeDescription
platformstringPlatform identifier: facebook, instagram, tiktok, linkedin, youtube, twitter, threads
statusstringPlatform posting status: processing, published, failed, deleted
paramsobject|nullPlatform-specific parameters used for this post
attempted_atstring|nullISO 8601 timestamp of posting attempt
insightsobjectEngagement metrics (when available)
insights.impressionsintegerNumber of impressions/views
insights.onstringISO 8601 timestamp when insights were captured

POST /api/posts

Creates a new post and publishes it to the specified platforms.

NameTypeRequiredDescription
post[body]stringNo*Text content of the post
post[scheduled_at]stringNoISO 8601 timestamp to schedule the post
draftbooleanNoIf true, creates a draft that won’t publish until reviewed
profilesarrayYesArray of profile IDs or platform names
mediaarrayNo*Array of media URLs or file uploads
platformsobjectNoPlatform-specific parameters

*Some platforms require media (Instagram, TikTok, YouTube). Some platforms require text content.

Set draft: true to create a post that won’t be published automatically. Draft posts can be reviewed and then published using the Publish endpoint.

{
"post": {
"body": "Content to review before posting"
},
"profiles": ["instagram"],
"draft": true
}

The profiles array accepts either:

  • Platform names: "twitter", "instagram", "facebook", etc. - Uses the first connected profile for that platform
  • Profile IDs: Hashid of a specific profile

You can provide media in two ways:

Option 1: URLs (JSON request)

Pass URLs to images or videos that PostProxy will download:

{
"media": [
"https://example.com/image1.jpg",
"https://example.com/image2.png"
]
}

Option 2: File upload (multipart form)

Upload files directly using multipart/form-data:

Terminal window
curl -X POST "https://api.postproxy.dev/api/posts" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "post[body]=Check out this photo!" \
-F "profiles[]=instagram" \
-F "profiles[]=facebook" \
-F "media[]=@/path/to/image.jpg"

When using file upload, use form field names with brackets: post[body], profiles[], media[].

Pass platform-specific options in the platforms object. See Platform Parameters for all available options.

{
"platforms": {
"instagram": {
"format": "reel",
"first_comment": "Check the link in bio!"
},
"youtube": {
"title": "My Video Title",
"privacy_status": "public"
}
}
}
Terminal window
curl -X POST "https://api.postproxy.dev/api/posts" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"post": {
"body": "Hello from the API!"
},
"profiles": ["twitter", "linkedin", "threads"],
"media": ["https://example.com/image.jpg"]
}'

Response (201 Created):

{
"id": "xyz789abc",
"body": "Hello from the API!",
"status": "processed",
"scheduled_at": null,
"created_at": "2024-01-15T10:30:00.000Z",
"platforms": [
{
"platform": "twitter",
"status": "pending",
"error": null,
"params": null,
"attempted_at": null
},
{
"platform": "linkedin",
"status": "pending",
"error": null,
"params": null,
"attempted_at": null
},
{
"platform": "threads",
"status": "pending",
"error": null,
"params": null,
"attempted_at": null
}
]
}

Missing profiles parameter (400):

{
"status": 400,
"error": "Bad Request",
"message": "param is missing or the value is empty: Missing profiles parameter"
}

Validation errors (422):

{
"errors": [
"Post profiles must have at least one profile selected",
"Media is required for feed post on Instagram"
]
}

DELETE /api/posts/:id

Deletes a post from the database. Note: This does not remove the post from social media platforms.

NameTypeRequiredDescription
idstringYesPost hashid
Terminal window
curl -X DELETE "https://api.postproxy.dev/api/posts/abc123xyz" \
-H "Authorization: Bearer YOUR_API_KEY"

Response:

{
"deleted": true
}

POST /api/posts/:id/publish

Publishes a draft post. Only posts with status: "draft" can be published using this endpoint.

NameTypeRequiredDescription
idstringYesPost hashid
Terminal window
curl -X POST "https://api.postproxy.dev/api/posts/abc123xyz/publish" \
-H "Authorization: Bearer YOUR_API_KEY"

Response:

{
"id": "abc123xyz",
"content": "Hello World!",
"status": "processing",
"scheduled_at": null,
"created_at": "2024-01-15T10:30:00.000Z",
"platforms": [
{
"platform": "instagram",
"status": "processing",
"params": {
"format": "post"
},
"attempted_at": null
}
]
}

Post not found (404):

{
"error": "Not found"
}

Post is not a draft (422):

{
"error": "Post is not a draft"
}

StatusDescription
draftPost is saved but not published, awaiting review
processingPost is being published to platforms
processedAll platform publishing attempts completed
scheduledPost is scheduled for future publishing
StatusDescription
processingCurrently being published to this platform
publishedSuccessfully published
failedPublishing failed (check error message)
deletedPost was deleted on a platform

Insights (impressions/views) are collected periodically after a post is published. The insights object in the platform response contains:

FieldDescription
impressionsNumber of views/impressions on the platform
onTimestamp when the metrics were captured

Insights are updated approximately every 8 hours for published posts.