Skip to main content
Follow a user on X using your connected account.

Overview

The Follow endpoint allows you to follow a user by their user ID. Use Lookup User first if you only have a username.

Authentication

Requires a valid API key with a connected X account.
curl -X POST https://api.trigify.io/v1/x/follow \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "target_user_id": "44196397"
  }'

Input

FieldTypeDescription
target_user_idstringRequired. The numeric user ID of the account to follow

Getting a User ID

If you have a username instead of a user ID, use Lookup User first:
// Look up user ID from username
const lookup = await fetch("https://api.trigify.io/v1/x/lookup-user", {
  method: "POST",
  headers: {
    "x-api-key": "YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ username: "trigaborter" }),
});

const { user_id } = await lookup.json();

// Then follow
await fetch("https://api.trigify.io/v1/x/follow", {
  method: "POST",
  headers: {
    "x-api-key": "YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ target_user_id: user_id }),
});

Credit Usage

This endpoint charges 1 credit per follow.

Notes

  • If the target account is private, the response may include pending_follow: true