Skip to content
  • Auto
  • Light
  • Dark
Get Started

Create

Create
client.Webhooks.New(ctx, body) (*WebhookWebhookWebhookNewResponse, error)
post/api/v1/webhooks

Invokes the c1.api.webhooks.v1.WebhooksService.Create method.

Parameters
bodyDisplayNamefieldURLfieldDescriptionfieldWebhookNewParams
Hide ParametersShow Parameters
DisplayNamefield
param.Field[string]

The displayName field.

URLfield
param.Field[string]

The url field.

Descriptionfield
optional
param.Field[string]

The description field.

Returns
WebhookNewResponsestruct

The WebhooksServiceCreateResponse message.

Hide ParametersShow Parameters
WebhookIDstringCreatedAtTimeDeletedAtTimeDescriptionstringDisplayNamestringUpdatedAtTimeURLstringWebhook
optional

The Webhook message.

Request example Go
package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/-go"
  "github.com/stainless-sdks/-go/option"
)

func main() {
  client := conductoronesdk.NewClient(
    option.WithAPIKey("My API Key"),
  )
  webhook, err := client.Webhooks.New(context.TODO(), conductoronesdk.WebhookNewParams{
    DisplayName: "displayName",
    URL: "url",
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", webhook.Webhook)
}
200 Example
{
  "webhook": {
    "id": "id",
    "description": "description",
    "displayName": "displayName",
    "url": "url"
  }
}