Language Reference

API endpoints

Declare HTTP routes in plain English and run them as a service.

Endpoint basics

  • Use create an api endpoint.
  • Choose get, post, and more.
  • Return plain text or JSON.

Declare endpoints

Use natural language to declare Flask-powered routes.

api.pln
create an api endpoint at /hello that get and returns "Hello from Plain Language"
create an api endpoint at /api/users that post and returns jsonify({"status": "created"})
create an async api endpoint at /api/users/async that get and returns await fetch_all_users()

Run the server

Start your API by running the file with the CLI. The runtime starts a server on port 5000.

terminal
plain run api.pln

Endpoint tips

  • Use jsonify for consistent JSON responses.
  • Keep route functions small and focused.
  • Use async endpoints for IO heavy workloads.