---
title: "Create a new webhook (secret returned ONCE)"
method: POST
path: "/api/workspaces/{workspaceId}/webhooks"
tags: ["Webhooks"]
---

# Create a new webhook (secret returned ONCE)

`POST /api/workspaces/{workspaceId}/webhooks`

## Request

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

## Request body

- object
  - `name` string, required
  - `url` string, uri, required
  - `events` string[], required

## Response `201`

Created webhook with plaintext secret

- object
  - `success` boolean, required
  - `data` object, required
    - `id` string, cuid, required
    - `name` string, required
    - `url` string, uri, required
    - `events` string[], required
    - `active` boolean, required
    - `lastSuccessAt` string, date-time, nullable, required
    - `lastFailureAt` string, date-time, nullable, required
    - `consecutiveFailureCount` integer, required
    - `disabledAt` string, date-time, nullable, required
    - `disabledReason` string, nullable, required
    - `workspaceId` string, cuid, required
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, required
    - `secret` string, required

## Other responses

- `400`: Validation error / bad URL
- `402`: Plan does not include api-access
- `403`: Requires workspace OWNER or ADMIN
- `409`: Max webhooks per workspace reached

---

[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)
