---
title: "Add a new flow to the repository"
method: POST
path: "/flows"
tags: ["flows"]
---

# Add a new flow to the repository

`POST /flows`

The new Flow will automatically be associated with the current user in the owners array, allowing editing and viewing by this user irrespective of tenancies.

## Request body

- MutableFlow
  - `name` string, required
  - `description` string
  - `graph` FlowGraph, required
    - `nodes` object[]
      - `id` string, required
      - `componentId` string, required
      - `command` string, required
      - `name` string
      - `description` string
      - `fields` object
    - `edges` object[]
      - `id` string, required
      - `config` object
        - `condition` string
        - `mapper` object
      - `source` string, required
      - `target` string, required
  - `type` 'ordinary' | 'realtime', required — Flow type
  - `owners` Owner[]
    - `id` string, required — External id of the owner
    - `type` string, required — Type to discriminate owner's type

## Response `201`

The created Flow.

- object
  - `data` Flow
    - `name` string, required
    - `description` string
    - `graph` FlowGraph, required
      - `nodes` object[]
        - `id` string, required
        - `componentId` string, required
        - `command` string, required
        - `name` string
        - `description` string
        - `fields` object
      - `edges` object[]
        - `id` string, required
        - `config` object
          - `condition` string
          - `mapper` object
        - `source` string, required
        - `target` string, required
    - `type` 'ordinary' | 'realtime', required — Flow type
    - `owners` Owner[]
      - `id` string, required — External id of the owner
      - `type` string, required — Type to discriminate owner's type
    - `id` string, required
    - `status` 'active' | 'inactive', required — Flow status
    - `createdAt` string, date-time, required — Flow creation time
    - `updatedAt` string, date-time, required — Flow update time
  - `meta` object

## Changes

- **2019-03-26** `a65fada07ca8` — 1 breaking, 3 info
  - the response's body type/format changed from ``/`` to `object`/`` for status `201`
  - removed `#/components/schemas/MutableFlow, subschema #2` from the response body `allOf` list for the response status `201`
  - added the optional property `data` to the response with the `201` status
  - added the optional property `meta` to the response with the `201` status

[Change history](https://skmtc.dev/openintegrationhub/apis/flow-repository/changes/flows/post.md)

---

[API](https://skmtc.dev/openintegrationhub/apis/flow-repository.md) · [All operations](https://skmtc.dev/openintegrationhub/apis/flow-repository/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/openintegrationhub/flow-repository/revisions/db102ef341f4/schema)
