WorkerKit

Build with the API

Build a kit over the API.

Read the guide, write the kit as one JSON file, validate it, publish it private, install it and run it: six steps, each one HTTPS request against the same endpoints the MCP server calls. The reads need no account; the writes take a key with the scopes below.

Before you start

A key, and the requests a build makes.

An account admin creates the key under Fleet access and reads it once. Keep it in WK_MANAGER_KEY, the variable the requests below and the wk CLI both read.

RequestWhat it doesScope
GET /api/directory/mcp/authoring/guide?section=The authoring guide, one section at a time. Start with index.none
GET /api/directory/mcp/authoring/tools?app=Every app and the tools a worker gets on it, with the operation key that unlocks each.none
GET /api/directory/mcp/authoring/vocabulary?app=The exact keys a kit may grant: operations, fields, providers, slots, categories.none
POST /api/manage/kits/validateThe dry run: every gate at once, and the manifest that would publish. Add ?kitRef=<slug> to judge a replacement.publishKits
POST /api/manage/kitsPublish a new kit from content, or from a worker with sourceWorkerId. Answers 201.publishKits
GET /api/manage/kits/{slug}/install-previewThe install form and your account's ability to satisfy it.installKits
POST /api/manage/kits/{slug}/installInstall as a new worker; deploy: true deploys it in the same call.installKits
PATCH /api/manage/workers/{workerId}/worker-bindingsFill, re-point or clear worker slots after install, one atomic alias map.manageAppsAndWorkers
POST /api/manage/workers/{workerId}/runRun it; waitSeconds up to 55 holds for the settled receipt.runWorkers
PUT /api/manage/kits/{slug}Replace wholesale with visibility private. Public publishing is temporarily paused.publishKits
ScopeWhat building a kit uses it for
publishKitsValidate, publish, edit, replace, unlist and delete your kits, and set the publisher name.
installKitsPreview the install form and install the private kit as a new worker.
manageAppsAndWorkersOptional: fill worker slots or change the installed worker's apps afterwards.
manageDeploymentsDeploy the new worker so it runs at all. Install with deploy set, or deploy after.
runWorkersStart the test run.
readRunsRead what the run returned. Without it the receipt comes back with its content withheld.
readWorkersWhich apps are connected, your kits with their moderation state, and the scan reports.

Create the key at Fleet access, or connect with OAuth2 as the API page describes. Both specs below describe every request, its body and its responses.

The specs

Two OpenAPI documents.

SurfaceOpenAPI 3 document
Workershttps://api.workerkit.ai/openapi/workers.json
Directoryhttps://api.workerkit.ai/openapi/directory.json

Step 1

Read the guide and the vocabulary.

No key needed. The guide says which kind of kit the job is and how to fill every field; the vocabulary holds the only keys a kit may grant.

  • The guide, no auth: index first, then schema and rules curl "https://api.workerkit.ai/api/directory/mcp/authoring/guide?section=index" curl "https://api.workerkit.ai/api/directory/mcp/authoring/guide?section=schema"
  • One app, no auth: what a worker can do on it, and its exact keys curl "https://api.workerkit.ai/api/directory/mcp/authoring/tools?app=tasks" curl "https://api.workerkit.ai/api/directory/mcp/authoring/vocabulary?app=tasks"

Read index first, then schema and rules; skill, instruction, slots, state, example and selfcheck as the kit needs them, decision for a classifier, and workers before declaring workerSlots. Read the vocabulary per app for the apps you use, and copy keys from it: there is no "all" shorthand.

Step 2

Write kit.json.

One JSON object: the listing, the content and the app descriptions. A complete example is on the build hub, and the guide's example section has a longer one beside a decision kit. Set "visibility": "private" for the first publish, and add publisherName to the account's first publish only.

Step 3

Validate it.

