publora

TotalClaw 作者 totalclaw

Publora API — 在 10 个平台上安排和发布社交媒体帖子 (X/Twitter、LinkedIn、Instagram、Threads、TikTok、YouTube、Facebook、Bluesky、 乳齿象,电报)。当用户想要发帖时使用这个技巧, 计划、草稿、批量计划、管理工作区用户、配置 webhooks、 或通过 Publora 检索 LinkedIn 分析。

安装 / 下载方式

TotalClaw CLI推荐
totalclaw install totalclaw:totalclaw~sergebulaev-publora
cURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/totalclaw%3Atotalclaw~sergebulaev-publora/file -o sergebulaev-publora.md
## 概述(中文)

Publora API — 在 10 个平台上安排和发布社交媒体帖子
(X/Twitter、LinkedIn、Instagram、Threads、TikTok、YouTube、Facebook、Bluesky、
乳齿象,电报)。当用户想要发帖时使用这个技巧,
计划、草稿、批量计划、管理工作区用户、配置 webhooks、
或通过 Publora 检索 LinkedIn 分析。

## 原文

# Publora API — Core Skill

Publora is an affordable REST API for scheduling and publishing social media posts
across 10 platforms (Pinterest is listed internally but not yet supported). Base URL: `https://api.publora.com/api/v1`

## Plans & API Access

| Plan | Price | Posts/Month | Platforms |
|------|-------|-------------|-----------|
| Starter | Free | 15 | LinkedIn & Bluesky |
| Pro | $2.99/account | 100/account | All |
| Premium | $5.99/account | 500/account | All |

> ℹ️ Starter gives API access for LinkedIn and Bluesky. Twitter/X requires Pro or Premium (explicitly excluded from Starter). See [publora.com/pricing](https://publora.com/pricing).

## Authentication

All requests require the `x-publora-key` header. Keys start with `sk_` (format: `sk_xxxxxxx.xxxxxx...`).

```bash
curl https://api.publora.com/api/v1/platform-connections \
  -H "x-publora-key: sk_YOUR_KEY"
```

Get your key: [publora.com](https://publora.com) → Settings → API Keys → Generate API Key.
⚠️ Copy immediately — shown only once.

## Step 0: Get Platform IDs

**Always call this first** to get valid platform IDs before posting.

```javascript
const res = await fetch('https://api.publora.com/api/v1/platform-connections', {
  headers: { 'x-publora-key': 'sk_YOUR_KEY' }
});
const { connections } = await res.json();
// connections[i].platformId → e.g. "linkedin-ABC123", "twitter-456"
// Also returns: tokenStatus, tokenExpiresIn, lastSuccessfulPost, lastError
```

Platform IDs look like: `twitter-123`, `linkedin-ABC`, `instagram-456`, `threads-789`, etc.

## Post Immediately

Omit `scheduledTime` to publish right away:

```javascript
await fetch('https://api.publora.com/api/v1/create-post', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json', 'x-publora-key': 'sk_YOUR_KEY' },
  body: JSON.stringify({
    content: 'Your post content here',
    platforms: ['twitter-123', 'linkedin-ABC']
  })
});
```

## Schedule a Post

Include `scheduledTime` in ISO 8601 UTC — must be in the future:

```javascript
await fetch('https://api.publora.com/api/v1/create-post', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json', 'x-publora-key': 'sk_YOUR_KEY' },
  body: JSON.stringify({
    content: 'Scheduled post content',
    platforms: ['twitter-123', 'linkedin-ABC'],
    scheduledTime: '2026-03-16T10:00:00.000Z'
  })
});
// Response: { postGroupId: "pg_abc123", scheduledTime: "..." }
```

## Save as Draft

Omit `scheduledTime` — post is created as draft. Schedule it later:

```javascript
// Create draft
const { postGroupId } = await createPost({ content, platforms });

// Schedule later
await fetch(`https://api.publora.com/api/v1/update-post/${postGroupId}`, {
  method: 'PUT',
  headers: { 'Content-Type': 'application/json', 'x-publora-key': 'sk_YOUR_KEY' },
  body: JSON.stringify({ status: 'scheduled', scheduledTime: '2026-03-16T10:00:00.000Z' })
});
```

## List Posts

Filter, paginate and sort your scheduled/published posts:

```javascript
// GET /api/v1/list-posts
// Query params: status, platform, fromDate, toDate, page, limit, sortBy, sortOrder
const res = await fetch(
  'https://api.publora.com/api/v1/list-posts?status=scheduled&platform=twitter&page=1&limit=20',
  { headers: { 'x-publora-key': 'sk_YOUR_KEY' } }
);
const { posts, pagination } = await res.json();
// pagination: { page, limit, totalItems, totalPages, hasNextPage, hasPrevPage }
```

Valid statuses: `draft`, `scheduled`, `published`, `failed`, `partially_published`

## Get / Delete a Post

```bash
# Get post details
GET /api/v1/get-post/:postGroupId

