Views API Routes
A view configuration is a saved data-table view for an entity, such as products or orders. It lets admin users customize how a table shows its data, then save that customization as a reusable view. These API routes allow admin users to manage the system default and personal views.
GET /admin/views/entities#
List Views
Retrieve a list of views. The views can be filtered by fields such as id. The views can also be sorted or paginated.
view_configurations feature flag is enabled. Set the MEDUSA_FF_VIEW_CONFIGURATIONS environment variable to true to enable it.Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Request examples
Responses
200 OK
entitiesobject[]The list of entities.
entitiesobject[]400, 401, 404, 409, 422, 500: an error response is returned.
GET /admin/views/{entity}/columns#
List Columns in View
Retrieve a list of columns in a view for an entity. The columns are retrieved for the authenticated admin user.
view_configurations feature flag is enabled. Set the MEDUSA_FF_VIEW_CONFIGURATIONS environment variable to true to enable it.Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
entitystringorders)Request examples
Responses
200 OK
columnsobject[]The view's columns.
columnsobject[]400, 401, 404, 409, 422, 500: an error response is returned.
GET /admin/views/{entity}/configurations#
List View Configurations
Retrieve a list of view configurations of an entity. The configurations can be filtered by fields like id. The configurations can also be paginated. An admin user can only retrieve their own configurations.
view_configurations feature flag is enabled. Set the MEDUSA_FF_VIEW_CONFIGURATIONS environment variable to true to enable it.Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
entitystringorders)Query parameters
offsetnumberOptionallimitnumberOptionalorderstringOptional-.with_deletedbooleanOptionalidstring | string[]Optionalentitystring | string[]Optionalnamestring | string[]Optionaluser_idstring | string[]Optionalis_system_defaultbooleanOptionalcreated_atobjectOptionalupdated_atobjectOptionalfieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. Without prefix it will replace the entire default fields.$andobject[]Optional$orobject[]OptionalRequest examples
Responses
200 OK
limitnumberoffsetnumbercountnumberestimate_countnumberOptionalview_configurationsobject[]The list of view configurations.
view_configurationsobject[]400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/views/{entity}/configurations#
Create View Configuration
Create a new view configuration for an entity. If is_system_default is set to true, the created configuration will be set as the system default for the specified entity. Otherwise, it will be a custom configuration for the admin user.
view_configurations feature flag is enabled. Set the MEDUSA_FF_VIEW_CONFIGURATIONS environment variable to true to enable it.Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
entitystringorders).Request body (application/json)
is_system_defaultbooleanOptionalset_activebooleanOptionalconfigurationobjectOptionalThe view's configuration.
configurationobjectOptionalnamestringOptionalRequest examples
Responses
200 OK
view_configurationobjectThe details of a view configuration.
view_configurationobject400, 401, 404, 409, 422, 500: an error response is returned.
GET /admin/views/{entity}/configurations/active#
Get Active View Configuration
Get the active view configurations for an entity. If no active view is set, null is returned. An admin user can only retrieve their own active configuration.
view_configurations feature flag is enabled. Set the MEDUSA_FF_VIEW_CONFIGURATIONS environment variable to true to enable it.Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
entitystringorders).Query parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. Without prefix it will replace the entire default fields.Request examples
Responses
200 OK
view_configurationobjectThe details of a view configuration.
view_configurationobjectis_default_activebooleanOptionaldefault_type"code" | "system"Optionalsystem if the active view is the system default, code if no active view is set, or undefined if the active view isn't the system default.400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/views/{entity}/configurations/active#
Make View Configuration Active
Make a view configuration active. This will set the given view configuration as the active one for the specified entity for the admin user. An admin user can only set their own configurations as active. If the view configuration ID is null, the active view configuration will be cleared, and the code or system default view configuration type will be used as the active view.
view_configurations feature flag is enabled. Set the MEDUSA_FF_VIEW_CONFIGURATIONS environment variable to true to enable it.Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
entitystringorders).Request body (application/json)
view_configuration_idstringnull, the active view configuration will be cleared, and the code or system default view configuration will be used as the active view.Request examples
Responses
200 OK
successboolean400, 401, 404, 409, 422, 500: an error response is returned.
GET /admin/views/{entity}/configurations/{id}#
Get View Configuration
Retrieve a view configuration for an entity. An admin user can only retrieve their own configurations.
view_configurations feature flag is enabled. Set the MEDUSA_FF_VIEW_CONFIGURATIONS environment variable to true to enable it.Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
entitystringorders)idstringQuery parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. Without prefix it will replace the entire default fields.Request examples
Responses
200 OK
view_configurationobjectThe details of a view configuration.
view_configurationobject400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/views/{entity}/configurations/{id}#
Update View Configuration
Update the view configuration of an entity. An admin user can only update their own configurations.
view_configurations feature flag is enabled. Set the MEDUSA_FF_VIEW_CONFIGURATIONS environment variable to true to enable it.Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
entitystringorders).idstringRequest body (application/json)
set_activebooleanOptionalnamestringOptionalis_system_defaultbooleanOptionalconfigurationobjectOptionalThe view's configuration.
configurationobjectOptionalRequest examples
Responses
200 OK
view_configurationobjectThe details of a view configuration.
view_configurationobject400, 401, 404, 409, 422, 500: an error response is returned.
DELETE /admin/views/{entity}/configurations/{id}#
Remove View Configurations
Remove view configurations of an entity. An admin user can only delete their own configurations.
view_configurations feature flag is enabled. Set the MEDUSA_FF_VIEW_CONFIGURATIONS environment variable to true to enable it.Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
entitystringorders)idstringRequest examples
Responses
200 OK
idstringobjectstringview_configurationdeletedboolean400, 401, 404, 409, 422, 500: an error response is returned.