PHPackages                             futureactivities/craft3-rest-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. futureactivities/craft3-rest-api

ActiveCraft-plugin[API Development](/categories/api)

futureactivities/craft3-rest-api
================================

Provides an easy to use REST API for Craft 4

2.0.5(2y ago)16261PHP

Since Apr 12Pushed 2y ago2 watchersCompare

[ Source](https://github.com/FutureActivities/Craft3-REST-API)[ Packagist](https://packagist.org/packages/futureactivities/craft3-rest-api)[ RSS](/packages/futureactivities-craft3-rest-api/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (1)Versions (21)Used By (0)

Craft REST API
==============

[](#craft-rest-api)

The REST API plugin by FutureActivities provides easy to use API endpoints for any Craft 3 or 4 installation. No configuration required, just enable the plugin and the endpoints are immediately available.

You can optionally exclude certain fields and sections from the API to avoid exposing data.

Use v1 for Craft 3, v2+ for Craft 4.

Features
--------

[](#features)

- Get all Entries, Categories, Globals, Tags, and Assets.
- Authenticate and manage users.
- Build on top of Yii 2 RESTful Web Services - supports expands, fields, pagination.
- Exclude specific fields or sections from being included in the response.

Installation
------------

[](#installation)

Install via composer:

```
composer require futureactivities/craft3-rest-api

```

Usage
-----

[](#usage)

Further documentation of available endpoints can be found at:

Examples
--------

[](#examples)

Get all categories:

```
GET /rest/v1/categories

```

Get all categories with the related field expanded - this will return data objects instead of IDs.

```
GET /rest/v1/categories?expand=related

```

Get a specific category

```
GET /rest/v1/categories/18

```

Get all entries belonging to the news channel &amp; limit results to slug and title only:

```
GET /rest/v1/entries?filter[section]=news&fields=slug,title

```

Get all entries in the news channel, expand featured image and apply a specific image transform:

```
GET /rest/v1/entries?filter[section]=news&expand=featuredImage&transforms[featuredImage]=featuredFull,featuredThumb

```

Settings
--------

[](#settings)

From the control panel the plugin can be configured with the following settings:

### General

[](#general)

`Include Disabled` - Should disabled entries, categories, etc. be included in the API results.

`Enable Assets` - Enable the asset endpoints

`Enable Tags` - Enable the tag endpoints

### Fields

[](#fields)

Configure which custom fields are available in the API results.

### Sections

[](#sections)

Configure which sections are available in the API results.

Events
------

[](#events)

### Field Event

[](#field-event)

This plugin only supports a limited number of field types in the API responses, for other field types and custom field types you can process the response yourself using the following event:

```
Event::on(\futureactivities\rest\services\Fields::class, \futureactivities\rest\services\Fields::EVENT_PROCESS_FIELD, function(Event $event) {
    $field = $event->field;

    if (is_a($field, 'namespace\plugin\CustomFieldType'))
        $event->data = [
            'key' => 'value'
        ];
    }
});

```

### Extra Fields Event

[](#extra-fields-event)

Sometimes you might want to include additional data in the response, the following event will allow you to add your own fields to the element.

```
Event::on(\futureactivities\rest\models\Element::class, \futureactivities\rest\models\Element::EVENT_EXTRA_FIELDS, function(Event $event) {
    $model = $event->model;

    if (is_a($model, 'craft\elements\Entry') && $model->section->handle == 'news') {
        $event->fields = [
            'myCustomField' => 'Hello'
        ];
    }
});

```

Authentication
--------------

[](#authentication)

If you are using the user authentication functionality of this plugin, then you may need to configure your server to ensure the authorisation headers are passed to Craft. For Apache this is done by adding the following to your conf file:

```
RewriteEngine On
RewriteCond %{HTTP:Authorization} .+
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

```

Cron
----

[](#cron)

### Expiring tokens

[](#expiring-tokens)

Out of the box, user authentication tokens will never expire. To expire tokens, setup a cron job running the following command:

```
./craft rest/token/expire

```

`` is optional. Default is 3600 seconds (1 hour).

Changelog
---------

[](#changelog)

### 1.2

[](#12)

- Fixed broken CMS settings layout
- Fixed bug in token verification
- Added `rest/v2/me` endpoint which returns a more useful User object that also works with field expands.

### 1.1

[](#11)

- Asset image transforms now expects `transforms` on the endpoint instead of `imageTransform`. This now allows a comma separated value of transform keys and will return an array of transforms along with the original image url.
- Added support to specify image transforms on entry &amp; category requests, in the following format:

    `transforms[field] = 'transformKey,anotherKey'``transforms[parent][child] = 'transformKey'`

Roadmap
-------

[](#roadmap)

The following features are planned for future versions:

- API Authentication - Limit the use of the API to authenticated users only.
- Limit the inclusion of fields/sections/etc. to certain user roles.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 90.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~93 days

Recently: every ~62 days

Total

20

Last Release

823d ago

Major Versions

1.2.4 → 2.0.02023-06-05

### Community

Maintainers

![](https://www.gravatar.com/avatar/c7a55d8f125fa768eb7683696289249e43c247d7f7a664300c96cda82697960f?d=identicon)[paul-blundell](/maintainers/paul-blundell)

![](https://www.gravatar.com/avatar/047191978f9f56ae6a15e0c8eb2e25bb925303a509ec8b339aa8156fb214e940?d=identicon)[nzimelimited](/maintainers/nzimelimited)

---

Top Contributors

[![nzimelimited](https://avatars.githubusercontent.com/u/10939047?v=4)](https://github.com/nzimelimited "nzimelimited (46 commits)")[![paul-blundell](https://avatars.githubusercontent.com/u/1451631?v=4)](https://github.com/paul-blundell "paul-blundell (5 commits)")

### Embed Badge

![Health badge](/badges/futureactivities-craft3-rest-api/health.svg)

```
[![Health](https://phpackages.com/badges/futureactivities-craft3-rest-api/health.svg)](https://phpackages.com/packages/futureactivities-craft3-rest-api)
```

###  Alternatives

[wrav/oembed

A simple plugin to extract media information from websites, like youtube videos, twitter statuses or blog articles.

36205.0k3](/packages/wrav-oembed)[craftcms/apple-news

Publish Craft CMS entries to Apple News

4223.5k](/packages/craftcms-apple-news)[craftpulse/craft-typesense

Craft Plugin that synchronises with Typesense

122.7k](/packages/craftpulse-craft-typesense)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
