> ## 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.

# Subscribe automation webhook

> Register a webhook URL for a third-party automation (Zapier, n8n)



## OpenAPI

````yaml /openapi.json post /v1/automation-webhooks/subscribe
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/automation-webhooks/subscribe:
    post:
      tags:
        - automation-webhooks
      summary: Subscribe automation webhook
      description: Register a webhook URL for a third-party automation (Zapier, n8n)
      operationId: subscribeAutomationWebhook
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubscribeAutomationWebhookRequest'
      responses:
        '200':
          description: Webhook subscribed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutomationWebhook'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    SubscribeAutomationWebhookRequest:
      type: object
      properties:
        target_url:
          type: string
          format: uri
          example: https://hooks.zapier.com/hooks/catch/123/abc
        event_type:
          type: string
          enum:
            - email.received
          example: email.received
        provider:
          type: string
          enum:
            - zapier
            - n8n
          example: zapier
        inbox_ids:
          type: array
          items:
            type: string
            format: uuid
          description: Optional array of inbox UUIDs to scope the trigger.
        send_test:
          type: boolean
          description: >-
            Deprecated and ignored on subscribe. Use the dedicated
            automation-webhooks test endpoint to send a sample event.
      required:
        - target_url
        - event_type
        - provider
    AutomationWebhook:
      type: object
      properties:
        id:
          type: string
          format: uuid
        organization_id:
          type: string
          format: uuid
        provider:
          type: string
          enum:
            - zapier
            - n8n
          example: zapier
        event_type:
          type: string
          enum:
            - email.received
          example: email.received
        target_url:
          type: string
          format: uri
        inbox_ids:
          type: array
          nullable: true
          items:
            type: string
            format: uuid
        active:
          type: boolean
        created_at:
          type: string
          format: date-time
      required:
        - id
        - organization_id
        - provider
        - event_type
        - target_url
        - inbox_ids
        - active
        - created_at
    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.

````