---
title: "Create a flow"
method: POST
path: "/{teamPid}/flows"
tags: ["Flows"]
---

# Create a flow

`POST /{teamPid}/flows`

## Request

- Base URL: `https://api.rightmessage.com/v1`
- URL: `https://api.rightmessage.com/v1/{teamPid}/flows`
- Auth: HTTP bearer

Adds a flow to the project's draft. Publish the draft to make it live.

Requires an API token with the `write` ability. Tokens created without abilities have `*`, which grants every ability.

## Path parameters

- `teamPid` string, required

## Request body

- StoreFlowRequest
  - `name` string, required
  - `definition` object
    - `type` 'root'
    - `child` string[]

## Response `201`

`FlowResource`

- object
  - `data` FlowResource, required
    - `id` string, nullable, required
    - `name` string, nullable, required
    - `definition` string, nullable, required

## Other responses

- `401`: Missing, invalid or revoked API token.
- `403`: Authorization error
- `404`: Not found
- `422`: Validation error
- `429`: Rate limit exceeded: 120 requests per minute for project endpoints, 60 per minute for token and connection endpoints. Retry after the `Retry-After` seconds.

---

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