GET /api/projects
Lists the projects the key can reach. Answers { projects }.
curl https://testerninja.com/api/projects \ -H "Authorization: Bearer $TESTERNINJA_KEY"
Everything the app does, it does through these addresses. So can you.
Make an API key in the app under Connect, and send it with every request in the Authorization header. A key starts with tn_ and is shown once.
export TESTERNINJA_KEY=tn_... curl https://testerninja.com/api/projects \ -H "Authorization: Bearer $TESTERNINJA_KEY"
{ "error": "what went wrong" } with a status: 400 something in the request is wrong, 401 no key or a wrong one, 403 the key may not do this, 404 not found, 402 no runs left.A project is one site under test. Every other address needs its id.
Lists the projects the key can reach. Answers { projects }.
curl https://testerninja.com/api/projects \ -H "Authorization: Bearer $TESTERNINJA_KEY"
Adds a site to test. When the workspace already has a project for that host, that project is returned. A key limited to one project cannot do this.
curl -X POST https://testerninja.com/api/projects \
-H "Authorization: Bearer $TESTERNINJA_KEY" \
-H "content-type: application/json" \
-d '{"url":"https://example.com","name":"Example shop"}'One project with its conversations. Answers { project, chats, assistant }.
curl https://testerninja.com/api/projects/PROJECT_ID \ -H "Authorization: Bearer $TESTERNINJA_KEY"
Changes a project. Fields left out keep their value.
curl -X PATCH https://testerninja.com/api/projects/PROJECT_ID \
-H "Authorization: Bearer $TESTERNINJA_KEY" \
-H "content-type: application/json" \
-d '{"name":"Example shop (staging)"}'Deletes the project and everything in it.
curl -X DELETE https://testerninja.com/api/projects/PROJECT_ID \ -H "Authorization: Bearer $TESTERNINJA_KEY"
A saved test (a test case) has a state: draft, active or archived. Only active tests join pipeline and scheduled runs.
Lists the saved tests with how each ended last time. Archived tests are left out; add ?status=all to get them too. Answers { cases }.
curl https://testerninja.com/api/projects/PROJECT_ID/cases \ -H "Authorization: Bearer $TESTERNINJA_KEY"
Creates one test as a draft. Answers { case }.
curl -X POST https://testerninja.com/api/projects/PROJECT_ID/cases \
-H "Authorization: Bearer $TESTERNINJA_KEY" \
-H "content-type: application/json" \
-d '{"title":"A visitor can send the contact form","steps":["Open the contact page","Fill in the form","Send it","Check that a thank-you message is shown"],"folder":"Contact"}'The same address also changes many tests at once, or copies one. Send one of these bodies. Answers { changed } or { case }.
curl -X POST https://testerninja.com/api/projects/PROJECT_ID/cases \
-H "Authorization: Bearer $TESTERNINJA_KEY" \
-H "content-type: application/json" \
-d '{"ids":["CASE_ID"],"status":"active"}'Changes a test. Takes the fields of a new test (but not maxSteps), and status. A change to what the test does is kept as a version.
curl -X PATCH https://testerninja.com/api/projects/PROJECT_ID/cases/CASE_ID \
-H "Authorization: Bearer $TESTERNINJA_KEY" \
-H "content-type: application/json" \
-d '{"status":"active"}'Deletes a test.
curl -X DELETE https://testerninja.com/api/projects/PROJECT_ID/cases/CASE_ID \ -H "Authorization: Bearer $TESTERNINJA_KEY"
The project's applications: other sites of the same product, such as an admin app. The project's own address is the main app. Answers { main, applications }.
curl https://testerninja.com/api/projects/PROJECT_ID/applications \ -H "Authorization: Bearer $TESTERNINJA_KEY"
Adds an application. PATCH /api/projects/{id}/applications/{appId} changes one; DELETE removes it and gives its tests back to the main app. Answers { application }.
curl -X POST https://testerninja.com/api/projects/PROJECT_ID/applications \
-H "Authorization: Bearer $TESTERNINJA_KEY" \
-H "content-type: application/json" \
-d '{"name":"Admin app","url":"https://admin.example.com"}'The models this workspace can use, with their prices, and the project's picks for the chat, the run review and the tester. Answers { picks, provider, models, auto, usage }.
curl https://testerninja.com/api/projects/PROJECT_ID/models \ -H "Authorization: Bearer $TESTERNINJA_KEY"
Changes the project's picks. Each is auto or a model id from the list; fields left out keep their value. Answers { picks }.
curl -X POST https://testerninja.com/api/projects/PROJECT_ID/models \
-H "Authorization: Bearer $TESTERNINJA_KEY" \
-H "content-type: application/json" \
-d '{"tester":"auto","chat":{"model":"auto","effort":"high"}}'The test, its versions, its last runs and the steps of one run. Add ?run=RUN_ID for a given run; the newest is used without it.
curl https://testerninja.com/api/projects/PROJECT_ID/cases/CASE_ID/trace \ -H "Authorization: Bearer $TESTERNINJA_KEY"
Says whether the result of a test in one run was right. A result marked wrong is told to the tester the next time.
curl -X POST https://testerninja.com/api/projects/PROJECT_ID/cases/CASE_ID/review \
-H "Authorization: Bearer $TESTERNINJA_KEY" \
-H "content-type: application/json" \
-d '{"runId":"RUN_ID","correct":false,"note":"The form was sent; the message is only shown after a few seconds."}'Writes steps for a test from its goal. Nothing is saved: the steps come back as { steps }. Answers 503 when no model is set up.
curl -X POST https://testerninja.com/api/projects/PROJECT_ID/cases/steps \
-H "Authorization: Bearer $TESTERNINJA_KEY" \
-H "content-type: application/json" \
-d '{"goal":"A visitor can add a product to the cart"}'A test plan is a named list of tests that run together, in order.
Lists the plans. Answers { plans }.
curl https://testerninja.com/api/projects/PROJECT_ID/plans \ -H "Authorization: Bearer $TESTERNINJA_KEY"
Creates a plan. Answers { id }.
curl -X POST https://testerninja.com/api/projects/PROJECT_ID/plans \
-H "Authorization: Bearer $TESTERNINJA_KEY" \
-H "content-type: application/json" \
-d '{"name":"Smoke","caseIds":["CASE_ID"]}'One plan and its runs. Answers { plan, runs }.
curl https://testerninja.com/api/projects/PROJECT_ID/plans/PLAN_ID \ -H "Authorization: Bearer $TESTERNINJA_KEY"
Changes a plan. Takes the same fields, and archived (true or false).
curl -X PATCH https://testerninja.com/api/projects/PROJECT_ID/plans/PLAN_ID \
-H "Authorization: Bearer $TESTERNINJA_KEY" \
-H "content-type: application/json" \
-d '{"reruns":2}'Deletes a plan. Its tests stay.
curl -X DELETE https://testerninja.com/api/projects/PROJECT_ID/plans/PLAN_ID \ -H "Authorization: Bearer $TESTERNINJA_KEY"
An automation does something by itself: runs a plan, maps the site, or gives the assistant instructions.
Lists the automations and what they did lately. Answers { automations, history }.
curl https://testerninja.com/api/projects/PROJECT_ID/automations \ -H "Authorization: Bearer $TESTERNINJA_KEY"
Creates an automation. Answers { automation }.
curl -X POST https://testerninja.com/api/projects/PROJECT_ID/automations \
-H "Authorization: Bearer $TESTERNINJA_KEY" \
-H "content-type: application/json" \
-d '{"name":"Smoke every morning","trigger":{"type":"schedule","every":"weekdays","hour":7,"minute":0,"tz":"Europe/Berlin"},"action":{"type":"plan","planId":"PLAN_ID"}}'Changes an automation. Fields left out keep their value.
curl -X PATCH https://testerninja.com/api/projects/PROJECT_ID/automations/AUTOMATION_ID \
-H "Authorization: Bearer $TESTERNINJA_KEY" \
-H "content-type: application/json" \
-d '{"active":false}'Runs the automation now. Answers { result }.
curl -X POST https://testerninja.com/api/projects/PROJECT_ID/automations/AUTOMATION_ID \ -H "Authorization: Bearer $TESTERNINJA_KEY"
Deletes an automation.
curl -X DELETE https://testerninja.com/api/projects/PROJECT_ID/automations/AUTOMATION_ID \ -H "Authorization: Bearer $TESTERNINJA_KEY"
A run tests the app in a real browser, in the cloud. It usually takes 1 to 5 minutes. Start one, then ask for it every 10 seconds or so until its status is done or failed.
Starts a run: a plan, a list of tests, or every saved test that is not archived when neither is sent. Answers { run } with the run's id and the number of tests. Answers 402 when the workspace has no runs left.
curl -X POST https://testerninja.com/api/projects/PROJECT_ID/runs \
-H "Authorization: Bearer $TESTERNINJA_KEY" \
-H "content-type: application/json" \
-d '{"planId":"PLAN_ID","environment":"Staging","trigger":"api"}'The last 50 runs, newest first. Answers { runs }.
curl https://testerninja.com/api/projects/PROJECT_ID/runs \ -H "Authorization: Bearer $TESTERNINJA_KEY"
One run: its status (queued, running, verifying, done, failed), each test with its result (passed, failed, blocked) and note, and the confirmed bugs. A run passed when its status is done and no test failed or was blocked.
curl https://testerninja.com/api/projects/PROJECT_ID/runs/RUN_ID \ -H "Authorization: Bearer $TESTERNINJA_KEY"
The full report of a run, as the report page shows it: every bug with its steps, what was expected and what happened. No key is needed: the run id is long and random and is the key, like the report link. Treat it like a password.
curl https://testerninja.com/api/runs/RUN_ID
The run as a file, one row per test. JSON, or CSV with ?format=csv. No key is needed, as above.
curl -O -J "https://testerninja.com/api/runs/RUN_ID/export?format=csv"
The pages the map knows, which of them a test has opened, the buttons and fields tests have used, and where to test next.
curl https://testerninja.com/api/projects/PROJECT_ID/coverage \ -H "Authorization: Bearer $TESTERNINJA_KEY"
The newest crawl of the site and the list of crawls. Answers { crawl, crawls }.
curl https://testerninja.com/api/projects/PROJECT_ID/crawls \ -H "Authorization: Bearer $TESTERNINJA_KEY"
Maps the site again. Answers { crawlId }, or 409 while a crawl is running. Send { reset: true } instead to make the map forget what it knows; tests and runs are not touched.
curl -X POST https://testerninja.com/api/projects/PROJECT_ID/crawls \
-H "Authorization: Bearer $TESTERNINJA_KEY" \
-H "content-type: application/json" \
-d '{"area":"/pricing","depth":2}'One crawl with its pages. Answers { crawl }.
curl https://testerninja.com/api/projects/PROJECT_ID/crawls/CRAWL_ID \ -H "Authorization: Bearer $TESTERNINJA_KEY"
Stops a running crawl. Send { stop: true }.
curl -X POST https://testerninja.com/api/projects/PROJECT_ID/crawls/CRAWL_ID \
-H "Authorization: Bearer $TESTERNINJA_KEY" \
-H "content-type: application/json" \
-d '{"stop":true}'Runs, results, bugs, run times and time saved over a period. Add ?days=30 (1 to 365), or ?from=2026-01-01&to=2026-01-31.
curl https://testerninja.com/api/projects/PROJECT_ID/insights?days=30 \ -H "Authorization: Bearer $TESTERNINJA_KEY"
The numbers behind time saved and cost saved. Fields left out keep their value. Answers { settings }.
curl -X PATCH https://testerninja.com/api/projects/PROJECT_ID/insights-settings \
-H "Authorization: Bearer $TESTERNINJA_KEY" \
-H "content-type: application/json" \
-d '{"minutesPerTest":6,"currency":"EUR"}'What the testers know about the app: notes, rules, memories, skills and documents. Rules are given to the tester on every run.
Everything known, with the project summary. Answers { knowledge, summary, summaryAt, crawlAt, targets }.
curl https://testerninja.com/api/projects/PROJECT_ID/knowledge \ -H "Authorization: Bearer $TESTERNINJA_KEY"
Saves one item. Answers { item }.
curl -X POST https://testerninja.com/api/projects/PROJECT_ID/knowledge \
-H "Authorization: Bearer $TESTERNINJA_KEY" \
-H "content-type: application/json" \
-d '{"kind":"rule","title":"Never press Delete account"}'The same address also handles the project summary.
curl -X POST https://testerninja.com/api/projects/PROJECT_ID/knowledge \
-H "Authorization: Bearer $TESTERNINJA_KEY" \
-H "content-type: application/json" \
-d '{"action":"save-summary","summary":"A shop for bike parts. Visitors can buy without an account."}'Changes an item.
curl -X PATCH https://testerninja.com/api/projects/PROJECT_ID/knowledge/ITEM_ID \
-H "Authorization: Bearer $TESTERNINJA_KEY" \
-H "content-type: application/json" \
-d '{"content":"Never press Delete account or Cancel subscription."}'Deletes an item.
curl -X DELETE https://testerninja.com/api/projects/PROJECT_ID/knowledge/ITEM_ID \ -H "Authorization: Bearer $TESTERNINJA_KEY"
Logins, inboxes, files and values the tests use. Secrets are write-only: a password, a key, a file or request headers can be sent, but no address ever sends them back. A config is answered with its public part and hasSecret: true or false.
Lists the saved test data, and the kinds there are. Answers { configs, types }.
curl https://testerninja.com/api/projects/PROJECT_ID/configs \ -H "Authorization: Bearer $TESTERNINJA_KEY"
Saves test data. Use a throwaway test account, never a real one. Answers { config }.
curl -X POST https://testerninja.com/api/projects/PROJECT_ID/configs \
-H "Authorization: Bearer $TESTERNINJA_KEY" \
-H "content-type: application/json" \
-d '{"type":"login","name":"Test customer","username":"test@example.com","password":"a-throwaway-password"}'Changes test data. Fields that are sent replace what was there; a field left out or sent empty stays as it was, secrets too. The type cannot be changed.
curl -X PATCH https://testerninja.com/api/projects/PROJECT_ID/configs/CONFIG_ID \
-H "Authorization: Bearer $TESTERNINJA_KEY" \
-H "content-type: application/json" \
-d '{"name":"Test customer 2"}'Deletes test data.
curl -X DELETE https://testerninja.com/api/projects/PROJECT_ID/configs/CONFIG_ID \ -H "Authorization: Bearer $TESTERNINJA_KEY"
Mail received by the project's test inboxes. Answers { addresses, messages }.
curl https://testerninja.com/api/projects/PROJECT_ID/inbox \ -H "Authorization: Bearer $TESTERNINJA_KEY"
Other addresses of the same app: staging, a preview. Production is the project's own address and is always in the list.
Lists the environments. Answers { environments }.
curl https://testerninja.com/api/projects/PROJECT_ID/environments \ -H "Authorization: Bearer $TESTERNINJA_KEY"
Saves an environment. Sending a name that exists changes that one. Headers and the password are secrets: they are kept encrypted and never sent back.
curl -X POST https://testerninja.com/api/projects/PROJECT_ID/environments \
-H "Authorization: Bearer $TESTERNINJA_KEY" \
-H "content-type: application/json" \
-d '{"name":"Staging","url":"https://staging.example.com"}'Deletes an environment.
curl -X DELETE https://testerninja.com/api/projects/PROJECT_ID/environments/ENVIRONMENT_ID \ -H "Authorization: Bearer $TESTERNINJA_KEY"
Things a person has to do before the testers can go on: give a login, unblock a page.
Lists the todos. Answers { todos }.
curl https://testerninja.com/api/projects/PROJECT_ID/todos \ -H "Authorization: Bearer $TESTERNINJA_KEY"
Raises a todo. A todo with the same title is counted again, not made twice. Answers { todo }.
curl -X POST https://testerninja.com/api/projects/PROJECT_ID/todos \
-H "Authorization: Bearer $TESTERNINJA_KEY" \
-H "content-type: application/json" \
-d '{"title":"Give a test login for the admin area","type":"credentials","priority":"high"}'The same address also changes or deletes many todos at once: send ids with the fields to change, or ids with remove: true. Answers { changed }.
curl -X POST https://testerninja.com/api/projects/PROJECT_ID/todos \
-H "Authorization: Bearer $TESTERNINJA_KEY" \
-H "content-type: application/json" \
-d '{"ids":["TODO_ID"],"status":"done"}'One todo.
curl https://testerninja.com/api/projects/PROJECT_ID/todos/TODO_ID \ -H "Authorization: Bearer $TESTERNINJA_KEY"
Changes a todo: the fields above, and status (open, done or rejected, with a reason when rejected).
curl -X PATCH https://testerninja.com/api/projects/PROJECT_ID/todos/TODO_ID \
-H "Authorization: Bearer $TESTERNINJA_KEY" \
-H "content-type: application/json" \
-d '{"status":"rejected","reason":"We do not test the admin area."}'Deletes a todo.
curl -X DELETE https://testerninja.com/api/projects/PROJECT_ID/todos/TODO_ID \ -H "Authorization: Bearer $TESTERNINJA_KEY"
Where the result of a run is sent: a webhook, Slack, Teams or email. A project can have 20.
Lists them. The address of a webhook is never sent back, only its host. Answers { notifications, canKeepSecrets }.
curl https://testerninja.com/api/projects/PROJECT_ID/notifications \ -H "Authorization: Bearer $TESTERNINJA_KEY"
Adds one. For a webhook the answer also holds secret, the key the messages are signed with: it is shown this once. Email goes only to people of the workspace.
curl -X POST https://testerninja.com/api/projects/PROJECT_ID/notifications \
-H "Authorization: Bearer $TESTERNINJA_KEY" \
-H "content-type: application/json" \
-d '{"kind":"webhook","target":"https://example.com/hooks/tests","on":"failure"}'Turns one on or off (enabled), or changes on.
curl -X PATCH https://testerninja.com/api/projects/PROJECT_ID/notifications/NOTIFICATION_ID \
-H "Authorization: Bearer $TESTERNINJA_KEY" \
-H "content-type: application/json" \
-d '{"enabled":false}'Sends a test message.
curl -X POST https://testerninja.com/api/projects/PROJECT_ID/notifications/NOTIFICATION_ID \ -H "Authorization: Bearer $TESTERNINJA_KEY"
Deletes one.
curl -X DELETE https://testerninja.com/api/projects/PROJECT_ID/notifications/NOTIFICATION_ID \ -H "Authorization: Bearer $TESTERNINJA_KEY"
A conversation with the assistant, which can explore the site, suggest tests and run them. Its status is working, waiting or idle.
The project's conversations. Answers { chats }.
curl https://testerninja.com/api/projects/PROJECT_ID/chats \ -H "Authorization: Bearer $TESTERNINJA_KEY"
Starts an empty conversation. Answers { chat }.
curl -X POST https://testerninja.com/api/projects/PROJECT_ID/chats \ -H "Authorization: Bearer $TESTERNINJA_KEY"
A conversation and what was said. Ask again while its status is working. Answers { chat, messages }.
curl https://testerninja.com/api/chats/CHAT_ID \ -H "Authorization: Bearer $TESTERNINJA_KEY"
Sends a message. Answers 202 at once; the assistant's answer arrives in the conversation.
curl -X POST https://testerninja.com/api/chats/CHAT_ID \
-H "Authorization: Bearer $TESTERNINJA_KEY" \
-H "content-type: application/json" \
-d '{"text":"Explore the site and suggest the top five tests"}'Renames a conversation (title), archives it (archived: true or false), or rates an answer (messageId with rating: up, down or null).
curl -X PATCH https://testerninja.com/api/chats/CHAT_ID \
-H "Authorization: Bearer $TESTERNINJA_KEY" \
-H "content-type: application/json" \
-d '{"title":"Checkout tests"}'Presses a button on a card in the conversation. Send messageId (the card), action (the button) and what the button needs. For a card of suggested tests: action create_cases with selected, the positions of the tests to create, counted from 0.
curl -X POST https://testerninja.com/api/chats/CHAT_ID/actions \
-H "Authorization: Bearer $TESTERNINJA_KEY" \
-H "content-type: application/json" \
-d '{"messageId":12,"action":"create_cases","selected":[0,1]}'Every conversation of a project, up to 500. Add show=archived or show=all, and q to search. Answers { chats }.
curl https://testerninja.com/api/chats/history?project=PROJECT_ID&show=all \ -H "Authorization: Bearer $TESTERNINJA_KEY"
Two addresses made for shell scripts: they answer plain key=value lines, so a pipeline needs nothing but curl. The ready-made script at /ci.sh uses them.
Starts a run of every active test, or of one plan. Answers 201 with three lines: run, tests and url.
curl -X POST https://testerninja.com/api/ci?project=PROJECT_ID&plan=Smoke \ -H "Authorization: Bearer $TESTERNINJA_KEY"
How the run is going. Lines: status, result (running, passed or failed), passed, failed, blocked, bugs and url.
curl https://testerninja.com/api/ci?project=PROJECT_ID&run=RUN_ID \ -H "Authorization: Bearer $TESTERNINJA_KEY"
Numbers in the text form Prometheus reads, per project: runs by status, tests and bugs of the last finished run, when it ended and how long it took, and saved tests by state. A read-only key is enough. A key limited to one project gets that project only.
curl https://testerninja.com/api/metrics \ -H "Authorization: Bearer $TESTERNINJA_KEY"
A small picture that says how the project's last run ended, for a README. No key is needed: it gives away nothing but the result.
curl https://testerninja.com/api/badge/PROJECT_ID.svg
Keys are usually made in the app, under Connect. A key limited to one project cannot use these addresses.
Lists the keys: name, first characters, what each can do, its project, and when it was last used. Never the key itself.
curl https://testerninja.com/api/keys \ -H "Authorization: Bearer $TESTERNINJA_KEY"
Makes a key. The full key is in the answer this once.
curl -X POST https://testerninja.com/api/keys \
-H "Authorization: Bearer $TESTERNINJA_KEY" \
-H "content-type: application/json" \
-d '{"name":"Pipeline","scope":"write","projectId":"PROJECT_ID"}'Revokes a key. Anything using it stops working at once.
curl -X DELETE https://testerninja.com/api/keys/KEY_ID \ -H "Authorization: Bearer $TESTERNINJA_KEY"
Coding agents (Claude Code, Cursor, Codex) can use Tester Ninja as tools over MCP, at /api/mcp (streamable HTTP, POST). It takes the same key in the same header; there is no other way to sign in. A read-only key is offered only the tools that read. A key limited to one project is offered only tools that work inside a project, sees only that project in list_projects, and cannot create a project.
claude mcp add --transport http testerninja https://testerninja.com/api/mcp \ --header "Authorization: Bearer $TESTERNINJA_KEY"
curl -X POST https://testerninja.com/api/mcp \
-H "Authorization: Bearer $TESTERNINJA_KEY" \
-H "content-type: application/json" \
-H "accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'The tools: list_projects, create_project, ask_assistant, get_chat, list_test_cases, create_test_cases, update_test_case, run_tests, get_run, list_runs, get_finding, get_test_trace, get_coverage, save_knowledge, delete_knowledge, list_knowledge, save_test_login, list_configs, list_test_plans, add_to_plan, schedule_plan, list_environments, save_environment, list_pull_requests, read_inbox, list_todos, raise_todo.
Setup for each agent is in the app under Connect. A page written for agents is at /agent-quickstart.md.
A small tool that calls the addresses above. It is one file, scripts/cli.mjs in the Tester Ninja repository, and needs only Node 18 or newer. It is not on npm yet.
# Save a key on this computer (it is asked for and not shown), or set TESTERNINJA_KEY node scripts/cli.mjs login node scripts/cli.mjs projects node scripts/cli.mjs tests "Example shop" # Start a run and wait for it. The exit code is 1 when it does not pass. node scripts/cli.mjs run "Example shop" --plan Smoke --environment Staging --wait node scripts/cli.mjs status RUN_ID node scripts/cli.mjs open RUN_ID
login checks the key with the server, then keeps it in ~/.testerninja/config.json, readable only by you. TESTERNINJA_KEY is used first when it is set, so a pipeline needs no login.run takes --plan, --url, --environment, --preset, --wait and --timeout (minutes, default 30). Without a plan it runs every saved test that is not archived.status lists each test with its result. open prints the address of the report.TESTERNINJA_API changes the server address.For a pipeline that has no Node, the shell script at /ci.sh does the same with curl.