Skip to main content

Overview

Account links represent X (Twitter) accounts connected to your Inbox team. Each account link enables you to send and receive DMs through that account. Retrieve all connected accounts:
const { data: accountLinks } = await client.get("/account-links");

console.log(`${accountLinks.length} connected account(s)`);

accountLinks.forEach((account) => {
  console.log(`@${account.username} (${account.id})`);
});
Response:
[
  {
    "id": "df6jbw4h36qm5d9iu2sgn7kx",
    "platform": "twitter",
    "platformId": "1566123362161725440",
    "name": "Acme Corp",
    "username": "acmecorp",
    "image": "https://pbs.twimg.com/profile_images/.../photo.jpg",
    "createdAt": "2024-06-01T12:00:00.000Z",
    "status": "active",
    "syncedAt": "2025-01-15T10:30:00.000Z"
  },
  {
    "id": "g7ht2kw9xr5m8fp3yjnbqvce",
    "platform": "twitter",
    "platformId": "1876543210987654321",
    "name": "Acme Support",
    "username": "acmesupport",
    "image": "https://pbs.twimg.com/profile_images/.../photo.jpg",
    "createdAt": "2024-08-01T09:00:00.000Z",
    "status": "active",
    "syncedAt": "2025-01-14T08:00:00.000Z"
  }
]
GET /account-links returns a flat array, not a wrapped object. The same applies to GET /members, GET /tags, and GET /statuses.

Key fields

FieldDescription
idInbox account link ID — use this for all API operations
platformAlways "twitter" for now
platformIdThe X numeric user ID
usernameX handle without @
imageProfile picture URL
status"active", "offline" (X signed out your account), or "paused" (team scheduled for deletion or other rare circumstances)
syncedAtWhen this account completed its first full sync. null if sync hasn’t finished yet

Send messages from specific accounts

Specify which account to send from using accountLinkId:
const { data: accountLinks } = await client.get("/account-links");
const salesAccount = accountLinks.find((a: any) => a.username === "acmecorp");

await client.post("/threads/messages", {
  externalPlatformId: "1876543210987654321",
  accountLinkId: salesAccount.id,
  content: "Hi! Reaching out from our sales team.",
});

Filter threads by account

View conversations for specific accounts using accountLinkIds:
const { data } = await client.get("/threads", {
  params: {
    "accountLinkIds[0]": "df6jbw4h36qm5d9iu2sgn7kx",
  },
});

console.log(`${data.threads.length} threads for this account`);

Lookup threads by account

Check if a thread exists for a specific account–prospect pair:
const { data: thread } = await client.get("/threads/lookup", {
  params: {
    externalPlatformId: "1876543210987654321",
    accountLinkId: "df6jbw4h36qm5d9iu2sgn7kx",
  },
});

if (thread) {
  console.log("Thread exists:", thread.id);
} else {
  console.log("No existing thread");
}

Multi-account patterns

Account selection logic

Choose the appropriate account based on context:
interface AccountSelector {
  accountLinkId: string;
  condition: (prospect: any) => boolean;
}

const accountRules: AccountSelector[] = [
  {
    accountLinkId: "df6jbw4h36qm5d9iu2sgn7kx",
    condition: (prospect) => prospect.followerCount >= 100000,
  },
  {
    accountLinkId: "g7ht2kw9xr5m8fp3yjnbqvce",
    condition: () => true,
  },
];

function selectAccount(prospect: any): string {
  for (const rule of accountRules) {
    if (rule.condition(prospect)) return rule.accountLinkId;
  }
  return accountRules[accountRules.length - 1].accountLinkId;
}

Cross-account thread check

Check if you have any existing thread with a prospect across all accounts:
async function findAnyThread(prospectPlatformId: string) {
  const { data: accountLinks } = await client.get("/account-links");

  for (const account of accountLinks) {
    const { data: thread } = await client.get("/threads/lookup", {
      params: {
        externalPlatformId: prospectPlatformId,
        accountLinkId: account.id,
      },
    });

    if (thread) {
      return { thread, accountLink: account };
    }
  }

  return null;
}

const existing = await findAnyThread("1876543210987654321");
if (existing) {
  console.log(`Found thread via @${existing.accountLink.username}`);
}

ID types

Account links have two ID types. Use the correct one:
PropertyExampleUse for
id (Inbox ID)"df6jbw4h36qm5d9iu2sgn7kx"All API operations
platformId (X ID)"1566123362161725440"Reference only
// Correct: Use Inbox ID
await client.get("/threads", {
  params: { "accountLinkIds[0]": account.id },
});

// Wrong: Using platform ID
await client.get("/threads", {
  params: { "accountLinkIds[0]": account.platformId },
});

Connecting new accounts

Account links are connected through the Inbox dashboard, not the API. To add a new X account:
  1. Go to inboxapp.com
  2. Navigate to Settings → Accounts
  3. Make sure you have the Chrome extension installed
  4. Click Open X and select the account to link
The new account will then appear in API responses.

Next steps