{"uid":"cap_P9DFJuw2Xo8wqkSanxNvc","slug":"api-production-853c-up-railway-app-aab15bcb","name":"MatrixFold Social Payload Repair API","description":"","url":"https://api-production-853c.up.railway.app/v1/repair","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":"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","ruleVersion"],"properties":{"diff":{"type":"array"},"platform":{"type":"string"},"ruleVersion":{"type":"string"},"repairApplied":{"type":"boolean"},"originalReport":{"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"}}}},"repairedReport":{"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"}}}},"fixedIssueCodes":{"type":"array","items":{"type":"string"}},"repairedPayload":{"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."}}},"remainingIssueCodes":{"type":"array","items":{"type":"string"}}}}}}}},"responseSchema":null,"example":{"request":{"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},"response":{"diff":[],"platform":"x","ruleVersion":"matrixfold-rules-2026-05-21","repairApplied":false,"originalReport":{"score":100,"valid":true,"errors":[],"metrics":{"chars":166,"links":0,"emojis":1,"images":1,"hashtags":3,"lineBreaks":0},"platform":"x","warnings":[],"riskLevel":"low","suggestedFixes":[]},"repairedReport":{"score":100,"valid":true,"errors":[],"metrics":{"chars":166,"links":0,"emojis":1,"images":1,"hashtags":3,"lineBreaks":0},"platform":"x","warnings":[],"riskLevel":"low","suggestedFixes":[]},"fixedIssueCodes":[],"repairedPayload":{"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"]},"remainingIssueCodes":[]}},"exampleRequest":{"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},"tags":["x402"],"displayCostAmount":"0.006","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.006/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.006","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.006","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_XuKECIzvKjPGRpq3HC5eB","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.006","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"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.","exampleAgentPrompt":"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?","exampleUseCases":null,"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T00:41:17.163Z","isFirstParty":false}