PHPackages                             tv2regionerne/statamic-private-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. tv2regionerne/statamic-private-api

ActiveLibrary[API Development](/categories/api)

tv2regionerne/statamic-private-api
==================================

v1.17.0(11mo ago)64.2k↓36.4%5[2 PRs](https://github.com/tv2regionerne/statamic-private-api/pulls)PHPPHP ^8.2CI passing

Since Nov 13Pushed 11mo ago4 watchersCompare

[ Source](https://github.com/tv2regionerne/statamic-private-api)[ Packagist](https://packagist.org/packages/tv2regionerne/statamic-private-api)[ RSS](/packages/tv2regionerne-statamic-private-api/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (36)Used By (0)

Statamic Private Api
====================

[](#statamic-private-api)

[![Packagist](https://camo.githubusercontent.com/a671386fd267593ab1bcb557e11d01aab45c3179552f530172d355ca79999bc0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f747632726567696f6e65726e652f73746174616d69632d70617373706f72742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tv2regionerne/statamic-passport)[![Downloads](https://camo.githubusercontent.com/acc7b8118062b9574a758a5e319cde59aead110ed0fa5a7daaf186ccd5f0957f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f747632726567696f6e65726e652f73746174616d69632d70617373706f72742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tv2regionerne/statamic-passport)[![License](https://camo.githubusercontent.com/f4ec77c12ebb6be8039e4bc731855acb2e998a744fce591eb0389dbac65d8ef7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f747632726567696f6e65726e652f73746174616d69632d70617373706f72742e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Supported Statamic version](https://camo.githubusercontent.com/290c205d494bd45c1477cc41f6ba9e772e4b830e153c935a7ad1b3ff78abed14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53746174616d69632d342e302532422d464632363945)](https://github.com/statamic/cms/releases)

> Statamic Private Api is a Statamic addon that enables a private REST API.
> The routes should be protected by Laravel Passport, Sanctum or similar.

Features
--------

[](#features)

Add's private API seperated from the Public API build into statamic.
Uses Laravel's build in auth guards, so you may use Laravel Passport, Laravel Sanctum or something else.
Permissions will foloww the permissions assigned to the user inside of Statamic.

See  for Laravel Passport integration into Statamic.

Limitations
-----------

[](#limitations)

The Private API uses the Statamic CP controllers.
Collection Entry revisions is not implemented.

How to Install
--------------

[](#how-to-install)

Run the following command from your project root:

```
composer require tv2regionerne/statamic-private-api
```

Make sure you have an 'api' guard in your config/auth.php configured.
Below example is using Laravel Passport for api authentication.

```
    'guards' => [
        'web' => [
            'driver' => 'session',
            'provider' => 'users',
        ],
        'api' => [
            'driver' => 'passport',
            'provider' => 'users',
        ],
    ],
```

Publish the config file:

```
php artisan vendor:publish --tag=private-api-config

```

Then, in /config/private-api.php enable the routes you would like to use, for example:

```
    'resources' => [
        'collections' => true,
        'navs' => false,
        'taxonomies' => false,
        'assets' => false,
        'globals' => false,
        'forms' => false,
        'users' => true,
    ],

```

How to Use
----------

[](#how-to-use)

Update the config or env to enable private API's.

Configure your .env with the following values to enable the private API with a prefix on "api/private".

```
PRIVATE_API_ENABLED=true
PRIVATE_API_ROUTE="api/private"
```

Addon endpoints in private API
------------------------------

[](#addon-endpoints-in-private-api)

Other addons can register their private API endpoints in the private API.
Consider below example which checks if the Private API addon is installed and then adds the addon's private API endpoints.
The routes will be protected by the same auth guard as the other Private API endpoints.
Authorisation and policies should be handled inside of the addon's controllers.

```
use Illuminate\Support\Facades\Route;
use Tv2regionerne\StatamicPrivateApi\Facades\PrivateApi;
if (class_exists(PrivateApi::class)) {
    PrivateApi::addRoute(function () {
        Route::prefix('/statamic-events/handlers')
            ->group(function () {
                Route::get('/', [Controller::class, 'index']);
                Route::get('{id}', [Controller::class, 'show']);
                Route::post('/', [Controller::class, 'store']);
                Route::patch('{id}', [Controller::class, 'update']);
                Route::delete('{id}', [Controller::class, 'destroy']);
            });
    });
}
```

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance51

Moderate activity, may be stable

Popularity30

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 61.9% 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 ~31 days

Recently: every ~93 days

Total

19

Last Release

346d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b9761a79e61f2d5b9d650510dfb3555da18daf38f027aa84012c937e397e39a7?d=identicon)[cboxdk](/maintainers/cboxdk)

---

Top Contributors

[![ryanmitchell](https://avatars.githubusercontent.com/u/51899?v=4)](https://github.com/ryanmitchell "ryanmitchell (39 commits)")[![sylvesterdamgaard](https://avatars.githubusercontent.com/u/2431914?v=4)](https://github.com/sylvesterdamgaard "sylvesterdamgaard (22 commits)")[![steveparks](https://avatars.githubusercontent.com/u/95851?v=4)](https://github.com/steveparks "steveparks (1 commits)")[![tv2reg](https://avatars.githubusercontent.com/u/127084336?v=4)](https://github.com/tv2reg "tv2reg (1 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/tv2regionerne-statamic-private-api/health.svg)

```
[![Health](https://phpackages.com/badges/tv2regionerne-statamic-private-api/health.svg)](https://phpackages.com/packages/tv2regionerne-statamic-private-api)
```

###  Alternatives

[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135192.6k5](/packages/statamic-rad-pack-runway)[ritson/placid-statamic

Consume RESTful APIs in your Statamic templates

551.2k](/packages/ritson-placid-statamic)[statamic-rad-pack/shopify

A Shopify Addon for Statamic

113.1k1](/packages/statamic-rad-pack-shopify)[cboxdk/statamic-mcp

MCP (Model Context Protocol) server for Statamic CMS v6 — gives AI assistants structured access to content, blueprints, assets, and more.

225.6k](/packages/cboxdk-statamic-mcp)

PHPackages © 2026

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