Platform API and access tokens
Every action of the app is a route of the Platform API: list runs, update a script, pause a schedule, run a flow. Outside Waiso you call it at https://waiso.dev/api (on a self-hosted install, <your Waiso address>/api) with an access token. Inside a script the same calls are the waiso.api library, already signed in as whoever started the run. Every route, with its parameters and examples, is in the API reference.
- Create an access token with exactly the access it needs
- Call the API over HTTP and read its errors
- Use the same calls inside a script as waiso.api
One API, three ways in
| From | How it signs in | What it can do |
|---|---|---|
| HTTP (curl, CI, another system) | An access token: Authorization: Bearer waiso_at_… | What the token’s scope allows, never more than its owner can do now. |
A script in Waiso (waiso.api) | Nothing to set: it is the run’s own identity. | What the person (or token) that started the run can do. |
| An AI agent (MCP, Code Mode) | The same access token. | The same scope, through the MCP tools or one program. |
The scope works per project and per area. A token at Edit on Scripts and Read on Runs may update a script and list runs, and nothing else; the same token on a project it was not given answers as if the project did not exist. And whatever the scope says, the token is also limited by what its owner may do right now: if an admin lowers the owner’s access, every token of that person narrows at once.
Create an access token
- Open Access tokens
Open Settings → Access tokens and press New token.
- Choose what it reaches
Turn on each project it may reach, at Read, Edit or Delete — or open Customize areas to give each area (Scripts, Flows, Runs, Schedules…) its own level, or none.
- Set when it expires
Pick an expiry, or never. It is shown once: copy it now. The list then shows its first characters, when it was last used and how many calls it made.
Revoke a token from the same list: the next call with it is refused. Admins see every token of the workspace under All tokens.
Call it over HTTP
curl -H "Authorization: Bearer $WAISO_TOKEN" \
"https://waiso.dev/api/projects/$PROJECT_ID/runs?status=failed&limit=5"| Answer | Means |
|---|---|
401 unauthenticated | No token, an unknown one, revoked or expired. |
403 token_not_allowed | A route only a signed-in person may call. |
403 access_denied | The token (or its owner) lacks the area’s level; the answer names area, have and need. |
404 not_found | A project the token does not reach answers like one that does not exist. |
429 rate_limited | More than 600 calls in a minute with this token; Retry-After says when. |
The same calls inside a script
In a script, waiso.api needs no token and no address: it acts as whoever started the run (the project owner for schedules and endpoints), and a call that names no project acts on the script’s own.
import waiso
def main():
failed = waiso.api.runs.list(status="failed", limit=20)["items"]
for run in failed:
waiso.api.runs.cancel(run["id"]) if run["status"] == "running" else None
return {"failed": len(failed)}