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

# Delete a webhook

> Removes the webhook from 2501. With servicenow_admin, 2501 first deletes the Business Rule it named at creation from the instance of its gateway, and keeps the webhook when ServiceNow refuses, or with 409 when the rule with that name does not send to this webhook. Without it, deactivate or delete the rule in ServiceNow yourself. The body is optional.



## OpenAPI

````yaml /0.19/openapi.json delete /api/v1/webhooks/{id}
openapi: 3.0.3
info:
  title: 2501 Public API
  version: v1
  description: >-
    The stable, versioned HTTP API for driving 2501 as code. See the API
    Overview for authentication, the org_id rule, cursor pagination, and the
    error envelope.
servers:
  - url: https://{command_center_host}
    variables:
      command_center_host:
        default: your-command-center-host
        description: Your Command Center host
security:
  - bearerAuth: []
paths:
  /api/v1/webhooks/{id}:
    delete:
      tags:
        - Webhooks
      summary: Delete a webhook
      description: >-
        Removes the webhook from 2501. With servicenow_admin, 2501 first deletes
        the Business Rule it named at creation from the instance of its gateway,
        and keeps the webhook when ServiceNow refuses, or with 409 when the rule
        with that name does not send to this webhook. Without it, deactivate or
        delete the rule in ServiceNow yourself. The body is optional.
      parameters:
        - schema:
            type: string
          required: true
          name: id
          in: path
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                servicenow_admin:
                  type: object
                  properties:
                    username:
                      type: string
                      minLength: 1
                    password:
                      type: string
                      minLength: 1
                  required:
                    - username
                    - password
                  additionalProperties: false
                  description: >-
                    A ServiceNow account allowed to write Business Rules. When
                    present, 2501 creates or deletes the Business Rule in the
                    instance of the gateway. Used for this request only: never
                    stored, logged or returned.
              default: {}
      responses:
        '200':
          description: Delete result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookDeleteResult'
        '400':
          description: >-
            Bad request - a field is missing, malformed, or not allowed
            (VALIDATION_FAILED, BAD_REQUEST, INVALID_CURSOR)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: >-
            No credentials, or a key that is invalid, revoked, or expired
            (UNAUTHORIZED)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            Authenticated but not allowed (FORBIDDEN, ORG_ACCESS_DENIED,
            STEP_UP_REFUSED, TWO_FACTOR_ENROLLMENT_REQUIRED,
            LICENSE_CAP_REACHED, LICENSE_EXPIRED)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No such row that this caller can see (NOT_FOUND)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: >-
            The write conflicts with existing data (CONFLICT, DUPLICATE_KEY,
            FOREIGN_KEY_VIOLATION, RESOURCE_IN_USE)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: >-
            An external system the request reaches refused it or did not answer
            (ENGINE_ERROR)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    WebhookDeleteResult:
      type: object
      properties:
        id:
          type: string
          example: whk_9c31e07b-...
        deleted:
          type: boolean
          enum:
            - true
        business_rule_deleted:
          type: boolean
          description: >-
            With servicenow_admin only: whether a Business Rule named after the
            webhook existed in the instance and was deleted.
      required:
        - id
        - deleted
    Error:
      type: object
      properties:
        code:
          type: string
          example: VALIDATION_FAILED
        message:
          type: string
          example: Validation failed
        request_id:
          type: string
          example: req_3702b7e7-...
        field:
          type: string
          description: Set when one input is at fault
        errors:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
              message:
                type: string
            required:
              - field
              - message
          description: Set when several inputs are at fault
        details:
          type: object
          additionalProperties:
            nullable: true
      required:
        - code
        - message
        - request_id
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        An API key minted in Command Center (Settings -> API Keys), sent as
        `Authorization: Bearer 2501_ak_...`. A Command Center session cookie is
        also accepted.

````

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