Skip to main content

Embargo and Rights Expiry

Keep an asset hidden until its release time and take it offline when its usage rights end. How the availability window works, how to set it through the API and at upload, who can see and change it, and what happens to delivery, search, shares and webhooks.

A product shot that must not appear before the launch, a press image under embargo until 09:00 on Tuesday, a licensed photo whose rights run out at the end of March. Until now the end date was a metadata field that somebody had to remember to act on. FileSpin now enforces both ends: before the embargo lifts and after the rights expire, the asset is hidden from people who should not see it and refused on every public delivery path, whatever links to it already exist.

Set the window, the asset is embargoed, then available, then its rights expire


The availability window​

Each asset has two optional dates, both in UTC:

FieldMeaning
embargo_untilThe asset is embargoed before this instant
rights_expire_atThe asset is expired from this instant on

The asset is available inside the half-open window [embargo_until, rights_expire_at). Either end can be empty: an asset with only rights_expire_at is available until then, one with only embargo_until is available from then on. Its state is one of AVAILABLE, EMBARGOED or EXPIRED, and it is worked out from the clock on every request, so an asset is hidden or shown on time even if nothing else happens at that moment.

rights_expire_at must be after embargo_until; a window that could never open is refused.

expiration_date: the last usable day​

Most people think of rights as ending on a day, not at an instant. Every schema has two built-in fields for the dashboard and for metadata forms:

Schema fieldTypeStored as
embargo_untildate-timeembargo_until
expiration_datedate YYYY-MM-DDrights_expire_at = the next day at 00:00 UTC

expiration_date is the last day the asset may be used. "expiration_date": "2027-03-31" is stored as rights_expire_at = 2027-04-01T00:00:00Z: the asset stays available until midnight UTC at the end of 31 March. If your rights end at a particular local time, set rights_expire_at directly instead.

These two fields are not stored in the asset's metadata, and a schema cannot define its own fields with these names: they are removed when a schema is saved and added back as built-ins when it is read.


Setting the dates through the API​

Use Update Data, either with top-level fields:

curl -X POST "https://app.filespin.io/api/v1/assets/99d819953914402babbdeb68337ea6a3/data/update" \
-H "X-FileSpin-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"mode": "APPEND",
"embargo_until": "2027-01-15T09:00:00Z",
"rights_expire_at": "2027-04-01T00:00:00Z"
}'

or with the schema fields inside data, alongside any other metadata:

curl -X POST "https://app.filespin.io/api/v1/assets/99d819953914402babbdeb68337ea6a3/data/update" \
-H "X-FileSpin-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"mode": "APPEND",
"data": {"usage_rights": "licensed_non_exclusive", "expiration_date": "2027-03-31"}
}'

A few details:

  • Date-times are ISO 8601 with Z or an offset (+05:30). A date-time without a time zone is refused rather than guessed.
  • null clears a date ("" also clears expiration_date).
  • mode is still required. A request that only sets dates can leave out data; it does not touch the asset's metadata, even in REPLACE mode, and returns {"status": "OK", "message": "Asset availability updated"}.
  • Dates and data are all or nothing: the dates are written only once the rest of the update validates, so a refused update leaves them unchanged.
  • Sending a value the asset already has is not a change, so a client that writes back the whole metadata form never trips a permission or plan check for a date it did not touch.

To clear an embargo and release the asset now, send {"mode": "APPEND", "embargo_until": null}.

Many assets at once​

Update Data - Bulk takes the same fields, top level or in data, and applies them to up to 500 assets:

curl -X POST "https://app.filespin.io/api/v1/assets/bulk/data/update" \
-H "X-FileSpin-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"asset_ids": ["99d819953914402babbdeb68337ea6a3", "a211ab5f351f4b398426efb59b0c72a3"],
"embargo_until": "2027-01-15T09:00:00Z",
"data": {"expiration_date": "2027-03-31"}
}'

The permission, plan and window checks are made for each asset. One that fails is listed in failed with a reason (no_access, plan_upgrade_required or invalid) and the others are updated. A date that cannot be read refuses the whole request. The change is recorded as a job and can be taken back for 7 days with Undo Update Data - Bulk, which puts the previous dates back too.

Setting the dates at upload​

Put embargo_until and expiration_date in the upload's metadata. The asset is unavailable from the moment it is created, so it is never public, not even for the seconds before a follow-up update would have arrived:

curl -X POST "https://upload.filespin.io/api/v1/assets/new/content/original/upload" \
-H "X-FileSpin-Api-Key: YOUR_API_KEY" \
--form file=@launch-hero.jpg \
--form 'custom_metadata={"data":{"embargo_until":"2027-01-15T09:00:00Z","expiration_date":"2027-12-31"}}'

The same fields work in data on Ingest from URI. On a replace they are applied to the asset straight away; a replacement otherwise keeps the dates the asset already had. The dates are checked before anything is stored, so a refused date means no asset is created.


Who can see and change the window​

Three permissions. Admin and Manager have them, and so does Asset Manager where that role exists:

