---
title: "Copy a Flow"
method: POST
path: "/flows/{flow_id}/copy"
tags: ["Flows"]
---

# Copy a Flow

`POST /flows/{flow_id}/copy`

## Request

- Base URL: `https://dataops.nexla.io/nexla-api`
- URL: `https://dataops.nexla.io/nexla-api/flows/{flow_id}/copy`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/nexla/apis/nexla-rest-api/docs/flows/:flow_id/copy/post.ts> (a function with typed inputs; its response is checked against the schema)

Use this endpoint to create a copy of an existing flow.

## Path parameters

- `flow_id` integer, required

## Request body

- object
  - `reuse_data_credentials` boolean: Set this to `true` if you do want to reuse the credentials of this flow instead of creating a clone of the credentials also.
  - `copy_access_controls` boolean: Set this to `true` if you want the new flow to be accessible by all users who have access to the this flow.
  - `copy_dependent_data_flows` boolean: This is relevant for flows where one or more destinations have sources as their children. Set this to `true` if you want to create a clone of the flows that originate from those sources also.
  - `owner_id` integer: The default API behavior is to create the new flow in the account of the authenticated user making this call. Set this property if you want a different user to be the owner of the new flow.
  - `org_id` integer: The default API behavior is to create the new flow in the org that the authenticated user making this call belongs to. Set this property if you want the flow to be created in a different org.

## Response `200`

Success

- object
  - `flows` FlowOriginNode[]
    - `id` integer
    - `parent_node_id` integer: Flow id of the parent flow node if this node is not the root node in the flow chain. This will usually be `null` as most flow definitions will originate in the node for `data_source`.
    - `origin_node_id` integer: Flow id of the root node in the flow chain.
    - `data_source_id` integer: The ID of the data source this flow node is linked to if this is a flow node for a data source.
    - `data_set_id` integer: The ID of the Nexset this flow node is linked to if this is flow node for a Nexset.
    - `data_sink_id` integer: The ID of the data sink this flow node is linked to if this is a flow node for a data sink.
    - `shared_origin_node_id` integer
    - `status` string
    - `project_id` integer
    - `flow_type` string
    - `ingestion_mode` string
    - `name` string
    - `description` string
    - `children` FlowChildNode[]: Each element of this array is a flow node that is directly linked to this flow node.
      - `id` integer
      - `parent_node_id` integer: The flow id of the flow node this node is a direct descendant of.
      - `origin_node_id` integer: The flow id of the flow node at the root of this flow chain.
      - `data_source_id` integer: The ID of the data source this flow node is linked to if this is a flow node for a data source.
      - `data_set_id` integer: The ID of the Nexset this flow node is linked to if this is flow node for a Nexset.
      - `data_sink_id` integer: The ID of the data sink this flow node is linked to if this is a flow node for a data sink.
      - `children` unknown[]: Each element is a flow node that is directly linked to this node.
        - unknown
  - `code_containers` object[]: All code containers that are linked to flow nodes in this response.
    - `id` integer
    - `owner_id` integer
    - `org_id` integer
    - `name` string
    - `description` unknown
    - `data_credentials_id` unknown
    - `public` boolean
    - `managed` boolean
    - `reusable` boolean
    - `resource_type` string
    - `output_type` string
    - `code_type` string
    - `code_encoding` string
    - `access_roles` unknown[]
      - unknown
    - `tags` unknown[]
      - unknown
    - `copied_from_id` integer
    - `created_at` string, date-time
    - `updated_at` string, date-time
  - `data_sources` object[]: All data sources that are linked to flow nodes in this response.
    - `id` integer
    - `owner_id` integer
    - `org_id` integer
    - `flow_node_id` integer
    - `origin_node_id` integer
    - `name` string
    - `description` unknown
    - `status` string
    - `data_credentials_id` integer, nullable
    - `data_sink_id` integer, nullable
    - `auto_generated` boolean
    - `managed` boolean
    - `source_type` string
    - `connector_type` string
    - `connection_type` string
    - `template_config` object
    - `vendor` unknown
    - `access_roles` unknown[]
      - unknown
    - `tags` unknown[]
      - unknown
    - `copied_from_id` integer, nullable
    - `created_at` string, date-time
    - `updated_at` string, date-time
  - `data_sets` object[]: All Nexsets that are linked to flow nodes in this response.
    - `id` integer
    - `owner_id` integer
    - `org_id` integer
    - `flow_node_id` integer
    - `origin_node_id` integer
    - `name` string
    - `description` string
    - `status` string
    - `data_source_id` integer, nullable
    - `parent_data_set_id` integer, nullable
    - `code_container_id` integer, nullable
    - `data_sink_ids` unknown[]
      - unknown
    - `public` boolean
    - `managed` boolean
    - `access_roles` unknown[]
      - unknown
    - `tags` unknown[]
      - unknown
    - `copied_from_id` integer, nullable
    - `created_at` string, date-time
    - `updated_at` string, date-time
  - `data_sinks` object[]: All data sinks that are linked to flow nodes in this response.
    - `id` integer
    - `owner_id` integer
    - `org_id` integer
    - `flow_node_id` integer
    - `origin_node_id` integer
    - `name` string
    - `description` unknown
    - `status` string
    - `data_credentials_id` integer
    - `data_set_id` integer
    - `data_source_id` integer, nullable
    - `managed` boolean
    - `sink_type` string
    - `connector_type` string
    - `connection_type` string
    - `template_config` object
    - `vendor` unknown
    - `access_roles` unknown[]
      - unknown
    - `tags` unknown[]
      - unknown
    - `copied_from_id` unknown
    - `created_at` string, date-time
    - `updated_at` string, date-time
  - `data_credentials` object[]: All credentials that are referenced by flow nodes in this response.
    - `id` integer
    - `owner_id` integer
    - `org_id` integer
    - `name` string
    - `description` unknown
    - `credentials_type` string
    - `verified_status` string
    - `managed` boolean
    - `template_config` object
    - `vendor` unknown
    - `access_roles` unknown[]
      - unknown
    - `tags` unknown[]
      - unknown
    - `copied_from_id` unknown
    - `created_at` string, date-time
    - `updated_at` string, date-time
  - `shared_data_sets` unknown[]: Metadata about the parent Nexset any relevant origin flow node is a descendant of. This is only relevant for flow nodes that originate in a shared Nexset instead of a data source.
    - unknown
  - `orgs` Org[]
    - `id` integer
    - `name` string
    - `email_domain` string
    - `email` unknown
    - `client_identifier` unknown
  - `users` Owner[]
    - `id` integer
    - `full_name` string
    - `email` string, email
  - `projects` object[]: All projects that any of the flows in this flow response are linked to.
    - `id` integer
    - `owner_id` integer
    - `org_id` integer
    - `name` string
    - `description` string
    - `access_roles` unknown[]
      - unknown

## Other responses

- `403`: Forbidden
- `404`: Not found

---

[API](https://skmtc.dev/nexla/apis/nexla-rest-api.md) - [All operations](https://skmtc.dev/nexla/apis/nexla-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/nexla/apis/nexla-rest-api/revisions/ef02be92fe7b?raw)
