X media upload processing_info states: poll until succeeded
After FINALIZE on the X API v2, processing_info moves from pending to in_progress to succeeded or failed. Poll using check_after_secs, then post the Sume video.

After FINALIZE, the X API may return processing_info with a state of pending, in_progress, then succeeded or failed, and a check_after_secs value that says how long to wait before the next check. Poll GET /2/media/upload on that schedule, and create the post only after succeeded.
What does each state mean for my code?
Treat only succeeded as ready. A missing processing_info means no polling is needed.
| State | Action |
|---|---|
pending | Wait check_after_secs, then poll |
in_progress | Wait check_after_secs, then poll |
succeeded | Create the post with the media_id |
failed | Stop; re-render or re-encode the video |
How do I write the loop?
The function takes any status callable, so the sample runs offline with a scripted sequence. Replace the stub with a real status request.
import time
def wait_ready(get_status, sleep=time.sleep, max_polls=20):
for _ in range(max_polls):
info = get_status().get("processing_info")
if info is None or info["state"] == "succeeded":
return True
if info["state"] == "failed":
return False
sleep(info.get("check_after_secs", 1))
return False
script = iter([{"processing_info": {"state": "pending", "check_after_secs": 1}},
{"processing_info": {"state": "in_progress", "check_after_secs": 1}},
{"processing_info": {"state": "succeeded"}}])
print(wait_ready(lambda: next(script), sleep=lambda s: None))How does this pair with Sume jobs?
Run the same pattern on both sides. A Sume render is a job that you poll through the status and result endpoints, then you hand the finished URL to X, which runs its own processing before the post is valid. Do not publish when only the Sume job is done.
Sources
Related posts
More in Integrations
- YouTube's Shorts help page says vertical, not 9:16: what to render
YouTube's Shorts help page states 3 minutes, vertical uploads and a 1080p maximum, but names no ratio. Render 1080x1920 with Sume Timeline 1.0 and probe it.
- Zapier MCP bills 2 tasks per success; retry Sume tools with one key
Zapier MCP charges 2 tasks per successful call and nothing for failures. A paid Sume tool needs an idempotency_key, and a repeat with the same key is safe.
- Zendesk vs Sume webhook signatures: base64 no dot vs hex with a dot
Zendesk signs base64(HMAC-SHA256(timestamp + body)) with no separator; Sume signs timestamp.body as sume-v1 hex. One verifier cannot check both.
- How to add an MCP server to ChatGPT with developer mode
Turn on ChatGPT developer mode, create an app for the server's URL, and sign in with OAuth. The steps, with Sume's hosted MCP server as the example.
Written by Sume