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

# Update a webhook endpoint

> Updates a webhook endpoint, such as url, events, status.



## OpenAPI

````yaml /openapi/endpoints/ycloud-api-v2.yaml patch /webhookEndpoints/{id}
openapi: 3.0.0
info:
  description: >-
    The [YCloud](https://ycloud.com) API is organized around
    [REST](https://en.wikipedia.org/wiki/Representational_state_transfer). Our
    API is designed to have predictable, resource-oriented URLs, return
    [JSON](https://www.json.org) responses, and use standard HTTP response codes
    and verbs.
  version: v2
  title: YCloud API
  termsOfService: https://ycloud.com/terms-service
  contact:
    email: service@ycloud.com
servers:
  - url: https://api.ycloud.com/v2
    description: Base URL
security:
  - api_key: []
tags:
  - name: Balance
  - name: Contacts
  - name: Custom Events
  - name: Emails
  - name: SMS
  - name: Unsubscribers
  - name: Verify
  - name: Voices
  - name: Webhook Endpoints
  - name: WhatsApp Business Accounts
  - name: WhatsApp Inbound Messages
  - name: WhatsApp Media
  - name: WhatsApp Messages
  - name: WhatsApp Blocked Users
  - name: WhatsApp Groups
  - name: WhatsApp Calling
  - name: WhatsApp Phone Numbers
  - name: WhatsApp Templates
  - name: WhatsApp Flows
  - name: Meta Business Agent
  - name: WhatsApp Group Messages
externalDocs:
  description: Homepage
  url: https://ycloud.com
paths:
  /webhookEndpoints/{id}:
    patch:
      tags:
        - Webhook Endpoints
      summary: Update a webhook endpoint
      description: Updates a webhook endpoint, such as url, events, status.
      operationId: webhook_endpoint-update
      parameters:
        - $ref: '#/components/parameters/id-in_path_for_webhook_endpoint'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookEndpointUpdateRequest'
        required: true
      responses:
        '200':
          description: Successfully updated the webhook endpoint.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookEndpoint'
        '404':
          description: The requested resource does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  parameters:
    id-in_path_for_webhook_endpoint:
      name: id
      in: path
      description: ID of the webhook endpoint.
      required: true
      schema:
        type: string
        example: wh627c8640675de8fc689ab9d9
  schemas:
    WebhookEndpointUpdateRequest:
      type: object
      properties:
        url:
          type: string
          description: The URL of the webhook endpoint.
          maxLength: 500
          example: https://httpbin.org/anything?tag=api
        enabledEvents:
          type: array
          description: The list of events to enable for this endpoint.
          items:
            $ref: '#/components/schemas/EventType'
        eventProperties:
          type: array
          description: >-
            Optional configuration for event properties in webhook payloads.
            Specifies which properties should be included for specific event
            types.

            When `enabledEvents` contains `contact.attributes_changed`, this
            field is required and must contain at least one event property
            configuration for that event type.
          items:
            $ref: '#/components/schemas/EventProperty'
          example:
            - event: contact.attributes_changed
              properties:
                - attr1
                - attr2
        description:
          type: string
          description: An optional description of what the webhook is used for.
          maxLength: 400
          example: My first webhook endpoint.
        status:
          $ref: '#/components/schemas/WebhookEndpointStatus'
    WebhookEndpoint:
      type: object
      required:
        - id
      properties:
        id:
          type: string
          description: Unique ID for the object.
          example: wh627c8640675de8fc689ab9d9
        url:
          type: string
          description: The URL of the webhook endpoint.
          example: https://httpbin.org/anything?tag=api
        enabledEvents:
          type: array
          description: The list of events to enable for this endpoint.
          example:
            - whatsapp.message.updated
            - whatsapp.inbound_message.received
          items:
            type: string
        eventProperties:
          type: array
          description: >-
            Optional configuration for event properties in webhook payloads.
            Specifies which properties should be included for specific event
            types.

            When `enabledEvents` contains `contact.attributes_changed`, this
            field is required and must contain at least one event property
            configuration for that event type.
          items:
            $ref: '#/components/schemas/EventProperty'
          example:
            - event: contact.attributes_changed
              properties:
                - attr1
                - attr2
        description:
          type: string
          description: An optional description of what the webhook is used for.
          example: My first webhook endpoint.
        status:
          $ref: '#/components/schemas/WebhookEndpointStatus'
        secret:
          type: string
          description: The endpoint's secret, used to generate webhook signatures.
          example: whsec_abc4147651944f02baf3be1eb45d33f1
        createTime:
          type: string
          format: date-time
          description: >-
            The time at which this object was created, formatted in [RFC
            3339](https://datatracker.ietf.org/doc/html/rfc3339). e.g.,
            `2022-06-01T12:00:00.000Z`.
          example: '2022-06-01T12:00:00.000Z'
        updateTime:
          type: string
          format: date-time
          description: >-
            The time at which this object was updated, formatted in [RFC
            3339](https://datatracker.ietf.org/doc/html/rfc3339). e.g.,
            `2022-06-01T12:00:00.000Z`.
          example: '2022-06-01T12:00:00.000Z'
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/Error'
          description: >-
            Contains the error code and human-readable message for the API
            error.
    EventType:
      type: string
      description: Type of event.
      enum:
        - email.delivery.updated
        - sms.message.updated
        - sms.inbound.received
        - voice.message.updated
        - whatsapp.business_account.deleted
        - whatsapp.business_account.reviewed
        - whatsapp.business_account.updated
        - whatsapp.inbound_message.received
        - whatsapp.message.updated
        - whatsapp.group.lifecycle_update
        - whatsapp.group.participants_update
        - whatsapp.group.settings_update
        - whatsapp.group.status_update
        - whatsapp.smb.history
        - whatsapp.smb.message.created
        - whatsapp.phone_number.deleted
        - whatsapp.phone_number.name_updated
        - whatsapp.phone_number.quality_updated
        - whatsapp.phone_number.business_username_updated
        - whatsapp.template.category_updated
        - whatsapp.template.correct_category_detection
        - whatsapp.template.quality_updated
        - whatsapp.template.reviewed
        - whatsapp.call.connect
        - whatsapp.call.terminate
        - whatsapp.call.status.updated
        - whatsapp.call.recording.updated
        - whatsapp.call.transcription.updated
        - whatsapp.flow.status_change
        - whatsapp.payment.updated
        - contact.attributes_changed
        - contact.created
        - contact.deleted
        - contact.unsubscribe.created
        - contact.unsubscribe.deleted
        - whatsapp.user.preferences
        - whatsapp.smb.message.echoes
        - contact.note.created
        - contact.note.updated
        - contact.note.deleted
        - whatsapp.echo_message.created
        - whatsapp.echo_message.updated
        - whatsapp.meta_business_agent.handover.updated
      x-enum-descriptions:
        - >-
          Occurs when an email delivery status is updated, and the status
          changes to `delivered` or `failed`.
        - >-
          Occurs when an SMS message status is updated, and the status changes
          to `delivered` or `undelivered`.
        - >-
          Occurs when an SMS inbound message is received, which means a user
          replies to your message.
        - >-
          Occurs when a voice message status is updated, and the status changes
          to `delivered` or `undelivered`.
        - Occurs when a WhatsApp Business Account is deleted.
        - Occurs when a WhatsApp Business Account has been reviewed.
        - >-
          Occurs when a policy violation happened, WhatsApp Business Account has
          been banned and more.
        - Occurs when a WhatsApp inbound message is received.
        - >-
          Occurs when a WhatsApp outbound message status is updated, and the
          status changes to `sent`, `failed`, `delivered`, or `read`.
        - >-
          Occurs when a WhatsApp group is created or deleted, including
          successful and failed results.
        - Occurs when WhatsApp group participants or join requests are updated.
        - >-
          Occurs when WhatsApp group settings are updated, including successful
          and failed results.
        - Occurs when a WhatsApp group suspension status is updated.
        - Occurs when WhatsApp Business app sync history message.
        - Occurs when WhatsApp Business app send message.
        - Occurs when a WhatsApp business phone number is deleted.
        - >-
          Occurs when a WhatsApp business phone number's name has been approved
          or rejected.
        - >-
          Occurs when a WhatsApp business phone number's quality-related status
          is updated, and the status changes to `GREEN`, `YELLOW`, or `RED`.
        - >-
          Occurs when a WhatsApp business phone number's Business Username is
          updated.
        - Occurs when a WhatsApp template category is updated.
        - >-
          Occurs when Meta detects non-utility content in Utility Direct Send.
          Subscribe through the webhook endpoint API.
        - Occurs when a WhatsApp template quality rating is updated.
        - >-
          Occurs when a WhatsApp template status is updated, and the status
          changes to `REJECTED`, `APPROVED`, `PAUSED`, `DISABLED`, `IN_APPEAL`,
          or `ARCHIVED`.
        - Occurs when a WhatsApp call is connected.
        - Occurs when a WhatsApp call is terminated.
        - Occurs when a WhatsApp call status is updated.
        - >-
          Occurs when an API-sourced WhatsApp call recording becomes available
          or permanently fails.
        - >-
          Occurs when an API-sourced WhatsApp call transcription becomes
          available or permanently fails.
        - Occurs when a WhatsApp flow status is updated.
        - Occurs when a WhatsApp payment transaction changes.
        - Occurs when a contact's attributes are changed.
        - Occurs when a contact is created.
        - Occurs when a contact is deleted.
        - Occurs when a contact unsubscribes from messages.
        - Occurs when a contact resumes subscription to messages.
        - >-
          Occurs when a WhatsApp user stops marketing messages or a WhatsApp
          user resumes marketing messages.
        - Occurs when WhatsApp Business app sends a message echo.
        - Occurs when a contact note is created.
        - Occurs when a contact note is updated.
        - >-
          Occurs when a contact note is independently deleted. Contact deletion
          does not emit this event for cascaded notes.
        - >-
          Occurs when an outbound echo message is recorded for a Public REST API
          Agent.
        - >-
          Occurs when an outbound echo status is received for a Public REST API
          Agent; late lower-ranked statuses can also be delivered.
        - >-
          Occurs when a supported handover callback transfers control away from
          a Public REST API Agent. Does not confirm Inbox assignment.
    EventProperty:
      type: object
      description: >-
        Represents event property configuration for webhook endpoints.

        Specifies which properties should be included in the webhook payload for
        a specific event type.
      required:
        - event
        - properties
      properties:
        event:
          type: string
          description: >-
            The event type for which properties are configured.

            This field accepts any valid event type that supports property
            configuration.
          example: contact.attributes_changed
        properties:
          type: array
          description: >-
            A list of property names that should be included in the webhook
            payload for the specified event type.

            The available properties depend on the specific event type
            configured.
          items:
            type: string
          example:
            - attr1
            - attr2
          minItems: 1
    WebhookEndpointStatus:
      type: string
      description: >-
        Webhook endpoint status.

        - `active`: Indicates that the webhook endpoint is active, and will
        receive notifications of events monitored.

        - `disabled`: Indicates that the webhook endpoint is disabled, and will
        not receive notifications.

        - `pending`: Indicates that the webhook endpoint is pending, and will
        not receive notifications. If a webhook endpoint fails to receive
        notifications frequently, it changes to pending.
      enum:
        - active
        - disabled
        - pending
    Error:
      type: object
      required:
        - status
        - code
      properties:
        status:
          type: integer
          format: int32
          pattern: '[45]\d{2}'
          description: >-
            HTTP status code, [RFC 7231, Section
            6](https://datatracker.ietf.org/doc/html/rfc7231#section-6). It
            conveys the HTTP status code used for the convenience of the
            consumer.
          example: 404
        code:
          type: string
          description: >-
            One of a server-defined error codes. Some `4xx` errors that could be
            handled programmatically include an error code that briefly explains
            the error reported.
          example: NOT_FOUND
        message:
          type: string
          description: >-
            A human-readable representation of the error. It is intended as an
            aid to developers and is not suitable for exposure to end users.
          example: The requested resource does not exist.
        target:
          type: string
          description: The target of the error.
          example: ''
        docUrl:
          type: string
          description: A URL to more information about the error.
          example: ''
        requestId:
          type: string
          description: >-
            Each API request has an associated request ID. It conveys the
            response header `YCloud-Request-ID` used for the convenience of the
            consumer.
          example: req_1KjtKI80IKoaJNa6n6p
        whatsappApiError:
          $ref: '#/components/schemas/WhatsappApiError'
          description: >-
            The original error object returned by WhatsApp. See [Handling
            Errors](https://developers.facebook.com/docs/graph-api/guides/error-handling),
            [Cloud API Error
            Codes](https://developers.facebook.com/docs/whatsapp/cloud-api/support/error-codes).


            Note: This field is returned if we tried to request the WhatsApp
            Business API and got an error response.
        metaBusinessAgentApiError:
          $ref: '#/components/schemas/MetaBusinessAgentApiError'
          description: >-
            Sanitized upstream details returned when a Meta Business Agent
            request fails.
    WhatsappApiError:
      type: object
      description: >-
        The original error object returned by WhatsApp. See [Handling
        Errors](https://developers.facebook.com/docs/graph-api/guides/error-handling),
        [Cloud API Error
        Codes](https://developers.facebook.com/docs/whatsapp/cloud-api/support/error-codes).
      required:
        - message
        - code
      properties:
        message:
          type: string
          description: A human-readable description of the error.
          example: HSM Template creation failed
        code:
          type: string
          description: An error code.
          example: 200002
        type:
          type: string
          description: Error type.
          example: OAuthException
        is_transient:
          type: boolean
          description: Whether the error is transient.
          example: false
        error_subcode:
          type: string
          description: Additional code about the error.
          example: 2388109
        error_user_msg:
          type: string
          description: >-
            The message to display to the user. The language of the message is
            based on the locale of the API request.
          example: This message template cannot be created.
        error_user_title:
          type: string
          description: >-
            The title of the dialog, if shown. The language of the message is
            based on the locale of the API request.
          example: Message Cannot Be Submitted
        fbtrace_id:
          type: string
          description: >-
            Internal support identifier. When reporting a bug related to a Graph
            API call, include the fbtrace_id to help us find log data for
            debugging.
          example: AVGjJ7ia2zJkrHG
        error_data:
          description: >-
            Additional data about the error. A string or map.

            - For template APIs, this field is a string describing the reason
            for the error.

            - For message APIs, this field is a map with property `details`
            describing the reason for the error.
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
    MetaBusinessAgentApiError:
      type: object
      description: Sanitized details from a failed Meta Business Agent upstream request.
      properties:
        title:
          type: string
        detail:
          type: string
        type:
          type: string
        status:
          type: integer
          format: int32
        requestId:
          type: string
  securitySchemes:
    api_key:
      type: apiKey
      name: X-API-Key
      in: header

````

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