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

# Create test

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

## Request

- Base URL: `https://app.base44.com`
- URL: `https://app.base44.com/api/apps/{app_id}/testing-agent/flows`
- Auth: HTTP bearer

<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: A test: a goal the testing agent tries to accomplish in a browser.
  - `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

- **2026-10-11** `80287813ab84`: 1 info
  - the endpoint scheme security `PersonalAccessTokenAuth` was added to the API
- **2026-09-30** `63675fa5257c`: 1 info
  - endpoint added

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

---

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