# MatrixFold X/Twitter Preflight Validator

> MatrixFold X/Twitter Preflight Validator is a paid API for AI agents from api-production-853c.up.railway.app, paid per call via x402, $0.004/call, status unknown (last checked 2026-09-15).

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.

## Facts

- Endpoint: POST https://api-production-853c.up.railway.app/v1/preflight
- Price: $0.004/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-production-853c-up-railway-app-37760eea
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_D6K5hBG0W7l-J7h1C3Pf-

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability api-production-853c-up-railway-app-37760eea -d '<json body>'
```

Example prompt: 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.

## When to prefer this

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.

## Known failure modes

- 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

## Output

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.

## Example request

```json
{
 "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"
 ]
}
```

## Request schema (JSON Schema)

```json
{
 "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": {
       
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-production-853c-up-railway-app-37760eea/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api-production-853c.up.railway.app](https://www.zero.xyz/host/api-production-853c.up.railway.app/llms.txt)
