Claude Platform Docs

Parse Unverified

client.Beta.Webhooks.ParseUnverified(payload) (*UnwrapWebhookEvent, error)
Function

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

Parameters
payload []byte

The raw JSON body of the incoming webhook request.

Returns
type UnwrapWebhookEvent struct { Type: "event"; ID; CreatedAt; Data }
Type Event

Object type. Always event for webhook payloads.

ID string

Unique event identifier for idempotency.

CreatedAt Time

RFC 3339 timestamp when the event occurred.

formatdate-time
One of the following:
Parse Unverified
package main

import (
	"fmt"

	"github.com/anthropics/anthropic-sdk-go/v2"
	"github.com/anthropics/anthropic-sdk-go/v2/option"
)

func main() {
	client := anthropic.NewClient(
		option.WithAPIKey("my-anthropic-api-key"),
	)
	// payload is the raw body of the incoming webhook request.
	event, err := client.Beta.Webhooks.ParseUnverified(payload)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", event)
}