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

# Create a module webhook endpoint

> Creates a webhook endpoint for canonical events consumed by the installed module.



## OpenAPI

````yaml https://api.develop.fourdos.dev/openapi/partner.json post /v1/installations/{installationId}/webhook-endpoints
openapi: 3.1.0
info:
  title: 4D OS Partner API
  version: 0.1.0
  description: >-
    REST API for 4D OS partners. Authenticate with your organization API key:
    `Authorization: Bearer <key>`.


    Requests and responses are JSON with `snake_case` field names. Errors share
    one envelope: `{ "error": { "code", "status", "message", "details"? } }`.


    Mutating endpoints that declare it accept an `Idempotency-Key` header so
    retries are safe.


    Bulk-migrating members? See the [Migrating to 4D
    guide](https://docs.fourdos.dev/walkthroughs/migrate-existing-members) for
    the canonical import schema, a worked example, and the `/v1/imports`
    sequence.
servers:
  - url: https://api.develop.fourdos.dev
security:
  - partnerApiKey: []
tags:
  - name: Users
    description: Create, read, and manage users and their org membership
  - name: Imports
    description: Bulk member import jobs (staging → validate → commit)
  - name: API keys
    description: Issue, list, and revoke server-side organization API keys
  - name: Modules
    description: >-
      Publish private modules, install visible modules, and manage their
      credentials
  - name: Ingest
    description: Receive signed native events from an installed module
  - name: Engagement
    description: Browser event tracking (publishable keys) and tracking-key management
paths:
  /v1/installations/{installationId}/webhook-endpoints:
    post:
      tags:
        - Modules
      summary: Create a module webhook endpoint
      description: >-
        Creates a webhook endpoint for canonical events consumed by the
        installed module.
      operationId: createModuleWebhookEndpoint
      parameters:
        - name: installationId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebhookEndpointBody'
      responses:
        '201':
          description: Module webhook endpoint created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModuleWebhookEndpointCreatedResponse'
        '401':
          description: Authentication is required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: A partner admin or platform admin session is required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Module installation not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - adminSession: []
components:
  schemas:
    CreateWebhookEndpointBody:
      type: object
      properties:
        url:
          type: string
          format: uri
        subscribed_event_types:
          minItems: 1
          type: array
          items:
            type: string
      required:
        - url
        - subscribed_event_types
    ModuleWebhookEndpointCreatedResponse:
      type: object
      properties:
        id:
          type: string
        module_installation_id:
          type: string
        organization_id:
          type: string
        url:
          type: string
        subscribed_event_types:
          type: array
          items:
            type: string
        status:
          type: string
          enum:
            - active
            - disabled
        created_at:
          type: string
        updated_at:
          type: string
        signing_secret:
          type: string
      required:
        - id
        - module_installation_id
        - organization_id
        - url
        - subscribed_event_types
        - status
        - created_at
        - updated_at
        - signing_secret
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            status:
              type: integer
            message:
              type: string
            details:
              type: object
              additionalProperties: true
          required:
            - code
            - status
            - message
      required:
        - error
  securitySchemes:
    partnerApiKey:
      type: http
      scheme: bearer
      description: >-
        Organization API key (`org_...`) sent as `Authorization: Bearer <key>`.
        Keys are scoped to one organization; every request operates within that
        tenant.
    adminSession:
      type: http
      scheme: bearer
      description: >-
        Partner admin session token sent as `Authorization: Bearer <token>`.
        Obtained by signing in (console or the email OTP endpoints) and
        completing the second factor; see the Authentication page.

````