- name
- publer-api
- description
- >
Publer API Skill
This skill enables you to interact with all Publer API endpoints.
Business plan required. The Publer API is only available to Business plan users.
Setup
Base URL: https://app.publer.com/api/v1
Required headers on almost every request:
Authorization: Bearer-API YOUR_API_KEY
Publer-Workspace-Id: YOUR_WORKSPACE_ID
Content-Type: application/jsonNote: Bearer-API (not Bearer) is the correct format.
If the user hasn't provided their API key, ask for it before making any calls. Never hardcode or expose API keys.
API key scopes: workspaces, accounts, posts, media, analytics
Quick Reference: All Endpoints
| Area | Method | Endpoint |
|---|---|---|
| Users | GET | /users/me |
| Workspaces | GET | /workspaces |
| Accounts | GET | /accounts |
| Posts | GET | /posts |
| Posts — Schedule/Draft | POST | /posts/schedule |
| Posts — Publish Now | POST | /posts/schedule/publish |
| Posts — Update | PUT | /posts/{id} |
| Posts — Delete | DELETE | /posts |
| Job Status | GET | /job_status/{job_id} |
| Media — List | GET | /media |
| Media — Direct Upload | POST | /media |
| Media — URL Upload | POST | /media/from-url |
| Media Options | GET | /workspaces/{workspace_id}/media_options |
| Analytics — Charts List | GET | /analytics/charts |
| Analytics — Chart Data | GET | /analytics/:account_id/chart_data |
| Analytics — Post Insights | GET | /analytics/:account_id/post_insights |
| Analytics — Hashtag Insights | GET | /analytics/:account_id/hashtag_insights |
| Analytics — Hashtag Posts | GET | /analytics/:account_id/hashtag_performing_posts |
| Analytics — Best Times | GET | /analytics/:account_id/best_times |
| Analytics — Members | GET | /analytics/members |
| Competitors — List | GET | /competitors/:account_id |
| Competitors — Analytics | GET | /competitors/:account_id/analytics |
For full request/response shapes, read references/api-reference.md.
Workflow
1. Identify the intent
Map the user's request to one or more API calls from the table above.
2. Gather required parameters
- Workspace ID: Needed for most calls. If unknown, call
GET /workspacesfirst. - Account IDs: Needed for post creation. If unknown, call
GET /accounts. - Scheduled posts:
scheduled_atmust be ISO 8601 with timezone, at least 1 minute in the future. - Analytics: Most endpoints need
from/todate range (YYYY-MM-DD). They are co-required. - Media: Must be uploaded first via
/mediaor/media/from-url, then referenced by ID in posts.
3. Make the API call
Use the correct HTTP method and headers. POST/PUT use Content-Type: application/json. Media direct upload uses multipart/form-data.
4. Handle async operations
Post creation and URL media uploads are asynchronous:
- Response returns
{ "success": true, "data": { "job_id": "..." } } - Poll
GET /job_status/{job_id}untilstatusis"complete"or"failed" - Check
payload.failureseven on"complete"— partial failures are possible
5. Interpret the response
- 2xx — success. Parse and present relevant fields clearly.
- 401 — ask user to verify API key and confirm
Bearer-APIformat. - 403 — check required scope is enabled, and
Publer-Workspace-Idheader is present. - 404 — resource ID is wrong; confirm with user.
- 422 — surface the
errors[]array to user and ask them to correct input. - 429 — rate limited (100 req/2 min); wait for
X-RateLimit-Reset, use exponential backoff. - 5xx — Publer server error; suggest retry.
Common Workflows
Schedule a post
- If workspace/account IDs unknown:
GET /workspacesthenGET /accounts POST /posts/schedulewithstate: "scheduled", network content, andscheduled_atper account- Poll
GET /job_status/{job_id}until complete - Confirm back: platform(s), scheduled time, text preview
Publish immediately
Same as above but use POST /posts/schedule/publish and omit scheduled_at.
Cross-post with platform-specific content
Use multiple keys under networks with per-platform text/type:
"networks": {
"facebook": { "type": "status", "text": "Longer Facebook copy..." },
"twitter": { "type": "status", "text": "Short tweet #hashtag" },
"linkedin": { "type": "status", "text": "Professional LinkedIn copy..." }
}Upload and attach media
POST /media(multipart) for direct upload, orPOST /media/from-urlfor URL import- Check
validityobject in response for network compatibility - Reference
media.idin themedia[]array inside the network object when creating post
List and review scheduled posts
GET /posts?state=scheduled- Display as readable list: date, network, text preview
- Offer to edit (
PUT /posts/{id}) or delete (DELETE /posts?post_ids[]=...) on request
Fetch analytics
- For account-level charts:
GET /analytics/chartsto get available IDs, thenGET /analytics/:account_id/chart_data?chart_ids[]=...&from=...&to=... - For per-post performance:
GET /analytics/:account_id/post_insights?from=...&to=... - For hashtag performance:
GET /analytics/:account_id/hashtag_insights - For best posting times:
GET /analytics/:account_id/best_times?from=...&to=...
Competitor analysis
GET /competitors/:account_idto list competitorsGET /competitors/:account_id/analyticsfor aggregate metrics- Use
competitors=true&competitor_id=...on post insights and best times endpoints for deeper comparison
Key Notes & Edge Cases
- Auth header format:
Bearer-API YOUR_KEY— notBearer - Workspace in header vs path: Most endpoints use
Publer-Workspace-Idheader. Exception:GET /workspaces/{workspace_id}/media_optionsuses workspace ID in the path. /users/meand/workspacesdo not require the workspace header.- Pagination: 0-based
pageparam throughout. Post insights and hashtag insights return 10 per page. - Date format: ISO 8601 with timezone for timestamps; YYYY-MM-DD for analytics date ranges.
defaultnetwork key: Use"default"as the network to apply same content to all accounts.- Threads: Cannot schedule for specific times via API.
- Analytics data freshness: Metrics auto-sync ~every 24h. Not real-time.
- Competitor
sort_type: Lowercaseasc/desc— unlike post/hashtag insights which useASC/DESC. reachfield: May be omitted in members analytics and competitor analytics for unsupported networks — handle gracefully.
Reference Files
references/api-reference.md— Full endpoint docs with all request/response shapes, field enums, media specs, daily post limits, and error handling. Read this when you need exact field names, response shapes, or need to handle a case not covered above.