# Delete post (also removes media from storage)
DELETE /api/v1/delete-post/:postGroupId
```

## Get Post Logs

Debug failed or partially published posts:

```javascript
const res = await fetch(
  `https://api.publora.com/api/v1/post-logs/${postGroupId}`,
  { headers: { 'x-publora-key': 'sk_YOUR_KEY' } }
);
const { logs } = await res.json();
```

## Test a Connection

Verify a platform connection is healthy before posting:

```javascript
const res = await fetch(
  'https://api.publora.com/api/v1/test-connection/linkedin-ABC123',
  { method: 'POST', headers: { 'x-publora-key': 'sk_YOUR_KEY' } }
);
// Returns: { status: "ok"|"error", message, permissions, tokenExpiresIn }
```

## Bulk Schedule (a Week of Content)

```python
from datetime import datetime, timedelta, timezone
import requests

HEADERS = { 'Content-Type': 'application/json', 'x-publora-key': 'sk_YOUR_KEY' }
base_date = datetime(2026, 3, 16, 10, 0, 0, tzinfo=timezone.utc)

posts = ['Monday post', 'Tuesday post', 'Wednesday post', 'Thursday post', 'Friday post']

for i, content in enumerate(posts):
    scheduled_time = base_date + timedelta(days=i)
    requests.post('https://api.publora.com/api/v1/create-post', headers=HEADERS, json={
        'content': content,
        'platforms': ['twitter-123', 'linkedin-ABC'],
        'scheduledTime': scheduled_time.isoformat()
    })
```

## Media Uploads

All media (images and videos) use a 3-step pre-signed upload workflow:

**Step 1:** `POST /api/v1/create-post` → get `postGroupId`  
**Step 2:** `POST /api/v1/get-upload-url` → get `uploadUrl`  
**Step 3:** `PUT {uploadUrl}` with file bytes (no auth needed for S3)

```python
import requests

HEADERS = { 'Content-Type': 'application/json', 'x-publora-key': 'sk_YOUR_KEY' }

# Step 1: Create post
post = requests.post('https://api.publora.com/api/v1/create-post', headers=HEADERS, json={
    'content': 'Check this out!',
    'platforms': ['instagram-456'],
    'scheduledTime': '2026-03-15T14:30:00.000Z'
}).json()
post_group_id = post['postGroupId']

# Step 2: Get pre-signed upload URL
upload = requests.post('https://api.publora.com/api/v1/get-upload-url', headers=HEADERS, json={
    'fileName': 'photo.jpg',
    'contentType': 'image/jpeg',
    'type': 'image',  # or 'video'
    'postGroupId': post_group_id
}).json()

# Step 3: Upload directly to S3 (no auth header needed)
with open('./photo.jpg', 'rb') as f:
    requests.put(upload['uploadUrl'], headers={'Content-Type': 'image/jpeg'}, data=f)
```

For carousels: call `get-upload-url` N times with the **same `postGroupId`**.

## Cross-Platform Threading

X/Twitter and Threads support threading. Three methods:

- **Auto-split**: Content over the char limit is split automatically at paragraph/sentence/word breaks. Publora adds `(1/N)` markers (e.g. `(1/3)`).
- **Manual `---`**: Use `---` on its own line to define exact split points.
- **Explicit `[n/m]`**: Use `[1/3]`, `[2/3]` markers — Publora preserves them as-is.

```javascript
// Manual split example
body: JSON.stringify({
  content: 'First tweet.\n\n---\n\nSecond tweet.\n\n---\n\nThird tweet.',
  platforms: ['twitter-123']
})
```

> ⚠️ **Threads Restriction:** Multi-threaded nested posts are **temporarily unavailable on Threads** (connected replies). Single posts, images, and carousels work normally. Contact support@publora.com for updates.

## LinkedIn Analytics

```javascript
// Post statistics — queryTypes is an ARRAY (not a string; 'ALL' is invalid here)
// Use queryType (singular string) for one metric, queryTypes (array) for multiple
await fetch('https://api.publora.com/api/v1/linkedin-post-statistics', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json', 'x-publora-key': 'sk_YOUR_KEY' },
  body: JSON.stringify({
    postedId: 'urn:li:share:7123456789',
    platformId: 'linkedin-ABC123',
    queryTypes: ['IMPRESSION', 'MEMBERS_REACHED', 'RESHARE', 'REACTION', 'COMMENT']
    // OR: queryType: 'IMPRESSION'  ← singular, returns { count: 123 }
    // Multi-metric response: { metrics: { IMPRESSION: 4521, MEMBERS_REACHED: 3200, ... } }
  })
});

// Profile summary (followers + aggregated stats)
await fetch('https://api.publora.com/api/v1/linkedin-profile-summary', {
  method: 'POST'