Skip to content

REST API: enable fields query param for api/collections/:collection/entries/:entry endpoint #1078

Closed
statamic/cms
#15319

Description

@BrandonOldenhof

The fields query param works for REST API index routes, but not for single entry routes:

  • Works: api/collections/:collection/entries?fields=title,slug
  • Doesn't work: api/collections/:collection/entries/:entry?fields=title,slug

The Statamic docs seem to hint at it working because it doesn't mention a specific type of endpoint https://statamic.dev/rest-api#selecting-fields:

Selecting Fields

You may specify which top level fields should be included in the response.
/endpoint?fields=id,title,content

It would be great if this could be implemented; my page entries tend to have a lot of fields, making the JSON payloads a lot larger than they need to be. The larger datasets take longer for decoupled frontends to download, making them a bit slower.

Discord thread: https://discord.com/channels/489818810157891584/1175070103499448372

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions