> ## Documentation Index
> Fetch the complete documentation index at: https://docs.n8negri.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Rule



## OpenAPI

````yaml /api-reference/openapi.json post /v1/event-rules
openapi: 3.1.0
info:
  title: Imtegrate API
  version: dev
servers: []
security: []
paths:
  /v1/event-rules:
    post:
      tags:
        - event-rules
      summary: Create Rule
      operationId: create_rule_v1_event_rules_post
      parameters:
        - name: Authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EventRuleCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventRuleOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    EventRuleCreate:
      properties:
        name:
          type: string
          maxLength: 120
          minLength: 2
          title: Name
        trigger_type:
          type: string
          pattern: ^(birthday|work_anniversary|cron)$
          title: Trigger Type
        schedule_cron:
          anyOf:
            - type: string
              maxLength: 120
            - type: 'null'
          title: Schedule Cron
        timezone:
          type: string
          maxLength: 64
          title: Timezone
          default: UTC
        template_id:
          type: string
          format: uuid
          title: Template Id
        output_format:
          type: string
          pattern: ^(png|jpg|mp4)$
          title: Output Format
          default: png
        filter:
          additionalProperties: true
          type: object
          title: Filter
        modifications_template:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Modifications Template
        webhook_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Webhook Url
        enabled:
          type: boolean
          title: Enabled
          default: true
      type: object
      required:
        - name
        - trigger_type
        - template_id
      title: EventRuleCreate
    EventRuleOut:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        org_id:
          type: string
          format: uuid
          title: Org Id
        name:
          type: string
          title: Name
        trigger_type:
          type: string
          title: Trigger Type
        schedule_cron:
          anyOf:
            - type: string
            - type: 'null'
          title: Schedule Cron
        timezone:
          type: string
          title: Timezone
        template_id:
          type: string
          format: uuid
          title: Template Id
        output_format:
          type: string
          title: Output Format
        filter:
          additionalProperties: true
          type: object
          title: Filter
        modifications_template:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Modifications Template
        webhook_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Webhook Url
        enabled:
          type: boolean
          title: Enabled
        last_run_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Run At
        next_run_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Next Run At
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - id
        - org_id
        - name
        - trigger_type
        - schedule_cron
        - timezone
        - template_id
        - output_format
        - filter
        - modifications_template
        - webhook_url
        - enabled
        - last_run_at
        - next_run_at
        - created_at
      title: EventRuleOut
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````