Skip to content

Replace an asset's file

POST/assets/{id}/replace

Costs 2 rate-limit points · Rate limits

Replace the file body of an existing internal asset in place. The asset ID and all digital-product / order links are preserved, so you don't have to re-attach the new file: buyers downloading the asset receive the new body automatically.

Like creating an internal asset, the response includes a single presigned PUT URL. Upload the new file body to that URL to finish. The previous file is removed once the replacement is committed, and any watermarking is re-applied to the new body.

Only internal assets can be replaced. Plan storage quota is enforced on the growth in size; the per-file ceiling is 2 GB.

Path parameters

  • idstringRequired

    The asset ID

Headers

  • X-Auth-TokenstringRequired

    API key for authentication

Request body

  • assetobjectRequired
    Show 3 child attributesHide child attributes
    • filenamestringRequired

      Suggested attachment name on download for the new file.

    • byte_sizeintegerRequired

      Size of the new file in bytes. Must be positive and at most 2 GB.

    • content_typestring

      Optional MIME type for the new file. Defaults to the asset's current content type, or application/octet-stream.

Returns

  • assetobject
    Show 11 child attributesHide child attributes
    • idstring

      Unique asset identifier

    • typestring

      The asset type. internal for uploaded files, external for URL-based assets, licence for licence key assets.

      One of internalexternallicence
    • namestring, nullable

      Display name of the asset.

    • filenamestring, nullable

      Filename of the asset (derived from the file or URL).

    • external_urlstring, nullable

      The external URL for external type assets. null for other types.

    • content_typestring, nullable

      MIME type of the asset.

    • byte_sizeinteger

      File size in bytes. 0 for external and licence assets.

    • watermark_assetboolean

      Whether watermarking is enabled for this asset (PDFs only).

    • autogenerate_licence_keyboolean

      Whether a licence key is auto-generated when this asset is purchased.

    • created_atstring

      When the asset was created.

    • updated_atstring

      When the asset was last updated.

  • uploadobject

    Single-PUT upload handle for the new file body.

    Show 4 child attributesHide child attributes
    • methodstring
      Example: PUT
      One of PUT
    • urlstring
      Example: https://example.com
    • headersobject
    • expires_atstring
      Example: 2026-01-15T09:30:00Z

Errors

404

Resource not found

422

Validation failed

POST/assets/{id}/replace
curl -X POST "https://app.filemonk.io/api/v1/external/assets/{id}/replace" \
  -H "X-Auth-Token: $FILEMONK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "asset": {
      "filename": "string",
      "byte_size": 1,
      "content_type": "string"
    }
  }'
Response
{
  "asset": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "type": "external",
    "name": "Photoshop Brushes Pack",
    "filename": "brushes-pack-v2.zip",
    "external_url": "https://cdn.example.com/files/brushes-pack-v2.zip",
    "content_type": "application/zip",
    "byte_size": 0,
    "watermark_asset": false,
    "autogenerate_licence_key": false,
    "created_at": "2026-01-15T09:30:00Z",
    "updated_at": "2026-01-15T09:30:00Z"
  },
  "upload": {
    "method": "PUT",
    "url": "https://example.com",
    "headers": {},
    "expires_at": "2026-01-15T09:30:00Z"
  }
}