---
title: "Publish resources to target environment"
method: POST
path: "/v2/environments/{targetEnvironmentId}/publish"
tags: ["Environments"]
---

# Publish resources to target environment

`POST /v2/environments/{targetEnvironmentId}/publish`

Publishes all workflows and resources from the source environment to the target environment. Optionally specify specific resources to publish or use dryRun mode to preview changes.

## Path parameters

- `targetEnvironmentId` string, required

## Request body

- PublishEnvironmentRequestDto
  - `sourceEnvironmentId` string — Source environment ID to sync from. Defaults to the Development environment if not provided.
  - `dryRun` boolean — Perform a dry run without making actual changes
  - `resources` ResourceToPublishDto[] — Array of specific resources to publish. If not provided, all resources will be published.
    - `resourceType` 'REGULAR' | 'ECHO' | 'BRIDGE', required — Type of the layout
    - `resourceId` string, required — Unique identifier of the resource to publish

## Response `200`

OK

- PublishEnvironmentResponseDto
  - `results` SyncResultDto[], required — Sync results by resource type
    - `resourceType` 'REGULAR' | 'ECHO' | 'BRIDGE', required — Type of the layout
    - `successful` SyncedWorkflowDto[], required — Successfully synced resources
      - `resourceType` 'REGULAR' | 'ECHO' | 'BRIDGE', required — Type of the layout
      - `resourceId` string, required — Resource ID
      - `resourceName` string, required — Resource name
      - `action` 'created' | 'updated' | 'skipped' | 'deleted', required — Sync action performed
    - `failed` FailedWorkflowDto[], required — Failed resource syncs
      - `resourceType` 'REGULAR' | 'ECHO' | 'BRIDGE', required — Type of the layout
      - `resourceId` string, required — Resource ID
      - `resourceName` string, required — Resource name
      - `error` string, required — Error message
      - `stack` string — Error stack trace
    - `skipped` SkippedWorkflowDto[], required — Skipped resources
      - `resourceType` 'REGULAR' | 'ECHO' | 'BRIDGE', required — Type of the layout
      - `resourceId` string, required — Resource ID
      - `resourceName` string, required — Resource name
      - `reason` string, required — Reason for skipping
    - `totalProcessed` number, required — Total number of resources processed
  - `summary` PublishSummaryDto, required
    - `resources` number, required — Number of resources processed
    - `successful` number, required — Number of successful syncs
    - `failed` number, required — Number of failed syncs
    - `skipped` number, required — Number of skipped resources

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `405` — Method Not Allowed
- `409` — Conflict
- `413` — Payload Too Large
- `414` — URI Too Long
- `415` — Unsupported Media Type
- `422` — Unprocessable Entity
- `429` — The client has sent too many requests in a given amount of time.
- `500` — Internal Server Error
- `503` — The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.

---

[API](https://skmtc.net/novu/apis/deprecated-novu-api-use-openapi-json-yaml-instead.md) · [All operations](https://skmtc.net/novu/apis/deprecated-novu-api-use-openapi-json-yaml-instead/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/novu/deprecated-novu-api-use-openapi-json-yaml-instead/versions/986fe259fa85/schema)
