Claude Platform Docs

Parse Unverified

$client->beta->webhooks->parseUnverified(string body): BetaWebhookEvent
Function

Parses a webhook payload into an event without verifying its signature. Prefer unwrap() unless you have already verified the signature yourself.

Parameters
body: string

The raw JSON body of the incoming webhook request.

Returns
class BetaWebhookEvent { $type = 'event'; $id; $createdAt; $data; }
"event" type

Object type. Always event for webhook payloads.

string id

Unique event identifier for idempotency.

\Datetime createdAt

RFC 3339 timestamp when the event occurred.

Parse Unverified
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use Anthropic\Client;

$client = new Client(apiKey: 'my-anthropic-api-key');

// $body is the raw body of the incoming webhook request.
$event = $client->beta->webhooks->parseUnverified($body);

var_dump($event);