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

# Update a webhook

> Updates an existing webhook.



## OpenAPI

````yaml patch /v1/webhooks/{id}
openapi: 3.1.0
info:
  title: Data API
  description: >-
    The Data API provides web3 application developers with multi-chain data
    related to Avalanche's primary network, Avalanche subnets, and Ethereum.
    With Data API, you can easily build products that leverage real-time and
    historical transaction and transfer history, native and token balances, and
    various types of token metadata. The API is in Beta and may be subject to
    change.</br></br>If you have feedback or feature requests for the API,
    please submit them <a
    href="https://portal.productboard.com/dndv9ahlkdfye4opdm8ksafi/tabs/4-glacier-api">here</a>.
    Bug reports can be submitted <a
    href="https://docs.google.com/forms/d/e/1FAIpQLSeJQrcp7QoNiqozMDKrVJGX5wpU827d3cVTgF8qa7t_J1Pb-g/viewform">here</a>,
    and any potential security issues can be reported <a
    href="https://immunefi.com/bounty/avalabs">here</a>.
  version: 1.0.0
  contact: {}
servers:
  - url: https://glacier-api.avax.network
security:
  - apiKey: []
  - {}
tags:
  - name: EVM Chains
    description: >-
      Find information about indexed EVM-compatible chains, such as the
      Avalanche C-Chain.
  - name: EVM Blocks
    description: >-
      Find information about blocks on EVM-compatible chains, such as the
      Avalanche C-Chain.
  - name: EVM Transactions
    description: >-
      Find information about transactions on EVM-compatible chains, such as the
      Avalanche C-Chain.
  - name: EVM Balances
    description: >-
      Find information about balances on EVM-compatible chains, such as the
      Avalanche C-Chain.
  - name: EVM Contracts
    description: >-
      Find information about contracts on EVM-compatible chains, such as the
      Avalanche C-Chain.
  - name: Primary Network
  - name: Primary Network Blocks
    description: >-
      Find information about blocks on Avalanche's Primary Network Chains - the
      P-Chain, the X-Chain, and the C-Chain.
  - name: Primary Network Vertices
    description: Find information about vertices on Avalanche's X-Chain.
  - name: Primary Network Transactions
    description: >-
      Find information about transactions on Avalanche's Primary Network Chains
      - the P-Chain, the X-Chain, and the C-Chain.
  - name: Primary Network Balances
    description: >-
      Find information about balances on Avalanche's Primary Network Chains -
      the P-Chain, the X-Chain, and the C-Chain.
  - name: Primary Network UTXOs
    description: >-
      Find information about utxos on Avalanche's Primary Network Chains - the
      P-Chain, the X-Chain, and the C-Chain.
  - name: Primary Network Rewards
    description: Find information about rewards on Avalanche's Primary Network.
  - name: NFTs
  - name: Operations
  - name: Health Check
  - name: Teleporter
    description: Find information about Teleporter transactions.
  - name: Interchain Messaging
    description: Find information about Interchain Messaging transactions.
  - name: Webhooks
    description: Manage webhooks and get notified for various onchain activities.
  - name: RPC
    description: Interact with chain nodes using JSON-RPC.
  - name: Data API Usage Metrics
    description: Usage metrics and logs for the Data API.
  - name: Signature Aggregator
    description: Request signatures for a Warp message from Subnet validators
  - name: Notifications
    description: Get notifications for validator status and activity issues.
  - name: AVAX Supply
    description: Find information about AVAX supply.
