RelayAPI

Twitter/X API

Posting to Twitter/X via RelayAPI — features, limits, and platform-specific settings.

Overview

RelayAPI supports publishing to Twitter/X through the unified API. Connect your Twitter/X account and start posting programmatically.

Getting Started

  1. Connect your Twitter/X account via the dashboard or Connect Account API
  2. Use the account ID as a target when creating posts

Quick Example

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"]
  }'

Content Limits

PropertyLimit
Character limit280
Supported mediaImages (4), GIF (1), Video (1)
Media size limits5 MB images, 512 MB video

Thread Support

For content exceeding 280 characters, RelayAPI automatically splits your post into a thread. You can also manually define thread segments using the thread field.

Platform-Specific Settings

Use platform_overrides to customize content for Twitter/X:

Content Overrides

{
  "content": "Default content for all platforms",
  "platform_overrides": {
    "twitter": {
      "content": "Custom content for Twitter/X"
    }
  }
}

Supported Fields

  • content — Custom text for Twitter/X
  • media — Platform-specific media attachments
  • reply_to — Reply to an existing tweet by ID

Rate Limits

Twitter/X enforces its own rate limits. RelayAPI automatically queues and retries posts when platform rate limits are reached. See Rate Limits for details.

Retry Behavior

When a rate limit is hit, RelayAPI will automatically retry with exponential backoff. Posts transition to publishing status during retries.

On this page