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

# Create a Webhook

> The `secret` field is only returned on creation — save it securely.



## OpenAPI

````yaml POST /v1/webhooks
openapi: 3.1.0
info:
  title: Plexos Pay API
  description: Mobile Money Payment Gateway for African Markets
  version: 1.0.0
  contact:
    name: Plexos Pay
    url: https://plexospay.com
servers:
  - url: https://api.plexospay.com
    description: Production
security:
  - bearerAuth: []
paths:
  /v1/webhooks:
    post:
      tags:
        - Webhooks
      summary: Create a webhook endpoint
      description: The `secret` field is only returned on creation — save it securely.
      operationId: createWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - url
                - events
              properties:
                url:
                  type: string
                events:
                  type: array
                  items:
                    type: string
                  description: >-
                    Event types: payment.debited, payment.failed,
                    refund.succeeded, etc.
                description:
                  type: string
      responses:
        '200':
          description: Webhook created (includes secret)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhook'
components:
  schemas:
    Webhook:
      type: object
      properties:
        id:
          type: string
          example: we_abc123
        url:
          type: string
        events:
          type: array
          items:
            type: string
        status:
          $ref: '#/components/schemas/WebhookStatus'
        description:
          type: string
          nullable: true
        secret:
          type: string
          description: Only returned on creation
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    WebhookStatus:
      type: string
      enum:
        - ACTIVE
        - DISABLED
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key starting with `sk_live_` or `sk_test_`

````