Replace Asset Content from URI
POST/api/v1/assets/:asset_id/content/original/replace/external
Replace an asset's original file with one FileSpin downloads from an HTTPS URL, keeping the Asset ID. It behaves like Replace Asset Content — the same permissions, formats and content versioning — with the file fetched for you.
This endpoint is served on https://upload.filespin.io — not the standard https://app.filespin.io host used by the rest of the API. Make sure your client targets the upload host for this request.
The URL follows the rules of Ingest from URI: a public download link, no private or internal addresses, and a sign-in or HTML page in place of the file is refused with the same error codes. name is optional and read from the link when omitted.
The file is downloaded while the request waits, so this suits documents and images; replace a very large file with the multipart replace.
Example request JSON payload
{
"key": "https://example.com/files/brochure-v2.pdf"
}
The response is the same as Replace Asset Content's.
Send expected_version (the versions.live you read from Get Data) to refuse the replace with 409 (stale_version) if the asset's file was replaced since. Without it the replace behaves as before. See Replace Asset Content.
Request
Responses
- 200
- 202
- 400
- 401
- 403
- 409
- 500
Replaced
Replaced; processing the new file
The source was refused (see code), or the request is invalid
Unauthorized - Invalid or missing authentication
Forbidden - No edit access to the asset, or source_not_allowed
Nothing was replaced. Either a version of this asset is already waiting for release ("code": "version_pending", with its version), or expected_version does not match the asset's live content version because the file was replaced since you read it ("code": "stale_version", with current_version; re-read the asset and retry).
Internal server error