Log inStart free

API documentation

One API for Facebook Pages, Instagram, Threads and TikTok. Base URL https://hubsz.com

1. Authentication

Create an API key on the Developer page. Send it on every request:

Authorization: Bearer sh_xxxxxxxx

To act for one of your end-users, add X-Profile-Id: prof_xxx (or your own ref). Without it you act on your own accounts.

2. Profiles & connecting accounts

POST https://hubsz.com/v1/profiles            {"ref":"user_123","name":"Kedai Ali"}
GET  https://hubsz.com/v1/profiles
DELETE https://hubsz.com/v1/profiles/{id}     (deletes all its accounts and data)

GET  https://hubsz.com/v1/connect/tiktok?profile_id=user_123&return_to=https://yourapp.com/done
→ {"url":"https://www.tiktok.com/v2/auth/authorize/?..."}   redirect your user there

After authorizing, the user returns to return_to?status=connected&platform=tiktok&profile_id=prof_…&accounts=1 (or status=error&error=…). return_to origins must be allowed on the Developer page.

3. Posting

GET  https://hubsz.com/v1/accounts                       (X-Profile-Id: user_123)
POST https://hubsz.com/v1/posts
{
  "account_ids": ["acc_..."],
  "text": "Hello!",
  "media": [{"url": "https://.../video.mp4"}],
  "schedule_at": "2026-11-01T21:00:00+08:00",
  "options": {
    "instagram": {"type": "reel"},
    "tiktok": {"mode": "direct", "privacy_level": "PUBLIC_TO_EVERYONE",
               "allow_comment": true, "allow_duet": false, "allow_stitch": false,
               "commercial": false, "is_aigc": false}
  }
}
GET  https://hubsz.com/v1/posts/{id}

TikTok compliance (required): before posting to TikTok, your UI must call tiktok_creator_info, show the creator's nickname/avatar, let the user pick privacy from privacy_level_options with no default, keep comment/duet/stitch off by default, offer commercial-content disclosure (Your brand / Branded content), and show TikTok's Music Usage Confirmation. Direct posts without a user-chosen privacy_level are rejected — use "mode":"draft" to send to the user's TikTok inbox instead.

4. Any tool via REST

POST https://hubsz.com/api/tools/{tool_name}     body = tool arguments (JSON)
GET  https://hubsz.com/api/tools                 list of tools with JSON schemas

5. Webhooks

Set your URL on the Developer page. We send POST JSON {"id","type","created_at","data"} with header X-SocialHub-Signature: sha256=HMAC_SHA256(secret, raw_body).

Events: post.published, post.failed, account.connected, account.reauth_required, message.received, comment.received.

6. MCP (AI agents)

https://hubsz.com/mcp                 + Authorization: Bearer sh_…  [+ X-Profile-Id]
https://hubsz.com/mcp/{key}           for clients that cannot send headers
https://hubsz.com/mcp/{key}/{profile}

Every tool below is exposed. agent_run gives a natural-language task to the AI agent team; each specialist agent can only use the tools of its own permission area.

7. Errors & limits

401 bad key · 402 plan limit reached · 403 missing platform permission or not allowed · 404 not found · 429 rate limit · 502 platform error. Body: {"error":"message"}.

FreeStarter Most popularProBusiness
PriceRM0RM49 / monthRM199 / monthContact us
Posts / month301,50010,000100,000
Profiles (end-users)35050010,000
Connected accounts51001,00020,000
AI agent runs / month203002,00020,000
API requests / minute301203001,000

Tools

Developer (owner only)

create_profile writeCreate a profile (sub-tenant) for one end-user of your SaaS. Accounts, posts and events are isolated per profile.
ref Your own user id for this end-user (unique) · name Display name
list_profilesList your profiles (end-users) with how many accounts each has connected.
limit Default 100
delete_profile writeDelete a profile and ALL its connected accounts, tokens, posts and events.
profile_id* Profile id or your ref
get_connect_urlCreate a hosted connect link. Send your end-user to this URL; after they authorize they return to return_to with ?status=connected&platform=..&profile_id=..
platform* facebook | instagram | threads | tiktok · profile_id Profile id or ref (omit for your own accounts) · return_to Full URL on an allowed origin
get_usageYour plan, limits and usage for this month.

