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

# Register a webhook

> Asks miniDesk to send the chosen events to a URL. The response carries the signing `secret`, shown this once: keep it to check the `miniDesk-Signature` header on every delivery.

Registering a URL this key already registered does not make a second webhook. The same webhook comes back active, with the events you sent replacing the old ones and a new secret, and the answer is 200 instead of 201. Use it to switch back on a webhook paused because deliveries kept failing. A webhook an owner paused by hand stays paused: registering it again answers 409, "An owner paused this webhook. Ask them to resume it in miniDesk."

The URL must be a public `https` address. Anything else answers 400 with `field: "url"` and one message for every reason, "Use a public https address. This one is not allowed." A workspace can have up to 10 webhooks; one more answers 409. The workspace owners get an email naming the key and the receiving host whenever a key adds a webhook. A server where webhooks are not set up answers 503.

An API key only sees the webhooks it registered. A webhook added in the dashboard or by another key is not listed, and its id answers 404.



## OpenAPI

````yaml /api-reference/openapi.json post /webhooks
openapi: 3.1.0
info:
  title: miniDesk API
  version: 1.0.0
  description: >-
    Create and work support tickets from your own systems. Every response
    carries an `X-Request-Id`; quote it when reporting a problem.
servers:
  - url: https://api.minidesk.ai/v1
security:
  - bearerAuth: []
paths:
  /webhooks:
    post:
      tags:
        - Webhooks
      summary: Register a webhook
      description: >-
        Asks miniDesk to send the chosen events to a URL. The response carries
        the signing `secret`, shown this once: keep it to check the
        `miniDesk-Signature` header on every delivery.


        Registering a URL this key already registered does not make a second
        webhook. The same webhook comes back active, with the events you sent
        replacing the old ones and a new secret, and the answer is 200 instead
        of 201. Use it to switch back on a webhook paused because deliveries
        kept failing. A webhook an owner paused by hand stays paused:
        registering it again answers 409, "An owner paused this webhook. Ask
        them to resume it in miniDesk."


        The URL must be a public `https` address. Anything else answers 400 with
        `field: "url"` and one message for every reason, "Use a public https
        address. This one is not allowed." A workspace can have up to 10
        webhooks; one more answers 409. The workspace owners get an email naming
        the key and the receiving host whenever a key adds a webhook. A server
        where webhooks are not set up answers 503.


        An API key only sees the webhooks it registered. A webhook added in the
        dashboard or by another key is not listed, and its id answers 404.
      operationId: createWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                  minLength: 1
                  maxLength: 2000
                events:
                  minItems: 1
                  maxItems: 4
                  type: array
                  items:
                    type: string
                    enum:
                      - conversation.created
                      - message.received
                      - conversation.status_changed
                      - conversation.assigned
              required:
                - url
                - events
      responses:
        '200':
          description: This key already had the URL. It is active again, with a new secret.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreatedWebhook'
        '201':
          description: The webhook was created. The secret is not shown again.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreatedWebhook'
        '400':
          description: The body failed validation. `field` names the offending property.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing, malformed, or revoked credential.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Conflicts with existing data. `field` names the offending property.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Over the rate limit. See the `Retry-After` header.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: A dependency is unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CreatedWebhook:
      type: object
      properties:
        id:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        url:
          type: string
        events:
          type: array
          items:
            type: string
            enum:
              - conversation.created
              - message.received
              - conversation.status_changed
              - conversation.assigned
        status:
          type: string
          enum:
            - active
            - paused
        created_at:
          type: string
        secret:
          type: string
      required:
        - id
        - url
        - events
        - status
        - created_at
        - secret
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - validation_failed
                - invalid_credential
                - identity_required
                - identity_invalid
                - forbidden
                - email_unconfirmed
                - seat_unavailable
                - not_found
                - no_account
                - conflict
                - quota_exceeded
                - invalid_transition
                - ai_disabled
                - app_outdated
                - rate_limited
                - internal_error
                - service_unavailable
            message:
              type: string
            field:
              type: string
          required:
            - code
            - message
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        An API credential from **Settings → API**, sent as `Authorization:
        Bearer mdsk_api_...`. Issued per workspace and shown once.

````

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