Errors
The Socialit API uses conventional HTTP status codes and returns JSON error bodies.
Status codes
Section titled “Status codes”| Status | Meaning |
|---|---|
200 / 201 | Success |
400 | Validation error or malformed request |
401 | Missing or invalid API key |
402 | Insufficient credits to publish |
404 | Resource not found (or not in your workspace) |
413 | Uploaded file too large |
429 | Rate limit exceeded |
Error body
Section titled “Error body”Most errors return an error string:
{ "error": "NotFound" }Validation errors
Section titled “Validation errors”Validation failures include a Zod-style issues array describing each problem:
{ "error": "ValidationError", "issues": [ { "code": "too_small", "minimum": 1, "path": ["content"], "message": "String must contain at least 1 character(s)" } ]}Insufficient credits
Section titled “Insufficient credits”Publishing returns 402 with the required and available credit amounts:
{ "error": "InsufficientCredits", "required": 3, "available": 1, "breakdown": []}Cross-workspace access
Section titled “Cross-workspace access”For security, requesting a resource that exists but belongs to another workspace returns 404 NotFound (rather than 403), so the existence of other workspaces’ resources is never revealed.