Skip to Content
Endpoints

Shared Steps

How to work with shared steps using the public API

The shared steps endpoints allow you to manage reusable test steps that can be referenced across multiple test cases. Shared steps consist of a title and a list of sub-steps, each with a description and expected result.

About Shared Steps

Shared steps are reusable test step templates that can be used in multiple test cases. They consist of:

  1. Title: A descriptive name for the shared step (1–255 characters)
  2. Sub-steps: A list of individual steps, each with:
    • Description: What action to perform (HTML content)
    • Expected: The expected result (HTML content)
    • Test data (optional): A list of up to 20 test data items (text, link or file), returned in the data field — see the Step Test Data section of the Test Cases page for the item shape

When a shared step is used in a test case, all its sub-steps are included. Updates to a shared step automatically propagate to all test cases that reference it.

  • Shared steps must have at least one sub-step
  • Each sub-step must have at least a description, expected result, or test data
  • The title of a shared step must be unique within a project
  • Shared steps are versioned - updates create new versions while preserving old ones
  • Deleted shared steps are still returned by test case versions that reference them, with deletedAt set on the shared step and its sub-steps

List Shared Steps

GET/api/public/v0/project/{project_id}/shared-step/paginated

/paginated endpoints are transitional. In API v1, the base paths will return paginated responses and the /paginated suffix will be removed.

Retrieves all non-deleted shared steps within a project, optionally sorted and with additional fields included.

Path Parameters

  • project_id: The project identifier (can be either the project code or UUID)

Query Parameters

ParameterTypeDescriptionDefaultExample
offsetnumberNumber of items to skip.0offset=10
limitnumberMaximum number of items to return. Accepted range: 0–1,000.100limit=20
sortFieldstringField to sort by: created_at or title.titlesortField=title
sortOrderstringSort direction for sortField: asc or desc.ascsortOrder=asc
includestringInclude additional fields omitted by default. Accepted value: tcaseCount.Noneinclude=tcaseCount
  • Use include=tcaseCount to see how many test cases reference each shared step
  • Sorting by created_at shows the most recently created steps first (with desc) or oldest first (with asc)
  • Sorting by title provides alphabetical ordering

Example Request

Fetch all shared steps

curl \
  -H "Authorization: ApiKey your.api.key.here" \
  https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/shared-step/paginated

Fetch all shared steps sorted by title in ascending order

curl \
  -H "Authorization: ApiKey your.api.key.here" \
  "https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/shared-step/paginated?sortField=title&sortOrder=asc"

Fetch all shared steps with test case count included

curl \
  -H "Authorization: ApiKey your.api.key.here" \
  "https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/shared-step/paginated?include=tcaseCount"

Response Fields

{
  total: number           // Number of matching shared steps across all pages
  offset: number          // Offset applied to this response
  limit: number           // Limit applied to this response
  data: Array<{           // Shared steps in this page
    id: number            //   Shared step ID
    version: number       //   Version of the shared step
    type: string          //   Type of the step (always `shared` for shared steps)
    title: string         //   Title of the shared step
    isLatest: boolean     //   Whether this is the latest version of the step
    subSteps: Array<{     //   List of sub-steps
      id: number          //     Sub-step ID
      type: string        //     Type of the sub-step (always `shared_sub_step`)
      version: number     //     Version of the sub-step (same as the parent step)
      isLatest: boolean   //     Whether this is the latest version of the sub-step (same as the parent step)
      description?: html  //     Details of the sub-step, absent when empty
      expected?: html     //     Expected result of the sub-step, absent when empty
      data?: StepData[]   //     Sub-step test data items, absent when there are none (see Step Test Data on the Test Cases page)
    }>
    tcaseCount?: number   //   Number of test cases using this shared step; only with `include=tcaseCount`
  }>
}

Example Response

{
  "total": 2,
  "offset": 0,
  "limit": 100,
  "data": [
    {
      "id": 1,
      "version": 3,
      "type": "shared",
      "title": "User login validation",
      "isLatest": true,
      "subSteps": [
        {
          "id": 2,
          "type": "shared_sub_step",
          "version": 3,
          "isLatest": true,
          "description": "<p>Navigate to the login page</p>",
          "expected": "<p>Login form is displayed</p>"
        },
        {
          "id": 3,
          "type": "shared_sub_step",
          "version": 3,
          "isLatest": true,
          "description": "<p>Enter valid username and password</p>",
          "expected": "<p>Credentials are accepted</p>"
        },
        {
          "id": 4,
          "type": "shared_sub_step",
          "version": 3,
          "isLatest": true,
          "description": "<p>Click the login button</p>",
          "expected": "<p>User is redirected to the dashboard</p>"
        }
      ],
      "tcaseCount": 5
    },
    {
      "id": 5,
      "version": 1,
      "type": "shared",
      "title": "Form submission validation",
      "isLatest": true,
      "subSteps": [
        {
          "id": 6,
          "type": "shared_sub_step",
          "version": 1,
          "isLatest": true,
          "description": "<p>Fill in all required fields</p>",
          "expected": "<p>All fields are populated correctly</p>"
        },
        {
          "id": 7,
          "type": "shared_sub_step",
          "version": 1,
          "isLatest": true,
          "description": "<p>Submit the form</p>",
          "expected": "<p>Form is submitted successfully</p>"
        }
      ],
      "tcaseCount": 12
    }
  ]
}

