Skip to main content
Back to API docs

Connected accounts API

List Connected Social Accounts with the Public API

Before publishing content, your backend needs to know which social accounts are connected and which accountId should be used in POST /api/content/post. The GET /api/content/accounts endpoint returns connected TikTok, Instagram, Threads, and Facebook accounts available to the API key owner. Use this endpoint from a trusted server-side environment and store the returned accountId values for publishing, scheduling, and status tracking workflows.

Endpoint and authentication

Call this endpoint with the same X-API-Key header used by other public content API endpoints. The API returns accounts owned by the authenticated workspace and includes active plus expired accounts so your app can show which accounts need reconnection.

const API_BASE_URL = 'https://api.wahdx.com';
const API_KEY = process.env.WAHDX_API_KEY;

const response = await fetch(API_BASE_URL + '/api/content/accounts', {
  method: 'GET',
  headers: {
    'X-API-Key': API_KEY
  }
});

const result = await response.json();

if (!response.ok || !result.success) {
  throw new Error(result.error || 'Failed to fetch connected accounts');
}

const accounts = result.data;

Example response

The response includes the current subscription plan and a normalized data array. Each item uses accountId, not the raw platform user ID, when calling publishing and status endpoints.

const API_BASE_URL = 'https://api.wahdx.com';
const API_KEY = process.env.WAHDX_API_KEY;

const response = await fetch(API_BASE_URL + '/api/content/accounts', {
  method: 'GET',
  headers: {
    'X-API-Key': API_KEY
  }
});

const result = await response.json();
console.log(result);

// Example response:
// {
//   "success": true,
//   "subscription": "pro",
//   "data": [
//     {
//       "accountId": "acc_tiktok_internal_uuid",
//       "platform": "tiktok",
//       "display_name": "Wahdx Creator",
//       "username": "wahdx_creator",
//       "avatar_url": "https://example.com/avatar.jpg",
//       "bio_description": "Content team account",
//       "status": "active",
//       "followers": 12000,
//       "following": 210,
//       "likes": 45000,
//       "videos": 128,
//       "is_verified": false
//     },
//     {
//       "accountId": "acc_instagram_internal_uuid",
//       "platform": "instagram",
//       "display_name": "Wahdx Studio",
//       "username": "wahdx.studio",
//       "avatar_url": "https://example.com/instagram.jpg",
//       "bio_description": "Studio profile",
//       "status": "active",
//       "followers": 8400,
//       "following": 180,
//       "likes": null,
//       "videos": 96,
//       "is_verified": null
//     },
//     {
//       "accountId": "acc_threads_internal_uuid",
//       "platform": "threads",
//       "display_name": "Wahdx Threads",
//       "username": "wahdx_threads",
//       "avatar_url": "https://example.com/threads.jpg",
//       "bio_description": "Threads profile",
//       "status": "expired",
//       "followers": 3200,
//       "following": 85,
//       "likes": null,
//       "videos": null,
//       "is_verified": null
//     },
//     {
//       "accountId": "acc_facebook_internal_uuid",
//       "platform": "facebook",
//       "display_name": "Wahdx Page",
//       "username": "1234567890",
//       "avatar_url": "https://example.com/page.jpg",
//       "bio_description": "Facebook Page",
//       "status": "active",
//       "followers": 5600,
//       "following": null,
//       "likes": 4100,
//       "videos": null,
//       "is_verified": null
//     }
//   ]
// }

Use accountId in publishing requests

After selecting an account from the list, pass the accountId and matching platform into POST /api/content/post. The platform must match the connected account platform, otherwise the publishing request will fail.

const API_BASE_URL = 'https://api.wahdx.com';
const API_KEY = process.env.WAHDX_API_KEY;

await fetch(API_BASE_URL + '/api/content/post', {
  method: 'POST',
  headers: {
    'X-API-Key': API_KEY,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify(
    {
      "platform": "instagram",
      "accountId": "acc_instagram_internal_uuid",
      "content": "Campaign post caption",
      "mediaItems": [
        {
          "url": "https://your-domain.com/video.mp4"
        }
      ],
      "instagramSettings": {
        "share_to_feed": true
      }
    }
  )
});

Field reference

The response is normalized across platforms. Some metrics are platform-specific, so unavailable values are returned as null. Expired accounts are included so your application can show users which accounts need reconnection before publishing.

  • accountId: internal connected account ID used by publishing and status endpoints.
  • platform: one of tiktok, instagram, threads, or facebook.
  • display_name: human-friendly account or Page name for UI selection.
  • username: platform username, or Facebook Page ID for facebook accounts.
  • status: active or expired; publish only with active accounts.
  • followers, following, likes, videos, is_verified: profile metrics where available.
  • subscription: current workspace plan returned beside the account list.

FAQ

Common questions about this API topic.

Which endpoint lists connected accounts?

Use GET /api/content/accounts with the X-API-Key header from a server-side environment.

Can this endpoint return multiple platforms?

Yes. It can return TikTok, Instagram, Threads, and Facebook accounts in one normalized data array.

Can I publish with an expired account?

No. Expired accounts are included for visibility and reconnection UX, but publishing should use accounts with status active.

Which ID should I use for posting?

Use accountId from the response. Do not use username, page_id, or external platform IDs for the public publishing endpoint.