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

> Create a new webhook endpoint for event notifications



## OpenAPI

````yaml /openapi.json post /v1/webhooks
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/webhooks:
    post:
      tags:
        - webhooks
      summary: Create webhook
      description: Create a new webhook endpoint for event notifications
      operationId: createWebhook
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebhookRequest'
      responses:
        '200':
          description: Webhook created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhook'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    CreateWebhookRequest:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          example: Email Events Webhook
        url:
          type: string
          format: uri
          example: https://api.example.com/webhooks
        type:
          type: string
          enum:
            - transactional
            - domain
            - receiving
          description: >-
            Webhook category type that determines which events the webhook
            subscribes to
          example: transactional
        inbox_ids:
          type: array
          items:
            type: string
            format: uuid
          description: >-
            Optional array of inbox UUIDs to scope receiving webhooks. Only
            applicable when type is 'receiving'.
          example:
            - 123e4567-e89b-12d3-a456-426614174000
      required:
        - name
        - url
        - type
    Webhook:
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        organization_id:
          type: string
          format: uuid
        name:
          type: string
        url:
          type: string
          format: uri
        type:
          type: string
          enum:
            - transactional
            - domain
            - receiving
          description: >-
            Webhook category type that determines which events the webhook
            subscribes to
          example: transactional
        events:
          type: array
          items:
            type: string
          description: Derived list of events based on the webhook type. Read-only.
        inbox_ids:
          type: array
          nullable: true
          items:
            type: string
            format: uuid
          description: >-
            Inbox UUIDs for scoping receiving webhooks. Null for non-receiving
            types.
        secret:
          type: string
        active:
          type: boolean
        created_by:
          type: string
          nullable: true
          format: uuid
        created_at:
          type: string
          format: date-time
      required:
        - id
        - organization_id
        - name
        - url
        - type
        - events
        - inbox_ids
        - secret
        - active
        - created_by
        - 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.

````