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

# Create forwarding rule

> Create an automated email forwarding rule



## OpenAPI

````yaml /openapi.json post /v1/forwarding-rules
openapi: 3.0.3
info:
  title: Emailr API
  version: 1.0.0
servers:
  - url: https://api.emailr.dev
    description: Production
security: []
tags:
  - name: emails
    description: Email sending and management
  - name: contacts
    description: Contact management
  - name: templates
    description: Email template management
  - name: domains
    description: Domain verification and management
  - name: webhooks
    description: Webhook configuration
  - name: broadcasts
    description: Broadcast campaign management
  - name: segments
    description: Contact segmentation
paths:
  /v1/forwarding-rules:
    post:
      tags:
        - forwarding-rules
      summary: Create forwarding rule
      description: Create an automated email forwarding rule
      operationId: createForwardingRule
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                from_pattern:
                  type: string
                  minLength: 1
                to_addresses:
                  type: array
                  items:
                    type: string
                    format: email
                  minItems: 1
                active:
                  type: boolean
                  default: true
              required:
                - name
                - from_pattern
                - to_addresses
      responses:
        '201':
          description: Forwarding rule created
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  success:
                    type: boolean
                required:
                  - id
                  - success
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
          example: An error occurred
        code:
          type: string
          example: VALIDATION_ERROR
        details: {}
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: API key authentication. Use your API key as the bearer token.

````