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

# Create a webhook endpoint

> Creates an endpoint with a freshly generated signing secret. Requires the manage:organization permission. The plaintext secret is returned exactly once and never retrievable later.



## OpenAPI

````yaml POST /api/v1/organization/webhooks
openapi: 3.1.0
info:
  title: Weelkit Publishing Integrations API
  description: >-
    Public endpoints for organization custom article fields, API webhook
    destinations, and WordPress.com site discovery. All requests require a
    bearer token and an X-Org-Id organization header.
  version: 1.0.0
servers:
  - url: https://api.weelkit.com
security:
  - bearerAuth: []
paths:
  /api/v1/organization/webhooks:
    post:
      summary: Create a webhook endpoint
      description: >-
        Creates an endpoint with a freshly generated signing secret. Requires
        the manage:organization permission. The plaintext secret is returned
        exactly once and never retrievable later.
      operationId: createWebhookEndpoint
      parameters:
        - name: X-Org-Id
          in: header
          required: true
          schema:
            type: string
            format: uuid
          description: The organization the request acts on.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebhookEndpointRequest'
      responses:
        '201':
          description: Created. The secret appears only in this response.
          content:
            application/json:
              schema:
                type: object
                required:
                  - endpoint
                  - secret
                properties:
                  endpoint:
                    $ref: '#/components/schemas/WebhookEndpoint'
                  secret:
                    $ref: '#/components/schemas/WebhookEndpointSecret'
        '400':
          description: Validation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing or invalid authentication, or no organization context.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: The caller lacks the manage:organization permission.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CreateWebhookEndpointRequest:
      type: object
      required:
        - name
        - url
        - events
      properties:
        name:
          type: string
          maxLength: 120
        url:
          type: string
          format: uri
          examples:
            - https://receiver.example.com/hooks
        events:
          type: array
          items:
            type: string
            enum:
              - article.version.created
    WebhookEndpoint:
      type: object
      required:
        - id
        - name
        - url
        - events
        - isActive
        - secretVersion
        - successRate
        - createdAtUtc
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          maxLength: 120
        url:
          type: string
          format: uri
          description: >-
            HTTPS endpoint. Loopback, private, link-local, and metadata hosts
            are rejected.
        events:
          type: array
          items:
            type: string
            enum:
              - article.version.created
        isActive:
          type: boolean
        secretVersion:
          type: integer
          description: Monotonic signing-secret rotation counter.
        secretRotatedAtUtc:
          type:
            - string
            - 'null'
          format: date-time
        successRate:
          type:
            - number
            - 'null'
          description: >-
            Success percentage over the latest 100 recorded deliveries. Null
            until a delivery has been recorded; unsent queued events do not
            count.
        lastDeliveryAtUtc:
          type:
            - string
            - 'null'
          format: date-time
        createdAtUtc:
          type: string
          format: date-time
    WebhookEndpointSecret:
      type: object
      description: >-
        Returned exactly once at creation or rotation; the plaintext secret is
        never retrievable afterwards.
      required:
        - endpointId
        - secret
        - secretVersion
      properties:
        endpointId:
          type: string
          format: uuid
        secret:
          type: string
          description: >-
            Signing secret with the whsec_ prefix. Shown once; store it
            immediately.
          examples:
            - whsec_examplesecretexamplesecretexample
        secretVersion:
          type: integer
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Stable error code, e.g. Validation, Conflict, NotFound, Forbidden.
        message:
          type: string
        errors:
          type:
            - array
            - 'null'
          items:
            type: object
            required:
              - field
              - message
            properties:
              field:
                type: string
              message:
                type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Weelkit access token.

````

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