Build paths

Build an API or a routine

Describe an API or a scheduled job, try it in the Overview, deploy it, and follow its requests and runs in Analytics.

On this page

Not every app needs screens. Ahamo can also build an API that other systems call, or a routine that runs by itself on a schedule, for example a job that fetches exchange rates every weekday morning and saves a summary to your Notion. Ahamo builds these in Python and deploys them to Ahamo's cloud.

Describe what it should do

Say in your first prompt that you want an API, a backend without screens, or something that runs by itself.

An API that returns our product catalogue as JSON, with an endpoint to look up one product by its id.

Every weekday at 07:00 UTC, fetch the day's exchange rates for EUR, USD and SEK and save a short summary to a new page in my Notion.

What the app is called follows from its parts:

  • an app with a website is an App;
  • an app without screens that answers requests is an API;
  • an app without screens that runs scheduled jobs is a Routine.

You can add parts later, for example by asking Ahamo to add a website to an API.

An API or a routine can keep data in its own database. While you build, it uses a separate copy of that data, so trying it changes nothing live. To work with a service such as Notion or Slack, link a connection; see Use a connection in your app.

Try it in the Overview

An API or a routine has no screens to preview, so the preview pane shows its Overview instead. An App that has both a website and an API switches between Preview and Overview in the toolbar.

The Overview shows one card per part, with the API and its number of endpoints and whether it is running while you build, its data, and each scheduled job with its schedule.

Under Try your API:

  1. Pick an endpoint. The form is filled in from what the API says it accepts, such as values in the address, options, headers, and a JSON body.
  2. Check the values and choose Send.
  3. Read the answer, with its status, how long it took, the body, and what it means in plain words, such as "It worked." or "Your API has nothing at this address."

If the API isn't running, choose Start your API; starting can take up to a minute. If the list of endpoints is empty, ask Ahamo in the chat to generate the API's OpenAPI contract. After you deploy, Copy as curl gives you a command that calls the live address.

Requests you send while building use the development data, never the live data.

Schedule jobs

A scheduled job runs on a schedule written in UTC, such as "Every weekday at 07:00 AM UTC". Ask for the times you need in UTC. If a schedule names another time zone, deploying stops and asks you to have it rewritten in UTC.

  • A job may run for up to 300 seconds. Ask Ahamo to split longer work into several jobs.
  • While you build, jobs don't run on their schedule. They start running once you deploy.
  • After you deploy, each job's card shows its next and last run, Run now, and Run history, with the last line each run printed. Runtime shows the same schedules and runs, and the workspace's Routines page lists every scheduled job across your apps.

Run now in the published app needs permission to deploy the app to production.

Deploy

An API or a routine has Deploy where an App with a website has Publish. Both work the same way; see Publish your app.

  1. Choose Deploy at the top of its pane.
  2. Review What deploying does, which shows which parts go live, and whether your live data is created for the first time or kept.
  3. Choose Deploy to production and wait for Deployed.

Your API then answers at its live address. Use Open live API in the navigator to open it. Your jobs run on their schedule from now on.

Before anything goes live, Ahamo checks the new version. If a check fails, nothing is switched and your live data is unchanged; the message names the one thing to fix. Changes to the database's tables are applied before the new version goes live.

Follow requests and runs in Analytics

Open Analytics and pick API or Scheduled jobs when the app has more than one part. Choose the last hour, 24 hours, or 7 days.

  • API starts with one sentence, such as "1,247 requests in the last 24 hours · 2.8% errors · 95% answered within 180 ms". Below it are requests and errors over time, typical and slowest response times, and the busiest endpoints. Status codes are under Technical details.
  • Scheduled jobs shows runs and failures over time, typical and longest run time, the next run, each job with its schedule, and the last failure with what it printed. Ahamo keeps an app's last 50 runs, so the page says from when it counts.

Analytics never records the content of a request, its query string, or who sent it.

Next, see Use a connection in your app or publish your app.

On this page