# Replace webhook

Replace an already existing webhook.

Endpoint: PUT /v1/projects/{projectId}/webhooks/{webhookId}
Version: 1.2.79
Security: BasicAuth, BearerAuth, OAuth2Production

## Path parameters:

  - `projectId` (string, required)
    The unique ID of the project. You can find this on the Sinch Dashboard.

  - `webhookId` (string, required)
    The unique ID of the webhook.

## Request fields (application/json):

  - `target` (string, required)
    A valid target url where events should be sent to.

  - `secret` (string, required)
    Secret to be used to sign contents of webhooks sent by the provisioning API. You can then use the secret to verify the signature. Please not that secret should have a high entropy to be considered secure.

  - `triggers` (array, required)
    List of triggers you want to be notified about on your webhook. To be able to listen to all type of events use ALL.
- Common: ALL
- Bundles: BUNDLE_DONE
- WhatsApp Sender: WHATSAPP_SENDER_ACTIVE, WHATSAPP_SENDER_COMMENT_ADDED, WHATSAPP_SENDER_DAILY_LIMIT_CHANGED, WHATSAPP_SENDER_DELETED, WHATSAPP_SENDER_ERROR, WHATSAPP_SENDER_INACTIVE, WHATSAPP_SENDER_PENDING_VERIFICATION, WHATSAPP_SENDER_QUALITY_RATING_CHANGED or WHATSAPP_SENDER_REJECTED
- WhatsApp Template: WHATSAPP_TEMPLATE_APPROVED, WHATSAPP_TEMPLATE_CATEGORY_FUTURE_UPDATE, WHATSAPP_TEMPLATE_CATEGORY_UPDATED, WHATSAPP_TEMPLATE_COMMENT_ADDED, WHATSAPP_TEMPLATE_DELETED, WHATSAPP_TEMPLATE_QUALITY_SCORE_UPDATED, WHATSAPP_TEMPLATE_REJECTED or WHATSAPP_TEMPLATE_STATUS_UPDATED
- WhatsApp Account: WHATSAPP_ACCOUNT_COMMENT_ADDED, WHATSAPP_ACCOUNT_DAILY_LIMIT_CHANGED, WHATSAPP_ACCOUNT_ONBOARDED, WHATSAPP_ACCOUNT_PENDING_VERIFICATION, WHATSAPP_ACCOUNT_REJECTED or WHATSAPP_WABA_ACCOUNT_CHANGED
- RCS Sender: RCS_BRAND_REGISTRATION_PROCESS_STATUS_UPDATED, RCS_SENDER_COMMENT_ADDED, RCS_SENDER_OPERATOR_STATUS_UPDATED or RCS_SENDER_STATUS_UPDATED
- KakaoTalk Sender: KAKAOTALK_SENDER_ACTIVE, KAKAOTALK_SENDER_COMMENT_ADDED, KAKAOTALK_SENDER_INACTIVE or KAKAOTALK_SENDER_REJECTED
- KakaoTalk Template: KAKAOTALK_TEMPLATE_APPROVED, KAKAOTALK_TEMPLATE_COMMENT_ADDED or KAKAOTALK_TEMPLATE_REJECTED
    Enum: "ALL", "BUNDLE_DONE", "KAKAOTALK_SENDER_ACTIVE", "KAKAOTALK_SENDER_COMMENT_ADDED", "KAKAOTALK_SENDER_INACTIVE", "KAKAOTALK_SENDER_REJECTED", "KAKAOTALK_TEMPLATE_APPROVED", "KAKAOTALK_TEMPLATE_COMMENT_ADDED", "KAKAOTALK_TEMPLATE_REJECTED", "RCS_BRAND_REGISTRATION_PROCESS_STATUS_UPDATED", "RCS_SENDER_COMMENT_ADDED", "RCS_SENDER_OPERATOR_STATUS_UPDATED", "RCS_SENDER_STATUS_UPDATED", "RCS_ACCOUNT_COMMENT_ADDED", "WHATSAPP_ACCOUNT_COMMENT_ADDED", "WHATSAPP_ACCOUNT_DAILY_LIMIT_CHANGED", "WHATSAPP_ACCOUNT_ONBOARDED", "WHATSAPP_ACCOUNT_PENDING_VERIFICATION", "WHATSAPP_ACCOUNT_REJECTED", "WHATSAPP_WABA_ACCOUNT_CHANGED", "WHATSAPP_SENDER_ACTIVE", "WHATSAPP_SENDER_COMMENT_ADDED", "WHATSAPP_SENDER_DAILY_LIMIT_CHANGED", "WHATSAPP_SENDER_DELETED", "WHATSAPP_SENDER_ERROR", "WHATSAPP_SENDER_INACTIVE", "WHATSAPP_SENDER_PENDING_VERIFICATION", "WHATSAPP_SENDER_QUALITY_RATING_CHANGED", "WHATSAPP_SENDER_REJECTED", "WHATSAPP_TEMPLATE_APPROVED", "WHATSAPP_TEMPLATE_CATEGORY_FUTURE_UPDATE", "WHATSAPP_TEMPLATE_CATEGORY_UPDATED", "WHATSAPP_TEMPLATE_COMMENT_ADDED", "WHATSAPP_TEMPLATE_DELETED", "WHATSAPP_TEMPLATE_QUALITY_SCORE_UPDATED", "WHATSAPP_TEMPLATE_REJECTED", "WHATSAPP_TEMPLATE_STATUS_UPDATED"

