---
title: "Add a workflow"
method: POST
path: "/workflows"
tags: ["Workflows"]
---

# Add a workflow

`POST /workflows`

## Request

- Base URL: `https://{prefix}.api.sandbox.checkout.com`
- URL: `https://{prefix}.api.sandbox.checkout.com/workflows`
- Auth: one of:
  - OAuth 2
    - Client credentials
    - Token URL: `string` scopes: `flow`, `flow:workflows`
  - API key in header `Authorization`
- TypeScript: <https://skmtc.dev/checkout/apis/checkout-com-api-reference/docs/workflows/post.ts> (a function with typed inputs; its response is checked against the schema)

Add a new workflow

## Request body

- AddWorkflowRequest
  - `name` string: A name you can use to describe your workflow
  - `active` boolean: Indicates whether the workflow is currently active
  - `conditions` WorkflowCondition[]: Only one condition of the same type is permitted
    - union: The workflow condition
      - object: Condition that enables a source
        - `type` string, required: The type of the workflow condition
        - `events` SourceEventsHashmap, required
      - object: The condition that filters, based on the NAS entity. It does not apply to MBC accounts.
        - `type` string, required: The type of the workflow condition
        - `entities` string[], required: ent_axclravnqf5u5ejkweijnp5zc4
      - object: Condition that filters based on the NAS processing channel. It's not applicable for MBC accounts
        - `type` string, required: The type of the workflow condition
        - `processing_channels` string[], required: pc_axclravnqf5u5ejkweijnp5zc4
  - `actions` WorkflowAction[]: One or more workflow actions
    - `type` string, required: The type of workflow action
    - `url` string, uri, required: Your webhook endpoint URL
    - `headers` object: Optional [HTTP headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers) added to the request
    - `signature` object: Used to produce a signature of the webhook contents that will be included in the `Cko-Signature` header. This value can be computed by you on receipt of a webhook to validate its authenticity.
      - `method` string: The signing method used to sign the webhook. If no value is specified, the value defaults to `HMAC SHA256`.
      - `key` string, required: The key used to sign the webhook

## Response `201`

Workflow added successfully

- AddWorkflowResponse
  - `id` string: The workflow identifier
  - `_links` WorkflowLinks: Links related to the workflow
    - `self` Link, required
      - `href` string, required: The link URL

## Other responses

- `401`: Unauthorized
- `422`: Invalid data was sent
- `500`: Internal Error

---

[API](https://skmtc.dev/checkout/apis/checkout-com-api-reference.md) - [All operations](https://skmtc.dev/checkout/apis/checkout-com-api-reference/llms.txt) - [OpenAPI document](https://skmtc.dev/checkout/apis/checkout-com-api-reference/revisions/0f1abdb1c3e9?raw)
