Replace Asset Content
POST/api/v1/assets/:asset_id/content/original/replace
API to replace the original content file of an asset while keeping the Asset ID unchanged.
Different host for uploads
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.
Note: For replacing files from within web pages, use the File Picker in Replace mode. To add or update custom metadata for the asset during replace, see Adding metadata to the asset.
HTTP RESPONSE
| Key | Value | Description |
|---|---|---|
files | JSON | List of files |
id | string | Asset ID, 32 character alphanumeric UUID |
name | string | File name |
size | integer | Size of file in bytes |
checksum | string | MD5 checksum |
content_type | string | MIME type |
provider | string | always "local" to indicate local upload |
success | boolean | true if upload completed, false otherwise |
metadata | JSON | Only returned for custom plans. Applies to image uploads. Where available, Exiftool tag values for 'ColorMode', 'ColorSpace', 'Orientation', 'Make' and 'Model' are returned. 'Width' and 'Height' are always returned |
Response JSON
{
"files": [
{
"id": "99d819953914402babbdeb68337ea6a3",
"name": "sample.jpg",
"size": 8836363,
"checksum": "5f5f26bd7c0f62c6e02e44c73d09734e",
"content_type": "image/jpeg",
"metadata": {
"Make": "Apple",
"ColorSpace": "sRGB",
"Model": "iPhone 3G",
"Orientation": "Horizontal (normal)",
"width": 1200,
"height": 800
}
}
],
"success": true,
"provider": "local"
}
Request
Responses
- 200
- 401
- 404
- 500
Asset content replaced successfully
Unauthorized
Asset not found
Internal server error