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

# Create or update the webhook

> Sets the HTTPS address that receives your events. The first call returns the signing secret **once**. Saving again also switches a webhook back on after it was switched off. See the Webhooks guide.



## OpenAPI

````yaml /openapi.json put /webhook
openapi: 3.0.3
info:
  title: Wasmou API
  version: 1.0.0
  description: >-
    Sell digital goods: catalog, purchase, delivery, game top-ups and per-client
    stock. All amounts are in DZD.
servers:
  - url: https://api.wasmou.net/api
    description: Production
security: []
paths:
  /webhook:
    put:
      tags:
        - Webhooks
      summary: Create or update the webhook
      description: >-
        Sets the HTTPS address that receives your events. The first call returns
        the signing secret **once**. Saving again also switches a webhook back
        on after it was switched off. See the Webhooks guide.
      operationId: saveWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - url
              properties:
                url:
                  type: string
                  example: https://your-site.com/wasmou-webhook
                  description: Public https:// address, up to 500 characters.
                events:
                  type: array
                  items:
                    type: string
                    enum:
                      - order.completed
                      - order.failed
                      - order.refunded
                      - order.canceled
                      - flexy.completed
                      - flexy.failed
                  description: Leave out to receive every event.
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: success
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      configured:
                        type: boolean
                      url:
                        type: string
                        example: https://your-site.com/wasmou-webhook
                      enabled:
                        type: boolean
                      events:
                        type: array
                        nullable: true
                        items:
                          type: string
                        description: null means every event
                      events_available:
                        type: array
                        items:
                          type: string
                      secret_hint:
                        type: string
                        example: …a1b2
                      disabled_reason:
                        type: string
                        nullable: true
                      created_at:
                        type: string
                      last_24h:
                        type: object
                        properties:
                          delivered:
                            type: integer
                          failed:
                            type: integer
                          pending:
                            type: integer
                      secret:
                        type: string
                        description: >-
                          Only returned when the webhook is first created. Shown
                          once.
        '201':
          description: Created. Contains the secret, shown once.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: success
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      configured:
                        type: boolean
                      url:
                        type: string
                        example: https://your-site.com/wasmou-webhook
                      enabled:
                        type: boolean
                      events:
                        type: array
                        nullable: true
                        items:
                          type: string
                        description: null means every event
                      events_available:
                        type: array
                        items:
                          type: string
                      secret_hint:
                        type: string
                        example: …a1b2
                      disabled_reason:
                        type: string
                        nullable: true
                      created_at:
                        type: string
                      last_24h:
                        type: object
                        properties:
                          delivered:
                            type: integer
                          failed:
                            type: integer
                          pending:
                            type: integer
                      secret:
                        type: string
                        description: >-
                          Only returned when the webhook is first created. Shown
                          once.
        '401':
          description: Missing or invalid API key
        '422':
          description: The URL is not valid or not public
      security:
        - ApiKey: []
components:
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: X-Api-Key
      description: Your API key from the Wasmou app (API access).

````

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