---
title: "Update X profile"
method: PATCH
path: "/x/profile"
tags: ["X Write"]
---

# Update X profile

`PATCH /x/profile`

## Headers

- `Idempotency-Key` string, required

## Request body

- object
  - `account` string, required — X account (@username or ID) to update profile
  - `name` string — Display name
  - `description` string — Bio description
  - `location` string
  - `url` string — Website URL

## Response `200`

Write reached a terminal state.

- XWriteAction — Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing the original Idempotency-Key returns this same record. Submit a new write only when safeToRetry is true, using a new key.
  - `object` 'x_write_action', required
  - `id` string, required
  - `writeActionId` string, required
  - `action` 'create_tweet' | 'delete_tweet' | 'like' | 'unlike' | 'retweet' | 'unretweet' | 'follow' | 'unfollow' | 'remove_follower' | 'send_dm' | 'upload_media' | 'update_profile' | 'update_avatar' | 'update_banner' | 'create_community' | 'delete_community' | 'join_community' | 'leave_community', required
  - `status` 'accepted' | 'dispatching' | 'pending_confirmation' | 'success' | 'failed' | 'expired', required
  - `terminal` boolean, required
  - `retryable` boolean, required — True only when a new attempt can reasonably succeed.
  - `safeToRetry` boolean, required — True only when no write was dispatched and a new idempotency key may be used.
  - `statusUrl` string, required
  - `pollAfterMs` integer, nullable, required
  - `charged` boolean, required
  - `chargedCredits` string, required
  - `billing` XWriteActionBilling, required — plannedCredits is the approved maximum. chargedCredits comes from the settled credit ledger. Pending or failed writes are not charged.
    - `status` 'not_charged' | 'pending' | 'charged' | 'charge_failed' | 'refunded', required
    - `charged` boolean, required
    - `plannedCredits` string, required
    - `chargedCredits` string, required
  - `request` XWriteActionRequest, required — Stable fingerprint and sanitized payload for replay checks.
    - `hash` string, nullable, required — Stable hash of account, action, target, and payload.
    - `payload` object, nullable, required — Exact sanitized payload dispatched for this action.
  - `account` XWriteActionAccount, nullable, required — Connected account selected for the write.
    - `id` string, required
    - `username` string, required
  - `target` XWriteActionTarget, nullable, required — Existing X resource targeted by the write, when applicable.
    - `type` 'tweet' | 'user' | 'community', required
    - `id` string, required
  - `targetId` string, nullable, required
  - `result` XWriteActionResult, nullable, required — Confirmed result produced by the write, when available.
    - `type` 'tweet' | 'direct_message' | 'media' | 'community' | 'state_change'
    - `id` string
    - `state` string
  - `nextAction` XWriteActionNextAction, nullable, required — Exact follow-up an API client or agent should perform.
    - `type` 'poll' | 'retry' | 'verify_result' | 'fix_request', required
    - `url` string
    - `afterMs` integer
    - `requiresNewIdempotencyKey` boolean
  - `requestHash` string
  - `requestId` string
  - `idempotent` boolean
  - `error` string
  - `message` string
  - `sendDispatched` boolean, required
  - `sendDispatchedAt` string, date-time — Dispatch timestamp when the write reached execution.
  - `createdAt` string, date-time
  - `updatedAt` string, date-time
  - `completedAt` string, date-time
  - `expiresAt` string, date-time — Deadline for resolving a non-terminal write. This is not the Idempotency-Key retention deadline.
  - `confirmedAt` string, date-time
  - `confirmationCheckedAt` string, date-time
  - `confirmationAttempts` integer
  - `tweetId` string — Compatibility field for a confirmed tweet result ID.
  - `messageId` string — Compatibility field for a confirmed direct message ID.
  - `mediaId` string — Compatibility field for a confirmed media upload ID.
  - `mediaUrl` string, uri — Public media URL when the upload creates one.
  - `communityId` string — Compatibility field for a confirmed community ID.
  - `communityName` string — Confirmed community name when available.
  - `resultId` string — Compatibility result ID for other write actions.
  - `media` object — Media count, kind, size, and billing details when used.
  - `details` object — Structured recovery context for a failed write.
  - `success` boolean, required

## Other responses

- `202` — Write was accepted or dispatched. Poll Location after Retry-After. Never submit another write while this action remains nonterminal.
- `400` — The write request is invalid and no action was dispatched.
- `401` — Unauthenticated
- `402` — Payment required. Fixed-price direct MPP requests return a Machine Payments Protocol problem document and a WWW-Authenticate challenge. Authenticated X data requests return balances and explicit Stripe checkout-creation actions. Guest paid-read keys receive only the accountless guest top-up action. Direct MPP challenges also advertise the Stripe wallet action. Other authenticated endpoints return a legacy error shape. A failed request never creates checkout. Create checkout only after the user confirms a payment option.
- `403` — The connected X account needs reauthentication or is currently restricted (locked, suspended, or recovering). Returns an error code of `account_needs_reauth` or `account_restricted`.
- `404` — Connected X account not found
- `409` — The idempotency key belongs to a different write request.
- `422` — X rejected the write or the media URL could not be downloaded. Possible codes: `x_content_too_long`, `x_duplicate_action`, `x_account_suspended`, `x_account_protected`, `x_dm_not_allowed`, `x_target_not_found`, `x_account_feature_required`, `x_rejected`, `media_download_failed` (URL fetch path only - body.url not HTTPS, resolves to private IP, file too large, origin error, or timeout).
- `429` — A write was throttled by Xquik's tier or action limits (`rate_limit_exceeded`) or by X (`x_rate_limited`, `x_daily_limit`). Respect the `Retry-After` header when present, otherwise back off before retrying.
- `500` — Write operation failed. Possible error codes include x_write_failed, x_write_ambiguous, x_duplicate_action, and x_daily_limit. Inspect the durable action, safeToRetry, and nextAction fields before retrying.
- `503` — Durable tracking or the write service is temporarily unavailable. Inspect safeToRetry before creating another action.

---

[API](https://skmtc.net/xquik-dev/apis/xquik-api.md) · [All operations](https://skmtc.net/xquik-dev/apis/xquik-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/xquik-dev/xquik-api/versions/d0ee2927ac71/schema)