paths:
  /v1/webhooks/{id}:
    patch:
      tags:
        - Webhooks
      summary: Update a webhook
      description: Updates an existing webhook.
      operationId: updateWebhook
      parameters:
        - name: id
          required: true
          in: path
          description: The webhook identifier.
          example: f33de69c-d13b-4691-908f-870d6e2e6b04
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWebhookRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/EVMAddressActivityResponse'
                  - $ref: '#/components/schemas/PrimaryNetworkAddressActivityResponse'
                  - $ref: '#/components/schemas/ValidatorActivityResponse'
        '400':
          description: |-
            Bad requests generally mean the client has passed invalid 
                or malformed parameters. Error messages in the response could help in 
                evaluating the error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
        '401':
          description: |-
            When a client attempts to access resources that require 
                authorization credentials but the client lacks proper authentication 
                in the request, the server responds with 401.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
        '403':
          description: |-
            When a client attempts to access resources with valid
                credentials but doesn't have the privilege to perform that action, 
                the server responds with 403.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Forbidden'
        '404':
          description: |-
            The error is mostly returned when the client requests
                with either mistyped URL, or the passed resource is moved or deleted, 
                or the resource doesn't exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
        '429':
          description: |-
            This error is returned when the client has sent too many,
                and has hit the rate limit.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TooManyRequests'
        '500':
          description: |-
            The error is a generic server side error that is 
                returned for any uncaught and unexpected issues on the server side. 
                This should be very rare, and you may reach out to us if the problem 
                persists for a longer duration.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerError'
        '502':
          description: |-
            This is an internal error indicating invalid response 
                  received by the client-facing proxy or gateway from the upstream server.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadGateway'
        '503':
          description: |-
            The error is returned for certain routes on a particular
                Subnet. This indicates an internal problem with our Subnet node, and may 
                not necessarily mean the Subnet is down or affected.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceUnavailable'
      x-codeSamples:
        - lang: javascript
          label: JavaScript
          source: |-
            import { Avalanche } from "@avalanche-sdk/chainkit";

            const avalanche = new Avalanche();

            async function run() {
              const result = await avalanche.webhooks.update({
                id: "f33de69c-d13b-4691-908f-870d6e2e6b04",
                updateWebhookRequest: {},
              });

              console.log(result);
            }

            run();
