---
title: "Create a workflow (admin only)"
method: POST
path: "/workflows"
tags: ["Workflows"]
---

# Create a workflow (admin only)

`POST /workflows`

## Request

- Base URL: `https://there-there.app/api`
- URL: `https://there-there.app/api/workflows`
- Auth: HTTP bearer

## Headers

- `X-Workspace-Id` integer

## Request body

- object
  - `name` string, required
  - `description` string, nullable
  - `trigger_type` 'on_new_ticket' | 'on_inbound_message' | 'on_no_reply' | 'manual', required
  - `trigger_parameters` object, nullable: Required for on_no_reply. The unit defaults to hours. Durations are capped at 30 days in total. With only_business_hours, minutes and hours pause outside workspace business hours, and days count business days; fully closed days do not count.
    - `value` integer
    - `unit` 'minutes' | 'hours' | 'days'
    - `only_business_hours` boolean
  - `condition_match_type` 'all' | 'any'
  - `is_enabled` boolean
  - `conditions` WorkflowConditionInput[]
    - `type` 'body_contains' | 'channel_is' | 'contact_is_new' | 'from_domain_equals' | 'from_email_contains' | 'from_email_equals' | 'subject_contains' | 'subject_equals', required
    - `parameters` object, required
  - `actions` WorkflowActionInput[]
    - `type` string, required
    - `parameters` object, required

## Response `201`

Workflow created

- object
  - `data` Workflow
    - `id` integer
    - `ulid` string
    - `name` string
    - `description` string, nullable
    - `trigger_type` 'on_new_ticket' | 'on_inbound_message' | 'on_no_reply' | 'manual'
    - `trigger_parameters` object, nullable: Present for on_no_reply workflows. The unit defaults to hours. Durations are capped at 30 days in total. With only_business_hours, minutes and hours pause outside workspace business hours, and days count business days; fully closed days do not count.
      - `value` integer: Duration amount. Combined with unit, capped at 30 days in total.
      - `unit` 'minutes' | 'hours' | 'days'
      - `only_business_hours` boolean
    - `condition_match_type` 'all' | 'any'
    - `is_enabled` boolean
    - `order_column` integer
    - `created_at` string, date-time
    - `conditions` object[]
      - `id` integer
      - `ulid` string
      - `type` string
      - `parameters` object
    - `actions` object[]
      - `id` integer
      - `ulid` string
      - `type` string
      - `parameters` object

---

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