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

# Update Webhook Endpoint

> Update an existing webhook endpoint's configuration.

<RequestExample>
  ```bash cURL theme={null}
  curl -X PATCH https://api.thinnest.ai/webhooks/endpoints/{endpoint_id} \
    -H "Authorization: Bearer $THINNESTAI_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
    "url": "https://new-url.com/webhook",
    "event_types": [
      "agent.created",
      "agent.deleted"
    ],
    "is_active": true
  }'
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.thinnest.ai/webhooks/endpoints/{endpoint_id}"
  headers = {
      "Authorization": "Bearer " + "YOUR_THINNESTAI_API_KEY",
      "Content-Type": "application/json",
  }

  payload = {
    "url": "https://new-url.com/webhook",
    "event_types": [
      "agent.created",
      "agent.deleted"
    ],
    "is_active": true
  }

  response = requests.patch(url, headers=headers, json=payload)
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.thinnest.ai/webhooks/endpoints/{endpoint_id}", {
    method: "PATCH",
    headers: {
      "Authorization": "Bearer " + "YOUR_THINNESTAI_API_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
    "url": "https://new-url.com/webhook",
    "event_types": [
      "agent.created",
      "agent.deleted"
    ],
    "is_active": true
  }),
  });

  const data = await response.json();
  console.log(data);
  ```

  ```go Go theme={null}
  package main

  import (
      "bytes"
      "fmt"
      "io"
      "net/http"
  )

  func main() {
      payload := []byte(`{
    "url": "https://new-url.com/webhook",
    "event_types": [
      "agent.created",
      "agent.deleted"
    ],
    "is_active": true
  }`)
      req, _ := http.NewRequest("PATCH", "https://api.thinnest.ai/webhooks/endpoints/{endpoint_id}", bytes.NewBuffer(payload))
      req.Header.Set("Authorization", "Bearer YOUR_THINNESTAI_API_KEY")
      req.Header.Set("Content-Type", "application/json")

      resp, err := http.DefaultClient.Do(req)
      if err != nil { panic(err) }
      defer resp.Body.Close()
      body, _ := io.ReadAll(resp.Body)
      fmt.Println(string(body))
  }
  ```
</RequestExample>

***

## Path Parameters

<ParamField path="endpoint_id" type="integer">
  Webhook endpoint ID
</ParamField>

## Request Body

All fields are optional — only include fields you want to change.

<ParamField body="url" type="string">
  New HTTPS URL
</ParamField>

<ParamField body="event_types" type="array">
  New list of event types
</ParamField>

<ParamField body="is_active" type="boolean">
  Enable/disable the endpoint
</ParamField>

<ParamField body="description" type="string">
  Updated description
</ParamField>

<ParamField body="max_retries" type="integer">
  Updated retry count (0–5)
</ParamField>

<ParamField body="timeout_ms" type="integer">
  Updated timeout
</ParamField>

## Response

<ResponseExample>
  ```json 200 theme={null}
  {
    "status": "success",
    "endpoint_id": 1
  }
  ```
</ResponseExample>


## OpenAPI

````yaml PATCH /webhooks/endpoints/{endpoint_id}
openapi: 3.1.0
info:
  title: ThinnestAI API
  description: REST API for ThinnestAI — build, deploy, and manage AI agents.
  version: 1.0.0
servers: []
security: []
tags:
  - name: Agents
    description: Create, configure, and manage AI agents
  - name: Chat
    description: Send messages and get AI responses from agents
  - name: Knowledge
    description: Upload files, URLs, and text to agent knowledge bases
  - name: Sessions
    description: View and manage chat sessions and message history
  - name: Voice
    description: Start and manage voice call sessions
  - name: Recordings
    description: Manage voice call recordings
  - name: Campaigns
    description: Create and run automated outreach campaigns
  - name: Webhooks
    description: Register webhook endpoints for real-time event notifications
  - name: Evaluations
    description: Run and track agent evaluation benchmarks
  - name: Analytics
    description: Query agent performance metrics and usage data
  - name: Agent Tools
    description: View and manage tools attached to agents
  - name: BYOK
    description: >-
      Bring Your Own Key — manage credentials for LLM/STT/TTS providers,
      telephony BYOK (Vobiz/Twilio/Plivo/Exotel/Telnyx), and tool-specific BYOK
      (Razorpay UPI Payment, Surepass Aadhaar eKYC)
paths:
  /webhooks/endpoints/{endpoint_id}:
    patch:
      tags:
        - Webhooks
      summary: Update Endpoint
      description: Update a webhook endpoint.
      operationId: update_endpoint_webhooks_endpoints__endpoint_id__patch
      parameters:
        - name: endpoint_id
          in: path
          required: true
          schema:
            type: integer
            title: Endpoint Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateEndpointRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    UpdateEndpointRequest:
      properties:
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Url
        event_types:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Event Types
        is_active:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Active
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        max_retries:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Retries
        timeout_ms:
          anyOf:
            - type: integer
            - type: 'null'
          title: Timeout Ms
      type: object
      title: UpdateEndpointRequest
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````