Skip to content
Get started

Update a worker template

client.Workers.Update(ctx, workerID, body) (*WorkerTemplate, error)
PATCH/api/workers/{workerId}

Update a worker’s instructions, title, summary, visibility, or output schema. Only the fields you send are changed; omitted fields keep their current values. Only the worker creator can update a worker.

ParametersExpand Collapse
workerID string
body WorkerUpdateParams
UpdateWorker param.Field[UpdateWorker]
ReturnsExpand Collapse
type WorkerTemplate struct{…}
ID string
CreatedAt string
Instructions string
OrganizationID string
OutputSchema map[string, any]
Summary string
Title string
UpdatedAt string
URL string

Web URL of the worker in the Handinger dashboard.

UserID string
Visibility WorkerTemplateVisibility
One of the following:
const WorkerTemplateVisibilityPublic WorkerTemplateVisibility = "public"
const WorkerTemplateVisibilityPrivate WorkerTemplateVisibility = "private"

Update a worker template

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"),
  )
  workerTemplate, err := client.Workers.Update(
    context.TODO(),
    "t_org_123_w_01HZY2ZJQ8G7K42W2D7WF6V4GM",
    handinger.WorkerUpdateParams{
      UpdateWorker: handinger.UpdateWorkerParam{

      },
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", workerTemplate.ID)
}
{
  "id": "id",
  "createdAt": "createdAt",
  "instructions": "instructions",
  "organizationId": "organizationId",
  "outputSchema": {
    "foo": "bar"
  },
  "summary": "summary",
  "title": "title",
  "updatedAt": "updatedAt",
  "url": "https://v3.handinger.com/worker/wrk_vk81XUHKHG-qr4",
  "userId": "userId",
  "visibility": "public"
}
Returns Examples
{
  "id": "id",
  "createdAt": "createdAt",
  "instructions": "instructions",
  "organizationId": "organizationId",
  "outputSchema": {
    "foo": "bar"
  },
  "summary": "summary",
  "title": "title",
  "updatedAt": "updatedAt",
  "url": "https://v3.handinger.com/worker/wrk_vk81XUHKHG-qr4",
  "userId": "userId",
  "visibility": "public"
}