Skip to content
Get started

List worker webhook executions

client.Workers.Webhooks.ListExecutions(ctx, workerID, query) (*WebhookExecutionList, error)
GET/api/workers/{workerId}/webhook/executions

List recent webhook delivery attempts for a worker, newest first, paginated 50 per page. Only the worker creator can read execution history.

ParametersExpand Collapse
workerID string
query WorkerWebhookListExecutionsParams
Page param.Field[int64]Optional

Page number (1-indexed). Defaults to 1.

minimum1
ReturnsExpand Collapse
type WebhookExecutionList struct{…}
ID string
CreatedAt Time
formatdate-time
DurationMs int64

Wall-clock time spent on the delivery attempt.

ErrorMessage string

Failure reason when requestStatus is error.

RequestStatus WebhookExecutionRequestStatus

success when the endpoint returned a 2xx response, error otherwise.

One of the following:
const WebhookExecutionRequestStatusSuccess WebhookExecutionRequestStatus = "success"
const WebhookExecutionRequestStatusError WebhookExecutionRequestStatus = "error"
ResponseStatus int64

HTTP status returned by the endpoint, when reachable.

TaskID string

Task that triggered the delivery, when available.

TaskTitle string

Title of the originating task, when available.

URL string

Endpoint Handinger attempted to deliver to.

WorkerID string
Page int64

Current page number.

PageCount int64

Total number of pages available.

TotalCount int64

Total number of executions recorded.

List worker webhook executions

package main

import (
  "context"
  "fmt"

  "github.com/ramensoft/handinger-go"
  "github.com/ramensoft/handinger-go/option"
)

func main() {
  client := handinger.NewClient(
    option.WithAPIKey("My API Key"),
  )
  webhookExecutionList, err := client.Workers.Webhooks.ListExecutions(
    context.TODO(),
    "t_org_123_w_01HZY2ZJQ8G7K42W2D7WF6V4GM",
    handinger.WorkerWebhookListExecutionsParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", webhookExecutionList.Logs)
}
{
  "logs": [
    {
      "id": "whe_01HZY31W2SZJ8MJ2FQTR3M1K9D",
      "createdAt": "2019-12-27T18:11:19.117Z",
      "durationMs": 0,
      "errorMessage": "errorMessage",
      "requestStatus": "success",
      "responseStatus": 0,
      "taskId": "taskId",
      "taskTitle": "taskTitle",
      "url": "url",
      "workerId": "workerId"
    }
  ],
  "page": 0,
  "pageCount": 0,
  "totalCount": 0
}
Returns Examples
{
  "logs": [
    {
      "id": "whe_01HZY31W2SZJ8MJ2FQTR3M1K9D",
      "createdAt": "2019-12-27T18:11:19.117Z",
      "durationMs": 0,
      "errorMessage": "errorMessage",
      "requestStatus": "success",
      "responseStatus": 0,
      "taskId": "taskId",
      "taskTitle": "taskTitle",
      "url": "url",
      "workerId": "workerId"
    }
  ],
  "page": 0,
  "pageCount": 0,
  "totalCount": 0
}