---
updatedAt: 2026-04-21T03:46:21.000Z
agentTools:
  projectIndex: https://help.rainforestqa.com/llms.txt
---

# Create a new test

Create a new test

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Rainforest API Documentation",
    "description": "Nearly all interactions done on in Rainforest can be done in via the API.<br/><br/>Find your API Token (for the CLIENT_TOKEN header field) on the <a href=\"https://app.rainforestqa.com/settings/integrations\">integration settings</a> page.",
    "version": "1"
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "tags": [
    {
      "name": "tests",
      "description": "Operations about tests"
    }
  ],
  "paths": {
    "/1/tests": {
      "post": {
        "summary": "Create a new test",
        "description": "Create a new test",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/post-tests"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Test created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Test"
                }
              }
            }
          },
          "400": {
            "description": "Test could not be created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "tests"
        ],
        "operationId": "post-tests",
        "x-rdme-order": 2
      }
    }
  },
  "servers": [
    {
      "url": "//app.rainforestqa.com/api"
    }
  ],
  "components": {
    "securitySchemes": {
      "api_key": {
        "type": "apiKey",
        "name": "CLIENT_TOKEN",
        "in": "header"
      }
    },
    "schemas": {
      "Test": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "test_id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "result": {
            "type": "string"
          },
          "wisp": {
            "type": "string"
          },
          "prompt": {
            "type": "string"
          },
          "prompt_credentials": {
            "type": "string"
          },
          "ai_mode": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "site_id": {
            "type": "string"
          },
          "priority": {
            "type": "string"
          },
          "start_uri": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "browsers": {
            "$ref": "#/components/schemas/RunTestBrowserStatus"
          },
          "tags": {
            "type": "string"
          },
          "frontend_url": {
            "type": "string"
          },
          "rfml_id": {
            "type": "string"
          },
          "exploratory_run_id": {
            "type": "string"
          },
          "initial_redirect_behavior": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "reroute_geo": {
            "type": "string",
            "description": "Deprecated: please use `connection.id` instead"
          },
          "connection": {
            "$ref": "#/components/schemas/Connection"
          },
          "atc_settings": {
            "type": "string"
          },
          "owner": {
            "$ref": "#/components/schemas/UserLite"
          },
          "last_updated_by": {
            "$ref": "#/components/schemas/UserLite"
          },
          "updated_at": {
            "type": "string"
          },
          "archived_at": {
            "type": "string"
          },
          "deleted": {
            "type": "string"
          },
          "attached_to": {
            "$ref": "#/components/schemas/Tests_Lite"
          },
          "dry_run_url": {
            "type": "string"
          },
          "last_run": {
            "$ref": "#/components/schemas/RunSuperLite"
          },
          "feature_id": {
            "type": "string"
          },
          "has_wisp": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "coverage_summary": {
            "type": "string"
          },
          "used_in_snippets_count": {
            "type": "string"
          },
          "used_in_tests_count": {
            "type": "string"
          },
          "used_in_archived_snippets_count": {
            "type": "string"
          },
          "used_in_archived_tests_count": {
            "type": "string"
          },
          "self_healed_at": {
            "type": "string"
          },
          "last_run_test": {
            "type": "object",
            "properties": {
              "self_healed": {
                "type": "string"
              },
              "rescued": {
                "type": "string"
              }
            }
          },
          "step_count": {
            "type": "integer",
            "format": "int32"
          },
          "deletable": {
            "type": "boolean"
          },
          "editable": {
            "type": "boolean"
          },
          "embedded": {
            "type": "boolean"
          },
          "unrewritable_reason": {
            "type": "string"
          },
          "test_version_id": {
            "type": "string"
          },
          "total_instances": {
            "type": "string"
          },
          "job_test_generation_id": {
            "type": "string"
          }
        },
        "description": "Test model"
      },
      "RunTestBrowserStatus": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "result": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "overridden_results": {
            "$ref": "#/components/schemas/OverriddenResult"
          },
          "credit_cost": {
            "type": "string"
          }
        }
      },
      "OverriddenResult": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "note": {
            "type": "string"
          },
          "result": {
            "type": "string"
          },
          "job_group_id": {
            "type": "string"
          },
          "user": {
            "$ref": "#/components/schemas/UserLite"
          }
        }
      },
      "UserLite": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "role": {
            "type": "string"
          }
        }
      },
      "Connection": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "name": {
            "type": "string"
          },
          "api_token": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "link_state": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "rainforest",
              "user"
            ]
          }
        },
        "description": "Connection model"
      },
      "Tests_Lite": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "test_id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "result": {
            "type": "string"
          },
          "wisp": {
            "type": "string"
          },
          "prompt": {
            "type": "string"
          },
          "prompt_credentials": {
            "type": "string"
          },
          "ai_mode": {
            "type": "string"
          },
          "priority": {
            "type": "string"
          },
          "real_cost_to_run": {
            "type": "string"
          },
          "owner_id": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          },
          "deleted": {
            "type": "string"
          },
          "feature_id": {
            "type": "string"
          }
        }
      },
      "RunSuperLite": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "state": {
            "type": "string"
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "An error message describing what went wrong"
          }
        },
        "required": [
          "error"
        ],
        "description": "Error model"
      },
      "post-tests": {
        "type": "object",
        "properties": {
          "ai_mode": {
            "type": "string",
            "description": "Set to `self-heal` to turn on self-healing for snippets",
            "enum": [
              "self-heal"
            ]
          },
          "browsers": {
            "type": "array",
            "description": "List of browsers that the test runs on by default; you can find a list of possible options via the client API",
            "items": {
              "type": "string"
            }
          },
          "category": {
            "type": "string",
            "description": "Test category",
            "enum": [
              "site",
              "app"
            ]
          },
          "connection_id": {
            "type": "string",
            "description": "Connection to route test execution through (geographic location or custom tunnel)"
          },
          "reroute_geo": {
            "type": "string",
            "description": "Deprecated: use connection_id instead"
          },
          "description": {
            "type": "string",
            "description": "Test notes"
          },
          "environment_id": {
            "type": "integer",
            "format": "int32",
            "description": "Environment used to get initial_navigate_url (only concerns Visual Editor tests)"
          },
          "feature_id": {
            "type": "integer",
            "format": "int32",
            "description": "Test feature"
          },
          "login_snippet_id": {
            "type": "integer",
            "format": "int32",
            "description": "ID of a snippet to use for login steps at the start of AI test generation. Mutually exclusive with prompt_credentials"
          },
          "owner_id": {
            "type": "integer",
            "format": "int32",
            "description": "Test owner"
          },
          "priority": {
            "type": "string",
            "description": "Test priority",
            "enum": [
              "P1",
              "P2",
              "P3",
              ""
            ]
          },
          "prompt": {
            "type": "string",
            "description": "Prompt for self-healing snippets or AI generated tests"
          },
          "prompt_credentials": {
            "type": "string",
            "description": "Login credentials for AI test generation (e.g. 'username / password'). Mutually exclusive with login_snippet_id"
          },
          "rfml_id": {
            "type": "string",
            "description": "RFML ID for this test"
          },
          "site_id": {
            "type": "integer",
            "format": "int32",
            "description": "Tested site"
          },
          "start_uri": {
            "type": "string",
            "description": "The path this test starts at; if present, must start with a /"
          },
          "state": {
            "type": "string",
            "description": "Test state",
            "enum": [
              "enabled",
              "disabled",
              "draft",
              "archived"
            ],
            "default": "enabled"
          },
          "tags": {
            "type": "array",
            "description": "Test tags",
            "items": {
              "type": "string"
            }
          },
          "title": {
            "type": "string",
            "description": "Test title (maximum length: 255 characters)"
          },
          "type": {
            "type": "string",
            "description": "The type of test to create",
            "enum": [
              "snippet",
              "test"
            ]
          },
          "atc_settings": {
            "type": "object",
            "properties": {
              "delay_after": {
                "type": "integer",
                "format": "int32",
                "description": "Delay(seconds) in execution after every verb"
              }
            },
            "required": [
              "delay_after"
            ]
          },
          "slim": {
            "type": "boolean",
            "description": "If true, returns less data in order to reduce latency and response size",
            "default": false
          }
        },
        "required": [
          "title",
          "type"
        ],
        "description": "Create a new test"
      }
    }
  }
}
```