> ## Documentation Index
> Fetch the complete documentation index at: https://docs.loadforge.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Test

> Create a new test

Create a new test by providing details such as name, rate, servers, users, host\_id, region, and locustfile. This endpoint allows you to programmatically set up load tests with your specific configuration.


## OpenAPI

````yaml POST /tests
openapi: 3.1.0
info:
  title: LoadForge API
  description: >-
    The LoadForge API provides programmatic access to create, manage, and run
    load tests on your web applications
  license:
    name: MIT
  version: 2.0.0
servers:
  - url: https://app.loadforge.com/api/v2
security:
  - bearerAuth: []
paths:
  /tests:
    post:
      description: Create a new test
      requestBody:
        description: Test to create
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewTest'
        required: true
      responses:
        '200':
          description: Test creation response
          content:
            application/json:
              schema:
                type: object
                properties:
                  test_id:
                    type: integer
                    description: ID of the created test
        '400':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    NewTest:
      type: object
      required:
        - name
        - rate
        - servers
        - users
        - host_id
        - region
        - locustfile
      properties:
        name:
          type: string
          description: Name of the test
        rate:
          type: integer
          description: Spawn rate of the virtual users
        servers:
          type: integer
          description: Number of worker servers to launch
        users:
          type: integer
          description: Total virtual users to simulate
        host_id:
          type: integer
          description: ID of the host to test
        region:
          type: string
          description: Region code for the test
        locustfile:
          type: string
          description: The full locustfile content
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````