Skip to main content
POST
/
modules
/
create
Create Module
curl --request POST \
  --url https://api.docketqa.com/modules/create \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '
{
  "title": "<string>",
  "viewport_width": 123,
  "viewport_height": 123,
  "browser_zoom": 123,
  "steps": [
    {
      "step_number": 123,
      "type": "<string>",
      "action": "<string>",
      "api_request": {
        "url": "<string>",
        "method": "<string>",
        "headers": {},
        "body": {},
        "timeout": 123,
        "retries": 123,
        "backoff_seconds": 123,
        "should_refresh_page": true
      }
    }
  ]
}
'
{
  "message": "<string>",
  "test_blueprint": {
    "id": 123,
    "title": "<string>",
    "type": "<string>",
    "status": "<string>",
    "steps": [
      {}
    ],
    "company_id": 123,
    "browser_zoom": 123,
    "viewport_width": 123,
    "viewport_height": 123,
    "usage_count": 123,
    "created_at": "<string>",
    "updated_at": "<string>"
  }
}
Create a reusable step module that can be shared across multiple tests. Modules support AI steps, assertion steps, and API steps.
title
string
required
The name of the module.
viewport_width
integer
Browser viewport width in pixels. Defaults to 1900.
viewport_height
integer
Browser viewport height in pixels. Defaults to 1200.
browser_zoom
number
Browser zoom level. Defaults to 1.
steps
object[]
required
An ordered list of steps for the module.

Example request body

{
  "title": "Login Setup Module",
  "viewport_width": 1900,
  "viewport_height": 1200,
  "browser_zoom": 1,
  "steps": [
    {
      "step_number": 1,
      "type": "act",
      "action": "Navigate to the login page",
      "use_vision": false
    },
    {
      "step_number": 2,
      "type": "api",
      "action": "",
      "use_vision": false,
      "api_request": {
        "url": "https://api.example.com/auth/token",
        "method": "POST",
        "headers": {},
        "body": {
          "username": "testuser",
          "password": "testpass"
        },
        "timeout": 60,
        "retries": 1,
        "backoff_seconds": 2.5,
        "should_refresh_page": false
      }
    },
    {
      "step_number": 3,
      "type": "assert",
      "action": "Verify the auth token was returned",
      "use_vision": false
    }
  ]
}
message
string
A confirmation message (e.g. "Test blueprint created successfully").
test_blueprint
object
The created module object.

Example response

{
  "message": "Test blueprint created successfully",
  "test_blueprint": {
    "id": 964,
    "title": "Login Setup Module",
    "type": "step_module",
    "status": "active",
    "company_id": 23,
    "browser_zoom": 1.0,
    "viewport_width": 1900,
    "viewport_height": 1200,
    "usage_count": 0,
    "steps": [
      {
        "id": 23103,
        "step_number": 1,
        "type": "act",
        "action": "Navigate to the login page",
        "use_vision": false,
        "api_request": null
      },
      {
        "id": 23104,
        "step_number": 2,
        "type": "api",
        "action": "",
        "use_vision": false,
        "api_request": {
          "url": "https://api.example.com/auth/token",
          "method": "POST",
          "headers": {},
          "body": { "username": "testuser", "password": "testpass" },
          "timeout": 60,
          "retries": 1,
          "backoff_seconds": 2.5,
          "should_refresh_page": false
        }
      },
      {
        "id": 23105,
        "step_number": 3,
        "type": "assert",
        "action": "Verify the auth token was returned",
        "use_vision": false,
        "api_request": null
      }
    ],
    "created_at": "2025-12-13T18:58:45.895773+00:00",
    "updated_at": "2025-12-13T18:58:45.895781+00:00"
  }
}