PHPackages                             mage4/magento2-rest-api-restriction - 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. mage4/magento2-rest-api-restriction

ActiveMagento2-module[API Development](/categories/api)

mage4/magento2-rest-api-restriction
===================================

Restrict/Disabled Rest API Endpoints.

1.2.0(3mo ago)10OSL-3.0PHPPHP &gt;=8.0

Since Mar 31Pushed 3mo agoCompare

[ Source](https://github.com/rehanmobin/magento2-rest-api-restriction)[ Packagist](https://packagist.org/packages/mage4/magento2-rest-api-restriction)[ RSS](/packages/mage4-magento2-rest-api-restriction/feed)WikiDiscussions main Synced 4w ago

READMEChangelog (4)Dependencies (2)Versions (4)Used By (0)

Rest API Restriction for Magento 2
==================================

[](#rest-api-restriction-for-magento-2)

Overview
--------

[](#overview)

**Mage4 Rest API Restriction** is a Magento 2 extension that allows store administrators to disable selected REST API endpoints without modifying core code or creating endpoint-specific plugins.

The module provides a generic admin configuration where blocked REST API endpoints can be listed one per line. When a request matches one of the configured endpoint patterns, the module throws a **403 Forbidden** API response with a clear error message.

This extension is useful for merchants and developers who want to harden API access, disable unused endpoints, or temporarily restrict selected REST routes.

---

Install via composer
--------------------

[](#install-via-composer)

```
composer require mage4/magento2-rest-api-restriction

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy

```

Features
--------

[](#features)

- Enable or disable the module from Magento admin
- Restrict specific Magento REST API endpoints
- Configure blocked endpoints from **Stores &gt; Configuration &gt; MAGE4 EXTENSIONS &gt; REST API RESTRICTION**
- Supports Magento-style route placeholders such as:
    - `:cartId`
    - `:sku`
    - `:attributeCode`
- Returns a proper JSON API error response
- Uses a generic validation approach instead of endpoint-specific plugins
- Helps improve API security by disabling unnecessary REST endpoints

---

Supported Endpoint Pattern Examples
-----------------------------------

[](#supported-endpoint-pattern-examples)

You can configure blocked endpoints like:

```
/V1/customers/me
/V1/guest-carts/:cartId
/V1/guest-carts/:cartId/totals
/V1/products/:sku
/V1/products/:sku/options
/V1/products/attributes/:attributeCode/is-filterable/:isFilterable

```

---

About us
--------

[](#about-us)

We’re an innovative development agency building awesome websites, webshops and web applications with Latest Technologies. Check out our website [mage4.com](http://mage4.com/) or email us at  | .

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance82

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

3

Last Release

91d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9c2152cb6fb9838a13cb6f533c468a971d14b45580165d84c338e895f8f97bc8?d=identicon)[rehanmobin](/maintainers/rehanmobin)

---

Top Contributors

[![rehanmobin](https://avatars.githubusercontent.com/u/7040684?v=4)](https://github.com/rehanmobin "rehanmobin (4 commits)")

---

Tags

magentoREST APImagento2magento 2magento 2 modulemagento 2 extensionapi-securitymagento extensionwebapimagento modulemage4magento webapirest endpoint restrictionapi restrictionapi access controldisable api endpointdisable rest apirestrict rest apirestrict api endpointsendpoint blockerendpoint restriction

### Embed Badge

![Health badge](/badges/mage4-magento2-rest-api-restriction/health.svg)

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

###  Alternatives

[smile/elasticsuite

Magento 2 merchandising and search engine built on ElasticSearch

8044.6M40](/packages/smile-elasticsuite)[mollie/magento2

Mollie Payment Module for Magento 2

1121.8M12](/packages/mollie-magento2)

PHPackages © 2026

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