Skip to main content
PATCH
Spree Admin SDK

Authorizations

x-spree-api-key
string
header
required

Secret API key for admin access

Authorization
string
header
required

JWT token for admin user authentication

Headers

x-spree-api-key
string
required
Authorization
string
required

Bearer token for admin authentication

Path Parameters

id
string
required

Media ID

Body

application/json
external_references
object

Identities the record has in external systems, keyed by system: the same { system: external_id } map the Admin API renders, so what you read can be sent straight back. Systems you do not name keep the reference they have. A list of { system, external_id } entries is accepted too.

alt
string | null
Example:

"Front view"

position
integer
Example:

1

media_type
enum<string>

Defaults to image. video needs a signed_id; external_video needs an external_video_url.

Available options:
image,
video,
external_video
Example:

"image"

external_video_url
string | null

YouTube or Vimeo link. Required when media_type is external_video.

poster_signed_id
string

A signed_id from files.upload() for a video's poster frame.

focal_point_x
number | null

Where the image is anchored when cropped, from 0 to 1.

focal_point_y
number | null

Where the image is anchored when cropped, from 0 to 1.

attachment
string

The file itself, sent as multipart form data. JSON clients upload first and send signed_id.

variant_ids
string[]

Variants to link this product-level media to. Variants of other products are dropped.

Response

200 - application/json

file updated

id
string
required
product_id
string | null
required
variant_ids
string[]
required
position
number
required
alt
string | null
required
media_type
enum<string>
required
Available options:
image,
video,
external_video
external_video_url
string | null
required
focal_point_x
number | null
required
focal_point_y
number | null
required
video_provider
string | null
required
video_embed_url
string | null
required
video_url
string | null
required
poster_url
string | null
required
original_url
string | null
required
mini_url
string | null
required
small_url
string | null
required
medium_url
string | null
required
large_url
string | null
required
xlarge_url
string | null
required
og_image_url
string | null
required
external_references
object
required
created_at
string
required
updated_at
string
required
attached
boolean
required
filename
string | null
required
content_type
string | null
required
byte_size
number | null
required
embed_url
string | null
required
signed_id
string | null
required
viewable_id
string | null
required
download_url
string | null
required
metadata
object
required
viewable_type
string | null
required