Postpone Logo
Getting Started

Error Handling

Understanding and handling errors in the Postpone GraphQL API.

GraphQL does not return a 400 response status code when a request is invalid. Instead, Postpone's GraphQL API returns specific attributes for all mutations to help you understand what went wrong and how to fix it.

Error Response Structure

All mutations in the Postpone API return the following attributes:

success
boolean
Indicates if the mutation was performed successfully. Always check this value first before proceeding.
errors
ValidationError[]
A list of validation error objects that provide detailed information about what went wrong. Each object contains field, message, and code properties.

Validation Errors

Validation errors provide detailed information about why a mutation failed. Each validation error object contains:

field
string
The specific field that caused the error. This helps you identify which input field needs to be corrected.
message
string
A human-readable description of the error that can be displayed to users or used for debugging.
code
string
A machine-readable error code that allows your application to handle specific error types programmatically.

Example: Missing Required Fields

When creating a Reddit post without providing required content:

{
  "data": {
    "scheduleRedditPost": {
      "success": false,
      "errors": [
        {
          "field": "content",
          "message": "Either link or content is required for a Reddit post",
          "code": "LINK_OR_CONTENT_REQUIRED"
        }
      ]
    }
  }
}

Example: Invalid Field Values

When providing invalid data for specific fields:

{
  "data": {
    "scheduleRedditPost": {
      "success": false,
      "errors": [
        {
          "field": "title",
          "message": "Title must be between 1 and 300 characters",
          "code": "INVALID_LENGTH"
        },
        {
          "field": "scheduledAt",
          "message": "Scheduled time must be in the future",
          "code": "INVALID_DATE"
        }
      ]
    }
  }
}

GraphQL Errors vs Mutation Errors

It's important to distinguish between GraphQL-level errors and mutation-level errors:

GraphQL Errors

These occur at the GraphQL parsing/execution level and are returned in the errors field of the root response:

{
  "errors": [
    {
      "message": "Cannot query field 'invalidField' on type 'Post'",
      "locations": [{"line": 3, "column": 5}]
    }
  ]
}

Mutation Errors

These are business logic errors returned within the mutation's response:

{
  "data": {
    "scheduleRedditPost": {
      "success": false,
      "errors": [
        {
          "field": "title",
          "message": "Title is required",
          "code": "REQUIRED_FIELD"
        }
      ]
    }
  }
}

Always check both levels when handling API responses.

Common Error Codes

Authentication Errors

emailDoesNotExist
string
We couldn't find a user with that email. Please try again.
passwordIncorrect
string
Current password is incorrect.
passwordsNotMatch
string
Passwords do not match.
wrongToken
string
Password reset link has expired.
duplicateEmail
string
That email is already associated with a different Postpone user. Please log in with that email or use a different one.
password_too_short
string
Your password must contain at least 8 characters.
password_too_common
string
Your password can't be a commonly used password.
password_too_similar
string
Your password can't be too similar to your other personal information.
password_entirely_numeric
string
Your password can't be entirely numeric.

Reddit Post Errors

subredditDoesNotExist
string
The subreddit does not exist.
linkPostNotAllowed
string
Link posts are not allowed by one or more subreddits.
selfPostNotAllowed
string
Self posts are not allowed by one or more subreddits.
pollPostNotAllowed
string
Poll posts are not allowed by one or more subreddits.
imagePostNotAllowed
string
Image posts are not allowed by one or more subreddits.
gifPostNotAllowed
string
GIF posts are not allowed by one or more subreddits.
videoPostNotAllowed
string
Video posts are not allowed by one or more subreddits.
galleryPostNotAllowed
string
Gallery posts are not allowed by one or more subreddits.
notLoggedIn
string
You are not logged in. Login to continue.
linkOrContentOnlyOne
string
Must submit link or content, but not both.
commentMaxLength
string
Comment cannot be more than 10,000 characters.
redditAccountNotLinked
string
That Reddit account has not been linked to Postpone.
invalidURL
string
That isn't a valid URL.
postOutsideOfPlan
string
Post outside of plan limits for the scheduled month. Upgrade to schedule additional Reddit posts.
editScopeNotEnabled
string
Postpone needs elevated permissions to auto-remove posts from this Reddit account. Please log into Postpone again with this Reddit account to proceed.
titleTooLong
string
Post titles can't be longer than 300 characters.
tooManySubmissions
string
You can only schedule up to a limited number of submissions per post.
noSubmissions
string
You must schedule to at least one subreddit.
tooManyMediaPerGallery
string
You can only add up to a limited number of media items per gallery.
draftWithSubmittedSubmissions
string
You cannot turn a submitted post into a draft.
submissionDateInPast
string
Submission date must be in the future. Please select a future date.
bulkImportInvalidDateTimeFormat
string
Invalid date/time format in the post_at column for one or more rows. Please use the format YYYY-MM-DD HH:MM.
missingSubmissionId
string
Post is not linked to platform. Please fix it in History and try again.