qTest Scenario API

The Tricentis qTest Scenario REST API for BDD/Gherkin assets — features and steps synchronized between qTest and Jira.

OpenAPI Specification

tricentis-qtest-scenario-openapi.yaml Raw ↑
swagger: "2.0"
info:
  version: "2025.2.0" # this should match with the swagger codegen version, so if there is swagger API change, the version is update
  title: qTest Scenario
#
externalDocs:
  description: "Introduction to qTest Scenario API"
  url: "https://documentation.tricentis.com/qtest/od/en/content/apis/apis/scenario_apis.htm"
# during dev, should point to your local machine
host: scenario-stage1.staging.qtestnet.com
# basePath prefixes all resource paths
# this must match with REST_ENDPOINT in config
basePath: /api
#
schemes:
  # tip: remove http to make production-grade
  - http
  - https
# format of bodies a client can send (Content-Type)
consumes:
  - application/json
  - application/x-www-form-urlencoded
# format of the responses to the client (Accepts)
produces:
  - application/json
securityDefinitions:
  qtestToken:
    type: apiKey
    in: header
    name: Authorization
  scenarioProjectId:
    type: apiKey
    in: header
    name: x-scenario-project-id
security:
  - qtestToken: []
    scenarioProjectId: []
paths:
  /features:
    get:
      tags:
        - "feature"
      operationId: getFeatures
      parameters: &feature_name_query_param
        - $ref: "#/parameters/Name"
        - $ref: "#/parameters/IssueKey"
        - $ref: "#/parameters/FileName"
      summary: get list of features
      responses:
        <<: &default_responses
          400:
            $ref: "#/responses/BadRequest"
          401:
            $ref: "#/responses/Unauthorized"
          403:
            $ref: "#/responses/Forbidden"
          default:
            $ref: "#/responses/Default"
        200:
          description: OK
          schema:
            type: array
            items: &feature_schema
              $ref: "#/definitions/Feature"
    post:
      tags:
        - "feature"
      operationId: createFeature
      parameters: &feature_body_params
        - name: feature
          in: body
          required: true
          schema:
            $ref: "#/definitions/FeatureInput"
      responses:
        <<: *default_responses
        201:
          description: OK
          schema: *feature_schema
  /features/{id}:
    parameters: &id_path_param
      - $ref: "#/parameters/IdPath"
    put:
      tags:
        - "feature"
      operationId: updateFeature
      parameters: *feature_body_params
      responses:
        <<: *default_responses
        200:
          description: OK
          schema: *feature_schema
    patch:
      tags:
        - "feature"
      operationId: patchFeature
      parameters: *feature_body_params
      responses:
        <<: *default_responses
        200:
          description: OK
          schema: *feature_schema
  /steps:
    get:
      tags:
        - "step"
      parameters:
        - $ref: "#/parameters/Text"
        - $ref: "#/parameters/Keyword"
        - $ref: '#/parameters/IssueId'
      operationId: getSteps
      summary: get list of steps
      responses:
        <<: *default_responses
        200:
          description: OK
          schema: &step_schema
            $ref: "#/definitions/Step"
    post:
      tags:
        - "step"
      parameters:
        - name: step
          in: body
          required: true
          schema:
            $ref: "#/definitions/StepInput"
      operationId: createStep
      responses:
        <<: *default_responses
        201:
          description: OK
          schema: *step_schema
  /steps/{id}:
    parameters: *id_path_param
    put:
      tags:
        - "step"
      parameters: &step_body_param
        - name: step
          in: body
          required: true
          schema:
            $ref: "#/definitions/StepInput"
      operationId: updateStep
      summary: update step
      responses:
        <<: *default_responses
        200:
          description: OK
          schema: *step_schema
    patch:
      tags:
        - "step"
      parameters: &step_body_param
        - name: step
          in: body
          required: true
          schema:
            $ref: "#/definitions/StepInput"
      operationId: patchStep
      summary: update step
      responses:
        <<: *default_responses
        200:
          description: OK
          schema: *step_schema
# common parameters
parameters:
  IdPath:
    name: id
    in: path
    required: true
    type: string
  Name:
    name: name
    in: query
    required: false
    type: string
  IssueKey:
    name: issueKey
    in: query
    required: false
    type: string
  FileName:
    name: filename
    in: query
    required: false
    type: string
  Text:
    name: text
    in: query
    required: false
    type: string
  Keyword:
    name: keyword
    in: query
    required: false
    type: string
  IssueId:
    name: issueId
    in: query
    required: false
    type: string
# common responses
responses:
  Default:
    description: Error
    schema: &error_schema
      $ref: "#/definitions/Error"
  BadRequest:
    description: Bad Request
    schema: *error_schema
  Unauthorized:
    description: Unauthorized
    schema: *error_schema
  Forbidden:
    description: Forbidden
    schema: *error_schema
# complex objects have schema definitions
definitions:
  Error:
    required:
      - message
    properties:
      message:
        type: string
  Doc:
    required:
      - id
    properties:
      id:
        type: string
  FeatureInput:
    allOf:
      - required:
          - issueId
          - repoFullName
          - updatedBy
          - fileName
          - sha
        properties: &feature_properties
          issueId:
            type: string
          repoFullName:
            type: string
          sha:
            type: string
          updatedBy:
            type: string
          issueKey:
            type: string
          normalizedName:
            type: string
          name:
            type: string
          fileName:
            type: string
          isFeatureFileLinked:
            type: boolean
          isFeatureFileLocked:
            type: boolean
          accountId:
            type: string
          projectId:
            type: string
  Feature:
    allOf:
      - $ref: "#/definitions/Doc"
      - required:
          - accountId
          - projectId
        properties: *feature_properties
  StepInput:
    allOf:
      - required:
          - issueId
          - repoFullName
          - hash
          - keyword
          - updatedBy
        properties: &step_properties
          accountId:
            type: string
          projectId:
            type: string
          issueId:
            type: string
          repoFullName:
            type: string
          hash:
            type: string
          text:
            type: string
          normalizedText:
            type: string
          keyword:
            type: string
          updatedBy:
            type: string
          status:
            $ref: "#/definitions/StepStatus"
  Step:
    allOf:
      - $ref: "#/definitions/Doc"
      - required:
          - accountId
          - projectId
          - issueId
          - repoFullName
          - hash
          - keyword
        properties: *step_properties
  StepStatus:
    type: string
    enum:
      - PASSED
      - FAILED
      - SKIPPED
# API groups
tags:
  - name: "feature"
    description: "Feature API"
  - name: "step"
    description: "Step API"