PermissionAllows
VIEW_UNAVAILABLE_ASSETSee embargoed and expired assets, and the dates on any asset
EDIT_EMBARGO_ASSETSet, move or clear embargo_until, and change an embargoed asset
EDIT_AVAILABILITYSet, move or clear rights_expire_at, and change an expired asset

Callers with VIEW_UNAVAILABLE_ASSET get three extra top-level fields on Get Data and in search results with extended_result:

{
"id": "99d819953914402babbdeb68337ea6a3",
"embargo_until": "2027-01-15T09:00:00Z",
"rights_expire_at": "2027-04-01T00:00:00Z",
"availability": "EMBARGOED",
"data": {"embargo_until": "2027-01-15T09:00:00Z", "expiration_date": "2027-03-31"}
}

Callers without it never see the dates.

Plans​

Setting a date on an asset that has none is part of the Scale and Enterprise plans. Moving or clearing a date that is already set works on every plan, so an account that changes plan can still release or extend what it has. Dates already set are enforced on every plan.

Errors​

Refusals return a JSON body with "status": "ERROR" and an error code:

HTTPerrorMeaning
400invalid_availability_valueA date that cannot be read, a date-time with no time zone, or the same field at the top level and in data with different values
400invalid_availability_windowrights_expire_at is not after embargo_until
403availability_edit_forbiddenMissing the permission for that date, or for changing an embargoed / expired asset
403plan_upgrade_requiredSetting a new date needs the Scale or Enterprise plan ("feature": "asset_availability")

What "unavailable" means​

While an asset is embargoed or expired:

  • It does not exist for callers without VIEW_UNAVAILABLE_ASSET. Fetching it by ID returns 404, not 403, so its existence is not disclosed. It is left out of search results, collection responses and relationship lists. A collection keeps it as a member, and it reappears when it becomes available.
  • Search hides it by default, even from those who may see it. Send "include_unavailable": true to include unavailable assets, or filter with "availability": EMBARGOED, EXPIRED, or EXPIRING_SOON (available now, rights expire within 30 days); all three return nothing to callers without VIEW_UNAVAILABLE_ASSET. See Run Search.
  • Public delivery is refused. On-demand images, image conversions, video and HLS, downloads and signed links return 404, whoever signed them. Signed-in viewers with VIEW_UNAVAILABLE_ASSET (for example in the dashboard) can still preview it, and those responses carry Cache-Control: private, no-store so no shared cache keeps a copy.
  • It cannot be published. Set Public Access returns 409 asset_unavailable, Get Link and its bulk form return 409, and a share that names it is refused. Shares that already contain it leave it out until it is available again, and it is never added to a collection zip download.
  • Automatic add-ons wait. An asset uploaded under embargo is processed by your automatic add-ons when the embargo lifts, so its image is not sent to any service before the release.
  • Changes need the matching permission. Editing an embargoed asset's metadata needs EDIT_EMBARGO_ASSET; an expired one, EDIT_AVAILABILITY.

When an asset becomes unavailable, FileSpin purges the CDN copies its delivery logs show were served. Before that, as the expiry approaches, public responses for the asset are cached for no longer than the time left: once rights_expire_at is less than 7 days away, the cache lifetime is capped at the remaining seconds, so copies age out of caches on time by themselves.


Webhooks​

Two webhook events report the transitions. Enable them in your webhook settings; they are off by default.

EventWhen
file-releasedThe embargo lifted and the asset is available: within about a minute of embargo_until, or at once when someone clears the embargo or moves it into the past
file-rights-expiredrights_expire_at was reached and the asset is now hidden. Within about a minute

Each fires once per transition. The payload is the Asset Data Format with event set, as for other asset events.

Every webhook payload for an asset that has a date set, for these events and all the others, carries the window: embargo_until and/or rights_expire_at (UTC, YYYY-MM-DDTHH:MM:SSZ, only the ones set), availability (AVAILABLE, EMBARGOED or EXPIRED) and, in data, the built-in embargo_until and expiration_date. An asset with neither date gets none of these keys. See Webhooks for an example.

A typical use: a CMS publishes the product page on file-released and takes the image down on file-rights-expired, for sites that keep their own copy of the file.

Not an API, but worth knowing: once a day, everyone who can see unavailable assets gets a notification and an email listing what was released or expired in the last 24 hours, what is releasing in the next 7 days and what expires in the next 30. Nothing is sent on a day with nothing to report, and each user can turn the email off in their profile.


Best practices​

  • Set the window at upload when you know it. An asset that is uploaded first and embargoed afterwards is public in between.
  • Use expiration_date for rights that end on a day, rights_expire_at for an exact time. Remember both are UTC.
  • Search with "availability": "EXPIRING_SOON" each week to renew rights before they lapse. Moving rights_expire_at later brings an expired asset straight back.
  • Treat 404 as "not for you" on integration accounts. An API key whose role lacks VIEW_UNAVAILABLE_ASSET sees an embargoed asset exactly as if it did not exist, which is usually what a public website integration should see.
  • Existing expiration_date values that an account stored as ordinary metadata before enforcement existed are not enforced until FileSpin moves them onto the asset for that account. Ask support when you are ready, after checking which dates are already in the past.

Next steps​