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
- Log in to your RelayAPI account at relayapi.com
- Go to Settings > API Keys
- Click Create API Key
- 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
npm install @relayapi/sdkpip install relayapi# No installation needed — use cURL directlySet Up the Client
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
const account = await relay.accounts.connect({
platform: "twitter",
access_token: "your_twitter_access_token",
});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
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 -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:
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
| Platform | Post | Schedule | Media | Analytics |
|---|---|---|---|---|
| Twitter/X | ✅ | ✅ | ✅ | ✅ |
| ✅ | ✅ | ✅ | ✅ | |
| ✅ | ✅ | ✅ | ✅ | |
| ✅ | ✅ | ✅ | ✅ | |
| TikTok | ✅ | ✅ | ✅ | ✅ |
| YouTube | ✅ | ✅ | ✅ | ✅ |
| ✅ | ✅ | ✅ | ✅ | |
| ✅ | ✅ | ✅ | ✅ | |
| Bluesky | ✅ | ✅ | ✅ | ✅ |
| Threads | ✅ | ✅ | ✅ | ✅ |
| Telegram | ✅ | ✅ | ✅ | ✅ |
| Snapchat | ✅ | ✅ | ✅ | ✅ |
What's Next?
- Platforms Overview — Learn about platform-specific features
- API Reference — Full endpoint documentation
- Guides — Step-by-step guides