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

# Create a webhook

> Subscribe a URL to events. The response carries the signing secret. It is shown once; store it.

Subscribe a URL to one or more [events](/public-api/webhooks/events). `name` defaults to the URL's host.

The response carries the signing `secret`. It is shown once, so store it before you do anything else. Use it to [verify each delivery](/public-api/webhooks/overview#verify-the-signature).

The URL must be `https` or `http`. Private, loopback and cloud metadata addresses are refused with `blocked_internal_host`.


## OpenAPI

````yaml POST /v2/webhooks
openapi: 3.1.0
info:
  title: OpenNous REST API
  version: 2.0.0
  description: >-
    Read and write the OpenNous revenue context graph over HTTP. Authenticate
    with a workspace API key.
servers:
  - url: https://api.opennous.cloud
    description: OpenNous Cloud
security:
  - bearerAuth: []
  - apiKeyHeader: []
tags:
  - name: People
  - name: Accounts
  - name: Deals
  - name: Notes
  - name: Attention
  - name: Insights
  - name: Enrich & score
  - name: Organization
  - name: Workflows
  - name: Webhooks
    description: >-
      Subscribe to events and have them pushed to your own stack, with the
      account record attached.
  - name: Usage
paths:
  /v2/webhooks:
    post:
      tags:
        - Webhooks
      summary: Create a webhook
      description: >-
        Subscribe a URL to events. The response carries the signing secret. It
        is shown once; store it.
      operationId: createWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - url
                - events
              properties:
                url:
                  type: string
                  format: uri
                  description: >-
                    Where we POST events. https or http; private and internal
                    hosts are refused.
                events:
                  type: array
                  items:
                    type: string
                    enum:
                      - conversation.call_ended
                      - conversation.reply_received
                      - deal.won
                      - deal.lost
                      - deal.stage_changed
                      - interaction.email_received
                      - interaction.email_bounced
                      - interaction.linkedin_connection_accepted
                      - interaction.linkedin_message_received
                      - interaction.meeting_scheduled
                      - interaction.meeting_held
                  description: Event types to receive. See GET /v2/webhooks/events.
                name:
                  type: string
                  description: Defaults to the URL's host.
            example:
              url: https://hooks.yourco.com/opennous
              events:
                - deal.won
                - deal.lost
                - conversation.call_ended
              name: n8n deal router
      responses:
        '201':
          description: Created. `secret` is shown only in this response.
          content:
            application/json:
              schema:
                type: object
                properties:
                  webhook:
                    $ref: '#/components/schemas/Webhook'
                  secret:
                    type: string
              example:
                webhook:
                  id: 3f1c2b7a-9d4e-4b8a-a6c1-2e5f7d9b0c41
                  name: n8n deal router
                  url: https://hooks.yourco.com/opennous
                  events:
                    - deal.won
                    - deal.lost
                    - conversation.call_ended
                  active: true
                  created_at: '2026-10-01T09:00:00Z'
                  updated_at: '2026-10-01T09:00:00Z'
                secret: whsec_9f2c1e7b4a6d8e0f3b5c7a9d1e2f4a6b
        '400':
          description: >-
            The body is missing something or names an event that does not exist.
            Most 400s also return `available_events`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                url_and_events_required:
                  summary: url_and_events_required
                  value:
                    error: url_and_events_required
                unknown_event:deal.closed:
                  summary: unknown_event
                  value:
                    error: unknown_event:deal.closed
                invalid_url:
                  summary: invalid_url
                  value:
                    error: invalid_url
                invalid_url_protocol:
                  summary: invalid_url_protocol
                  value:
                    error: invalid_url_protocol
                blocked_internal_host:
                  summary: blocked_internal_host
                  value:
                    error: blocked_internal_host
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/ReadOnlyKey'
      security:
        - bearerAuth: []
        - apiKeyHeader: []
components:
  schemas:
    Webhook:
      type: object
      description: >-
        A subscription. The signing secret is never returned here; you get it
        once on create and on rotate.
      properties:
        id:
          type: string
        name:
          type: string
        url:
          type: string
          format: uri
        events:
          type: array
          items:
            type: string
            enum:
              - conversation.call_ended
              - conversation.reply_received
              - deal.won
              - deal.lost
              - deal.stage_changed
              - interaction.email_received
              - interaction.email_bounced
              - interaction.linkedin_connection_accepted
              - interaction.linkedin_message_received
              - interaction.meeting_scheduled
              - interaction.meeting_held
        active:
          type: boolean
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    Error:
      type: object
      description: >-
        Every error response. `error` is a stable machine code. Some errors add
        fields such as `detail`, `supported`, `max`, or `reason`.
      required:
        - error
      properties:
        error:
          type: string
          description: Machine-readable error code.
        detail:
          type: string
          description: Human-readable explanation, when there is one.
      additionalProperties: true
  responses:
    Unauthorized:
      description: Missing, unknown, or expired API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            missing:
              summary: api_key_required
              value:
                error: api_key_required
            invalid:
              summary: invalid_api_key
              value:
                error: invalid_api_key
            expired:
              summary: api_key_expired
              value:
                error: api_key_expired
                detail: >-
                  This API key has expired. Create or rotate a key to get a
                  fresh one.
    ReadOnlyKey:
      description: A read-only key called a write endpoint.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: read_only_key
            detail: >-
              This API key is read-only — it can read context but cannot record,
              modify, connect, or send. Use a read/write key for write
              operations.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Workspace API key. Create one in **Settings → API keys**.
    apiKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
      description: The same key, sent as a header.

````

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