# Sinch API Webhooks Update

> Update an existing webhook configuration

- Skill: `sinch/sinch-api-webhooks-update` (Agent Skill)
- Install (CLI): `npx skillmds@latest add sinch/sinch-api-webhooks-update`
- Raw SKILL.md: https://api.skillmd.com/api/skills/sinch/sinch-api-webhooks-update/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: sinch (https://skillmd.com/u/sinch)
- Updated: 2026-09-10
- Page: https://skillmd.com/skills/sinch/sinch-api-webhooks-update

---


# Update Webhook

Update an existing webhook's configuration including target URL, triggers, or secret.

**IMPORTANT: Execute this command directly. Do NOT generate script files. Do NOT create Python/JavaScript files. Perform the API call immediately using the instructions below.**

## Input

- `--id` / `-i`: Webhook ID to update (required)
- `--target` / `-t`: New target URL (optional)
- `--triggers` / `-T`: New comma-separated list of triggers (optional)
- `--secret` / `-s`: New secret token (optional)

Arguments: $ARGUMENTS

## Instructions

**Execute these steps directly - do not write code or scripts:**

0. Check if $ARGUMENTS is empty or only contains the command name:
   - If empty or no meaningful arguments provided, enter interactive mode:
     * Ask: "🆔 What is the webhook ID you want to update?"
     * Ask: "What would you like to update? (target/triggers/secret/multiple)"
     * Based on response, ask for the specific new values
     * Use the provided answers as the arguments for the following steps
   - If arguments are provided, proceed directly to step 1

1. Parse and validate arguments from $ARGUMENTS or interactive input:
   - Validate that `--id` is provided and non-empty
   - At least one of `--target`, `--triggers`, or `--secret` must be provided
   - If `--target` is provided, validate it's a valid HTTPS URL
   - If `--triggers` is provided, parse and validate each trigger

2. Try to call `mcp__sinch__sinch-mcp-configuration` to get the current configuration.

3. If MCP is NOT available, retrieve configuration from environment variables:
   - CONVERSATION_PROJECT_ID
   - CONVERSATION_REGION
   - CONVERSATION_KEY_ID
   - CONVERSATION_KEY_SECRET
   - If any are missing, report: "Sinch API is not configured. Please set the required environment variables."

4. Verify the webhook exists:
   - Retrieve the existing webhook configuration
   - If not found, report: "Webhook with ID '{webhook_id}' not found"

5. Prepare the update payload:
   - Start with the existing webhook configuration
   - Apply only the fields that were provided in arguments
   - Keep existing values for fields not specified

6. Update the webhook using the Sinch Conversation API:
   - Endpoint: `PATCH https://{region}.conversation.api.sinch.com/v1/projects/{projectId}/webhooks/{webhookId}`
   - Use OAuth2 authentication with key ID and secret to generate access token
   - Include request body with updated fields

7. Handle errors gracefully:
   - If configuration is incomplete, report: "Sinch API is not configured. Please set the required environment variables."
   - If no update parameters are provided, report: "Please provide at least one field to update (--target, --triggers, or --secret)"
   - If validation fails, provide clear error messages
   - If the API call fails, display the error message with status code and error description

## Examples

Update webhook target URL:
```
/sinch-api-webhooks-update --id=01E9WEBHOOK123 --target=https://newurl.com/webhook
```

Update webhook triggers:
```
/sinch-api-webhooks-update -i 01E9WEBHOOK123 -T MESSAGE_DELIVERY,MESSAGE_INBOUND,CONVERSATION_START
```

Update multiple fields:
```
/sinch-api-webhooks-update --id=01E9WEBHOOK123 --target=https://newurl.com/webhook --secret=new-secret
```

## API Reference

- **MCP Tool**: `mcp__sinch__sinch-mcp-configuration` (for getting configuration)
- **API Endpoint**: `PATCH /v1/projects/{projectId}/webhooks/{webhookId}`
- **Documentation**: https://developers.sinch.com/docs/conversation/api-reference/conversation/tag/Webhooks/#tag/Webhooks/operation/Webhooks_UpdateWebhook

## Request Body Example

```json
{
  "target": "https://newurl.com/webhook",
  "triggers": [
    "MESSAGE_DELIVERY",
    "MESSAGE_INBOUND"
  ]
}
```

## Notes

- Only the fields you specify will be updated
- Unspecified fields retain their current values
- When updating triggers, you must provide the complete list (not incremental)
- Changing the secret will invalidate the old one immediately
- Target URL must be publicly accessible and use HTTPS