Accounts

list_accountsList connected social accounts (id, platform, name, granted scopes, status).
platform Optional filter: facebook | instagram | threads | tiktok | meta_ads | tiktok_ads, or "social" / "ads"
get_profileGet live profile details of a connected account (bio, followers, verification).
account_id* Connected account id (from list_accounts)
Scopes: facebook: pages_show_list · instagram: instagram_business_basic · threads: threads_basic · tiktok: user.info.basic
resync_pages writeRe-sync the Facebook Pages (incl. Business Manager pages) available to a connected Facebook account.
account_id* Any connected Facebook Page account id
Scopes: facebook: pages_show_list / business_management
disconnect_account writeDisconnect an account and delete its stored tokens and events.
account_id* Connected account id (from list_accounts)
tiktok_creator_infoTikTok creator info required before posting: nickname, avatar, allowed privacy levels, disabled interactions, max video duration.
account_id* Connected account id (from list_accounts)
Scopes: tiktok: video.publish / video.upload

Publishing

upload_media_from_url writeCopy an image/video from any URL (e.g. Google Flow output) into storage and return a public URL usable for posting.
url* Source media URL
publish_post writePublish or schedule a post to one or more accounts. Media must be public URLs. TikTok direct posts REQUIRE options.tiktok.privacy_level chosen by the user (see tiktok_creator_info).
account_ids* Account ids to post to · text Caption / post text · media Images or videos · schedule_at Optional ISO datetime to schedule, e.g. 2026-11-01T09:00:00+08:00 · options object
Scopes: facebook: pages_manage_posts · instagram: instagram_business_content_publish · threads: threads_content_publish · tiktok: video.publish / video.upload
get_postGet status/URL of a post created through this service.
post_id* Post id
list_postsList posts created through this service (newest first).
status scheduled | processing | published | failed | cancelled · limit Max rows, default 30
cancel_post writeCancel a scheduled post that has not been published yet.
post_id* Post id
threads_location_searchSearch Threads locations to tag in a post (returns location ids).
account_id* Connected account id (from list_accounts) · q* Place name
Scopes: threads: threads_location_tagging

Comments

list_recent_contentList recent posts/videos of an account (ids are used for comments & insights).
account_id* Connected account id (from list_accounts) · limit Default 10
Scopes: facebook: pages_read_engagement · instagram: instagram_business_basic · threads: threads_basic · tiktok: video.list
list_commentsList comments/replies on a post.
account_id* Connected account id (from list_accounts) · content_id* Post / media id
Scopes: facebook: pages_read_engagement / pages_read_user_content · instagram: instagram_business_manage_comments · threads: threads_read_replies
reply_comment writeReply publicly to a comment or reply.
account_id* Connected account id (from list_accounts) · comment_id* Comment/reply id · text* Reply text
Scopes: facebook: pages_manage_engagement · instagram: instagram_business_manage_comments · threads: threads_manage_replies
hide_comment writeHide or unhide a comment/reply.
account_id* Connected account id (from list_accounts) · comment_id* Comment id · hide true to hide, false to unhide
Scopes: facebook: pages_manage_engagement · instagram: instagram_business_manage_comments · threads: threads_manage_replies
delete_comment writeDelete a comment on your own post.
account_id* Connected account id (from list_accounts) · comment_id* Comment id
Scopes: facebook: pages_manage_engagement · instagram: instagram_business_manage_comments
delete_post writeDelete one of your own posts.
account_id* Connected account id (from list_accounts) · content_id* Post id
Scopes: facebook: pages_manage_posts · threads: threads_delete

Inbox & webhooks

