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

# Update Webhook

> Updates webhook configuration. Allows updating URL, events, and active status.

Updates webhook configuration. Allows updating URL, events, and active status.

## Authentication

This endpoint requires authentication via Bearer token:

* **Authorization**: `Bearer <token>`

## Path Parameters

| Parameter        | Type          | Required | Description     |
| ---------------- | ------------- | -------- | --------------- |
| `organizationId` | string (UUID) | Yes      | Organization ID |
| `id`             | string (UUID) | Yes      | Webhook ID      |

## Request Body

| Field      | Type    | Required | Description            |
| ---------- | ------- | -------- | ---------------------- |
| `url`      | string  | No       | Webhook endpoint URL   |
| `events`   | array   | No       | Array of event types   |
| `isActive` | boolean | No       | Enable/disable webhook |

## Updatable Fields

* **URL**: Change webhook endpoint
* **Events**: Update subscribed events
* **Active Status**: Enable or disable webhook delivery

## Permissions

Only **OWNERS** and **ADMINS** can update webhooks.

## Example Request

```bash theme={null}
curl -X PUT http://localhost:3001/api/organizations/550e8400-e29b-41d4-a716-446655440000/webhooks/123e4567-e89b-12d3-a456-426614174000 \
  -H "Authorization: Bearer <your_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/new-webhook",
    "events": ["organization.updated", "member.removed"],
    "isActive": true
  }'
```

## Example Response

```json theme={null}
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "organizationId": "550e8400-e29b-41d4-a716-446655440000",
  "url": "https://example.com/new-webhook",
  "events": ["organization.updated", "member.removed"],
  "isActive": true,
  "createdAt": "2025-01-26T10:00:00Z",
  "updatedAt": "2025-12-26T15:30:00Z"
}
```

## Common Errors

### 400 Bad Request

Invalid input data.

```json theme={null}
{
  "statusCode": 400,
  "message": ["url must be a valid URL", "events must be an array"]
}
```

### 401 Unauthorized

Authentication required.

```json theme={null}
{
  "statusCode": 401,
  "message": "Authentication required. Provide a valid bearer token."
}
```

### 403 Forbidden

Only owners and admins can update webhooks.

```json theme={null}
{
  "statusCode": 403,
  "message": "Access denied. Only owners and admins can update webhooks."
}
```

### 404 Not Found

Webhook not found.

```json theme={null}
{
  "statusCode": 404,
  "message": "Webhook not found with the provided ID."
}
```


## OpenAPI

````yaml PUT /organizations/{organizationId}/webhooks/{id}
openapi: 3.1.0
info:
  title: Timbrix API
  description: >-
    REST API with OAuth2 server for managing organizations, members, and
    webhooks
  version: '1.0'
  contact: {}
servers:
  - url: http://sandbox.mintlify.com
    description: Sandbox environment
  - url: http://localhost:3001/api
    description: Local development
security: []
tags:
  - name: organizations
    description: Organization management endpoints
  - name: oauth
    description: OAuth2 authentication and authorization
  - name: webhooks
    description: Webhook configuration and delivery
  - name: users
    description: User information endpoints
  - name: api-keys
    description: API Keys management and validation
paths:
  /organizations/{organizationId}/webhooks/{id}:
    put:
      tags:
        - webhooks
      summary: Update webhook
      description: >-
        Updates webhook configuration. Allows updating URL, events, and active
        status.
      operationId: WebhooksController_update
      parameters:
        - name: organizationId
          required: true
          in: path
          schema:
            type: string
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWebhookDto'
      responses:
        '200':
          description: Webhook updated successfully with new configuration.
        '400':
          description: Invalid input data. Check URL format and event types.
        '401':
          description: Authentication required. Provide a valid bearer token.
        '403':
          description: Access denied. Only owners and admins can update webhooks.
        '404':
          description: Webhook not found with the provided ID.
      security:
        - bearer: []
components:
  schemas:
    UpdateWebhookDto:
      type: object
      properties:
        url:
          type: string
          description: Webhook endpoint URL
          example: https://example.com/webhooks
        events:
          description: Events to subscribe to
          example:
            - organization.created
            - organization.updated
          type: array
          items:
            type: array
        isActive:
          type: boolean
          description: Whether the webhook is active
          example: true
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````