# MatrixFold Social Payload Repair API

> MatrixFold Social Payload Repair API is a paid API for AI agents from api-production-853c.up.railway.app, paid per call via x402, $0.006/call, status unknown (last checked 2026-09-15).

Repairs invalid X/Twitter, LinkedIn, and Xiaohongshu post payloads by returning corrected JSON, validation reports, fixed rule codes, remaining risks, and a machine-readable diff for safe retry.

## Facts

- Endpoint: POST https://api-production-853c.up.railway.app/v1/repair
- Price: $0.006/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-aab15bcb
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_P9DFJuw2Xo8wqkSanxNvc

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-aab15bcb -d '<json body>'
```

Example prompt: My X/Twitter post payload just failed validation — can you repair it and give me the corrected JSON, a list of the fixed rule codes, any remaining risks, and a diff so I can safely retry publishing?

## When to prefer this

Use this endpoint when a social post payload has already been validated or attempted and failed, and you need automated repair with a diff and remaining risk assessment before retrying. Prefer this over the validator endpoint when you already know the payload is broken and need it fixed, not just checked. Ideal for agentic publishing pipelines on X/Twitter, LinkedIn, or Xiaohongshu where the agent must retry safely after a failure.

## Known failure modes

- Payload is too malformed to repair — returns error with explanation of unresolvable violations
- Unsupported platform specified — returns error indicating valid platform options are X/Twitter, LinkedIn, Xiaohongshu
- Missing required payload fields — returns validation error listing absent fields
- Payment not included or invalid — returns 402 Payment Required
- Repair succeeds but remaining risks flagged — corrected payload returned with risk warnings that agent must review before retrying

## Output

Returns corrected JSON payload ready for social platform APIs, a validation report detailing what was fixed, codes for each repaired rule violation, a list of remaining risks that could still cause issues, and a machine-readable diff showing exactly what changed between the original and repaired payload.

## Example request

```json
{
 "text": "Just launched our new AI-powered analytics platform! 🚀 It helps teams make data-driven decisions faster than ever before. Check it out and let us know what you think.",
 "title": "Product Launch Announcement",
 "hashtags": [
  "#AI",
  "#Analytics",
  "#ProductLaunch"
 ],
 "platform": "x",
 "imageUrls": [
  "https://example.com/product-screenshot.png"
 ],
 "preserveIntent": "Announce a new product feature to professional audience",
 "maxRepairPasses": 2
}
```

## 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": "AI agent social post body to validate for length, hashtags, links, emoji density, and publishing guardrails."
      },
      "title": {
       "type": "string",
       "maxLength": 160,
       "description": "Optional social post title to validate for platform rules."
      },
      "hashtags": {
       "type": "array",
       "items": {
        "type": "string"
       },
       "maxItems": 30,
       "description": "Hashtags to check for platform limits."
      },
      "platform": {
       "enum": [
        "x",
        "linkedin",
        "xiaohongshu"
       ],
       "type": "string",
       "description": "Target social platform for post compliance validation: X/Twitter, LinkedIn, or Xiaohongshu."
      },
      "imageUrls": {
       "type": "array",
       "items": {
        "type": "string",
        "format": "uri"
       },
       "maxItems": 20,
       "description": "Image URLs to check for platform image-count limits."
      },
      "preserveIntent": {
       "type": "string",
       "maxLength": 500,
       "description": "Optional intent to preserve if risky terms or links must be removed."
      },
      "maxRepairPasses": {
       "type": "integer",
       "maximum": 3,
       "minimum": 1,
       "description": "Maximum deterministic repair passes. Defaults to 2."
      }
     }
    },
    "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",
      "repairApplied",
      "originalReport",
      "repairedPayload",
      "repairedReport",
      "fixedIssueCodes",
      "remainingIssueCodes",
      "diff",
      "ruleVe
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-production-853c-up-railway-app-aab15bcb/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)
