Xquik X Write API

X write actions (tweets, likes, follows, DMs)

Operations 19

POST /api/v1/x/tweets Create tweet #
GET /api/v1/x/write-actions/{id} Get write action status #
DELETE /api/v1/x/tweets/{id} Delete tweet #
POST /api/v1/x/tweets/{id}/like Like tweet #
DELETE /api/v1/x/tweets/{id}/like Unlike tweet #
POST /api/v1/x/tweets/{id}/retweet Retweet #
DELETE /api/v1/x/tweets/{id}/retweet Unretweet #
POST /api/v1/x/users/{id}/follow Follow user #
DELETE /api/v1/x/users/{id}/follow Unfollow user #
POST /api/v1/x/users/{id}/remove-follower Remove follower #
POST /api/v1/x/dm/{userId} Send direct message #
POST /api/v1/x/media Upload media #
PATCH /api/v1/x/profile Update X profile #
PATCH /api/v1/x/profile/avatar Update profile avatar #
PATCH /api/v1/x/profile/banner Update profile banner #
POST /api/v1/x/communities Create community #
DELETE /api/v1/x/communities/{id} Delete community #
POST /api/v1/x/communities/{id}/join Join community #
DELETE /api/v1/x/communities/{id}/join Leave community #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/xquik-api-x-write-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

xquik-api-x-write-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Xquik X Write API
  version: '1.0'
  description: "Xquik is an independent third-party service. Not affiliated with X Corp. \"Twitter\" and \"X\" are trademarks of X Corp. Look up tweets, users, and X trends. Search tweets, check follow relationships, download media, and monitor accounts. 33 paid-read endpoints accept prepaid credits without a subscription. 7 fixed-price lookups also accept direct MPP payments. Write and automation endpoints require an API key or OAuth 2.1 bearer token.\n\n## Xquik SDKs\n\nStainless generates each SDK from this OpenAPI schema. Pick a language:\n\n- TypeScript / Node.js: `npm i x-twitter-scraper` -\n  [Xquik-dev/x-twitter-scraper-typescript](https://github.com/Xquik-dev/x-twitter-scraper-typescript)\n\n- Python: `pip install x-twitter-scraper` -\n  [Xquik-dev/x-twitter-scraper-python](https://github.com/Xquik-dev/x-twitter-scraper-python)\n\n- Go: `go get github.com/Xquik-dev/x-twitter-scraper-go` -\n  [Xquik-dev/x-twitter-scraper-go](https://github.com/Xquik-dev/x-twitter-scraper-go)\n\n- Ruby: `gem install x-twitter-scraper` -\n  [Xquik-dev/x-twitter-scraper-ruby](https://github.com/Xquik-dev/x-twitter-scraper-ruby)\n\n- Java (source build; Maven Central pending) -\n  [Xquik-dev/x-twitter-scraper-java](https://github.com/Xquik-dev/x-twitter-scraper-java)\n\n- Kotlin (source build; Maven Central pending) -\n  [Xquik-dev/x-twitter-scraper-kotlin](https://github.com/Xquik-dev/x-twitter-scraper-kotlin)\n\n- C# / .NET: `dotnet add package XTwitterScraper` -\n  [Xquik-dev/x-twitter-scraper-csharp](https://github.com/Xquik-dev/x-twitter-scraper-csharp)\n\n- PHP: `composer require xquik/x-twitter-scraper` -\n  [Xquik-dev/x-twitter-scraper-php](https://github.com/Xquik-dev/x-twitter-scraper-php)\n\n- CLI: `go install github.com/Xquik-dev/x-twitter-scraper-cli/cmd/x-twitter-scraper@latest` -\n  [Xquik-dev/x-twitter-scraper-cli](https://github.com/Xquik-dev/x-twitter-scraper-cli)\n\n- Terraform Provider (Terraform Registry) -\n  [Xquik-dev/terraform-provider-x-twitter-scraper](https://github.com/Xquik-dev/terraform-provider-x-twitter-scraper)\n\n\nOpenClaw plugin: [Xquik-dev/tweetclaw](https://github.com/Xquik-dev/tweetclaw) (`openclaw plugins install clawhub:@xquik/tweetclaw`)."
  x-guidance: '## Common tasks


    **Find a tweet** - GET /x/tweets/{id} with a numeric tweet ID. Returns full tweet data: text, author, metrics (likes, retweets, replies, views), media URLs, and creation timestamp. Cost: $0.00015 per lookup.


    **Search tweets** - GET /x/tweets/search?q={query}&limit={n}. Supports X search operators, structured filters like fromUser, mediaType, minFaves, hashtags, and verifiedOnly, plus exact lookup for a pasted Tweet ID or X status URL. Plain from:user date windows are optimized for timeline completeness. Returns up to 200 tweets per page with cursor-based pagination. Cost: $0.00015 per tweet returned.


    **Find a user** - GET /x/users/{id} where {id} is a numeric user ID or @username. Returns profile data: name, bio, follower/following counts, verification status, join date. Cost: $0.00015 per lookup.


    **Check if A follows B** - GET /x/followers/check?source={a}&target={b} where source and target are usernames, @usernames, or X or Twitter profile URLs. Cost: $0.00075.


    **Get trending topics** - GET /trends?woeid={region}&count={n}. WOEID 1 = worldwide, 23424977 = US, 23424975 = UK, 23424969 = Turkey. Cost: $0.00045.


    **Download media** - POST /x/media/download with {"tweetIds": ["123", "456"]} body. Returns download URLs for images and videos. Cost: 1 credit per fresh tweet processed with media; cached repeat downloads are free.


    **Read an article** - GET /x/articles/{tweetId} for long-form X Articles. Returns full article HTML, cover image, and metadata. Cost: $0.00075.


    ## Pagination


    Default v1 responses keep their existing pagination fields for compatibility. Platform list endpoints return `hasMore` and `nextCursor`; X data endpoints return `has_next_page` and `next_cursor`. Send `xquik-api-contract: 2026-04-29` to receive the unified best-practice fields `has_more` and `next_cursor`. Pass the cursor back as `?cursor={cursor}`; legacy `?after={cursor}` still works. Dynamic-priced endpoints charge per item returned, not per request.


    ## Authentication


    Eligible paid read endpoints accept accountless prepaid credit wallets. Fixed-price lookups also accept direct MPP payments. Media downloads, write endpoints, and automation features require authentication. Send an Xquik API key through `x-api-key`, `Xquik-Api-Key`, or `Authorization: Bearer xq_...`. Send an OAuth 2.1 access token through `Authorization: Bearer`.


    ## Best-Practice Response Contract


    v1 keeps its original response contract by default so existing integrations do not break. Send `xquik-api-contract: 2026-04-29` to opt in to the best-practice contract: snake_case response fields, Unix timestamps in seconds, structured error objects, `has_more` and `next_cursor` pagination fields, `object` resource identifiers, and prefixed IDs where available. Dependency failures that returned 502 in default v1 return 424 in the opt-in contract. Future major API versions should make this contract the default.'
  contact:
    name: Xquik
    url: https://xquik.com
    email: support@xquik.com