The dry run judges the body as a public publish and reports every section at once. Nothing is created.

  • Validate the file you will publish curl -X POST https://api.workerkit.ai/api/manage/kits/validate \ -H "Authorization: Bearer $WK_MANAGER_KEY" \ -H "Content-Type: application/json" \ --data @kit.json

Read canPublish first. errors[] would block the publish and warnings[] would not, each with its section; lintWarnings are advisory nudges about the instructions; requiredInputs lists the install-form fields your text declared; manifestPreview is the exact permission manifest that would ship. Fix and repeat until canPublish is true.

Step 4

Publish it private.

The response is the listing: its slug, its status, and any lint warnings.

  • Publish it, with "visibility": "private" in the body curl -X POST https://api.workerkit.ai/api/manage/kits \ -H "Authorization: Bearer $WK_MANAGER_KEY" \ -H "Content-Type: application/json" \ --data @kit.json

A publish is not idempotent: every success creates another listing. After a timeout, read GET /api/manage/kits/mine before you send it again. A private kit installs only on your account and skips the public scan; the same request publishes from a worker you already tuned when the body carries sourceWorkerId instead of content (the body).

Step 5

Install it, deploy it, run it once.

Installing creates the worker; deploying is what lets it run at all; one run shows whether the instructions and the access hold.

  • Read the install form curl https://api.workerkit.ai/api/manage/kits/{slug}/install-preview \ -H "Authorization: Bearer $WK_MANAGER_KEY"
  • Install and deploy, answering any requiredInputs the preview lists curl -X POST https://api.workerkit.ai/api/manage/kits/{slug}/install \ -H "Authorization: Bearer $WK_MANAGER_KEY" \ -H "Content-Type: application/json" \ -d '{"deploy": true}'
  • Run it with the new worker's id, and wait for the receipt curl -X POST https://api.workerkit.ai/api/manage/workers/{workerId}/run \ -H "Authorization: Bearer $WK_MANAGER_KEY" \ -H "Content-Type: application/json" \ -d '{"waitSeconds": 55}'

The install response carries the new worker's workerId for the run request, and its key and any webhook signing secrets exactly once: store them before you discard the response. readiness says whether an app still needs connecting, and connectAppsUrl is where a person connects it. Deploying needs manageDeployments beside installKits; reading the receipt needs readRuns.

Step 6

Keep improving it privately.

Public publishing and promotion are temporarily paused. Send visibility private when replacing or validating your kit.

  • Validate the private version against the kit it replaces curl -X POST "https://api.workerkit.ai/api/manage/kits/validate?kitRef={slug}" \ -H "Authorization: Bearer $WK_MANAGER_KEY" \ -H "Content-Type: application/json" \ --data @kit.json
  • Replace it, with "visibility": "private" in the body curl -X PUT https://api.workerkit.ai/api/manage/kits/{slug} \ -H "Authorization: Bearer $WK_MANAGER_KEY" \ -H "Content-Type: application/json" \ --data @kit.json

Private kits remain available to your account. Public publishing, public replacement and relisting return an error while the pause is in effect.

Send a body on every POST, at least {}: a POST with no body is refused at the edge before it reaches the API, which bites the bodyless unpublish, relist and make-private calls first.

Errors

The responses to branch on.

Status and codeWhat it means
400 invalid_requestThe publish names the first rule the body breaks. Validate to see every one at once.
403 OPERATION_NOT_ALLOWEDThe key lacks the scope the message names, or the source worker came from a protected kit. A wider key is the fix, never a retry.
404 not_foundNo such kit on this account. Another account's kit is indistinguishable by design.
409 conflictThe publisher name on a first publish is already taken.
429A rate window is full: wait out Retry-After. Publishing is 20 an hour per account and installing 10.
500 kit_data_errorA problem on our side, not in your body. Changing the request will not help; report the slug.
503 kit_scan_unavailableThe public scan could not run, and nothing changed. Retry later with the same body, or publish private.

Edit, unlist and delete are on the build hub. The same steps run from your AI assistant and the terminal.