list_conversationsList recent DM conversations (Facebook Messenger / Instagram Direct).
account_id* Connected account id (from list_accounts)
Scopes: facebook: pages_messaging · instagram: instagram_business_manage_messages
get_conversationRead messages of one conversation.
account_id* Connected account id (from list_accounts) · conversation_id* Conversation id
Scopes: facebook: pages_messaging · instagram: instagram_business_manage_messages
send_dm writeSend a direct message reply to a user who messaged the account (within the 24h messaging window).
account_id* Connected account id (from list_accounts) · recipient_id* Sender id (PSID / IGSID) from the conversation · text* Message text
Scopes: facebook: pages_messaging · instagram: instagram_business_manage_messages
subscribe_webhooks writeSubscribe the account to real-time webhooks (new DMs, new comments) so agents can auto-reply.
account_id* Connected account id (from list_accounts)
Scopes: facebook: pages_manage_metadata · instagram: instagram_business_manage_messages / instagram_business_manage_comments
list_eventsList incoming webhook events (DMs and comments) and what the agents did with them.
account_id Optional account filter · limit Default 30
set_auto_reply writeSet AI auto-reply mode for an account: off, draft (AI writes reply, human approves), auto (AI replies). Optional rules/instructions.
account_id* Connected account id (from list_accounts) · mode* off | draft | auto · rules Instructions for the agents, e.g. tone, FAQ, prices

Analytics

account_insightsAccount-level analytics for the last N days (views, reach, engagement, followers).
account_id* Connected account id (from list_accounts) · days Default 7, max 30 · metrics Optional comma list to override default metrics
Scopes: facebook: read_insights · instagram: instagram_business_manage_insights · threads: threads_manage_insights · tiktok: user.info.stats
content_insightsAnalytics for a single post / video.
account_id* Connected account id (from list_accounts) · content_id* Post / media / video id · metrics Optional comma list
Scopes: facebook: read_insights · instagram: instagram_business_manage_insights · threads: threads_manage_insights · tiktok: video.list

Discovery

threads_keyword_searchSearch public Threads posts by keyword or #topic (trend & lead research).
account_id* Connected account id (from list_accounts) · q* Keyword · search_type TOP | RECENT · limit Default 15
Scopes: threads: threads_keyword_search
threads_profile_lookupLook up a public Threads profile (followers, bio, stats).
account_id* Connected account id (from list_accounts) · username* Threads username without @
Scopes: threads: threads_profile_discovery
threads_profile_postsRead recent public posts of a Threads profile.
account_id* Connected account id (from list_accounts) · username* Threads username · limit Default 10
Scopes: threads: threads_profile_discovery
page_visitor_postsRead posts that visitors/customers published on your Facebook Page.
account_id* Connected account id (from list_accounts)
Scopes: facebook: pages_read_user_content

Ads (Meta and TikTok)

