Skip to content
Go to Micro

Update a webhook

client.Webhooks.Update(ctx, webhookID, params) (*WebhookUpdateResponse, error)
PATCH/v2/webhooks/{teamId}/{webhookId}

Updates mutable fields. Changing url resets verification and re-runs the handshake.

ParametersExpand Collapse
webhookID string
formatuuid
params WebhookUpdateParams
TeamID param.Field[string]Optional

Path param

formatuuid
WebhookUpdate param.Field[WebhookUpdate]

Body param: Partial update. Changing url resets verification and re-runs the handshake.

ReturnsExpand Collapse
type WebhookUpdateResponse struct{…}

A webhook plus the status of a verification handshake enqueued by this request.

Verification WebhookUpdateResponseVerificationOptional

Status of the verification handshake enqueued by this request. The handshake runs asynchronously in the dispatcher; poll the webhook (its verified flag flips to true on success) to observe the outcome.

Status WebhookUpdateResponseVerificationStatus

Always pending at the moment of the response — the dispatcher has been asked to run the handshake but has not reported back yet.

Update a webhook

package main

import (
  "context"
  "fmt"

  "github.com/micro-so/micro-sdk-go"
  "github.com/micro-so/micro-sdk-go/option"
)

func main() {
  client := micro.NewClient(
    option.WithAPIKey("My API Key"),
    option.WithTeamID("My Team ID"),
  )
  webhook, err := client.Webhooks.Update(
    context.TODO(),
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    micro.WebhookUpdateParams{
      WebhookUpdate: micro.WebhookUpdateParam{

      },
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", webhook)
}
{
  "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "created_at": "2019-12-27T18:11:19.117Z",
  "enabled": true,
  "name": "name",
  "team_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "url": "https://example.com",
  "verified": true,
  "description": "description",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "verification_token": "verification_token",
  "verified_at": "2019-12-27T18:11:19.117Z",
  "verification": {
    "status": "pending"
  }
}
Returns Examples
{
  "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "created_at": "2019-12-27T18:11:19.117Z",
  "enabled": true,
  "name": "name",
  "team_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "url": "https://example.com",
  "verified": true,
  "description": "description",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "verification_token": "verification_token",
  "verified_at": "2019-12-27T18:11:19.117Z",
  "verification": {
    "status": "pending"
  }
}