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
Create a connect link
POST /v1/accounts/connect
| Field | Type | Description |
|---|---|---|
platform | string, required | tiktok, instagram, facebook or youtube |
external_id | string, optional | Your own ID for the owner, such as a user or creator ID. Stored on the account. |
redirect_url | string, optional | Where the owner lands after approving. Use a page in your app. |
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"
}'{ "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
| Platform | Account type | Notes |
|---|---|---|
| TikTok | Any TikTok account | Available privacy options come from the account's settings. |
| Business or Creator | Personal accounts can't publish via Meta's API. | |
| Facebook Page | The admin picks which Pages to grant. Each Page becomes its own account. | |
| YouTube | A YouTube channel | The owner picks the channel during Google sign-in. |
List accounts
GET /v1/accounts returns connected accounts. Filter with platform and external_id.
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
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.