---
title: "Create test"
method: POST
path: "/api/apps/{app_id}/testing-agent/flows"
---

# Create test

`POST /api/apps/{app_id}/testing-agent/flows`

<Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Adds a test to the app. A test is a goal written in plain language that the testing agent tries to accomplish in a real browser when you [run it](/api-reference/run-test).

Set `role` to run the test as a user with that role. Leave it out and Base44 picks a role named in the test's name or goal, such as "as an admin", or runs as a regular user when neither names one.

An app can have up to 250 tests. Creating a test is free. Running it costs credits.

This is limited to 300 requests per minute per caller for each app. Some workspaces have a different limit.

<Note>This endpoint accepts a personal API key belonging to a user with editor access to the app. Read-only keys and workspace API keys are refused.</Note>

## Path parameters

- `app_id` string, required — ID of the app.

## Request body

- CreateFlowRequest
  - `name` string, required — Short name for the test.
  - `goal` string, required — What the testing agent should try to do, in plain language.
  - `role` string, nullable — Role to run the test as, such as `admin`. Leave it out to let Base44 pick one from the name or goal.

## Response `200`

The created test.

- FlowResponse — Fields the FE actually reads, plus the metadata the runtime slice needs (``role`` for per-flow role-aware runs, ``revision`` for optimistic-concurrency, ``source`` so AI-generated rows can be styled differently, etc.).
  - `id` string, required — ID of the test.
  - `app_id` string, required — ID of the app the test belongs to.
  - `name` string, required — Short name of the test.
  - `goal` string, required — What the testing agent tries to do, in plain language.
  - `role` string, nullable — Role set on the test, or `null` when none is set. A test without one can still run as a role its name or goal names. The run's `flow_role` shows the role actually used.
  - `source` string, required — `manual` for a test you created, `app_context` for one Base44 generated from the app.
  - `revision` integer, required — Starts at 1 and goes up each time the test is edited.
  - `created_date` string, required — When the test was created, as an ISO 8601 UTC timestamp.
  - `updated_date` string, required — When the test last changed, as an ISO 8601 UTC timestamp.

## Other responses

- `400` — `name` or `goal` is only whitespace, or the app already has 250 tests.
- `401` — Missing or invalid credentials.
- `403` — You don't have editor access to this app, the app is blocked, or your API key is read-only or a workspace API key.
- `404` — App not found.
- `409` — Your workspace requires an unlocked SSO session.
- `422` — Validation Error
- `429` — Rate limit exceeded.

## Changes

> 22 revisions in range; 1 not diffed.

- **2026-09-29** `d2b7ac8beb0c` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/adexad/apis/base44-app-management-api/changes/api/apps/:app_id/testing-agent/flows/post.md)

---

[API](https://skmtc.dev/adexad/apis/base44-app-management-api.md) · [All operations](https://skmtc.dev/adexad/apis/base44-app-management-api/llms.txt) · [OpenAPI document](https://skmtc.dev/adexad/apis/base44-app-management-api/revisions/862b46d283f0?raw)
