X (Twitter)

Post to X via API — Schedule, Publish, Analyze

Publish videos, images, and text to X (Twitter) with reply permission controls and alt text — scheduled precisely, delivered reliably.

Get Started FreeNo credit card required

X-specific API controls

Reply permissions, alt text, and three post types from one endpoint.

Native video tweetspost_type: video

Upload video natively to X — plays inline in the timeline rather than as an external link, improving engagement.

Image tweetspost_type: image

Up to 4 images per tweet. Images are uploaded via the X media upload API and attached to the post.

Text tweetspost_type: text

Plain text posts up to 280 characters (or 25,000 for X Premium). Supports hashtags, mentions, and URLs.

Reply permissionsx_reply_settings

Set to 'following' so only accounts you follow can reply, or 'mentionedUsers' to restrict replies to tagged users only.

Image alt textx_alt_text

Add descriptive alt text to images for screen reader accessibility — required for brand accessibility compliance.

API Example

Tweet with reply restrictions

Schedule a tweet with an image, accessible alt text, and restricted replies — only users you mention can respond.

x-post.sh
# Post to X with reply restrictions
curl -X POST \
  https://api.codivupload.com/v1/posts \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -d '{
    "profile_name": "my-brand",
    "platforms": ["x"],
    "post_type": "image",
    "description": "Announcing our Spring 2026 collection",
    "media_urls": ["https://cdn.example.com/spring-drop.jpg"],
    "x_reply_settings": "mentionedUsers",
    "x_alt_text": "Model in floral dress at rooftop"  }'
Setup

Getting started with X

X requires a Bring Your Own Keys (BYOK) setup — you connect your own X Developer App rather than using a shared one. This takes about 5 minutes the first time, and it means your rate limits and API costs are entirely under your control.

1

Create a Developer App

Go to developer.x.com, create a project and app, then enable OAuth 2.0 with read and write permissions. Copy your Client ID and Client Secret. The free tier of the X API is sufficient for posting — no paid plan required.

2

Enter keys in CodivUpload

Open the Integrations tab in your CodivUpload dashboard, click Connect X, and paste your Client ID and Client Secret. CodivUpload encrypts these credentials with AES-256-GCM before storage — they are never exposed in plaintext after submission.

3

Authorize and post

After entering your keys, CodivUpload redirects you to X for OAuth authorization. Once approved, you can immediately start composing and scheduling posts from the dashboard or via the API. Token refresh is handled automatically.

Why X requires Bring Your Own Keys (BYOK)

Unlike most platforms, X charges API access per-app rather than per-user. A shared app serving thousands of users would quickly hit rate limits (1,500 posts per 15 minutes at the free tier) and incur significant costs. With BYOK, each CodivUpload user connects their own X Developer App, which means:

  • Your rate limits are isolated — other CodivUpload users cannot affect your posting capacity
  • You control your own API tier — upgrade to Basic ($100/mo) or Pro ($5,000/mo) if you need higher limits
  • Full transparency — you can monitor your own usage in the X Developer Portal
Step-by-step BYOK setup guide
Content Tips

X content tips

X rewards brevity, timeliness, and visual content. Here are the patterns that consistently drive engagement on the platform.

280 characters, every word counts

Standard accounts get 280 characters. X Premium extends this to 25,000, but shorter posts still outperform long ones in engagement. Front-load your key message — many users scroll fast and only read the first line. For longer content, use threads from the dashboard.

Always add alt text to images

Alt text makes your images accessible to screen reader users and improves searchability. Use the x_alt_text parameter to add descriptive text. Keep descriptions specific: “Bar chart showing Q1 revenue at $2.4M” is better than “chart”.

Best times: Mon-Fri, 8-10 AM

X engagement peaks on weekday mornings between 8:00 AM and 10:00 AM in your target audience's time zone. A secondary peak occurs around lunch (12-1 PM). Use CodivUpload's scheduled_date parameter to hit these windows consistently across time zones.

Threads for long-form storytelling

Threads (reply chains of 3-10 tweets) are one of the highest-engagement formats on X. They let you tell a story, share a tutorial, or break down a complex topic. Thread creation is available from the CodivUpload dashboard — the API supports single-post publishing for now.

X via API

Schedule a video tweet

Native video on X plays inline in the timeline, driving significantly higher engagement than external video links. CodivUpload uploads the video via X's chunked media upload API and attaches it to the tweet automatically.

All X-specific parameters use the x_ prefix. See the full API reference for every supported parameter.

x-video.sh
# Schedule a video tweet on X
curl -X POST \
  https://api.codivupload.com/v1/posts \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "profile_name": "my-brand",
    "platforms": ["x"],
    "post_type": "video",
    "description": "60-second product demo",
    "media_urls": [
      "https://cdn.example.com/demo.mp4"
    ],
    "x_reply_settings": "following",
    "scheduled_date": "2026-04-07T09:00:00Z"  }'

Start posting to X for free

2 profiles, 10 uploads/mo on the free plan. Upgrade for unlimited.

Get Started Free

X API questions