components:
  schemas:
    UpdateWebhookRequest:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        url:
          type: string
        status:
          $ref: '#/components/schemas/WebhookStatusType'
        includeInternalTxs:
          type: boolean
          description: >-
            Whether to include traces in the webhook payload. Traces are only
            available for C-Chain on chainId 43113 and 43114.
        includeLogs:
          type: boolean
    EVMAddressActivityResponse:
      type: object
      properties:
        id:
          type: string
        url:
          type: string
        chainId:
          type: string
        status:
          $ref: '#/components/schemas/WebhookStatusType'
        createdAt:
          type: number
        name:
          type: string
        description:
          type: string
        eventType:
          $ref: '#/components/schemas/AddressActivityEventType'
        metadata:
          $ref: '#/components/schemas/AddressActivityMetadata'
        includeInternalTxs:
          type: boolean
          description: Whether to include traces in the webhook payload.
        includeLogs:
          type: boolean
          description: Whether to include logs in the webhook payload.
      required:
        - id
        - url
        - chainId
        - status
        - createdAt
        - name
        - description
        - eventType
        - metadata
    PrimaryNetworkAddressActivityResponse:
      type: object
      properties:
        id:
          type: string
        url:
          type: string
        chainId:
          type: string
        status:
          $ref: '#/components/schemas/WebhookStatusType'
        createdAt:
          type: number
        name:
          type: string
        description:
          type: string
        eventType:
          $ref: '#/components/schemas/PrimaryNetworkAddressActivityEventType'
        metadata:
          $ref: '#/components/schemas/PrimaryNetworkAddressActivityMetadata'
      required:
        - id
        - url
        - chainId
        - status
        - createdAt
        - name
        - description
        - eventType
        - metadata
    ValidatorActivityResponse:
      type: object
      properties:
        id:
          type: string
        url:
          type: string
        chainId:
          type: string
        status:
          $ref: '#/components/schemas/WebhookStatusType'
        createdAt:
          type: number
        name:
          type: string
        description:
          type: string
        eventType:
          $ref: '#/components/schemas/ValidatorActivityEventType'
        metadata:
          $ref: '#/components/schemas/ValidatorActivityMetadata'
      required:
        - id
        - url
        - chainId
        - status
        - createdAt
        - name
        - description
        - eventType
        - metadata
    BadRequest:
      type: object
      properties:
        message:
          description: The error message describing the reason for the exception
          oneOf:
            - type: string
            - type: array
              items:
                type: string
        statusCode:
          type: number
          description: The HTTP status code of the response
          examples:
            - 400
        error:
          type: string
          description: The type of error
          examples:
            - Bad Request
      required:
        - message
        - statusCode
        - error
    Unauthorized:
      type: object
      properties:
        message:
          description: The error message describing the reason for the exception
          oneOf:
            - type: string
            - type: array
              items:
                type: string
        statusCode:
          type: number
          description: The HTTP status code of the response
          examples:
            - 401
        error:
          type: string
          description: The type of error
          examples:
            - Unauthorized
      required:
        - message
        - statusCode
        - error
    Forbidden:
      type: object
      properties:
        message:
          description: The error message describing the reason for the exception
          oneOf:
            - type: string
            - type: array
              items:
                type: string
        statusCode:
          type: number
          description: The HTTP status code of the response
          examples:
            - 403
        error:
          type: string
          description: The type of error
          examples:
            - Forbidden
      required:
        - message
        - statusCode
        - error
    NotFound:
      type: object
      properties:
        message:
          description: The error message describing the reason for the exception
          oneOf:
            - type: string
            - type: array
              items:
                type: string
        statusCode:
          type: number
          description: The HTTP status code of the response
          examples:
            - 404
        error:
          type: string
          description: The type of error
          examples:
            - Not Found
      required:
        - message
        - statusCode
        - error
    TooManyRequests:
      type: object
      properties:
        message:
          description: The error message describing the reason for the exception
          oneOf:
            - type: string
            - type: array
              items:
                type: string
        statusCode:
          type: number
          description: The HTTP status code of the response
          examples:
            - 429
        error:
          type: string
          description: The type of error
          examples:
            - Too Many Requests
      required:
        - message
        - statusCode
        - error
    InternalServerError:
      type: object
      properties:
        message:
          description: The error message describing the reason for the exception
          oneOf:
            - type: string
            - type: array
              items:
                type: string
        statusCode:
          type: number
          description: The HTTP status code of the response
          examples:
            - 500
        error:
          type: string
          description: The type of error
          examples:
            - Internal Server Error
      required:
        - message
        - statusCode
        - error
    BadGateway:
      type: object
      properties:
        message:
          description: The error message describing the reason for the exception
          oneOf:
            - type: string
            - type: array
              items:
                type: string
        statusCode:
          type: number
          description: The HTTP status code of the response
          examples:
            - 502
        error:
          type: string
          description: The type of error
          examples:
            - Bad Gateway
      required:
        - message
        - statusCode
        - error
    ServiceUnavailable:
      type: object
      properties:
        message:
          description: The error message describing the reason for the exception
          oneOf:
            - type: string
            - type: array
              items:
                type: string
        statusCode:
          type: number
          description: The HTTP status code of the response
          examples:
            - 503
        error:
          type: string
          description: The type of error
          examples:
            - Service Unavailable
      required:
        - message
        - statusCode
        - error
    WebhookStatusType:
      type: string
      enum:
        - active
        - inactive
    AddressActivityEventType:
      type: string
      enum:
        - address_activity
    AddressActivityMetadata:
      type: object
      properties:
        eventSignatures:
          description: Array of hexadecimal strings of the event signatures.
          examples:
            - - >-
                0x61cbb2a3dee0b6064c2e681aadd61677fb4ef319f0b547508d495626f5a62f64
          type: array
          items:
            type: string
        addresses:
          description: >-
            Ethereum address(es) for the address_activity event type. The
            maximum number of 'addresses' you can track depends  on the Data API
            plan you are subscribed to.
          examples:
            - - '0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E'
          type: array
          items:
            type: string
      required:
        - addresses
    PrimaryNetworkAddressActivityEventType:
      type: string
      enum:
        - primary_network_address_activity
    PrimaryNetworkAddressActivityMetadata:
      type: object
      properties:
        eventSignatures:
          description: Array of hexadecimal strings of the event signatures.
          examples:
            - - >-
                0x61cbb2a3dee0b6064c2e681aadd61677fb4ef319f0b547508d495626f5a62f64
          type: array
          items:
            type: string
        keyType:
          $ref: '#/components/schemas/PlatformAddressActivityKeyType'
        keys:
          description: >-
            Array of keys like addresses corresponding to the keyType being
            monitored. For PrimaryNetworkAddressActivity event, an array of
            multiple addresses can be provided. The maximum number of
            'addresses' you can track depends on the Data API plan you are
            subscribed to.
          type: array
          items:
            type: string
        subEvents:
          description: Sub-events to monitor
          allOf:
            - $ref: '#/components/schemas/PrimaryNetworkAddressActivitySubEvents'
        balanceThresholdFilter:
          description: Balance threshold filter
          allOf:
            - $ref: '#/components/schemas/PrimaryNetworkBalanceThresholdFilter'
      required:
        - keyType
        - keys
        - subEvents
    ValidatorActivityEventType:
      type: string
      enum:
        - validator_activity
    ValidatorActivityMetadata:
      type: object
      properties:
        eventSignatures:
          description: Array of hexadecimal strings of the event signatures.
          examples:
            - - >-
                0x61cbb2a3dee0b6064c2e681aadd61677fb4ef319f0b547508d495626f5a62f64
          type: array
          items:
            type: string
        keyType:
          $ref: '#/components/schemas/ValidatorActivityKeyType'
        keys:
          description: >-
            Array of keys like NodeID or SubnetID corresponding to the keyType
            being monitored. ValidatorActivity event will only accept a single
            key
          type: array
          items:
            type: string
        subEvents:
          description: Sub-events to monitor
          allOf:
            - $ref: '#/components/schemas/ValidatorActivitySubEvents'
        nodeIds:
          description: Array of node IDs to filter the events
          type: array
          items:
            type: string
        subnetIds:
          description: Array of subnet IDs to filter the events
          type: array
          items:
            type: string
        l1ValidatorFeeBalanceThreshold:
          type: string
          description: L1 validator fee balance threshold in nAVAX
      required:
        - keyType
        - keys
        - subEvents
    PlatformAddressActivityKeyType:
      type: string
      description: The type of key to monitor for the address activity event type.
      enum:
        - addresses
    PrimaryNetworkAddressActivitySubEvents:
      type: object
      properties:
        addressActivitySubEvents:
          type: array
          items:
            $ref: '#/components/schemas/PrimaryNetworkAddressActivitySubEventType'
      required:
        - addressActivitySubEvents
    PrimaryNetworkBalanceThresholdFilter:
      type: object
      properties:
        balanceType:
          $ref: '#/components/schemas/CommonBalanceType'
        balanceThreshold:
          type: string
          description: Threshold for balance corresponding to balanceType in nAVAX
      required:
        - balanceType
        - balanceThreshold
    ValidatorActivityKeyType:
      type: string
      description: The type of key to monitor for the validator activity event type.
      enum:
        - nodeId
        - subnetId
    ValidatorActivitySubEvents:
      type: object
      properties:
        validatorActivitySubEvents:
          type: array
          description: Array of validator activity sub-event types
          items:
            type: string
            enum:
              - validator_stake
              - delegator_stake
              - reward_distribution
              - l1_validator_balance_increased
              - l1_validator_disabled
              - l1_validator_removed
              - l1_validator_balance_threshold
      required:
        - validatorActivitySubEvents
    PrimaryNetworkAddressActivitySubEventType:
      type: string
      description: Array of address activity sub-event types
      enum:
        - balance_change
        - balance_threshold
        - reward_distribution
    CommonBalanceType:
      type: string
      description: Type of balance to monitor
      enum:
        - unlockedUnstaked
        - unlockedStaked
        - lockedPlatform
        - lockedStakeable
        - lockedStaked
        - pendingStaked
        - unlocked
        - locked
        - atomicMemoryUnlocked
        - atomicMemoryLocked
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-glacier-api-key
      description: >-
        Api keys provide higher access to rate limits. To obtain an api key,
        sign up for an account at https://avacloud.io/.

````