Asset update error, not found for exist asset

Topic summary

A developer is encountering a “Not Found” error when attempting to update an existing CSS asset via Shopify’s Admin API.

The Issue:

  • A GET request successfully retrieves the asset (assets/test.css) with all metadata including public URL and timestamps
  • However, a subsequent PUT request to update the same asset returns a “Not Found” error
  • The asset clearly exists, as confirmed by the successful GET response

Request Details:

  • Using Shopify Admin API version 2024-01
  • Theme ID: 160877478194
  • Asset key: assets/test.css
  • Authentication appears valid (GET request works)

Current Status:
The issue remains unresolved. The developer is seeking explanation for why the update fails despite the asset being retrievable and the request structure appearing correct.

Summarized with AI on November 4. AI used: claude-sonnet-4-5-20250929.
Hello i send this request : 

curl --location --globoff 'https://itbcode.myshopify.com/admin/api/2024-01/themes/160877478194/assets.json?asset[key]=assets%2Ftest.css' \
--header 'X-Shopify-Access-Token: $token' \

get

{
    "asset": {
        "key": "assets/test.css",
        "public_url": "https://cdn.shopify.com/s/files/1/0746/5936/5170/t/2/assets/test.css?v=1729792972",
        "value": "",
        "created_at": "2024-10-24T14:02:52-04:00",
        "updated_at": "2024-10-24T14:02:52-04:00",
        "content_type": "text/css",
        "size": 0,
        "checksum": "d41d8cd98f00b204e9800998ecf8427e",
        "theme_id": 160877478194,
        "warnings": []
    }
}

so why this request 

curl --location --request PUT 'https://itbcode.myshopify.com/admin/api/2024-07/themes/160877478194/assets.json' \
--header 'X-Shopify-Access-Token: $token' \
--header 'Content-Type: application/json' \
--data '{
    "asset": {
        "key": "assets/test.css",
        "value": "body { background-color: #000; }"
    }
}'

i get

{
    "errors": "Not Found"
}