Skip to content

Admin UI

The API tab on the Loopress admin page lists every custom REST API route currently deployed on the site, whichever file was last pushed with lps api push.

The API tab in the Loopress admin page, listing uploaded route files and the endpoint each one publishes

For each uploaded route file:

Column Description
File The filename on disk, {slug}.php
Route The live endpoint path under the loopress-api/v1 namespace

The tab is read-only: it reflects what’s deployed, it doesn’t let you create, edit, or remove routes from the admin. Manage route files locally with the CLI and deploy with lps api push, see CLI for the command reference and Writing Route Files for the file format.

The Settings tab holds the namespace your routes register under, loopress-api/v1 by default. It accepts lowercase letters, digits, and hyphens followed by a version segment (e.g. acme/v1); loopress/v1 is rejected because it’s reserved for Loopress’s own management endpoints. Changing it changes every route’s URL immediately, with no redirect from the old one, see the namespace rules.

The field reads and writes loopress/v1/api-namespace:

GET /wp-json/loopress/v1/api-namespace
{ "namespace": "loopress-api/v1" }
PUT /wp-json/loopress/v1/api-namespace
{ "namespace": "acme/v1" }
## REST API
The tab reads from `GET /wp-json/loopress/v1/api-files`, the same management endpoint `lps api pull/push/list` use:
```json
[
{
"filename": "hello-world",
"content": "<?php\n\ndeclare(strict_types=1);\n\nclass HelloWorld\n{\n public function get(): array\n {\n return ['message' => 'Hello, world!'];\n }\n}\n"
}
]

This is distinct from the routes a deployed file itself exposes, which are registered under loopress-api/v1 instead, to avoid a namespace collision with this management endpoint.