Stable download link
Downloads the newest release that has a file for the chosen platform and architecture. The link names no version or filename, so it stays the same when you publish a new release.
GET /v1/products/{product}/download
Use cases
- Put a download button on your website that always leads to the newest file.
- Link to the newest beta, or to the newest version of one version line.
- Download the newest file on your server for a customer of a
licensedproduct.
To add these links to a web page, see Put download links on your page. To download one exact file, use Download an artifact.
File selection
The query parameters choose one release and one file of that release. The links in the Download links section of the product in the dashboard already name the parameters that each file needs.
Without version, the link leads to the newest published release that has a matching file. The release is from the channel of the link or a more stable channel. Without channel, the link uses stable. The rules are in Newest release.
- A release without a matching file is skipped. A fix for Windows only does not change the macOS link.
- A
universalbuild matches a link for any architecture. A build for the exact architecture wins over auniversalbuild. - A file without a platform or an architecture never matches a link that names one.
- If several files of the chosen release match, the link fails with the status 404. Add
filetypeorfilenameto the link. Seatify does not use an older release instead. - A link without parameters works only when the newest release has one file.
filename chooses the file with this exact filename. A filename that contains the version leads only to that version.
With version, the link leads to this exact release. The link then ignores channel and constraint. Send the version without a v prefix. In the query string, encode the plus sign of build metadata as %2B, such as version=2.1.0%2B42.
A draft release, a yanked release and a file whose upload has not finished are never chosen. An exact version of a draft or a yanked release answers with the status 404.
Download link
A download answers with the status 303 and no body. The Location header is a signed download link. HTTP clients and browsers follow the redirect by default.
- The link expires. Request this endpoint again for a new link.
- The link does not need a license key.
- The link accepts a
Rangeheader, so your application can resume a download that stopped. - The file is saved under its filename.
- An expired link answers with the status 403 and the text
The link has expired.
The redirect is not signed. Verify the file with its SHA-256 and its signature before your application installs it. See Verifying files.
License checks
The stable download link checks the license key when the request sends one. A refused license answers with the status 403 and this body:
{
"valid": false,
"reason": "suspended"
}The reason is product_mismatch, suspended, expired or release_not_covered. See License checks.
A license that expired under the Perpetual fallback rule gets only the releases that were published on or before its expiry date. A backdated release counts as published on its backdated date.
- Without
version, the link leads to the newest of these releases. - With the
versionof a release that was published later, the answer has the reasonrelease_not_covered.
Seatify checks the license before it looks for the release. A refused license gets the status 403, also when no file matches.
Download allowance
On the Free plan, a download is refused when your account used the download allowance of the month. The answer has the status 403 and this body:
{
"valid": false,
"reason": "download_limit_reached"
}Seatify checks the allowance before the license checks and before it looks for the release. The refusal also applies to an open product without a license key. A refused download is not counted, and it records no activity. See Downloads.
Downloads and activity
- Each redirect counts as one download of the artifact. A refused request and a request that answers 404 are not counted.
- A request with a license key records a download on the license. A refused license is recorded too. See Activity.
- A request without a license key, on an
openproduct, records no activity. A request that answers 404 records no activity.
Authentication
Send the license key of the customer. A product with the open distribution setting does not require a key. See Authentication.
A browser sends no header when it follows a link. So a link on a web page works only for an open product. For a licensed product, your server requests the link. See Licensed products.
Request
{product} is the ID of the product. The request has no body.
| Header | Required | Description |
|---|---|---|
Seatify-License-Key | For a licensed product | The license key of the customer. For an open product, a key that the request sends must be valid. |
The redirect is not signed. The API ignores the Seatify-Nonce and Seatify-Signing-Key headers on this endpoint.
| Parameter | Type | Required | Description |
|---|---|---|---|
platform | string | No | The platform of the file: darwin, windows, linux, ios, android or freebsd. See Platforms and architectures. |
arch | string | No | The architecture of the file: amd64, arm64, x86, arm or universal. |
filetype | string | No | The file type, such as dmg, exe or tar.gz. It is the extension of the filename without the dot. |
filename | string | No | The exact filename of the file. The filename is case-sensitive. |
version | string | No | An exact version, such as 2.1.0. Without it, the link leads to the newest release. See File selection. |
channel | string | No | The channel of the newest release. The release is from this channel or a more stable channel. The dev channel returns only dev releases. The default is stable. An exact version ignores it. |
constraint | string | No | A major version, such as 2, or a major and minor version, such as 2.1. The constraint 2 allows only 2.x.y versions. The constraint 2.1 allows only 2.1.y versions. An exact version ignores it. |
Response
A download answers with the status 303 and no body.
| Header | Description |
|---|---|
Location | The signed download link. See Download link. |
Cache-Control | The value is no-store. Do not cache the redirect. |
A refused license answers with the status 403 and a JSON body.
| Field | Type | Description |
|---|---|---|
valid | boolean | The value is always false. |
reason | string | The reason of the refusal. See License checks. |
Errors
| Status | Reason | Description |
|---|---|---|
| 400 | The submitted details are not valid. | A query parameter is not valid. The errors field names the parameter. |
| 401 | A license key is required. | The product is licensed, and the request has no Seatify-License-Key header, or the header is empty. |
| 401 | The license key is not valid. | No license in your account has this key. This applies to an open product too. |
| 403 | product_mismatch, suspended, expired or release_not_covered | The license is refused. See License checks. |
| 403 | download_limit_reached | Your account used the download allowance of the Free plan for this month. See Download allowance. |
| 404 | The product was not found. | No product has this ID. |
| 404 | The artifact was not found. | No published release in the channel and the constraint has a matching file. With version, the release is not published or has no matching file. |
| 404 | Several artifacts match the request. Name a filetype, or the filename itself. | Several files of the chosen release match. See File selection. |
| 429 | There are too many requests. Try again later. | See Rate limits. |
See Errors.
Example
Download the newest macOS file.
curl --fail --location --remote-name --remote-header-name \
-H "Seatify-License-Key: $LICENSE_KEY" \
"https://dist.seatify.dev/v1/products/$PRODUCT_ID/download?platform=darwin&arch=universal&filetype=zip"The first answer is the redirect:
HTTP/1.1 303 See Other
Cache-Control: no-store
Location: <signed download link>A link that matches several files answers with the status 404:
{
"message": "Several artifacts match the request. Name a filetype, or the filename itself."
}