invalid_expiration

The request is a signed URL, but its expires parameter is out of range. The API does not check the signature and does not render anything. Sign a new URL with a valid expiry. This page is part of the error code reference.

HTTP status 401 Unauthorized
error.type authentication_error
error.retryable false
Credits used 0

Example response

{
  "error": {
    "type": "authentication_error",
    "code": "invalid_expiration",
    "message": "Signed URL expires must be at most 30 days in the future",
    "retryable": false,
    "docs": "https://renderscreenshot.com/docs/errors/invalid-expiration"
  },
  "request_id": "req_abc123"
}

Causes

  • The expiry is more than 30 days ahead. Signed URLs are credentials, so the API caps their lifetime at 30 days (plus 5 minutes for clock drift).
  • expires is in milliseconds. Date.now() in JavaScript returns milliseconds. A millisecond value is not accepted. The message is expires must be a Unix timestamp in seconds.
  • expires is not a number. A date string such as 2026-12-01 or a value such as tomorrow is rejected with the same message.

How to fix it

  1. Send expires as an integer Unix timestamp in seconds.
  2. Keep it at most 30 days after the time the URL will be fetched.
  3. For an image that must work for longer than 30 days, use the public CDN link from the X-Cache-URL header, or copy the image to your own bucket.

A past expires returns expired_signature instead.

Was this page helpful?