> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.apologist.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.apologist.ai/_mcp/server.

# WhatsApp Webhook Verification

GET https://your-agent-domain.com/api/v1/channels/{id}/whatsapp

Handles the Meta WhatsApp Cloud API webhook verification handshake, echoing `hub.challenge` when `hub.verify_token` matches the channel's configured token.

Reference: https://docs.apologist.ai/agent-api/api-reference/channels/verify-whats-app-webhook

## Request

### Path parameters

- `id` (string, required) — The channel id

### Query parameters

- `hub.mode` (enum, required)
  - Allowed values: `subscribe`
- `hub.verify_token` (string, required)
- `hub.challenge` (string, optional)

## Response

### 200

Verification succeeded; echoes the challenge

## Errors

### 400 Bad Request Error

Invalid request or unsupported mode

- `any`

### 403 Forbidden Error

Verify tokens do not match

- `any`

### 404 Not Found Error

Channel not found

- `any`

## Examples

**Response**

```json
"string"
```

**SDK Code**

```typescript
import { ApologistAgentClient } from "apologist";

async function main() {
    const client = new ApologistAgentClient({
        apiKey: "YOUR_API_KEY_HERE",
    });
    await client.channels.verifyWhatsAppWebhook({
        id: "id",
        hubMode: "subscribe",
        hubVerifyToken: "hub.verify_token",
    });
}
main();

```

```python
from apologist import ApologistAgentClient

client = ApologistAgentClient(
    api_key="YOUR_API_KEY_HERE",
)

client.channels.verify_whats_app_webhook(
    id="id",
    hub_mode="subscribe",
    hub_verify_token="hub.verify_token",
)

```

```java
package com.example.usage;

import ai.apologist.AgentClient;
import ai.apologist.resources.channels.requests.VerifyWhatsAppWebhookRequest;
import ai.apologist.resources.channels.types.VerifyWhatsAppWebhookRequestHubMode;

public class Example {
    public static void main(String[] args) {
        AgentClient client = AgentClient
            .builder()
            .apiKey("YOUR_API_KEY_HERE")
            .build();

        client.channels().verifyWhatsAppWebhook(
            "id",
            VerifyWhatsAppWebhookRequest
                .builder()
                .hubMode(VerifyWhatsAppWebhookRequestHubMode.SUBSCRIBE)
                .hubVerifyToken("hub.verify_token")
                .build()
        );
    }
}
```

```ruby
require "apologist"

client = Apologist::AgentClient.new(api_key: "YOUR_API_KEY_HERE")

client.channels.verify_whats_app_webhook(
  id: "id",
  hub_mode: "subscribe",
  hub_verify_token: "hub.verify_token"
)

```

```csharp
using Apologist;
using System.Threading.Tasks;

public partial class Examples
{
    public async Task Example() {
        var client = new AgentClient(
            apiKey: "YOUR_API_KEY_HERE"
        );

        await client.Channels.VerifyWhatsAppWebhookAsync(
            new VerifyWhatsAppWebhookRequest {
                Id = "id",
                HubMode = VerifyWhatsAppWebhookRequestHubMode.Subscribe,
                HubVerifyToken = "hub.verify_token"
            }
        );
    }

}

```

```go
package example

import (
    context "context"

    apgsdkgo "github.com/apologist-project/apg-sdk-go"
    client "github.com/apologist-project/apg-sdk-go/client"
    option "github.com/apologist-project/apg-sdk-go/option"
)

func do() {
    client := client.NewApologistAgentClient(
        option.WithAPIKey(
            "YOUR_API_KEY_HERE",
        ),
    )
    request := &apgsdkgo.VerifyWhatsAppWebhookRequest{
        ID: "id",
        HubMode: apgsdkgo.VerifyWhatsAppWebhookRequestHubModeSubscribe,
        HubVerifyToken: "hub.verify_token",
    }
    client.Channels.VerifyWhatsAppWebhook(
        context.TODO(),
        request,
    )
}

```

```php
<?php

namespace Example;

use Apologist\AgentClient;
use Apologist\Channels\Requests\VerifyWhatsAppWebhookRequest;
use Apologist\Channels\Types\VerifyWhatsAppWebhookRequestHubMode;

$client = new AgentClient(
    apiKey: 'YOUR_API_KEY_HERE',
);
$client->channels->verifyWhatsAppWebhook(
    'id',
    new VerifyWhatsAppWebhookRequest([
        'hubMode' => VerifyWhatsAppWebhookRequestHubMode::Subscribe->value,
        'hubVerifyToken' => 'hub.verify_token',
    ]),
);

```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://your-agent-domain.com/api/v1/channels/id/whatsapp?hub.mode=subscribe&hub.verify_token=hub.verify_token")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```