Playbooks API

Create, list, update, and version playbooks.

Playbooks are version-controlled workflow templates. Each playbook has one or more versions, and only one version can be approved (active) at a time. All endpoints require authentication.

Endpoints

All paths are relative to /api/v1/workspaces/{workspaceId}

List playbooks

GET /playbooks

Returns a paginated list of playbooks in the workspace.

Query parameters

ParameterTypeDescription
statusstringFilter by version status: draft, approved, deprecated
function_areastringFilter by function area (e.g. "Marketing")
ownerstringFilter by owner user ID
sortstringupdated_at (default), title, created_at
orderstringdesc (default), asc
pagenumberPage number (default: 1)
limitnumberResults per page (default: 50)
curl "https://patina.so/api/v1/workspaces/WORKSPACE_ID/playbooks?status=approved&limit=10" \
  -H "Authorization: Bearer pk_YOUR_API_KEY"
{
  "playbooks": [
    {
      "id": "pb_abc123...",
      "title": "Blog Post Workflow",
      "slug": "blog-post-workflow",
      "summary": "Step-by-step process for writing blog posts",
      "functionArea": "Marketing",
      "visibility": "workspace_private",
      "latestVersion": {
        "id": "ver_xyz...",
        "versionNumber": 3,
        "status": "approved"
      },
      "createdAt": "2025-01-15T10:00:00.000Z",
      "updatedAt": "2025-03-10T14:30:00.000Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 10,
    "total": 42
  }
}

Get a playbook

GET /playbooks/:playbookId

Returns the full playbook including its versions, linked context nodes, and tags.

curl https://patina.so/api/v1/workspaces/WORKSPACE_ID/playbooks/PLAYBOOK_ID \
  -H "Authorization: Bearer pk_YOUR_API_KEY"

Create a playbook

POST /playbooks

Creates a new playbook with an initial draft version. Requires editor role or above.

Request body

FieldTypeRequiredDescription
titlestringYesPlaybook name
versionobjectYesInitial version with content (object, required) and changeNote (string, optional)
slugstringNoURL-safe identifier. Auto-generated from title if omitted.
summarystringNoBrief description
descriptionstringNoLonger description (supports markdown)
functionAreastringNoCategory label (e.g. "Marketing", "Engineering")
visibilitystringNoworkspace_private (default) or parent_readonly
curl -X POST https://patina.so/api/v1/workspaces/WORKSPACE_ID/playbooks \
  -H "Authorization: Bearer pk_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Customer Onboarding Email",
    "summary": "Template for welcoming new customers",
    "functionArea": "Customer Success",
    "version": {
      "content": {
        "instructions": "Write a warm onboarding email that introduces the key features..."
      },
      "changeNote": "Initial draft"
    }
  }'

Update a playbook

PATCH /playbooks/:playbookId

Updates playbook metadata. Does not create a new version — use the versions endpoint for that. Requires editor role.

curl -X PATCH https://patina.so/api/v1/workspaces/WORKSPACE_ID/playbooks/PLAYBOOK_ID \
  -H "Authorization: Bearer pk_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Customer Onboarding Email v2",
    "summary": "Updated template with product tour link"
  }'

Archive a playbook

DELETE /playbooks/:playbookId

Soft-deletes the playbook by setting archivedAt. The playbook is hidden from list results but not permanently removed. Requires owner role.

curl -X DELETE https://patina.so/api/v1/workspaces/WORKSPACE_ID/playbooks/PLAYBOOK_ID \
  -H "Authorization: Bearer pk_YOUR_API_KEY"

Create a version

POST /playbooks/:playbookId/versions

Creates a new draft version of a playbook. The previous approved version remains active until the new version is explicitly approved.

Request body

FieldTypeRequiredDescription
contentobjectYesVersion content (typically includes instructions)
changeNotestringNoDescription of what changed
curl -X POST https://patina.so/api/v1/workspaces/WORKSPACE_ID/playbooks/PLAYBOOK_ID/versions \
  -H "Authorization: Bearer pk_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": {
      "instructions": "Updated instructions with new brand voice..."
    },
    "changeNote": "Aligned with Q2 brand refresh"
  }'

Approve a version

PATCH /playbooks/:playbookId/versions/:versionId/approve

Marks a draft version as approved. Any previously approved version on the same playbook is automatically deprecated. Requires editor role.

curl -X PATCH https://patina.so/api/v1/workspaces/WORKSPACE_ID/playbooks/PLAYBOOK_ID/versions/VERSION_ID/approve \
  -H "Authorization: Bearer pk_YOUR_API_KEY"