Guide · Amazon S3

S3 presigned URLs expire after 7 days. Here is why, and what to do about it.

You asked for thirty days and got an error. Or the link worked on Monday and returned Request has expired on Tuesday, well short of the week you set. Both come from the same two rules, and once you know them the workarounds sort themselves into good, acceptable and bad.

Checked against AWS's own documentation on 5 November 2026. Commands are for the AWS CLI; the SDKs behave the same way.

The two rules

Rule one: seven days is the ceiling. A presigned URL is a Signature Version 4 request written into a URL. The signature is made with a key derived for one day, one region and one service, and S3 accepts such signatures for at most seven days after signing. Ask for more and the signing fails before any URL exists:

$ aws s3 presign s3://client-bucket/final_master_v3.mov --expires-in 2592000
X-Amz-Expires must be less than a week (in seconds); that is, the given
X-Amz-Expires must be less than 604800 seconds

The largest value that works is --expires-in 604800. There is no account setting, support ticket or region where this is different.

Rule two: the URL dies with the credentials that signed it. If the signer was an IAM user with a long-lived access key, the URL lives for the window you set, up to the seven days. If the signer was anything temporary, an assumed role, an instance profile, an SSO session, a federation token, the URL stops working when that session's token expires, whatever expiry you wrote into it. A role session is often one hour and at most twelve. This is the "worked on Monday, dead on Tuesday" case, and it is the one that catches people, because the URL was generated without an error and looks fine.

When either rule bites, the recipient sees a 403 with a body like this, which is what most people search for:

<Error><Code>AccessDenied</Code><Message>Request has expired</Message></Error>

What the limit is protecting

A presigned URL is a bearer token. Whoever holds it can download until it expires, and there is no way to take it back once it is out: not by deleting it from your chat history, not by asking nicely. Seven days is the ceiling on how long a leaked URL can hurt you. Temporary credentials cut that further for the same reason. Seen that way, the limit is a feature. The problem is only that most delivery work needs a link that outlives it.

The ways around it, ranked

  1. Sign with a long-lived IAM user, not a role. This gets you the full seven days instead of your session's lifetime. Create a user with nothing but s3:GetObject on the bucket, sign with its access key, and keep that key off laptops and out of chat. If seven days is enough, stop here.
  2. Put a short link in front and re-send when it lapses. The recipient gets a link that does not change; what changes behind it is the signed URL. That is what Klarsend does. On S3 a Klarsend link is still capped at seven days, because AWS's rule is AWS's rule, but the link can be revoked the moment the job is delivered, it logs who opened it, and the recipient never sees a 400-character URL. On Azure the same link can run to thirty days.
  3. CloudFront signed URLs or cookies. Put a CloudFront distribution in front of the bucket, keep the bucket private, and sign with a CloudFront key pair instead. Those signatures have no seven-day ceiling, and rotating the public key in the key group kills every URL signed with it. The cost is a distribution to set up and pay for, and a second signing scheme to maintain. Right for a product; heavy for a hand-off.
  4. Re-sign on a schedule. A small job that mints a fresh URL every few days and updates wherever the link is published. Works, and it is what most teams end up with by accident. The failure mode is the link being pasted somewhere the job does not update.
  5. Make the object public for the window. Do not. A public object has no expiry at all, and "I will remember to flip it back" is how masters end up indexed.

Going the other way: making URLs expire sooner

If your worry is the opposite, that someone on the team signs URLs for a week when an hour would do, the bucket can enforce a shorter life for everyone. A bucket policy can deny any presigned request whose signature is older than a limit you choose, in milliseconds. This one refuses anything older than ten minutes:

{
  "Version": "2012-10-17",
  "Statement": [{
    "Sid": "DenyOldSignatures",
    "Effect": "Deny",
    "Principal": "*",
    "Action": "s3:*",
    "Resource": "arn:aws:s3:::client-bucket/*",
    "Condition": { "NumericGreaterThan": { "s3:signatureAge": "600000" } }
  }]
}

The condition key is s3:signatureAge, and where several limits apply the most restrictive wins. It is the one control that lets the bucket owner, rather than each signer, decide how long a link can live.

When a presigned URL is the wrong tool

If the recipient is a system, a presigned URL is right: it needs nothing but the URL. If the recipient is a person, three things usually matter more than the expiry. Can you take the link back if it went to the wrong person? Do you know whether they downloaded it? Does the link look like something a client will trust? A raw presigned URL answers no, no and no. Klarsend's answer to all three is on the Amazon S3 guide, including the IAM policy and the bucket CORS rule it needs. For the revoke question on its own, see how to revoke a presigned URL or SAS token.

See also the FAQ and the guide for Azure Blob Storage, where SAS tokens have no seven-day ceiling and a different set of trade-offs.

Get started

Bring the storage a client actually gave you.

Connect it, send a link, revoke it — in under ten minutes, with no card and no email address.

The core stays free. Premium is €6 a month, VAT included — pricing · refund policy.