openapi: 3.2.0 info: description: 'Stack Moxie is a QA Automation platform for Marketing, Sales, and Enterprise Business technologists. This REST API can be used by developers like you to further automate, extend, and integrate quality into the workflows that matter most to you. Don''t have an account? [Sign up here](https://app.stackmoxie.com). # Authentication The Stack Moxie REST API uses HTTP Bearer Authentication, in the form of a JWT token, across all endpoints for authentication. You can manage your API tokens on your account settings page. ' title: 'Stack Moxie REST How To: Test API' x-logo: url: https://app.stackmoxie.com/api/logo.png altText": Stack Moxie Logo servers: - url: https://app.stackmoxie.com/api/ security: - jwtBearerAuth: [] tags: - name: 'How To: Test' description: 'Use these calls to define test Scenarios, Run them, and retrieve their results. ' paths: /v1/organizations/{org}/scenarios: get: summary: List Scenarios description: 'Retrieve the list of test Scenarios for the given Organization. ' tags: - 'How To: Test' parameters: - $ref: '#/components/parameters/OrgPathParam' responses: '200': description: Returns a list of the Organization's test Scenarios. content: application/json: schema: type: array items: $ref: '#/components/schemas/Scenario' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' post: summary: Create a Scenario description: 'Creates a test Scenario for the given Organization. ' tags: - 'How To: Test' parameters: - $ref: '#/components/parameters/OrgPathParam' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Scenario' responses: '200': description: Returns the test Scenario just created. content: application/json: schema: $ref: '#/components/schemas/Scenario' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '422': description: Returned if the provided scenario definition is malformed. content: application/json: schema: $ref: '#/components/schemas/Error' /v1/organizations/{org}/scenarios/{id}: get: summary: Get a Scenario description: 'Retrieves an individual test Scenario by ID. ' tags: - 'How To: Test' parameters: - $ref: '#/components/parameters/OrgPathParam' - name: id in: path description: The Scenario's ID. required: true schema: type: integer responses: '200': description: Returns the test Scenario. content: application/json: schema: $ref: '#/components/schemas/Scenario' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' patch: summary: Update a Scenario description: 'Updates an individual test Scenario by ID. ' tags: - 'How To: Test' parameters: - $ref: '#/components/parameters/OrgPathParam' - name: id in: path description: The Scenario's ID. required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Scenario' responses: '200': description: Returns the updated test Scenario. content: application/json: schema: $ref: '#/components/schemas/Scenario' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '422': description: Returned if the provided scenario definition is malformed. content: application/json: schema: $ref: '#/components/schemas/Error' delete: summary: Delete a Scenario description: 'Deletes an individual test scenario by ID. ' tags: - 'How To: Test' parameters: - $ref: '#/components/parameters/OrgPathParam' - name: id in: path description: The Scenario's ID. required: true schema: type: integer responses: '204': description: Scenario successfully deleted. '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' /v1/organizations/{org}/asyncScenario: post: summary: Create an Async Scenario description: 'Creates a Scenario Asynchronously. ' tags: - 'How To: Test' parameters: - $ref: '#/components/parameters/OrgPathParam' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Scenario' responses: '200': description: Returns an async job. content: application/json: schema: type: object properties: jobId: type: string format: uuid '400': description: Returned if the provided scenario definition does not match async requirements. content: application/json: schema: $ref: '#/components/schemas/Error' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' /v1/organizations/{org}/job/{jobId}: get: summary: Get Async Job Status description: 'Retrieves the status of an async job, including the created scenario if finished. ' tags: - 'How To: Test' parameters: - $ref: '#/components/parameters/OrgPathParam' - name: jobId in: path description: This Job's UUID. required: true schema: type: string format: uuid responses: '200': description: Returns the job status, including the created scenario if finished. content: application/json: schema: $ref: '#/components/schemas/Job' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' /v1/organizations/{org}/scenarios/allTemplates: get: summary: List Templates description: 'Retrieve the list of all Template Scenarios for the given Organization. ' tags: - 'How To: Test' parameters: - $ref: '#/components/parameters/OrgPathParam' responses: '200': description: Returns a list of the Organization's Template Scenarios. content: application/json: schema: type: array items: $ref: '#/components/schemas/Scenario' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' /v1/organizations/{org}/scenarios/linkableTemplates: get: summary: List Linkable Templates description: 'Retrieve the list of all Linkable Template Scenarios for the given Organization. ' tags: - 'How To: Test' parameters: - $ref: '#/components/parameters/OrgPathParam' responses: '200': description: Returns a list of the Organization's Linkable Template Scenarios. content: application/json: schema: type: array items: $ref: '#/components/schemas/Scenario' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' /v1/organizations/{org}/scenarios/exposedTemplates: get: summary: List Exposed Templates description: 'Retrieve the list of all Template Scenarios that are exposed to external APIs. ' tags: - 'How To: Test' parameters: - $ref: '#/components/parameters/OrgPathParam' responses: '200': description: Returns a list of all Template Scenarios that are exposed to external APIs. content: application/json: schema: type: array items: $ref: '#/components/schemas/Scenario' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' /v1/organizations/{org}/scenarios/{id}/runs: get: summary: List Scenario Runs description: 'Retrieves a list of Runs for the given Scenario ID. ' tags: - 'How To: Test' parameters: - $ref: '#/components/parameters/OrgPathParam' - name: id in: path description: Scenario's ID. required: true schema: type: integer - $ref: '#/components/parameters/PageQueryParam' - $ref: '#/components/parameters/OutcomeQueryParam' - $ref: '#/components/parameters/RanAfterQueryParam' - $ref: '#/components/parameters/RanBeforeQueryParam' responses: '200': description: Returns a list of the Scenario's Runs. content: application/json: schema: type: array items: $ref: '#/components/schemas/Run' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' post: summary: Create a Scenario Run description: 'Creates a Run for the given scenario given an optional set of token replacements. ' tags: - 'How To: Test' parameters: - $ref: '#/components/parameters/OrgPathParam' - name: id in: path description: Scenario's ID. required: true schema: type: integer requestBody: required: true content: application/json: schema: type: object properties: tokens: type: object notify: type: string enum: - me - team default: me description: 'Determines who receives notifications. The default `me` means notifications are only sent to the authenticated user initiating the run creation request, while `team` will send to any associated Notification Group(s) or the Organization''s global notification alias. ' responses: '200': description: Returns the Run just created. content: application/json: schema: $ref: '#/components/schemas/Run' '400': description: Returns when notify value is invalid. content: application/json: schema: $ref: '#/components/schemas/Error' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' /v1/organizations/{org}/scenarios/{scenarioId}/runs/{id}: get: summary: Get a Scenario Run description: 'Retrieves an individual Run by its ID. ' tags: - 'How To: Test' parameters: - $ref: '#/components/parameters/OrgPathParam' - name: scenarioId in: path description: Scenario's ID. required: true schema: type: integer - name: id in: path description: Run's ID. required: true schema: type: integer responses: '200': description: Returns the Run. content: application/json: schema: $ref: '#/components/schemas/Run' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' /v1/organizations/{org}/scenarios/{scenarioId}/mostRecentRun: get: summary: Get a Scenario's Most Recent Run description: 'Retrieves the most recent Run of the given Scenario. ' tags: - 'How To: Test' parameters: - $ref: '#/components/parameters/OrgPathParam' - name: scenarioId in: path description: Scenario's ID. required: true schema: type: integer responses: '200': description: Returns the Run. content: application/json: schema: $ref: '#/components/schemas/Run' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' /v1/organizations/{org}/scenarios/{scenarioId}/runs/{runId}/log/{id}: get: summary: Get a Scenario Run Log description: 'Retrieves an individual Run Log given its ID. ' tags: - 'How To: Test' parameters: - $ref: '#/components/parameters/OrgPathParam' - name: scenarioId in: path description: Scenario's ID. required: true schema: type: integer - name: runId in: path description: Run's ID. required: true schema: type: integer - name: id in: path description: Run Log's ID. required: true schema: type: integer responses: '200': description: Returns the Run Log. content: application/json: schema: $ref: '#/components/schemas/RunLog' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' components: schemas: Run: description: Represents a single run of a Test Scenario. type: object properties: outcome: type: string readOnly: true description: The status or outcome of the test. enum: - Created - Running - Passed - Failed - Error - Waiting duration: type: integer readOnly: true description: Duration (in ms) that this run took to complete. scenario: oneOf: - type: integer - $ref: '#/components/schemas/Scenario' readOnly: true description: The ID or Scenario object this Run is associated with. id: type: number readOnly: true description: A numeric identifier for this Run. uuid: type: string format: uuid readOnly: true description: An identifier for this Run in the form of a UUID. log: oneOf: - type: integer - $ref: '#/components/schemas/RunLog' readOnly: true description: The ID or RunLog object corresponding to this Run. createdAt: type: string readOnly: true description: Unix timestamp (ms) of this Run's creation. updatedAt: type: string readOnly: true description: Unix timestamp (ms) of when this Run was last updated. createdBy: oneOf: - type: integer - $ref: '#/components/schemas/User' readOnly: true description: The ID or User object who created this Run. Scenario: required: - definition - name type: object properties: name: type: string description: The name of the Scenario. description: type: string description: A brief description of the Scenario. definition: $ref: '#/components/schemas/ScenarioDefinition' type: type: string description: The type of scenario. Determines how the scenario will be used and how it is handled in the UI. enum: - default - template - from-template severity: type: integer description: Issue severity status of the scenario, 1 being the most severe and 4 being the least. enum: - 1 - 2 - 3 - 4 dashboardSetting: type: string description: Value that indicates whether to include this scenario in the Status Dashboard or not. enum: - default - include - exclude feature: description: The ID or Folder object under which this Scenario lives (if any). oneOf: - type: integer - $ref: '#/components/schemas/Folder' schedule: description: The ID or Schedule object associated with this Scenario (if any). oneOf: - type: integer - $ref: '#/components/schemas/Folder' notificationGroups: description: The Notification Groups that will be notified for scenario run results. type: - array - 'null' items: type: object $ref: '#/components/schemas/NotificationGroup' instructions: type: string description: For templates only. Additional guidelines on how to work with this scenarios. exposedToApis: type: boolean description: For templates only. Value that indicates whether to include this scenario when querying the exposedTemplates endpoint. isLinkable: type: boolean description: For templates only. Indicates whether this scenario can be chained onto other scenarios. uuid: type: string format: uuid readOnly: true description: An identifier for this Scenario in the form of a UUID. id: type: integer readOnly: true description: A numeric identifier for this Scenario. createdAt: type: integer readOnly: true description: Unix timestamp (ms) of this Scenario's creation. updatedAt: type: integer readOnly: true description: Unix timestamp (ms) of this Scenario's last update. createdBy: readOnly: true oneOf: - type: integer - $ref: '#/components/schemas/User' description: The ID or User object who created this Scenario. lastUpdatedBy: readOnly: true oneOf: - type: integer - $ref: '#/components/schemas/User' description: The ID or User object who last updated this Scenario. LinkedScenarioOutcome: description: The scenario that should run based on the outcome of this scenario. type: object properties: templateId: type: integer description: Id of the template scenario that should be run. steps: type: array $ref: '#/components/schemas/Steps' Job: description: The status of the job that is running asynchronously. type: object properties: createdAt: type: integer readOnly: true description: Unix timestamp (ms) of this Job's creation. updatedAt: type: integer readOnly: true description: Unix timestamp (ms) of this Job's last update. id: type: integer readOnly: true description: A numeric identifier for this Job. jobId: type: string format: uuid description: UUID of the job that is running. status: type: string readOnly: true description: Status of the job. enum: - Processing - Complete - Failed type: type: string readOnnly: true description: The type of async Job. enum: - Scenario data: type: string readOnly: true description: JSON string containing all data from the job. NotificationGroup: description: Represents a notification group that can be notified during a scenario run. required: - name type: object properties: name: type: string description: Notification Group name. email: type: - string - 'null' description: The email alias of the notification group. members: description: The users that are members of this notification group. type: - array - 'null' items: type: object $ref: '#/components/schemas/User' id: type: integer readOnly: true description: A numeric identifier for this Notification Group. uuid: type: string readOnly: true description: An identifier for this Notification Group in the form of a UUID. createdAt: type: string readOnly: true description: Unix timestamp (ms) of this Notification Group's creation. updatedAt: type: string readOnly: true description: Unix timestamp (ms) of when this Notification Group was last modified. createdBy: readOnly: true oneOf: - type: integer - $ref: '#/components/schemas/User' description: The ID or User object who created this Notification Group. LinkedScenarios: description: Scenarios that should run based on the outcome of this scenario. properties: onPass: $ref: '#/components/schemas/LinkedScenarioOutcome' onFail: $ref: '#/components/schemas/LinkedScenarioOutcome' RunLog: description: Represents a detailed log associated with a specific test Scenario Run. type: object properties: id: type: integer readOnly: true description: A numeric identifier for this Run Log. uuid: type: string format: uuid readOnly: true description: An identifier for this Run Log in the form of a UUID. createdAt: type: integer readOnly: true description: Unix timestamp (ms) of this Run Log's creation. updatedAt: type: integer readOnly: true description: Unix timestamp (ms) of when this Run Log was last modified. body: type: array items: type: object properties: outcome: type: string enum: - Passed - Failed - Error message: type: string cog: type: string stepId: type: string stepData: type: object readOnly: true Steps: type: array items: type: object required: - cog - stepId properties: cog: type: string description: The name of the Cog (e.g. vendor/cog-name) stepId: type: string description: The ID of the step to be executed. name: type: string description: The human-readable name of the step. data: type: object description: Data to be supplied to the step during step execution. waitFor: type: integer default: 0 description: The amount of time (in seconds) to wait before executing the step. failAfter: type: integer default: 0 description: The amount of time (in seconds) to retry this step before considering the scenario run to have failed. Error: type: object properties: name: type: string message: type: string User: required: - emailAddress - fullName - password type: object properties: uuid: type: string emailAddress: maxLength: 200 type: string emailStatus: type: string emailChangeCandidate: type: string password: type: string fullName: maxLength: 120 type: string notificationSetting: type: string notificationOverride: maxLength: 200 type: string maxTrials: type: string isSuperAdmin: type: boolean passwordResetToken: type: string passwordResetTokenExpiresAt: type: string emailProofToken: type: string emailProofTokenExpiresAt: type: string tosAcceptedByIp: type: string lastSeenAt: type: string ScenarioDefinition: required: - steps type: object properties: scenario: type: string description: The name of the scenario. description: type: string description: Description of the scenario's purpose. steps: type: array $ref: '#/components/schemas/Steps' linkedScenarios: type: object description: Scenarios that should run based on the outcome of this scenario. $ref: '#/components/schemas/LinkedScenarios' Folder: required: - name type: object properties: name: type: string description: Folder Name description: type: string description: Brief description of the Folder's purpose or intention. uuid: type: string format: uuid readOnly: true description: An identifier for this Folder in the form of a UUID. id: type: integer readOnly: true description: A numeric identifier for this Folder. createdBy: readOnly: true oneOf: - type: integer - $ref: '#/components/schemas/User' description: The ID or User who created this Folder. lastUpdatedBy: readOnly: true oneOf: - type: integer - $ref: '#/components/schemas/User' description: The ID or User who last updated this Folder. createdAt: type: integer readOnly: true description: Unix timestamp (ms) of this Folder's creation. updatedAt: type: integer readOnly: true description: Unix timestamp (ms) of when this Folder was last updated. responses: Unauthorized: description: 'Returned when there may be a problem with your API token. ' content: application/json: schema: $ref: '#/components/schemas/Error' Forbidden: description: 'Returned if the authenticated user isn''t allowed to perform this action. ' content: application/json: schema: $ref: '#/components/schemas/Error' parameters: RanBeforeQueryParam: name: ranBefore in: query description: Used to filter scenario runs that ran before the specified date. e.g. ?ranBefore=1591702698140 schema: type: integer RanAfterQueryParam: name: ranAfter in: query description: Used to filter scenario runs that ran after the specified date. e.g. ?ranAfter=1591702698140 schema: type: integer PageQueryParam: name: page in: query description: This helps with pagination and when the limit is known schema: type: integer OrgPathParam: name: org in: path description: Organization's UUID (to scope the API call). required: true schema: type: string format: uuid OutcomeQueryParam: name: outcome in: query description: Used for filtering scenario runs by outcome by passing in comma-delimited values. e.g. ?outcome=Passed,Failed schema: type: integer securitySchemes: jwtBearerAuth: type: http scheme: bearer bearerFormat: JWT