RelayAPI

Quickstart

Get started with the RelayAPI unified social media API in minutes.

Overview

RelayAPI is a unified API that lets you post to 12+ social media platforms with a single API call. Connect your social accounts, create posts, and publish everywhere — all through one consistent interface.

Authentication

Sign up at relayapi.com and create an API key from your dashboard.

Getting Your API Key

  1. Log in to your RelayAPI account at relayapi.com
  2. Go to Settings > API Keys
  3. Click Create API Key
  4. Copy the key immediately — you won't be able to see it again

Key Format

API keys are prefixed with rlay_live_ for production or rlay_test_ for testing. Keys are stored as SHA-256 hashes and are only shown once at creation.

Install the SDK

Node.js
npm install @relayapi/sdk
Python
pip install relayapi
cURL
# No installation needed — use cURL directly

Set Up the Client

Node.js
import { RelayAPI } from "@relayapi/sdk";

const relay = new RelayAPI("rlay_live_your_api_key");

Connect a Social Account

Before posting, connect at least one social media account through the dashboard or via the API.

Using the API

Node.js
const account = await relay.accounts.connect({
  platform: "twitter",
  access_token: "your_twitter_access_token",
});
cURL
curl -X POST https://api.relayapi.dev/v1/accounts/connect \
  -H "Authorization: Bearer rlay_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "platform": "twitter",
    "access_token": "your_twitter_access_token"
  }'

Available Platforms

See Platforms Overview for the full list of supported platforms and their capabilities.

Create and Publish a Post

Node.js
const post = await relay.posts.create({
  content: "Hello from RelayAPI!",
  targets: ["acc_twitter_123", "acc_linkedin_456"],
});

console.log(post.id); // "post_abc123"
console.log(post.status); // "published"
cURL
curl -X POST https://api.relayapi.dev/v1/posts \
  -H "Authorization: Bearer rlay_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Hello from RelayAPI!",
    "targets": ["acc_twitter_123", "acc_linkedin_456"]
  }'

Posting to Multiple Platforms

Target multiple accounts in a single API call. RelayAPI handles platform-specific formatting automatically.

Scheduling Posts

Schedule posts for future publishing by adding scheduled_at and timezone:

Node.js
const post = await relay.posts.create({
  content: "Scheduled post!",
  targets: ["acc_twitter_123"],
  scheduled_at: "2024-01-16T12:00:00",
  timezone: "America/New_York",
});

Supported Platforms

PlatformPostScheduleMediaAnalytics
Twitter/X
Instagram
Facebook
LinkedIn
TikTok
YouTube
Pinterest
Reddit
Bluesky
Threads
Telegram
Snapchat

What's Next?

On this page