Update Conversational WhatsApp Webhook Settings with OAuth 2.0

Prev Next

This endpoint helps you update the webhook URL and other relevant settings for conversational messages.

Endpoint

POST https://whatsapp.useinsider.com/v2/conversational/settings

The system supports two grant types for OAuth2 authentication:

  • grant_type: client_credentials

  • grant_type: refresh_token

Client Credentials Request

curl -X POST https://gw.useinsider.com/api/wa/v2/conversational/settings \

        -H "Content-Type: application/json" \

        -H "Authorization: Bearer your_access_token" \

        -d '{

        "webhook_url": "https://partner.example.com/webhooks/conversational",

        "from": "+1234567890",

        "auth_type": "oauth2",

        "oauth2": {

        "grant_type": "client_credentials",

        "token_url": "https://oauth.partner.com/oauth/token",

        "client_id": "your_client_id",

        "client_secret": "your_client_secret",

        "scopes": ["webhook.write"],

        "expires_in": 3600

        }

        }'

Refresh Token Request

curl -X POST https://gw.useinsider.com/api/wa/v2/conversational/settings \

        -H "Content-Type: application/json" \

        -H "Authorization: Bearer your_access_token" \

        -d '{

        "webhook_url": "https://partner.example.com/webhooks/conversational",

        "from": "+1234567890",

        "auth_type": "oauth2",

        "oauth2": {

        "grant_type": "refresh_token",

        "token_url": "https://oauth.partner.com/oauth/token",

        "client_id": "your_client_id",

        "client_secret": "your_client_secret",

        "refresh_token": "your_refresh_token",

        "scopes": ["webhook.write"],

        "expires_in": 3600

        }

        }'

Error Codes

Code

HTTP Status

Description

2010

400

The settings request body could not be decoded.

2011

400

The settings request body failed validation.

2012

400

An error occurred while saving the settings.

2020

400

The webhook URL failed validation.