List Shared Steps (Deprecated)

Deprecated

This endpoint is deprecated. Use List Shared Steps (GET /api/public/v0/project/{project_id}/shared-step/paginated) instead.

GET/api/public/v0/project/{project_id}/shared-step

Retrieves all non deleted shared steps within a project, optionally sorted and with additional fields included.

Path Parameters

  • project_id: The project identifier (can be either the project code or UUID)

Query Parameters

All query parameters are optional.

ParameterTypeDescriptionDefaultExample
sortFieldstringField to sort by: created_at or title.titlesortField=title
sortOrderstringSort direction for sortField: asc or desc.ascsortOrder=asc
includestringInclude additional fields omitted by default. Accepted value: tcaseCount.Noneinclude=tcaseCount
  • Use include=tcaseCount to see how many test cases reference each shared step
  • Sorting by created_at shows the most recently created steps first (with desc) or oldest first (with asc)
  • Sorting by title provides alphabetical ordering

Example Request

Fetch all shared steps

curl \
  -H "Authorization: ApiKey your.api.key.here" \
  https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/shared-step

Fetch all shared steps sorted by title in ascending order

curl \
  -H "Authorization: ApiKey your.api.key.here" \
  "https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/shared-step?sortField=title&sortOrder=asc"

Fetch all shared steps with test case count included

curl \
  -H "Authorization: ApiKey your.api.key.here" \
  "https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/shared-step?include=tcaseCount"

Response Fields

{
  sharedSteps: Array<{    // List of shared step objects
    id: number            //   Shared step ID
    version: number       //   Version of the shared step
    type: string          //   Type of the step (always `shared` for shared steps)
    title: string         //   Title of the shared step
    isLatest: boolean     //   Whether this is the latest version of the step
    subSteps: Array<{     //   List of sub-steps
      id: number          //     Sub-step ID
      type: string        //     Type of the sub-step (always `shared_sub_step`)
      version: number     //     Version of the sub-step (same as the parent step)
      isLatest: boolean   //     Whether this is the latest version of the sub-step (same as the parent step)
      description?: html  //     Details of the sub-step, absent when empty
      expected?: html     //     Expected result of the sub-step, absent when empty
      data?: StepData[]   //     Sub-step test data items, absent when there are none (see Step Test Data on the Test Cases page)
    }>
    tcaseCount?: number   //   Number of test cases using this shared step; only with `include=tcaseCount`
  }>
}

Example Response

{
  "sharedSteps": [
    {
      "id": 1,
      "version": 3,
      "type": "shared",
      "title": "User login validation",
      "isLatest": true,
      "subSteps": [
        {
          "id": 2,
          "type": "shared_sub_step",
          "version": 3,
          "isLatest": true,
          "description": "<p>Navigate to the login page</p>",
          "expected": "<p>Login form is displayed</p>"
        },
        {
          "id": 3,
          "type": "shared_sub_step",
          "version": 3,
          "isLatest": true,
          "description": "<p>Enter valid username and password</p>",
          "expected": "<p>Credentials are accepted</p>"
        },
        {
          "id": 4,
          "type": "shared_sub_step",
          "version": 3,
          "isLatest": true,
          "description": "<p>Click the login button</p>",
          "expected": "<p>User is redirected to the dashboard</p>"
        }
      ],
      "tcaseCount": 5
    },
    {
      "id": 5,
      "version": 1,
      "type": "shared",
      "title": "Form submission validation",
      "isLatest": true,
      "subSteps": [
        {
          "id": 6,
          "type": "shared_sub_step",
          "version": 1,
          "isLatest": true,
          "description": "<p>Fill in all required fields</p>",
          "expected": "<p>All fields are populated correctly</p>"
        },
        {
          "id": 7,
          "type": "shared_sub_step",
          "version": 1,
          "isLatest": true,
          "description": "<p>Submit the form</p>",
          "expected": "<p>Form is submitted successfully</p>"
        }
      ],
      "tcaseCount": 12
    }
  ]
}

