Skip to main content
PATCH
/
v1
/
media
/
{id}
Update media asset
curl --request PATCH \
  --url https://api.marblecms.com/v1/media/{id} \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Updated hero image",
  "alt": "Dashboard with a post editor open"
}
'
{
  "media": {
    "id": "cryitfjp1234jl04vdnycek8",
    "name": "Hero image",
    "url": "https://cdn.marblecms.com/media/hero.jpg",
    "alt": "A dashboard screenshot",
    "size": 382019,
    "mimeType": "image/jpeg",
    "width": 1600,
    "height": 900,
    "duration": 12000,
    "blurHash": "LEHV6nWB2yk8pyo0adR*.7kCMdnj",
    "type": "image",
    "createdAt": "2024-01-15T10:00:00Z",
    "updatedAt": "2024-01-16T12:00:00Z"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.marblecms.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Your Marble API key

Path Parameters

id
string
required

Media asset ID

Example:

"cryitfjp1234jl04vdnycek8"

Body

application/json
name
string
Minimum string length: 1
Example:

"Updated hero image"

alt
string | null
Example:

"Dashboard with a post editor open"

Response

Media asset updated successfully

media
object
required