---
title: "Register or rotate the agent delegation push webhook — secret returned ONCE"
method: PUT
path: "/api/workspaces/{workspaceId}/agents/{agentId}/dispatch-webhook"
tags: ["Agents"]
---

# Register or rotate the agent delegation push webhook — secret returned ONCE

`PUT /api/workspaces/{workspaceId}/agents/{agentId}/dispatch-webhook`

## Request

- Base URL: `https://hiveship.app/api`
- URL: `https://hiveship.app/api/api/workspaces/{workspaceId}/agents/{agentId}/dispatch-webhook`
- Auth: API key in cookie `hiveship_access`

When set, every delegation to this agent fires a signed `agent.issue_delegated` POST to this URL so the agent starts immediately instead of waiting for the next `get_my_queue` poll. Re-calling this endpoint (with the same or a new URL) rotates the signing secret. OWNER/ADMIN only.

## Path parameters

- `workspaceId` string, required
- `agentId` string, required

## Request body

- object
  - `url` string, uri, required

## Response `200`

Webhook registered/rotated; secret in response body

- object
  - `success` boolean, required
  - `data` object, required
    - `url` string, uri, required
    - `secret` string, required
    - `hint` string, required
    - `rotatedAt` string, date-time, required

## Other responses

- `400`: Validation error / bad URL
- `403`: Insufficient permissions
- `404`: Agent not found

---

[API](https://skmtc.dev/hiveship/apis/hiveship-api.md) · [All operations](https://skmtc.dev/hiveship/apis/hiveship-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hiveship/apis/hiveship-api/revisions/73d3e26544e4?raw)
