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

# Create a webhook

> Creates an outbound alert destination: Slack, Discord, or your own HTTPS endpoint. See [Anomaly detection](/govern/anomaly).

- `url` must be HTTPS and must not point at localhost or internal addresses. Slack URLs must be on `hooks.slack.com`. Discord URLs must be on `discord.com` or `discordapp.com`.
- Each type is plan-gated (`403 plan_feature_unavailable`).
- The limit is 10 webhooks per organization.

`http` webhooks are signed, and the response includes the signing `secret` once. See [Delivery and signing](/api-reference/webhook-signing).

**Required permission:** `alerts:manage`




## OpenAPI

````yaml /api-reference/openapi.yaml post /api/v1/webhooks
openapi: 3.1.0
info:
  title: Igris Management API
  version: '1'
  description: >-
    REST API for managing Igris connections, policies, sessions, audit events
    and alerts.
servers:
  - url: https://api.igrisecurity.com
security:
  - bearerAuth: []
tags:
  - name: Connections
  - name: Policies
  - name: Sessions
  - name: Audit Events
  - name: Incidents
  - name: Webhooks
  - name: API Keys
  - name: Members
  - name: LLM Providers
  - name: LLM Cost
  - name: Observe
paths:
  /api/v1/webhooks:
    post:
      tags:
        - Webhooks
      summary: Create a webhook
      description: >
        Creates an outbound alert destination: Slack, Discord, or your own HTTPS
        endpoint. See [Anomaly detection](/govern/anomaly).


        - `url` must be HTTPS and must not point at localhost or internal
        addresses. Slack URLs must be on `hooks.slack.com`. Discord URLs must be
        on `discord.com` or `discordapp.com`.

        - Each type is plan-gated (`403 plan_feature_unavailable`).

        - The limit is 10 webhooks per organization.


        `http` webhooks are signed, and the response includes the signing
        `secret` once. See [Delivery and
        signing](/api-reference/webhook-signing).


        **Required permission:** `alerts:manage`
      operationId: createWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - type
                - url
                - eventTypes
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 100
                type:
                  type: string
                  enum:
                    - slack
                    - discord
                    - http
                url:
                  type: string
                  format: uri
                  description: Must start with `https://`.
                eventTypes:
                  type: array
                  minItems: 1
                  items:
                    type: string
                    enum:
                      - policy_deny
                      - anomaly
                      - session_suspended
                enabled:
                  type: boolean
                  default: true
            example:
              name: Security alerts
              type: http
              url: https://your-service.com/hooks/igris
              eventTypes:
                - policy_deny
                - anomaly
                - session_suspended
              enabled: true
      responses:
        '201':
          description: The created webhook. `secret` is present for `http` webhooks only.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/WebhookWithSecret'
              example:
                data:
                  id: 4d5e6f70-0000-4000-8000-00000000000a
                  name: Security alerts
                  type: http
                  url: https://your-service.com/...****
                  eventTypes:
                    - policy_deny
                    - anomaly
                    - session_suspended
                  enabled: true
                  hasSecret: true
                  secret: whsec_3q2+7wXyZ...
                  createdAt: '2026-01-01T00:00:00Z'
                  updatedAt: '2026-01-01T00:00:00Z'
        '400':
          description: >
            The URL points at an internal address, the host does not match the
            type (`webhook_url_mismatch_integration`), or the organization
            already has 10 webhooks.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: webhook_url_mismatch_integration
                reason: Slack webhooks must use hooks.slack.com
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Missing permission, or the webhook type is not on your plan.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ForbiddenError'
                  - $ref: '#/components/schemas/PlanError'
              example:
                error: plan_feature_unavailable
                feature: custom-webhooks
                currentPlan: free
                upgradeTo: growth
        '422':
          description: Validation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: URL must use HTTPS
components:
  schemas:
    WebhookWithSecret:
      allOf:
        - $ref: '#/components/schemas/Webhook'
        - type: object
          properties:
            secret:
              type: string
              description: >-
                The signing secret, including its `whsec_` prefix. Shown only in
                this response; store it now.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
    ForbiddenError:
      type: object
      properties:
        error:
          type: string
          example: Forbidden
        required:
          type: string
          description: The permission the caller lacks.
          example: policies:write
    PlanError:
      type: object
      description: Plan limit or plan feature errors. See Limits and errors.
      properties:
        error:
          type: string
          example: PLAN_LIMIT_REACHED
        code:
          type: string
          example: PLAN_LIMIT_REACHED
        feature:
          type: string
        detector:
          type: string
          description: The detector your plan does not include.
        limit:
          type: string
        current:
          type: integer
        max:
          type: integer
        plan:
          type: string
        currentPlan:
          type: string
        upgradeTo:
          type: string
    Webhook:
      type: object
      description: >
        A webhook. The URL is masked in every response. Only `hasSecret` is
        exposed, never the secret itself, except the one-time `secret` returned
        when a signing secret is issued.
      properties:
        id:
          type: string
          format: uuid
        organizationId:
          type: string
        name:
          type: string
        type:
          type: string
          enum:
            - slack
            - discord
            - http
        url:
          type: string
          description: Masked
          for example `https://your-service.com/...****`.: null
        eventTypes:
          type: array
          items:
            type: string
            enum:
              - policy_deny
              - anomaly
              - session_suspended
        enabled:
          type: boolean
        hasSecret:
          type: boolean
          description: Whether deliveries are signed.
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
  responses:
    Unauthorized:
      description: No valid session or API key, or the key's creator is no longer a member.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Unauthorized
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: ig_...
      description: >-
        An Igris API key. It acts with the current role and permission overrides
        of the member who created it.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.