Plugin route Unauthenticated


i am testing the api example from the docs without success.
I added this to the config/config.php

  'api' => [
      'allowInsecure' => true

this is my module index.php file.


Kirby::plugin('test/api', [
  'api' => [
    'routes' => [
        'pattern' => 'my-endpoint',
        'action'  => function () {
          return [
            'hello' => 'world'



From where are you calling your endpoint? How are you authenticating? If you are using Basic Authentication, you have to allow that in your config as well.

Good morning texnixe,

from the browser and postman. I do not have any authentification.
I just want to make an endpoint for simple ajax calls with no auth required.
Am i wrong?

The API needs authentication, so to call your endpoint in Postman, you have to first allow Basic Authentication in your config:

   'api' => [
        'allowInsecure' => true,
        'basicAuth' => true

And secondly add your authentication credential (I use the Rested app, not Postman, but I guess you can add your credentials somewhere in Postman as well).

If you only want an endpoint with no authentication, use a normal route outside the API.

my backend auth credentials?

$response = Remote::get('', [
  'headers' => [
    'Authorization: Basic ' . base64_encode($email . ':' . $password)

$page = json_decode($response->content())->data;

Yes, that Basic Authentication example is PHP. To use authentication in JS, you would go down the session based authentication example.

As I said, if you want a simple Ajax endpoint without authentication at all, use a standard route.

thanks alot!