# RelayAPI > RelayAPI is a unified social media API that lets you post to 12+ platforms with a single API call. ## Overview RelayAPI provides a single REST API to create, schedule, and publish posts across Twitter/X, Instagram, Facebook, LinkedIn, TikTok, YouTube, Pinterest, Reddit, Bluesky, Threads, Telegram, and Snapchat. ## Authentication All API requests require a Bearer token in the Authorization header. API keys are prefixed with `rlay_live_` for production or `rlay_test_` for testing. ``` Authorization: Bearer rlay_live_your_api_key ``` ## Base URL ``` https://api.relayapi.dev/v1 ``` ## Core Endpoints ### Posts - `POST /v1/posts` — Create and publish a post to one or more platforms - `GET /v1/posts` — List all posts (cursor-paginated) - `GET /v1/posts/:id` — Get a single post by ID - `PATCH /v1/posts/:id` — Update a post (draft or scheduled only) - `DELETE /v1/posts/:id` — Delete a post ### Accounts - `GET /v1/accounts` — List connected social accounts - `POST /v1/accounts/connect` — Connect a new social account - `DELETE /v1/accounts/:id` — Disconnect a social account ### Media - `POST /v1/media/upload` — Upload a media file (images, video, GIFs) - `GET /v1/media/:id` — Get media metadata - `DELETE /v1/media/:id` — Delete a media file ### Webhooks - `GET /v1/webhooks` — List webhook endpoints - `POST /v1/webhooks` — Create a webhook endpoint - `DELETE /v1/webhooks/:id` — Delete a webhook endpoint ## Supported Platforms | Platform | Post | Schedule | Media | Analytics | |----------|------|----------|-------|-----------| | Twitter/X | Yes | Yes | Yes | Yes | | Instagram | Yes | Yes | Yes | Yes | | Facebook | Yes | Yes | Yes | Yes | | LinkedIn | Yes | Yes | Yes | Yes | | TikTok | Yes | Yes | Yes | Yes | | YouTube | Yes | Yes | Yes | Yes | | Pinterest | Yes | Yes | Yes | Yes | | Reddit | Yes | Yes | Yes | Yes | | Bluesky | Yes | Yes | Yes | Yes | | Threads | Yes | Yes | Yes | Yes | | Telegram | Yes | Yes | Yes | Yes | | Snapchat | Yes | Yes | Yes | Yes | ## Creating a Post ```json POST /v1/posts { "content": "Hello from RelayAPI!", "targets": ["acc_twitter_123", "acc_linkedin_456"], "platform_overrides": { "twitter": { "content": "Hello Twitter! #relayapi" } } } ``` ## Pagination List endpoints use cursor-based pagination: ```json { "data": [...], "next_cursor": "cursor_abc123", "has_more": true } ``` Query params: `cursor` (string), `limit` (1-100, default 20). ## Error Responses ```json { "error": { "code": "invalid_request", "message": "Content is required", "details": {} } } ``` ## Rate Limits API rate limits are returned in response headers: - `X-RateLimit-Limit` — Max requests per window - `X-RateLimit-Remaining` — Remaining requests - `X-RateLimit-Reset` — Window reset time (Unix timestamp) ## Links - Documentation: https://docs.relayapi.com - Dashboard: https://relayapi.com - OpenAPI Spec: https://docs.relayapi.com/api/openapi - GitHub: https://github.com/relayapi