Get Shared Step

GET/api/public/v0/project/{project_id}/shared-step/{step_id}

Get details of a single shared step using its ID.

Path Parameters

  • project_id: The project identifier (can be either the project code or UUID)
  • step_id: The shared step identifier (numeric ID)

Example Request

curl \
  -H "Authorization: ApiKey your.api.key.here" \
  https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/shared-step/1

Response Fields

{
  id: number            // Shared step ID
  version: number       // Version of the shared step
  type: string          // Type of the step (always `shared` for shared steps)
  title: string         // Title of the shared step
  isLatest: boolean     // Whether this is the latest version of the step
  subSteps: Array<{     // List of sub-steps
    id: number          //   Sub-step ID
    type: string        //   Type of the sub-step (always `shared_sub_step`)
    version: number     //   Version of the sub-step (same as the parent step)
    isLatest: boolean   //   Whether this is the latest version of the sub-step (same as the parent step)
    description?: html  //   Details of the sub-step, absent when empty
    expected?: html     //   Expected result of the sub-step, absent when empty
    data?: StepData[]   //   Sub-step test data items, absent when there are none (see Step Test Data on the Test Cases page)
  }>
  tcaseCount: number    // Number of test cases using this shared step
}

Example Response

{
  "id": 1,
  "version": 3,
  "type": "shared",
  "title": "User login validation",
  "isLatest": true,
  "subSteps": [
    {
      "id": 2,
      "type": "shared_sub_step",
      "version": 3,
      "isLatest": true,
      "description": "<p>Navigate to the login page</p>",
      "expected": "<p>Login form is displayed</p>"
    },
    {
      "id": 3,
      "type": "shared_sub_step",
      "version": 3,
      "isLatest": true,
      "description": "<p>Enter valid username and password</p>",
      "expected": "<p>Credentials are accepted</p>",
      "data": [
        {
          "type": "text",
          "label": "Credentials",
          "data": { "value": "user@example.com / s3cret", "format": "plaintext" }
        }
      ]
    },
    {
      "id": 4,
      "type": "shared_sub_step",
      "version": 3,
      "isLatest": true,
      "description": "<p>Click the login button</p>",
      "expected": "<p>User is redirected to the dashboard</p>"
    }
  ],
  "tcaseCount": 5
}

Create Shared Step

POST/api/public/v0/project/{project_id}/shared-step

Creates a shared step. Test cases use it by its ID, through sharedStepId in their steps.

Request Body

{
  title: string         // Title (1–255 characters), unique in the project
  subSteps: Array<{     // Sub-steps, in order
    description?: html  //   Details of the sub-step
    expected?: html     //   Expected result of the sub-step
    data?: StepData[]   //   Sub-step test data items (max 20; see Step Test Data on the Test Cases page)
  }>
}

Sub-steps without a description, expected result or test data are dropped, and at least one must remain.

Response

Status: 201 Created

The created shared step, as Get Shared Step returns it.

Errors

Status CodeDescription
400No sub-step has a description, expected result or test data
409A shared step with the same title exists

Update Shared Step

PATCH/api/public/v0/project/{project_id}/shared-step/{step_id}

Changes the title or the sub-steps of a shared step.

  • subSteps replaces the whole list. Send an existing sub-step's id to keep it; a sub-step without id is added, and existing sub-steps left out are removed.
  • Every test case that uses the shared step gets a new version, and open runs get the new versions, like after any test case update.

Request Body

{
  title?: string        // New title (1–255 characters), unique in the project
  subSteps?: Array<{    // New sub-steps, in order
    id?: number         //   Existing sub-step to keep; omitted for a new one
    description?: html  //   Details of the sub-step
    expected?: html     //   Expected result of the sub-step
    data?: StepData[]   //   Sub-step test data items (max 20; see Step Test Data on the Test Cases page)
  }>
}

Omitted fields are left unchanged. A request that changes nothing returns the shared step as it is, without a new version.

Response

Status: 200 OK

The updated shared step, as Get Shared Step returns it.

Errors

Status CodeDescription
400A sub-step id doesn't belong to the shared step, or no sub-step has any content
409A shared step with the same title exists

Delete Shared Step

DELETE/api/public/v0/project/{project_id}/shared-step/{step_id}

Deletes a shared step.

Irreversible

Deleted shared steps don't go to the trash and can't be restored. Every test case that uses the shared step gets a new version with its sub-steps copied in as standalone steps, so they can't be linked to the shared step again.

Response

Status: 200 OK

{
  message: string
}