Skip to content

Error Handling

The PosterMyWall API always returns HTTP status 200, even when a request fails. Do not rely on the HTTP status code to detect a failure. Instead, check the response body: a failed request returns a JSON object shaped like this:

{
"err": "<human-readable message>",
"errCode": "<machine-readable code>"
}
  • err is a human-readable message you can log or show while debugging.
  • errCode is a stable, machine-readable code you should check in your code to detect and handle the failure.

For example, calling /templates/{template_id} with an ID that doesn’t exist returns:

{
"err": "No template exists with that ID.",
"errCode": "invalid_template_id"
}

Each endpoint in the API Reference lists the errCode values it can return. The table below summarizes the endpoint-specific codes currently in use across the API. In addition, any OAuth-secured endpoint can return the codes listed further below, and any endpoint can return system_error.

Codes any OAuth-secured endpoint can return

errCode Meaning
expired_access_token The OAuth access token has expired. Refresh it.
access_denied The token’s user is not permitted to access the resource.
invalid_user_id The user id in the path does not match the token or does not exist.
invalid_team_id The team id is invalid or the user is not in the team.
system_error An unexpected server-side failure. Retry later.

Endpoint-specific codes

errCode Meaning
invalid_type The type filter passed to /templates is not a valid template type.
invalid_size The size filter passed to /templates is not a valid design size.
invalid_template_id No template exists with the given template ID.
invalid_design_id No design exists with the given design ID.
design_not_owned The design exists but is not owned by the specified user.
design_not_in_team The design exists but does not belong to the specified team.
invalid_folder_id No folder exists with the given folder ID.
user_does_not_own_folder The folder exists but is not owned by the specified user.
invalid_folder No folder exists with the given folder ID (team endpoints).
invalid_download_id No download exists with the given download ID.
limit_too_large The limit query parameter exceeds the maximum allowed value of 200.
invalid_api_key The client_id (API key) is missing or not valid.
invalid_url The url passed to /settings/set-notification-url is not a valid URL.
missing_notification_url No notification URL has been registered yet for this application.
invalid_notification_url The registered notification URL is not valid.