How to access content via api

Hi, in the example project provided I was wanted to access the notes content via the api but I can’t seem to find a way of doing that. Is it possible to access content via the api?

I was thinking it would be nice to use Kirby as an CMS but have a iOS app accessing the content via the api.


Have you checked the docs?

Hi, thank you for the quick reply. I have had a look at the docs. I couldn’t see what I was trying to achieve in there. Could it be I have to use a custom collection or model which is currently saying: Docs are coming soon…?

Looking at the part which says:
$this->file($pageId, $filename);
$this->user($userId = null);

I was expecting one which said something like $this->content but could be way off.


All endpoints are available in the reference:

1 Like

I am having a similar question.
I am using the stock Starter Kit and trying to access the ‘About’ page content using the API.

I followed the API documentation and use the following URL, I always receive Error 404:

Am I doing something wrong? Thanks!

1 Like

Still can’t get to the bottom of it: In the Starter-Kit I can view this page in the browser:


but I can’t get to it via the api:

Doing a get on this:

just returns:
“status”: “error”,
“exception”: “Exception”,
“message”: “No route found for path: “notes” and request method: “GET””,
“file”: “by/src/Http/Router.php”,
“line”: 120,
“code”: 404


Anyone has solved out this issue? Experiencing the exact same issue here. A bit frustrated here, as I always receive the code 404 via API and I don’t think the docs are particularly helpful for this matter. :frowning:

i remember this being discussed on slack once. it might depens how your localhost setup is created and how authentification is done. have you tried uploading it to an apache/nginx server online?
can you tell us more about your localhost? mamp, xamp, php-router,… ?

as you can see from the docs the 404 error is the generic error. have you tried enabling debug mode?

We didn’t manage to figure this out in the time we had been given to find a solution for a few upcoming projects in the office, so sadly we had to bounce on to Cockpit cms for those. Will follow this thread and hopefully get to use Kirby in the future for something.

hi, this is a proof of concept.
Is this what you are looking for? remember that you have to auteticarte to be able to connect to the API

  <main class="main" role="main">

<div class="app" id="app"> dfd</div>

     const csrf = "<?= csrf() ?>";

     fetch("<?php echo $kirby->url() ?>/api/roles", {
         method: "GET",
         headers: {
           "X-CSRF" : csrf
       .then(response => response.json())
       .then(response => {
         const page =;


       .catch(error => {
         // something went wrong