---
title: "Add a workspace run (self-hosted)"
method: POST
path: "/self-hosted/{accountId}/workspaces/{workspaceId}/runs"
tags: ["Self-Hosted Runners"]
---

# Add a workspace run (self-hosted)

`POST /self-hosted/{accountId}/workspaces/{workspaceId}/runs`

## Path parameters

- `accountId` string, required
- `workspaceId` string, required

## Request body

- AddWorkspaceRunRequest
  - `workspaceRun` WorkspaceRun, required — Base entity with common fields
    - `id` string — Unique identifier
    - `accountId` string — Unique identifier of the account
    - `createdAt` string, date-time — Timestamp when the entity was created
    - `updatedAt` string, date-time — Timestamp when the entity was last updated
    - `workspaceId` string — Unique identifier of the associated workspace
    - `workspaceName` string — Name of the workspace
    - `runId` string — Unique identifier for the run
    - `runName` string — Name of the run
    - `status` 'pending' | 'running' | 'success' | 'failed' | 'canceled' | 'initializing' | 'queued' | 'planning' | 'planning_destroy' | 'applying' | 'destroying' | 'ready_for_apply' | 'ready_for_destroy' | 'destroyed' | 'destroy_plan_completed' | 'destroy_plan_failed' | 'destroy_failed' | 'discarded' | 'canceling_init' | 'canceling_plan' | 'canceling_planning_destroy' | 'canceling_apply' | 'canceling_destroy' | 'canceled_init' | 'canceled_plan' | 'canceled_planning_destroy' | 'canceled_apply' | 'canceled_destroy' | 'init_error' | 'plan_success' | 'plan_error' | 'apply_error' | 'apply_success' | 'blocked' | 'Acknowledged' | 'plan_no_changes' | 'apply_no_changes' | 'runner_failure' — The status of a workspace run
    - `pullRequestId` string — ID of the associated pull request
    - `pullRequestUrl` string — URL of the associated pull request
    - `branch` string — Branch associated with the run
    - `commitId` string — ID of the commit
    - `commitUrl` string — URL of the commit
    - `runnerType` 'github-actions' | 'gitlab-pipelines' | 'bitbucket-pipelines' | 'azure-pipelines' | 'jenkins' | 'semaphore' | 'atlantis' | 'env0' | 'firefly' | 'unrecognized' — The type of CI/CD runner or pipeline system
    - `buildId` string — ID of the build
    - `buildUrl` string — URL of the build
    - `buildName` string — Name of the build
    - `vcsType` 'github' | 'gitlab' | 'bitbucket' | 'codecommit' | 'azuredevops' — The type of version control system
    - `repo` string — Repository associated with the run
    - `repoUrl` string — URL of the repository
    - `ownerSummary` object — Summary of the owner of the run
      - `email` string — Email of the owner
      - `name` string — Name of the owner
      - `initials` string — Initials of the owner
      - `customColor` string — Custom color for the owner
    - `title` string — Title of the run
    - `terraformVersion` string — Version of Terraform used
    - `iacType` 'terraform' | 'opentofu' | 'k8s' — Type of Infrastructure as Code
    - `backendSummary` object — Summary of backend configuration
      - `backendType` string — Type of backend
      - `backendConfig` object — Backend configuration
      - `iacStackId` string — ID of the IaC stack
      - `managedResourceCount` integer — Number of managed resources
    - `planTaskId` string — Unique identifier of the plan task
    - `applyTaskId` string — Unique identifier of the apply task
    - `plan` Task[] — Plan tasks
      - `id` string — Unique identifier
      - `accountId` string — Unique identifier of the associated account
      - `createdAt` string, date-time — Timestamp when the entity was created
      - `updatedAt` string, date-time — Timestamp when the entity was last updated
      - `contentKeys` object — Keys for accessing content related to subtasks
      - `status` string — Status of the task run
      - `resultStatus` string — Result status of the task
      - `type` 'post-plan' | 'post-apply' — The type of task in the workflow
      - `guardrailsSummary` object — Summary of guardrail results
        - `total` integer — Total number of guardrails
        - `passed` integer — Number of passed guardrails
        - `failed` integer — Number of failed guardrails
        - `violations` object[]
          - `id` string — Violation ID
          - `severity` 'high' | 'medium' | 'low' — Severity of the violation
          - `message` string — Violation message
        - `description` string — Summary of guardrail results
      - `backendSummary` object — Summary of backend configuration
        - `type` 's3' | 'azurerm' | 'gcs' | 'consul' — Type of backend
        - `config` object — Backend configuration
        - `resources` integer — Number of resources
        - `description` string — Summary of backend configuration
      - `changedFilesCodeSummary` object — Summary of changed code files
        - `total` integer — Total number of files
        - `added` integer — Number of added files
        - `modified` integer — Number of modified files
        - `deleted` integer — Number of deleted files
        - `files` object[]
          - `path` string — File path
          - `type` 'added' | 'modified' | 'deleted' — Type of change
        - `description` string — Summary of changed code files
      - `vcsType` 'github' | 'gitlab' | 'bitbucket' | 'codecommit' | 'azuredevops' — The type of version control system
      - `runnerType` 'github-actions' | 'gitlab-pipelines' | 'bitbucket-pipelines' | 'azure-pipelines' | 'jenkins' | 'semaphore' | 'atlantis' | 'env0' | 'firefly' | 'unrecognized' — The type of CI/CD runner or pipeline system
    - `apply` Task[] — Apply tasks
      - `id` string — Unique identifier
      - `accountId` string — Unique identifier of the associated account
      - `createdAt` string, date-time — Timestamp when the entity was created
      - `updatedAt` string, date-time — Timestamp when the entity was last updated
      - `contentKeys` object — Keys for accessing content related to subtasks
      - `status` string — Status of the task run
      - `resultStatus` string — Result status of the task
      - `type` 'post-plan' | 'post-apply' — The type of task in the workflow
      - `guardrailsSummary` object — Summary of guardrail results
        - `total` integer — Total number of guardrails
        - `passed` integer — Number of passed guardrails
        - `failed` integer — Number of failed guardrails
        - `violations` object[]
          - `id` string — Violation ID
          - `severity` 'high' | 'medium' | 'low' — Severity of the violation
          - `message` string — Violation message
        - `description` string — Summary of guardrail results
      - `backendSummary` object — Summary of backend configuration
        - `type` 's3' | 'azurerm' | 'gcs' | 'consul' — Type of backend
        - `config` object — Backend configuration
        - `resources` integer — Number of resources
        - `description` string — Summary of backend configuration
      - `changedFilesCodeSummary` object — Summary of changed code files
        - `total` integer — Total number of files
        - `added` integer — Number of added files
        - `modified` integer — Number of modified files
        - `deleted` integer — Number of deleted files
        - `files` object[]
          - `path` string — File path
          - `type` 'added' | 'modified' | 'deleted' — Type of change
        - `description` string — Summary of changed code files
      - `vcsType` 'github' | 'gitlab' | 'bitbucket' | 'codecommit' | 'azuredevops' — The type of version control system
      - `runnerType` 'github-actions' | 'gitlab-pipelines' | 'bitbucket-pipelines' | 'azure-pipelines' | 'jenkins' | 'semaphore' | 'atlantis' | 'env0' | 'firefly' | 'unrecognized' — The type of CI/CD runner or pipeline system
    - `error` WorkspaceRunError
      - `type` string, required
      - `description` string, required
      - `activity` string
      - `temporalWorkflowId` string, required
      - `cause` string

## Response `200`

Workspace run added successfully

## Other responses

- `201` — Workspace run created successfully
- `400` — Bad Request Error
- `404` — Not Found Error
- `500` — Internal Server Error

---

[API](https://skmtc.net/firefly/apis/api-gateway.md) · [All operations](https://skmtc.net/firefly/apis/api-gateway/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/firefly/api-gateway/revisions/eea119b4113f/schema)
