API Documentation

Quick Reference

Available Endpoints

Introduction

Publora provides a powerful REST API that enables seamless integration with your existing tools and workflows.

Whether you're building a custom application, automating your social media management, or integrating with no-code platforms, our API lets you schedule and manage content across multiple social networks programmatically.

Base URL

https://api.publora.com

Authentication

All API requests must include your API key in the request headers:

x-publora-key: your_api_key_here

You can generate your API key in the Settings page of your dashboard.

API Reference

Create a Post

To create a post, you'll need to follow these two steps:

Step 1: Get Connected Accounts

First, retrieve the list of connected social media accounts. You'll need the platformId from each connection to create posts.

GET/api/v1/platform-connections

Response

{
  "success": true,
  "connections": [
    {
      "platformId": "twitter-123456",    // Use this ID for creating posts
      "username": "example",
      "displayName": "Example User",     // Only available for X, Bluesky, Mastodon
      "profileImageUrl": "https://..."
    }
  ]
}

Step 2: Create the Post

Use the platformId values from step 1 to specify which accounts should post your content. Include multiple platform IDs to create the same post across different platforms simultaneously.

POST/api/v1/create-post

Request Body

{
  "content": "Your post content",
  "scheduledTime": "2025-04-07T10:00:00Z",  // ISO 8601 UTC format
  "platforms": ["twitter-123456", "instagram-789012"]  // platformIds from step 1
}

Response

{
  "success": true,
  "postGroupId": "6507e563a1b2c3d4e5f6g789"  // Use this ID to upload media or delete post
}

Get Post Details

Use the postGroupId received from the create-post response to retrieve details about a post group including its status and platform-specific post information. This is useful for tracking the status of your posts and getting the platform-specific post IDs after publication.

GET/api/v1/get-post/:postGroupId

Response

{
  "success": true,
  "postGroupId": "6868a10bdafc11893c9cab32",
  "posts": [
    {
      "_id": "6868a10bdafc11893c9cab35",
      "content": "Your post content",
      "platform": "linkedin",
      "platformId": "pwdsv7ZwyL",
      "status": "published",
      "postedId": "urn:li:share:7347109644793757697" // Post ID from the target platform
    }
    // Additional platform posts will appear here
  ]
}

Note: postedId is only available for LinkedIn posts at the moment.

Upload Media

To upload media files (images or videos), you'll need to follow these two steps:

Step 1: Get Upload URL

Request a pre-signed upload URL for your media file using the postGroupId from step 1. You can upload up to 4 images or 1 video per post. The pre-signed URL expires after 15 minutes.

POST/api/v1/get-upload-url

Request Body

{
  "fileName": file.name,            // Original file name
  "contentType": file.type,         // MIME type of the file
  "type": "image",                  // Either "image" or "video"
  "postGroupId": "post_group_id"    // ID received from create-post response
}

Response

{
  "success": true,
  "uploadUrl": "https://...",       // Presigned S3 URL for uploading (expires in 15 minutes)
  "fileUrl": "https://...",         // Final URL where file will be accessible
  "mediaId": "67f6659c3df3ebdee"    // Store this ID to reference the media in your posts
}

Step 2: Upload the File

Use the presigned URL to upload your file with a PUT request. Make sure to set the Content-Type header to match the MIME type from step 1, and set withCredentials to False when uploading to S3. You can also track upload progress using the onUploadProgress event.

const response = await fetch(uploadUrl, {
  method: 'PUT',
  body: fileContent,
  headers: {
    'Content-Type': contentType
  },
  withCredentials: false, 
  onUploadProgress: (progressEvent) => {
    if (progressEvent.total) {
      const progress = (progressEvent.loaded / progressEvent.total) * 100;
      console.log(`Upload progress: ${progress}%`);
    }
  }
});

// The file will be available at the fileUrl from step 1

Update Post

Use this endpoint to update a post's status or scheduled time. Use the postGroupId that was returned when you created the post. You can change a post's status between draft and scheduled, update its scheduled time, or both. At least one of these fields must be provided in the request.

PUT/api/v1/update-post/:postGroupId

Request Body

{
  "status": "draft",                       
  "scheduledTime": "2025-04-07T10:00:00Z" 
}

Response

{
  "success": true,
  "message": "Post updated successfully",
  "postGroup": {
    "_id": "6507e563a1b2c3d4e5f6g789",
    "status": "scheduled",
    "scheduledTime": "2025-04-07T10:00:00Z"
  }
}

Delete a Post

To delete a scheduled post and all its associated platform-specific posts, use the postGroupId that was returned when you created the post.

DELETE/api/v1/delete-post/:postGroupId

Response

{
  "success": true
}

LinkedIn Post Statistics

Retrieve analytics data for a LinkedIn post. This endpoint allows you to get various metrics such as impressions, reach, reactions, comments, and reshares for a specific LinkedIn post.

Required Parameters

  • postedId: The LinkedIn post identifier
    • Format: urn:li:share:7387028262125965312
    • Where to get it: From the get-post endpoint response, in the postedId field of a published LinkedIn post
  • queryType: The type of statistic to retrieve
    • IMPRESSION: Number of times the post was shown
    • MEMBERS_REACHED: Number of unique members who saw the post
    • RESHARE: Number of times the post was reshared
    • REACTION: Number of reactions (likes, etc.) on the post
    • COMMENT: Number of comments on the post
  • platformId: The LinkedIn connection identifier
    • Format: Either linkedin-Tz9W5i6ZYG or just Tz9W5i6ZYG
    • Where to get it: From the platform-connections endpoint response
POST/api/v1/linkedin-post-statistics

Request Body

{
  "postedId": "urn:li:share:7387028262125965312",
  "queryType": "COMMENT",
  "platformId": "linkedin-Tz9W5i6ZYG"
}

Response

{
  "success": true,
  "count": 42
}

Important Notes

  • You must first publish a post to LinkedIn before you can retrieve its statistics
  • The postedId is only available after a post has been successfully published
  • Each query type returns a single count value for the specified metric
  • To get all statistics, make separate requests for each query type

Support

Need help? Join our Discord community or email us at [email protected].