Skip to content
UGC API

Connect accounts

Before you can post, a social account must be connected. You create a connect link, the account owner approves on the platform, and the account appears in your account list with an ID you post to.

Updated

POST /v1/accounts/connect

FieldTypeDescription
platformstring, requiredtiktok, instagram, facebook or youtube
external_idstring, optionalYour own ID for the owner, such as a user or creator ID. Stored on the account.
redirect_urlstring, optionalWhere the owner lands after approving. Use a page in your app.
bash
curl https://ugcapi.dev/v1/accounts/connect \
  -H "Authorization: Bearer ugc_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "platform": "instagram",
    "external_id": "user_123",
    "redirect_url": "https://yourapp.com/settings/accounts"
  }'
json
{ "url": "https://ugcapi.dev/connect/..." }

Redirect the user to url, or send it by email or DM. Generate a fresh link for each connect. The owner logs in on the platform's own page, so you never handle passwords.

Platform requirements

PlatformAccount typeNotes
TikTokAny TikTok accountAvailable privacy options come from the account's settings.
InstagramBusiness or CreatorPersonal accounts can't publish via Meta's API.
FacebookFacebook PageThe admin picks which Pages to grant. Each Page becomes its own account.
YouTubeA YouTube channelThe owner picks the channel during Google sign-in.

List accounts

GET /v1/accounts returns connected accounts. Filter with platform and external_id.

javascript
const res = await fetch(
  "https://ugcapi.dev/v1/accounts?platform=instagram&external_id=user_123",
  { headers: { "Authorization": "Bearer " + process.env.UGCAPI_KEY } }
);
const { data } = await res.json();
// data: [{ id: "acc_...", platform: "instagram", username: "...", external_id: "user_123", status: "connected" }]

Use the id values in accounts when you create a post. An account's status is connected or disconnected.

Disconnect

bash
curl -X DELETE https://ugcapi.dev/v1/accounts/acc_123 -H "Authorization: Bearer ugc_live_..."

Disconnecting removes our access tokens for that account. Scheduled posts to it will fail with account_not_found, so cancel them first if you don't want failures.

When a connection breaks

Owners can revoke access on the platform, and tokens can expire. When that happens, the account's status becomes disconnected and we send an account.disconnected webhook. Create a new connect link with the same external_id. For UX tips, read white-label account connect.

FAQ

Can one user connect several accounts?

Yes. Create one link per account. They can share the same external_id.

Do connected accounts cost anything?

No. There are no per-account fees. You pay only for posts.

Why can't my Instagram account connect?

It is probably a personal account. Switch it to Business or Creator in the Instagram app, then try again.

Related