servers:
- url: https://xquik.com
security:
- apiKey: []
- oauthBearer: []
tags:
- name: X Write
  description: X write actions (tweets, likes, follows, DMs)
paths:
  /api/v1/x/tweets:
    post:
      operationId: createTweet
      summary: Create tweet
      tags:
      - X Write
      security:
      - apiKey: []
      - oauthBearer: []
      parameters:
      - $ref: '#/components/parameters/WriteIdempotencyKey'
      requestBody:
        required: true
        description: Account and tweet content. Requires text, media, or both.
        content:
          application/json:
            schema:
              type: object
              required:
              - account
              properties:
                account:
                  type: string
                  description: X account (@username or account ID)
                  example: '@elonmusk'
                text:
                  type: string
                  description: Tweet text (optional when media is provided)
                  example: Just launched our new feature!
                reply_to_tweet_id:
                  type: string
                  example: '1234567890'
                community_id:
                  type: string
                  example: '1500000000000000000'
                is_note_tweet:
                  type: boolean
                  example: false
                media:
                  type: array
                  items:
                    type: string
                  maxItems: 4
                  description: Array of public media URLs to attach. Supports up to 4 images or exactly 1 MP4 video up to 100 MB. Each URL must be publicly reachable. Attached media adds 2 credits per started MB across all files.
                  example:
                  - https://example.com/video.mp4
            example:
              account: '@elonmusk'
              text: Just launched our new feature!
      responses:
        '200':
          $ref: '#/components/responses/WriteActionCompleted'
        '202':
          $ref: '#/components/responses/WriteActionAccepted'
        '400':
          $ref: '#/components/responses/WriteInvalidInput'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/AccountAuthError'
        '409':
          $ref: '#/components/responses/WriteIdempotencyConflict'
        '422':
          $ref: '#/components/responses/WriteRejected'
        '429':
          $ref: '#/components/responses/WriteRateLimited'
        '500':
          $ref: '#/components/responses/WriteError'
        '503':
          $ref: '#/components/responses/WriteTrackingUnavailable'
        default:
          content:
            application/json:
              example:
                error: internal_error
                message: Unexpected error. Try again.
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error.
      description: Create tweet.
  /api/v1/x/write-actions/{id}:
    get:
      operationId: getWriteActionStatus
      summary: Get write action status
      tags:
      - X Write
      security:
      - apiKey: []
      - oauthBearer: []
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
        description: Write action ID returned by a pending write response.
      responses:
        '200':
          $ref: '#/components/responses/WriteActionCompleted'
        '202':
          $ref: '#/components/responses/WriteActionAccepted'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
        default:
          content:
            application/json:
              example:
                error: internal_error
                message: Unexpected error. Try again.
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error.
      description: Get write action status.
  /api/v1/x/tweets/{id}:
    delete:
      operationId: deleteTweet
      summary: Delete tweet
      tags:
      - X Write
      security:
      - apiKey: []
      - oauthBearer: []
      parameters:
      - $ref: '#/components/parameters/WriteIdempotencyKey'
      - name: id
        in: path
        required: true
        schema:
          type: string
        description: Tweet ID to delete
      requestBody:
        required: true
        description: Account that owns the tweet.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/XAccountBody'
            example:
              account: '@elonmusk'
      responses:
        '200':
          $ref: '#/components/responses/WriteActionCompleted'
        '202':
          $ref: '#/components/responses/WriteActionAccepted'
        '400':
          $ref: '#/components/responses/WriteInvalidInput'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/AccountAuthError'
        '409':
          $ref: '#/components/responses/WriteIdempotencyConflict'
        '422':
          $ref: '#/components/responses/WriteRejected'
        '429':
          $ref: '#/components/responses/RateLimitedByX'
        '500':
          $ref: '#/components/responses/WriteError'
        '503':
          $ref: '#/components/responses/WriteTrackingUnavailable'
        default:
          content:
            application/json:
              example:
                error: internal_error
                message: Unexpected error. Try again.
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error.
      description: Delete tweet.
  /api/v1/x/tweets/{id}/like:
    post:
      operationId: likeTweet
      summary: Like tweet
      tags:
      - X Write
      security:
      - apiKey: []
      - oauthBearer: []
      parameters:
      - $ref: '#/components/parameters/WriteIdempotencyKey'
      - name: id
        in: path
        required: true
        schema:
          type: string
        description: Tweet ID to like
      requestBody:
        required: true
        description: Account to perform the like.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/XAccountBody'
            example:
              account: '@elonmusk'
      responses:
        '200':
          $ref: '#/components/responses/WriteActionCompleted'
        '202':
          $ref: '#/components/responses/WriteActionAccepted'
        '400':
          $ref: '#/components/responses/WriteInvalidInput'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/AccountAuthError'
        '409':
          $ref: '#/components/responses/WriteIdempotencyConflict'
        '422':
          $ref: '#/components/responses/WriteRejected'
        '429':
          $ref: '#/components/responses/RateLimitedByX'
        '500':
          $ref: '#/components/responses/WriteError'
        '503':
          $ref: '#/components/responses/WriteTrackingUnavailable'
        default:
          content:
            application/json:
              example:
                error: internal_error
                message: Unexpected error. Try again.
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error.
      description: Like tweet.
    delete:
      operationId: unlikeTweet
      summary: Unlike tweet
      tags:
      - X Write
      security:
      - apiKey: []
      - oauthBearer: []
      parameters:
      - $ref: '#/components/parameters/WriteIdempotencyKey'
      - name: id
        in: path
        required: true
        schema:
          type: string
        description: Tweet ID to unlike
      requestBody:
        required: true
        description: Account that liked the tweet.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/XAccountBody'
      responses:
        '200':
          $ref: '#/components/responses/WriteActionCompleted'
        '202':
          $ref: '#/components/responses/WriteActionAccepted'
        '400':
          $ref: '#/components/responses/WriteInvalidInput'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/AccountAuthError'
        '409':
          $ref: '#/components/responses/WriteIdempotencyConflict'
        '422':
          $ref: '#/components/responses/WriteRejected'
        '429':
          $ref: '#/components/responses/RateLimitedByX'
        '500':
          $ref: '#/components/responses/WriteError'
        '503':
          $ref: '#/components/responses/WriteTrackingUnavailable'
        default:
          content:
            application/json:
              example:
                error: internal_error
                message: Unexpected error. Try again.
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error.
      description: Unlike tweet.
  /api/v1/x/tweets/{id}/retweet:
    post:
      operationId: retweet
      summary: Retweet
      tags:
      - X Write
      security:
      - apiKey: []
      - oauthBearer: []
      parameters:
      - $ref: '#/components/parameters/WriteIdempotencyKey'
      - name: id
        in: path
        required: true
        schema:
          type: string
        description: Tweet ID to retweet
      requestBody:
        required: true
        description: Account to perform the retweet.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/XAccountBody'
      responses:
        '200':
          $ref: '#/components/responses/WriteActionCompleted'
        '202':
          $ref: '#/components/responses/WriteActionAccepted'
        '400':
          $ref: '#/components/responses/WriteInvalidInput'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/AccountAuthError'
        '409':
          $ref: '#/components/responses/WriteIdempotencyConflict'
        '422':
          $ref: '#/components/responses/WriteRejected'
        '429':
          $ref: '#/components/responses/RateLimitedByX'
        '500':
          $ref: '#/components/responses/WriteError'
        '503':
          $ref: '#/components/responses/WriteTrackingUnavailable'
        default:
          content:
            application/json:
              example:
                error: internal_error
                message: Unexpected error. Try again.
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error.
      description: Retweet.
    delete:
      operationId: unretweet
      summary: Unretweet
      tags:
      - X Write
      security:
      - apiKey: []
      - oauthBearer: []
      parameters:
      - $ref: '#/components/parameters/WriteIdempotencyKey'
      - name: id
        in: path
        required: true
        schema:
          type: string
        description: Tweet ID to unretweet
      requestBody:
        required: true
        description: Account that retweeted the tweet.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/XAccountBody'
      responses:
        '200':
          $ref: '#/components/responses/WriteActionCompleted'
        '202':
          $ref: '#/components/responses/WriteActionAccepted'
        '400':
          $ref: '#/components/responses/WriteInvalidInput'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/AccountAuthError'
        '409':
          $ref: '#/components/responses/WriteIdempotencyConflict'
        '422':
          $ref: '#/components/responses/WriteRejected'
        '429':
          $ref: '#/components/responses/RateLimitedByX'
        '500':
          $ref: '#/components/responses/WriteError'
        '503':
          $ref: '#/components/responses/WriteTrackingUnavailable'
        default:
          content:
            application/json:
              example:
                error: internal_error
                message: Unexpected error. Try again.
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error.
      description: Unretweet.
  /api/v1/x/users/{id}/follow:
    post:
      operationId: followUser
      summary: Follow user
      tags:
      - X Write
      security:
      - apiKey: []
      - oauthBearer: []
      parameters:
      - $ref: '#/components/parameters/WriteIdempotencyKey'
      - name: id
        in: path
        required: true
        schema:
          type: string
        description: User ID to follow
      requestBody:
        required: true
        description: Account to perform the follow.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/XAccountBody'
      responses:
        '200':
          $ref: '#/components/responses/WriteActionCompleted'
        '202':
          $ref: '#/components/responses/WriteActionAccepted'
        '400':
          $ref: '#/components/responses/WriteInvalidInput'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/AccountAuthError'
        '409':
          $ref: '#/components/responses/WriteIdempotencyConflict'
        '422':
          $ref: '#/components/responses/WriteRejected'
        '429':
          $ref: '#/components/responses/WriteRateLimited'
        '500':
          $ref: '#/components/responses/WriteError'
        '503':
          $ref: '#/components/responses/WriteTrackingUnavailable'
        default:
          content:
            application/json:
              example:
                error: internal_error
                message: Unexpected error. Try again.
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error.
      description: Follow user.
    delete:
      operationId: unfollowUser
      summary: Unfollow user
      tags:
      - X Write
      security:
      - apiKey: []
      - oauthBearer: []
      parameters:
      - $ref: '#/components/parameters/WriteIdempotencyKey'
      - name: id
        in: path
        required: true
        schema:
          type: string
        description: User ID to unfollow
      requestBody:
        required: true
        description: Account that follows the target user.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/XAccountBody'
      responses:
        '200':
          $ref: '#/components/responses/WriteActionCompleted'
        '202':
          $ref: '#/components/responses/WriteActionAccepted'
        '400':
          $ref: '#/components/responses/WriteInvalidInput'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/AccountAuthError'
        '409':
          $ref: '#/components/responses/WriteIdempotencyConflict'
        '422':
          $ref: '#/components/responses/WriteRejected'
        '429':
          $ref: '#/components/responses/WriteRateLimited'
        '500':
          $ref: '#/components/responses/WriteError'
        '503':
          $ref: '#/components/responses/WriteTrackingUnavailable'
        default:
          content:
            application/json:
              example:
                error: internal_error
                message: Unexpected error. Try again.
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error.
      description: Unfollow user.
  /api/v1/x/users/{id}/remove-follower:
    post:
      operationId: removeFollower
      summary: Remove follower
      tags:
      - X Write
      security:
      - apiKey: []
      - oauthBearer: []
      parameters:
      - $ref: '#/components/parameters/WriteIdempotencyKey'
      - name: id
        in: path
        required: true
        schema:
          type: string
        description: User ID to remove from your followers
      requestBody:
        required: true
        description: Account whose follower list should be updated.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/XAccountBody'
      responses:
        '200':
          $ref: '#/components/responses/WriteActionCompleted'
        '202':
          $ref: '#/components/responses/WriteActionAccepted'
        '400':
          $ref: '#/components/responses/WriteInvalidInput'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/AccountAuthError'
        '409':
          $ref: '#/components/responses/WriteIdempotencyConflict'
        '422':
          $ref: '#/components/responses/WriteRejected'
        '429':
          $ref: '#/components/responses/WriteRateLimited'
        '500':
          $ref: '#/components/responses/WriteError'
        '503':
          $ref: '#/components/responses/WriteTrackingUnavailable'
        default:
          content:
            application/json:
              example:
                error: internal_error
                message: Unexpected error. Try again.
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error.
      description: Remove follower.
  /api/v1/x/dm/{userId}:
    post:
      operationId: sendDm
      summary: Send direct message
      tags:
      - X Write
      security:
      - apiKey: []
      - oauthBearer: []
      parameters:
      - $ref: '#/components/parameters/WriteIdempotencyKey'
      - name: userId
        in: path
        required: true
        schema:
          type: string
        description: Recipient user ID
      requestBody:
        required: true
        description: Account, message text, and an optional media attachment.
        content:
          application/json:
            schema:
              type: object
              required:
              - account
              - text
              properties:
                account:
                  type: string
                  description: X account (@username or ID) sending the DM
                  example: '@elonmusk'
                text:
                  type: string
                  example: Example text
                media_ids:
                  type: array
                  minItems: 1
                  maxItems: 1
                  items:
                    type: string
                  description: Optional array containing exactly 1 uploaded media ID.
                  example:
                  - '1234567890123456789'
            example:
              account: '@elonmusk'
              text: Example text content
              media_ids:
              - '1234567890123456789'
      responses:
        '200':
          $ref: '#/components/responses/WriteActionCompleted'
        '202':
          $ref: '#/components/responses/WriteActionAccepted'
        '400':
          $ref: '#/components/responses/WriteInvalidInput'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/AccountAuthError'
        '409':
          $ref: '#/components/responses/WriteIdempotencyConflict'
        '422':
          $ref: '#/components/responses/WriteRejected'
        '429':
          $ref: '#/components/responses/WriteRateLimited'
        '500':
          $ref: '#/components/responses/WriteError'
        '503':
          $ref: '#/components/responses/WriteTrackingUnavailable'
        default:
          content:
            application/json:
              example:
                error: internal_error
                message: Unexpected error. Try again.
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error.
      description: Send direct message.
  /api/v1/x/media:
    post:
      operationId: uploadMedia
      summary: Upload media
      tags:
      - X Write
      security:
      - apiKey: []
      - oauthBearer: []
      parameters:
      - $ref: '#/components/parameters/WriteIdempotencyKey'
      requestBody:
        required: true
        description: Upload media with multipart form data, or provide a JSON URL for server-side download.
        content:
          multipart/form-data:
            schema:
              type: object
              required:
              - account
              - file
              properties:
                account:
                  type: string
                  description: X account (@username or ID) uploading media
                  example: '@elonmusk'
                file:
                  type: string
                  format: binary
                  description: Media file to upload
                  example: binary-content
                is_long_video:
                  type: boolean
                  description: Set true only for video/mp4 multipart uploads longer than 140 seconds.
                  example: false
            example:
              account: '@elonmusk'
              file: file_value
              is_long_video: true
          application/json:
            schema:
              type: object
              required:
              - account
              - url
              properties:
                account:
                  type: string
                  description: X account (@username or ID) uploading media from URL
                  example: '@elonmusk'
                url:
                  type: string
                  format: uri
                  description: HTTPS URL to download and upload as media
                  example: https://example.com/image.png
            example:
              account: '@elonmusk'
              url: https://example.com/image.png
      responses:
        '200':
          $ref: '#/components/responses/WriteActionCompleted'
        '202':
          $ref: '#/components/responses/WriteActionAccepted'
        '400':
          $ref: '#/components/responses/WriteInvalidInput'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/AccountAuthError'
        '404':
          $ref: '#/components/responses/XAccountNotFound'
        '409':
          $ref: '#/components/responses/WriteIdempotencyConflict'
        '422':
          $ref: '#/components/responses/WriteRejected'
        '429':
          $ref: '#/components/responses/WriteRateLimited'
        '500':
          $ref: '#/components/responses/WriteError'
        '503':
          $ref: '#/components/responses/WriteTrackingUnavailable'
        default:
          content:
            application/json:
              example:
                error: internal_error
                message: Unexpected error. Try again.
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error.
      description: Upload media.
  /api/v1/x/profile:
    patch:
      operationId: updateProfile
      summary: Update X profile
      tags:
      - X Write
      security:
      - apiKey: []
      - oauthBearer: []
      parameters:
      - $ref: '#/components/parameters/WriteIdempotencyKey'
      requestBody:
        required: true
        description: Account and profile fields to update (name, bio, location, website).
        content:
          application/json:
            schema:
              type: object
              required:
              - account
              properties:
                account:
                  type: string
                  description: X account (@username or ID) to update profile
                  example: '@elonmusk'
                name:
                  type: string
                  description: Display name
                  example: Example Name
                description:
                  type: string
                  description: Bio description
                  example: CEO of Tesla, SpaceX, and X
                location:
                  type: string
                  example: Austin, TX
                url:
                  type: string
                  description: Website URL
                  example: https://x.com
            example:
              account: '@elonmusk'
              name: Example Name
              description: description_value
              location: location_value
              url: https://xquik.com/example
      responses:
        '200':
          $ref: '#/components/responses/WriteActionCompleted'
        '202':
          $ref: '#/components/responses/WriteActionAccepted'
        '400':
          $ref: '#/components/responses/WriteInvalidInput'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/AccountAuthError'
        '404':
          $ref: '#/components/responses/XAccountNotFound'
        '409':
          $ref: '#/components/responses/WriteIdempotencyConflict'
        '422':
          $ref: '#/components/responses/WriteRejected'
        '429':
          $ref: '#/components/responses/WriteRateLimited'
        '500':
          $ref: '#/components/responses/WriteError'
        '503':
          $ref: '#/components/responses/WriteTrackingUnavailable'
        default:
          content:
            application/json:
              example:
                error: internal_error
                message: Unexpected error. Try again.
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error.
      description: Update X profile.
  /api/v1/x/profile/avatar:
    patch:
      operationId: updateAvatar
      summary: Update profile avatar
      tags:
      - X Write
      security:
      - apiKey: []
      - oauthBearer: []
      parameters:
      - $ref: '#/components/parameters/WriteIdempotencyKey'
      requestBody:
        required: true
        description: Account and avatar image file or HTTPS image URL (max 700 KB).
        content:
          multipart/form-

# --- truncated at 32 KB (95 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/xquik-api/refs/heads/main/openapi/xquik-api-x-write-api-openapi.yml