---
title: "Push a workflow from CLI"
method: POST
path: "/v1/workflows/push"
tags: ["workflows"]
---

# Push a workflow from CLI

`POST /v1/workflows/push`

## Request

- Base URL: `https://api.wraps.dev`
- URL: `https://api.wraps.dev/v1/workflows/push`
- Auth: HTTP bearer

Upserts a workflow parsed from TypeScript source. Used by `wraps email workflows push`.

## Request body

- object
  - `slug` string, required: Workflow slug (filename without extension)
  - `name` string, required: Workflow display name
  - `description` string: Workflow description
  - `sourceTs` string, required: Original TypeScript source code
  - `sourceHash` string, required: SHA256 hash of source file
  - `steps` object[], required: Flat array of workflow steps
    - `id` string, required
    - `type` string, required
    - `name` string, required
    - `position` object, required
      - `x` number, required
      - `y` number, required
    - `config` unknown, required
  - `transitions` object[], required: Flat array of step transitions
    - `id` string, required
    - `fromStepId` string, required
    - `toStepId` string, required
    - `condition` object
      - `branch` string, required
  - `triggerType` string, required: Trigger type
  - `triggerConfig` unknown
  - `settings` object
    - `allowReentry` boolean
    - `reentryDelaySeconds` number
    - `maxConcurrentExecutions` number
    - `contactCooldownSeconds` number
  - `defaults` object
    - `from` string
    - `fromName` string
    - `replyTo` string
    - `senderId` string
  - `cliProjectPath` string: Path in project (e.g. workflows/onboarding.ts)
  - `force` boolean: Force overwrite even if edited on dashboard
  - `draft` boolean: Push as draft without enabling the workflow

## Response `200`

## Other responses

- `400`: Malformed request — unparseable body or an invalid parameter.
- `401`: Missing, malformed, or revoked credentials. Send `Authorization: Bearer <api key>`.
- `403`: Authenticated, but the resource belongs to another organization.
- `404`: No such route, or no such resource in this organization.
- `422`: The request parsed but failed schema validation.
- `429`: Rate limit exceeded. Wait for the window named by the RateLimit headers.
- `500`: Unexpected server failure. Safe to retry with backoff; quote `requestId` if it persists.

---

[API](https://skmtc.dev/wraps/apis/wraps-platform-api.md) · [All operations](https://skmtc.dev/wraps/apis/wraps-platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/wraps/apis/wraps-platform-api/revisions/12116fb21af7?raw)
