Rest API, Fetch page with blocks that contain media uploads

default discord avatar
8 months ago

Hi I'm new to Payload and I've ran into a problem.

When I do a request from nextjs to payload the media field inside a block is always an ID but I want this to be a media object.

Payload setup:

Pages -> blocks -> a block that contains a media field

Nextjs request:


I've tried settings the depth to a redicilous number e.g. 100 but that also returns a id.

Is this behaviour expected or am I doing something wrong?

I'm a idiot 😄, forgot to add the access permission on the media collection

    Open the post
    Continue the discussion in Discord
    Like what we're doing?
    Star us on GitHub!


    Connect with the Payload Community on Discord



    Can't find what you're looking for?

    Get help straight from the Payload team with an Enterprise License.