# Backend Controller

**URL:** <https://forum.shopware.com/t/backend-controller/62084>\
**Category:** Programming (EN)\
**Created:** [1. Oktober 2019 um 07:45 UTC](https://forum.shopware.com/t/backend-controller/62084 "2019-10-01T07:45:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ivanb](https://avatars.discourse-cdn.com/v4/letter/i/958977/32.png) [@ivanb](https://forum.shopware.com/u/ivanb)\
**Post date:** [1. Oktober 2019 um 07:45 UTC](https://forum.shopware.com/t/backend-controller/62084/1 "2019-10-01T07:45:37Z")

</div>

How can I create&nbsp;a controller which is accessible only if admin is logged in? Or how can I determine if shop admin is logged in?

---

<div class="post-metadata">

**Author:** ![Michael\_Telgmann](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/michael_telgmann/32/20289_2.png) [@Michael\_Telgmann](https://forum.shopware.com/u/Michael_Telgmann)\
**Post date:** [1. Oktober 2019 um 09:01 UTC](https://forum.shopware.com/t/backend-controller/62084/2 "2019-10-01T09:01:08Z")

</div>

Hi Ivan,

because of the API first approch in Shopware 6, there is no controller which is only usable in the administration. The administration is a client for the [admin API](https://docs.shopware.com/en/shopware-platform-dev-en/api/admin-api?category=shopware-platform-dev-en/api), so you could create a new controller and set its scope to this API. Have a look at this controller for example&nbsp;[https://github.com/shopware/platform/blob/master/src/Core/Framework/Api/Controller/ApiController.php](https://github.com/shopware/platform/blob/master/src/Core/Framework/Api/Controller/ApiController.php)  
Every route starting with „/api/v1/“ will be checked for authorization automatically. So you do not check this by yourself. If someone calls this route, whether it’s from the admin or from somewhere else, he must be authorized. It should not matter to you, if this is the shop admin or any other user, who has the rights to call your route.

Best regards from Schöppingen

![cool](http://forum.shopware.com/plugins/CKEditor/plugins/smiley/images/shopware.png "cool")&nbsp;Michael Telgmann

---

<div class="post-metadata">

**Author:** ![ivanb](https://avatars.discourse-cdn.com/v4/letter/i/958977/32.png) [@ivanb](https://forum.shopware.com/u/ivanb)\
**Post date:** [1. Oktober 2019 um 11:03 UTC](https://forum.shopware.com/t/backend-controller/62084/3 "2019-10-01T11:03:34Z")

</div>

Hi Michael,

Thank you for your answer.

---

<div class="post-metadata">

**Author:** ![rs2487](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/rs2487/32/13703_2.png) [@rs2487](https://forum.shopware.com/u/rs2487)\
**Post date:** [23. Juni 2021 um 06:53 UTC](https://forum.shopware.com/t/backend-controller/62084/4 "2021-06-23T06:53:47Z")

</div>

Hi @Michael_Telgmann , can you please add the new Link for the admin API? The given one brings me to the Homepage of the Developer Documentation.

---

<div class="post-metadata">

**Author:** ![SmartStylez](https://avatars.discourse-cdn.com/v4/letter/s/a88e4f/32.png) [@SmartStylez](https://forum.shopware.com/u/SmartStylez)\
**Post date:** [23. Juni 2021 um 06:59 UTC](https://forum.shopware.com/t/backend-controller/62084/5 "2021-06-23T06:59:41Z")

</div>

You need this one? [Admin API Guide - Shopware Developer](https://developer.shopware.com/docs/guides/integrations-api/admin-api)
