---
title: "Create a playbook"
method: POST
path: "/api/workspaces/{workspaceId}/playbooks"
tags: ["Playbooks"]
---

# Create a playbook

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

## Request

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

## Path parameters

- `workspaceId` string, required

## Request body

- object
  - `name` string, required
  - `triggerHint` string, required
  - `content` string, required

## Response `201`

Playbook created

- object
  - `success` boolean, required
  - `data` object, required
    - `id` string, cuid, required
    - `workspaceId` string, cuid, required
    - `name` string, required
    - `triggerHint` string, nullable, required
    - `content` string
    - `version` integer, required
    - `createdAt` string, required
    - `updatedAt` string, required

## Other responses

- `400`: Validation error, or a playbook with that name exists
- `403`: Not workspace OWNER/ADMIN, or plan lacks the feature

---

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