Enabling for resources
If you haven’t already done so, you’ll need to enable Statamic’s REST API. You can do this by adding the following line to your.env
file:
config/statamic/api.php
:
runway
key to your resources
array in config/statamic/api.php
, and provide the handles of the resources for which you wish to enable the API:
Endpoints
Each resource will have two endpoints:/api/runway/{resourceHandle}
for retrieving models associated with a resource./api/runway/{resourceHandle}/{id}
for retrieving a specific model.
Filtering
To enable filtering for your resources, you’ll need to opt in by defining a list ofallowed_filters
for each resource in your config/statamic/api.php
configuration file: