Skip to main content
The API uses standard HTTP status codes and returns a consistent JSON error envelope.

Error envelope

  • message: always present. Safe to surface to end users.
  • errors: present on 422 validation failures. Each key is the offending field; each value is an array of per-field messages.
  • error_code: present on plan and ability errors. Current values are PLAN_UPGRADE_REQUIRED (with 402) and API_TOKEN_MISSING_SCOPE (with 403).

Status code reference

Validation errors

The 422 shape mirrors Laravel’s validation output:
message is the first validation error. When there are more, it ends with how many, for example (and 1 more error) or (and 2 more errors). Use the errors object to display field-level messages in your UI. Keys mirror the request structure: posts.0.media_ids.0 means the first media ID of the first post item failed validation.

Authentication and plan errors

Resource not found

Post state errors

Posts move through a lifecycle, and some actions are only valid in some states:

Publish failures

Posts that successfully reach the API but fail when handed off to the social network surface their error in two places:
  1. The post’s status becomes failed.
  2. error_message on the post contains the network’s error description (for example “Instagram: Media aspect ratio not supported”).
The HTTP response from the original create call was 201. The failure is reported asynchronously. Always check status after creating a post, especially for scheduled posts that publish minutes or days after creation. Failed posts can be re-attempted with PUT /posts/{post}/retry.

Retrying safely

Reporting an error

If you see consistent 5xx responses or behaviour that looks wrong, email hello@publishbuddy.com with:
  • The endpoint and method
  • The approximate timestamp (UTC)
  • The X-Request-ID header from the failing response (every response carries one)
  • A redacted dump of the request body (omit your token)
That gives us enough to find the request in our logs.