POST
/v1/file_links/{link}Update a file link
Updates an existing file link's expiration or metadata. Use expires_at to set a future Unix expiration timestamp, expire the link immediately with now, or clear the expiration with an empty string. Expired links can no longer be updated.
- RetriesRetries up to 2×, 500ms backoff, 30s timeout.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
linkstringrequired
The unique identifier of the file link to update.
Optional file link changes, including expiration, response expansion, and metadata.
expandarray<string>optional
Specifies which fields in the response should be expanded.
expires_atstringoptional
A future timestamp after which the link will no longer be usable, or `now` to expire the link immediately.
metadataobjectoptional
Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
200Returns the updated file link with its identifier, associated file, publicly accessible URL, creation time, expiration time, expiration state, livemode, metadata, and object type.
createdintegerrequired
Time at which the object was created. Measured in seconds since the Unix epoch.
expiredbooleanrequired
Returns if the link is already expired.
expires_atintegeroptional
Time that the link expires.
filestringrequired
The file object this link points to.
idstringrequired
Unique identifier for the object.
livemodebooleanrequired
If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
metadataobjectrequired
Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
objectstringrequired
String representing the object's type. Objects of the same type share the same value.
urlstringoptional
The publicly accessible URL to download the file.
defaultError response.
errorobjectrequired
Error handling
link must identify an existing, unexpired file link. expires_at must be now, a Unix timestamp, or an empty string, and metadata must be key-value data or an empty string.