Package-level declarations

Types

Link copied to clipboard

An incoming webhook lacks a valid signature or has an unacceptable delivery timestamp.

Link copied to clipboard
@Serializable
data class WebhookEndpoint(val id: String, val createdAt: Long, val eventTypes: List<String>, val name: String, val url: String, val signingSecretHint: String? = null, val updatedAt: Long? = null, val signingSecret: String? = null, val objectType: String = "webhook_endpoint")

Webhook endpoint configuration and optional creation/rotation signing secret.

Link copied to clipboard
@Serializable
data class WebhookEndpointRequest(val eventTypes: List<String>, val name: String, val url: String)

Creates a project webhook endpoint.

Link copied to clipboard
@Serializable
data class WebhookEndpointUpdate(val eventTypes: List<String>? = null, val name: String? = null, val url: String? = null)

Changes a project webhook endpoint.

Link copied to clipboard
@Serializable(with = WebhookEvent.Serializer::class)
data class WebhookEvent(val payload: JsonObject)

A webhook event preserving all fields, including future event types and data.

Link copied to clipboard
@Serializable
data class WebhookSecretRotation(val keepOldSecretActiveFor24Hours: Boolean? = null)

Controls overlap while rotating a webhook signing key.

Link copied to clipboard
@Serializable
data class WebhookTestRequest(val eventType: String)

Requests a sample delivery to a webhook endpoint.

Link copied to clipboard
@Serializable
data class WebhookTestResult(val eventType: String, val statusCode: Int, val webhookEndpointId: String, val success: Boolean = true, val objectType: String = "webhook_endpoint.test")

Result of sending a sample webhook delivery.

Link copied to clipboard
class WebhookVerifier(secret: String, toleranceSeconds: Long = 300)

Verifies OpenAI's Standard Webhooks HMAC-SHA256 signatures over the unmodified body bytes. Supply a trusted current Unix time on every call. Timestamp tolerance limits replay age; applications must additionally deduplicate event IDs when processing deliveries.