---
title: "Creates a new automation workflow rule."
url: "https://earlyaccess.developers.bynder.com/apis/automation-workflow-api-1/versions/428d2b99-ec99-455a-8d22-c0d61a9bb810/operations/postRules"
---

> Full API specification: https://earlyaccess.developers.bynder.com/apis/automation-workflow-api-1/versions/428d2b99-ec99-455a-8d22-c0d61a9bb810.md

# Creates a new automation workflow rule.

`POST` `/rules`

Operation ID: `postRules`

Creates a new automation workflow rule. Ensure that you check the available triggers, conditions, and actions to use valid options. Use the following endpoints to check which options are available before creating a rule: - `/triggers` – lists available triggers - `/conditions` – lists available conditions - `/actions` – lists available actions

## Request body (required)

Content types: `application/json`

## Responses

- `200`
- `400`
- `401`

## OpenAPI definition

```yaml
openapi: 3.1.0
info:
  title: Automation Workflow API
  version: 1.0.0
servers:
  - url: https://{your-bynder-domain}/api/1/automation-workflow/
paths:
  /rules:
    post:
      description: "

        Creates a new automation workflow rule. Ensure that you check the
        available triggers, conditions, and actions to use valid options.


        Use the following endpoints to check which options are available before
        creating a rule:

        - `/triggers` – lists available triggers

        - `/conditions` – lists available conditions

        - `/actions` – lists available actions

        \        "
      operationId: postRules
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AutomationWorkflowRuleBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateAutomationWorkflowRuleResponse"
          description: ""
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
          description: ""
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorAuthorizationResponse"
          description: ""
      security:
        - {}
        - httpAuth: []
      summary: Creates a new automation workflow rule.
      tags:
        - Automation Workflow Rules
security:
  - {}
  - httpAuth: []
components:
  schemas:
    AutomationWorkflowRuleBody:
      properties:
        name:
          type: string
        steps:
          items:
            $ref: "#/components/schemas/AutomationWorkflowStep"
          type: array
        triggers:
          items:
            type: string
          type: array
      required:
        - name
      title: AutomationWorkflowRuleBody
      type: object
    CreateAutomationWorkflowRuleResponse:
      properties:
        account_id:
          type: string
        created_by_id:
          type: string
        date_created:
          type: string
        date_modified:
          type: string
        edited_by_id:
          type: string
        id:
          type: string
        name:
          type: string
        status:
          type: string
      required:
        - id
        - status
        - name
        - account_id
        - created_by_id
        - date_created
        - date_modified
      title: CreateAutomationWorkflowRuleResponse
      type: object
    ErrorResponse:
      properties:
        message:
          type: string
      required:
        - message
      title: ErrorResponse
      type: object
    ErrorAuthorizationResponse:
      properties:
        message:
          type: string
      required:
        - message
      title: ErrorAuthorizationResponse
      type: object
    AutomationWorkflowStep:
      properties:
        actions:
          items:
            $ref: "#/components/schemas/AutomationWorkflowStepActionBase"
          type: array
        conditions:
          items:
            $ref: "#/components/schemas/AndCondition"
          type: array
        step_triggers:
          items:
            type: string
          type: array
      title: AutomationWorkflowStep
      type: object
    AutomationWorkflowStepActionBase:
      oneOf:
        - $ref: "#/components/schemas/AutomationWorkflowStepActionAgent"
        - $ref: "#/components/schemas/AutomationWorkflowStepAddToCollectionAction"
      title: AutomationWorkflowStepActionBase
    AndCondition:
      properties:
        and:
          items:
            $ref: "#/components/schemas/LeafCondition"
          type: array
      title: AndCondition
      type: object
    AutomationWorkflowStepActionAgent:
      properties:
        action_type:
          type: string
        data:
          $ref: "#/components/schemas/StepActionAgentData"
        is_valid:
          type: boolean
      required:
        - action_type
        - data
      title: AutomationWorkflowStepActionAgent
      type: object
    AutomationWorkflowStepAddToCollectionAction:
      properties:
        action_type:
          type: string
        data:
          $ref: "#/components/schemas/StepAddToCollectionActionData"
        is_valid:
          type: boolean
      required:
        - action_type
        - data
      title: AutomationWorkflowStepAddToCollectionAction
      type: object
    LeafCondition:
      properties:
        condition_type:
          type: string
        expression:
          $ref: "#/components/schemas/ExpressionCondition"
        is_valid:
          type: boolean
      required:
        - condition_type
        - expression
      title: LeafCondition
      type: object
    StepActionAgentData:
      properties:
        agent_id:
          type: string
        run_name:
          type: string
      required:
        - agent_id
      title: StepActionAgentData
      type: object
    StepAddToCollectionActionData:
      properties:
        collection_id:
          type: string
      required:
        - collection_id
      title: StepAddToCollectionActionData
      type: object
    ExpressionCondition:
      properties:
        operator:
          type: string
        term:
          items:
            $ref: "#/components/schemas/Term"
          type: array
      required:
        - operator
      title: ExpressionCondition
      type: object
    Term:
      oneOf:
        - $ref: "#/components/schemas/ArchiveTerm"
        - $ref: "#/components/schemas/AssetTypeTerm"
        - $ref: "#/components/schemas/MetapropertyOptionTerm"
      title: Term
    ArchiveTerm:
      properties:
        offset_amount:
          format: int32
          type: integer
        offset_unit:
          type: string
      required:
        - offset_amount
        - offset_unit
      title: ArchiveTerm
      type: object
    AssetTypeTerm:
      properties:
        asset_type:
          type: string
      required:
        - asset_type
      title: AssetTypeTerm
      type: object
    MetapropertyOptionTerm:
      properties:
        metaproperty_id:
          format: uuid
          type: string
        metaproperty_option_id:
          format: uuid
          type: string
      required:
        - metaproperty_id
      title: MetapropertyOptionTerm
      type: object
  securitySchemes:
    httpAuth:
      scheme: bearer
      type: http
```