ads_overviewAd account summary for a period: total spend, impressions, clicks, results, and every campaign with its status, daily budget and performance.
account_id* Ad account id (Meta Ads or TikTok Ads) · date_preset today | yesterday | last_7d | last_30d | this_month
Scopes: meta_ads: ads_read · tiktok_ads:
ads_listList campaigns, ad sets (TikTok: ad groups) or ads, optionally inside a parent campaign/ad set.
account_id* Ad account id · level* campaign | adset | ad · parent_id Optional parent campaign / ad set id
Scopes: meta_ads: ads_read · tiktok_ads:
ads_insightsPerformance rows (spend, impressions, clicks, CTR, CPC, CPM, results, cost per result) by account, campaign, ad set or ad.
account_id* Ad account id · level account | campaign | adset | ad · date_preset today | yesterday | last_7d | last_30d | this_month · object_id Optional: only this campaign/ad set/ad
Scopes: meta_ads: ads_read · tiktok_ads:
ads_search_targetingMeta: search interests or locations to target (returns ids to use in ads_create_campaign).
account_id* Meta ad account id · type interest | city | region · q* Search text, e.g. kopi, Kuala Lumpur
Scopes: meta_ads: ads_read
ads_pause writePause a campaign, ad set or ad immediately (always allowed — it only stops spend).
account_id* Ad account id · object_id* Campaign / ad set / ad id · level campaign | adset | ad
Scopes: meta_ads: ads_management · tiktok_ads:
ads_enable writeTurn a paused campaign, ad set or ad back on. Checked against spend limits; AI requests need human approval unless the account is in auto mode.
account_id* Ad account id · object_id* Campaign / ad set / ad id · level campaign | adset | ad
Scopes: meta_ads: ads_management · tiktok_ads:
ads_set_budget writeChange the daily budget (in account currency, e.g. 25 = RM25/day) of a campaign or ad set. Lowering is immediate; raising is checked against limits and needs approval for AI.
account_id* Ad account id · object_id* Campaign / ad set id · level campaign | adset · daily_budget* New daily budget in account currency
Scopes: meta_ads: ads_management · tiktok_ads:
ads_create_campaign writeCreate an ad. Meta: boosts an existing Facebook post or Instagram post, or makes a link ad, with campaign + ad set + ad in one step. TikTok: creates a paused campaign shell. Checked against limits; AI requests need human approval unless auto mode.
account_id* Ad account id · name* Campaign name · objective engagement | traffic | awareness (TikTok also: video_views) · daily_budget* Daily budget in account currency · duration_days How many days to run (1-90, default 7) · start_time Optional ISO start time · activate Start delivering right away (default true) · targeting object · source object
Scopes: meta_ads: ads_management · tiktok_ads:
ads_get_guardRead the AI mode, daily/monthly spend limits and auto-pause rules of an ad account.
account_id* Ad account id
ads_set_guard writeSet AI mode (report | suggest | auto), hard daily and monthly spend limits, and auto-pause rules. Human only. Auto mode requires both limits.
account_id* Ad account id · mode report | suggest | auto · daily_cap Max total active daily budget (account currency) · monthly_cap Max spend per calendar month · rules Auto-pause rules
ads_list_proposalsActions waiting for human approval (and past decisions).
status pending | executed | rejected | failed · limit Default 30
ads_approve_proposal writeApprove and execute a pending ads proposal. Human only. Spend limits still apply.
proposal_id* Proposal id
ads_reject_proposal writeReject a pending ads proposal. Human only.
proposal_id* Proposal id · reason Optional reason
ads_logAudit log of every ads change (who, what, when), including automatic pauses.
account_id Optional ad account id · limit Default 40
ads_list_pagesMeta: Facebook Pages (and linked Instagram accounts) available to this ad connection.
account_id* Meta ad account id
Scopes: meta_ads: pages_show_list
ads_list_lead_formsMeta: lead forms of a Facebook Page with lead counts.
account_id* Meta ad account id · page_id* Facebook Page id
Scopes: meta_ads: leads_retrieval
ads_get_leadsMeta: leads submitted to a lead form (name, phone, email and other answers).
account_id* Meta ad account id · page_id* Facebook Page id · form_id* Lead form id · limit Default 50
Scopes: meta_ads: leads_retrieval
ads_subscribe_leads writeMeta: receive new leads in real time for a Page (webhook lead.received).
account_id* Meta ad account id · page_id* Facebook Page id
Scopes: meta_ads: leads_retrieval

AI agents

agent_run writeGive a natural-language task to the AI agent team (e.g. "post this video to all accounts tonight 9pm", "reply to new comments politely", "weekly performance report"). agent=auto lets the Orchestrator delegate.
task* What to do · agent auto | account | publisher | community | inbox | analyst | scout · execute false = draft mode (no write actions executed) · account_id Optional: use this account's reply rules
list_agentsList AI agents, their tools and the platform permission scopes each one uses.
list_agent_runsHistory of agent runs.
limit Default 20