Create Webhook Endpoint
WebhookEndpointWithSecret webhooks().create(WebhookCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
POST/webhook_endpoints
Create Webhook Endpoint
package com.openai.example;
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.webhooks.WebhookCreateParams;
import com.openai.models.webhooks.WebhookEndpointWithSecret;
public final class Main {
private Main() {}
public static void main(String[] args) {
OpenAIClient client = OpenAIOkHttpClient.fromEnv();
WebhookCreateParams params = WebhookCreateParams.builder()
.addEventType(WebhookCreateParams.EventType.BATCH_COMPLETED)
.name("x")
.url("https://")
.build();
WebhookEndpointWithSecret webhookEndpointWithSecret = client.webhooks().create(params);
}
}{
"id": "id",
"created_at": 0,
"event_types": [
"string"
],
"name": "name",
"object": "webhook_endpoint",
"signing_secret": "signing_secret",
"signing_secret_hint": "signing_secret_hint",
"url": "url",
"updated_at": 0
}Returns Examples
{
"id": "id",
"created_at": 0,
"event_types": [
"string"
],
"name": "name",
"object": "webhook_endpoint",
"signing_secret": "signing_secret",
"signing_secret_hint": "signing_secret_hint",
"url": "url",
"updated_at": 0
}