Media2URL Developer Platform REST API
    • Media2URL Developer Platform - Overview & API Documentation
    • Retrieve Account & API Usage
      GET
    • Request Direct R2 Upload URL
      POST
    • Finalize Upload & Promote Asset
      POST
    • Check for Duplicate Asset
      POST
    • List Assets
      GET
    • Get Asset Details
      GET
    • Delete Asset
      DELETE
    • Presign Replacement Upload
      POST
    • Finalize Asset Replacement
      POST
    • List Asset Version History
      GET
    • List Folders
      GET
    • Create Folder
      POST
    • Import Remote URL
      POST
    • Get Job Status
      GET
    • Schemas
      • CredentialSurface
      • ProblemDetails
      • UsageResponse
      • AutomationAccountCapabilities
      • PresignUploadRequest
      • PresignUploadResponse
      • FinalizeUploadRequest
      • ReplacePresignRequest
      • AssetResource
      • CheckDuplicateRequest
      • CheckDuplicateResponse
      • PaginatedAssetList
      • VersionHistoryResponse
      • FolderResource
      • FolderListResponse
      • CreateFolderRequest
      • ImportRequest
      • ImportResponse
      • JobResource

      Finalize Asset Replacement

      POST
      /assets/{assetId}/replace/finalize
      Validates uploaded replacement bytes, records a new version, deactivates older versions, and preserves the public URL.

      Request

      Authorization
      Bearer Token
      Provide your bearer token in the
      Authorization
      header when making requests to protected resources.
      Example:
      Authorization: Bearer ********************
      or
      Path Params

      Body Params application/jsonRequired

      Examples

      Responses

      🟢200
      application/json
      Asset replaced successfully
      Bodyapplication/json

      🟠404NotFound
      Request Request Example
      Shell
      JavaScript
      Java
      Swift
      curl --location '/assets//replace/finalize' \
      --header 'Authorization: Bearer <token>' \
      --header 'Content-Type: application/json' \
      --data '{
          "upload_id": "upl_9f3b1458-45a2-4a0b-8d59-2c7bb2de3f1a"
      }'
      Response Response Example
      200 - Example 1
      {
          "id": "asset_01HXYZ...",
          "status": "active",
          "filename": "hero.png",
          "content_type": "image/png",
          "size": 245817,
          "checksum_sha256": "string",
          "privacy": "public",
          "direct_url": "https://files.media2url.com/media/hero.png",
          "share_url": "https://media2url.com/m/hero",
          "temporary": true,
          "expires_at": "2019-08-24T14:15:22.123Z",
          "trial_remaining": 0,
          "embeds": {
              "markdown": "string",
              "html": "string",
              "css": "string"
          },
          "created_at": "2019-08-24T14:15:22.123Z"
      }
      Modified at 2026-10-11 18:32:15
      Previous
      Presign Replacement Upload
      Next
      List Asset Version History
      Built with