ShortyyDocs

Errors & Status Codes

Comprehensive guide to Shortyy standardized JSON error envelope, error codes, and troubleshooting steps.

Errors & Status Codes

Shortyy returns standard HTTP status codes along with a consistent, typed JSON error envelope across all REST endpoints. Direct HTTP clients and SDKs can reliably inspect error.code and error.status.


Standardized Error Envelope

All error responses adhere to this structure:

json
{
  "error": {
    "code": "INVALID_URL",
    "message": "The provided destination URL must use http:// or https:// protocol.",
    "status": 400,
    "details": {
      "field": "url"
    }
  }
}

Canonical Error Codes

Status CodeError CodeDescriptionCorrective Action
400MALFORMED_JSONRequest body contains invalid JSON syntax.Ensure valid JSON syntax with escaped strings.
400VALIDATION_FAILEDRequired fields are missing or fail type checks.Check request parameters and types.
400INVALID_URLTarget URL is not a valid absolute HTTP/HTTPS URL.Prefix with https:// and ensure hostname is valid.
401UNAUTHORIZEDMissing Authorization or X-API-Key header.Supply valid Bearer token.
401INVALID_API_KEYSupplied API key does not match or has expired.Generate a new key from the developer keys portal.
403FORBIDDENKey lacks necessary scope or plan entitlement.Verify scopes or upgrade subscription tier.
404LINK_NOT_FOUNDLink ID or short code does not exist.Confirm the UUID or short code exists and belongs to you.
409CODE_ALREADY_EXISTSCustom short code is already claimed or reserved.Select an alternative custom code.
415INVALID_CONTENT_TYPEPayload sent without Content-Type: application/json.Include Content-Type: application/json header.
429RATE_LIMIT_EXCEEDEDToken bucket exhausted.Wait retryAfterSeconds before re-requesting.
500INTERNAL_SERVER_ERRORInternal system error.Retry with exponential backoff; contact support.