{"uid":"cap_D6K5hBG0W7l-J7h1C3Pf-","slug":"api-production-853c-up-railway-app-37760eea","name":"MatrixFold X/Twitter Preflight Validator","description":"","url":"https://api-production-853c.up.railway.app/v1/preflight","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object","required":["platform","text"],"properties":{"text":{"type":"string","maxLength":6000,"minLength":1,"description":"Post text before MatrixFold merges structured hashtags into the final X text field."},"hashtags":{"type":"array","items":{"type":"string"},"maxItems":30,"description":"Structured hashtags to append to the final X text field if missing."},"mediaIds":{"type":"array","items":{"type":"string"},"maxItems":4,"description":"Already-uploaded X media IDs to attach to POST /2/tweets."},"platform":{"enum":["x"],"type":"string","description":"Only X is supported in the preflight adapter."},"imageUrls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":20,"description":"Raw image URLs. Any non-empty value blocks ready=true; upload them first and pass mediaIds instead."},"apiProfile":{"enum":["x_api_v2_create_tweet"],"type":"string","description":"Strict downstream API profile for X POST /2/tweets."}}},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","required":["platform","apiProfile","ready","publishText","validationReport","blockingReasons","warnings","prerequisites","apiLimits","caveats"],"properties":{"ready":{"type":"boolean"},"caveats":{"type":"array","items":{"type":"string"}},"platform":{"enum":["x"],"type":"string"},"warnings":{"type":"array"},"apiLimits":{"type":"object"},"apiProfile":{"enum":["x_api_v2_create_tweet"],"type":"string"},"publishText":{"type":"string"},"prerequisites":{"type":"array"},"blockingReasons":{"type":"array"},"retryableRequest":{"type":"object"},"validationReport":{"type":"object","required":["platform","valid","score","riskLevel","errors","warnings","suggestedFixes","metrics"],"properties":{"score":{"type":"integer","maximum":100,"minimum":0},"valid":{"type":"boolean"},"errors":{"type":"array"},"metrics":{"type":"object"},"platform":{"type":"string"},"warnings":{"type":"array"},"riskLevel":{"enum":["low","medium","high"],"type":"string"},"suggestedFixes":{"type":"array","items":{"type":"string"}}}}}}}}}},"responseSchema":null,"example":{"request":{"text":"Just launched our new AI tool! Check it out at https://example.com #AI #launch","hashtags":["AI","launch"],"platform":"x","imageUrls":["https://example.com/image1.jpg"]},"response":{"ready":false,"caveats":["ready=true means MatrixFold validated the request body shape and deterministic content limits only.","MatrixFold cannot verify the buyer's X API plan, OAuth token, account status, rate limit, or platform moderation outcome."],"platform":"x","warnings":[],"apiLimits":{"maxHashtags":3,"maxMediaIds":4,"maxTextChars":280,"textEndpoint":"https://api.x.com/2/tweets"},"apiProfile":"x_api_v2_create_tweet","publishText":"Just launched our new AI tool! Check it out at https://example.com #AI #launch","prerequisites":[{"code":"X_MEDIA_UPLOAD_REQUIRED","message":"Upload media to X first; raw image URLs are not accepted by POST /2/tweets.","endpointHint":"POST /2/media/upload"}],"blockingReasons":[{"code":"MEDIA_UPLOAD_REQUIRED","path":"imageUrls","message":"Raw image URLs are not accepted by X POST /2/tweets. Upload media first, then pass mediaIds to this preflight adapter.","howToFix":"Upload each image through X media upload, pass the returned media IDs as mediaIds, and omit raw imageUrls."}],"validationReport":{"score":100,"valid":true,"errors":[],"metrics":{"chars":78,"links":1,"emojis":0,"images":1,"hashtags":2,"lineBreaks":0},"platform":"x","warnings":[],"riskLevel":"low","suggestedFixes":[]}}},"exampleRequest":{"text":"Just launched our new AI tool! Check it out at https://example.com #AI #launch","hashtags":["AI","launch"],"platform":"x","imageUrls":["https://example.com/image1.jpg"]},"tags":["x402"],"displayCostAmount":"0.004","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.004/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_vjf2kCEegZTqHsBVa4p8z","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.004","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Pre-validates AI-generated X/Twitter post payloads before submission, checking text length, hashtags, links, media prerequisites, and unsupported fields to prevent 400/422 errors.","exampleAgentPrompt":"Before I post to X, run a preflight check on this tweet payload — the text is 'Just launched our new AI tool! Check it out at https://example.com #AI #launch' — and tell me if it's ready to publish, what's blocking it, and give me a corrected request body I can retry.","exampleUseCases":null,"resultDescription":"Returns a ready boolean, a list of blockingReasons explaining why the post would fail, a retryableRequest body with fixes applied, a retry policy, auth requirements needed, and caveats to be aware of before calling POST /2/tweets.","failureModes":["Invalid or missing tweet text returns validation error with specific blocking reasons","Unsupported media IDs or missing media upload prerequisites flagged as blocking","Malformed payload fields result in detailed field-level error list","Auth requirement mismatches identified but not resolvable without credentials","Rate limit or service unavailability returns 5xx error"],"whenToPreferThis":"Use this endpoint when an AI agent is about to call POST /2/tweets and wants to reduce publishing failures by catching text length violations, hashtag issues, link formatting problems, media upload prerequisites, and unsupported fields before making the actual post. Ideal for agentic social publishing pipelines where retry costs or rate limit consumption matter.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T03:45:47.713Z","isFirstParty":false}