## Response 200 fields (application/json):

  - `id` (string, required)
    The ID of the webhook.

  - `target` (string, required)
    The target url where events will be sent to.

  - `projectId` (string, required)
    The project that this webhook belongs to.

  - `triggers` (array, required)
    List of triggers this webhook is triggered by.
    Enum: same as `triggers` (37 values)

## Response 400 fields (application/json):

  - `body` (InvalidInputErrorTitle (object) or InvalidPayloadErrorTitle (object) or InvalidIdFormatErrorTitle (object)) — one of:
    - InvalidInputErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "invalid_input"
      - `message` (string)
        Human readable message.
        Example: "Invalid input."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Correct the validation errors and submit again."
      - `additionalInformation` (object)
        Additional information for error.
        Example: {"validationErrors":["target must be a string","target must be a URL address"]}
    - InvalidPayloadErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "invalid_payload"
      - `message` (string)
        Human readable message.
        Example: "Invalid payload."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Correct payload and submit again."
    - InvalidIdFormatErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "invalid_id_format"
      - `message` (string)
        Human readable message.
        Example: "Id is not in the expected format."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "webhookId param is in the wrong format. Confirm that you're sending the correct value."

## Response 401 fields (application/json):

  - `errorCode` (string)
    Error code allows to programmatically handle errors.
    Example: "unauthorized_error"

  - `message` (string)
    Human readable message.
    Example: "Unauthorized error."

  - `resolution` (string)
    Human readable message with an explanation of how to solve the error.
    Example: "Verify that projectId is correct."

## Response 404 fields (application/json):

  - `errorCode` (string)
    Error code allows to programmatically handle errors.
    Example: "webhook_not_found"

  - `message` (string)
    Human readable message.
    Example: "Webhook not found."

  - `resolution` (string)
    Human readable message with an explanation of how to solve the error.
    Example: "Verify that the parameters are correct."

## Response 409 fields (application/json):

  - `errorCode` (string)
    Error code allows to programmatically handle errors.
    Example: "webhook_exists"

  - `message` (string)
    Human readable message.
    Example: "Webhook with the provided target already exists."

  - `resolution` (string)
    Human readable message with an explanation of how to solve the error.
    Example: "Webhooks must have a unique target. Change the target and submit again."

## Response 500 fields (application/json):

  - `errorCode` (string)
    Error code allows to programmatically handle errors.
    Example: "internal_error"

  - `message` (string)
    Human readable message.
    Example: "Internal server error."

  - `resolution` (string)
    Human readable message with an explanation of how to solve the error.
    Example: "Please wait and try again, if the error persist please contact support."


