Skip to content

templates construct returns "Bad Request" for all templates #454

@m3tam3re

Description

@m3tam3re

Bug Report

basecamp templates construct <template_id> --name <name> returns a generic Bad Request error for every template, even when the template exists and is valid.

Steps to Reproduce

  1. List templates to confirm one exists:
$ basecamp templates list
4 templates
 Id       Name                         Description   Created
 47071281 Project Default DE                         1 hour ago
 46955909 AZ Standard                                Apr 20, 2026
 ...
  1. Try to construct a project from any template:
$ basecamp templates construct 46955909 --name Tester
╭─────────────╮
│ ✗ Error     │
│             │
│ Bad Request │
╰─────────────╯
$ basecamp templates construct 46955909 --name Tester --json
{
  "ok": false,
  "error": "Bad Request",
  "code": "api_error"
}

Expected Behavior

A new project construction should be created, returning a construction ID that can be polled via templates construction.

Root Cause (Likely)

Two issues in the construct command:

  1. Spurious --status flag: The command exposes --status string Filter: active, archived, trashed (default "active"). This is a list filter that should not be present on a create/construct action. If status: "active" is sent in the POST body, the Basecamp API rejects it with 400 because POST /templates/:template_id/project_constructions.json does not accept a status parameter.
  2. Missing project wrapper: Per the Basecamp API docs, the request body must nest name and description inside a project object:
{
  "project": {
    "name": "Tester",
    "description": "..."
  }
}

If the CLI sends them flat ({"name": "Tester"}), the API returns 400.

Environment

$ basecamp --version
basecamp version 0.7.2

Installed via Nix. Authentication is valid (basecamp auth status shows authenticated, not expired). The error is reproducible with multiple templates and project names.

Workaround

Using the API directly works:

curl -s -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"project":{"name":"Tester"}}' \
  https://3.basecampapi.com/$ACCOUNT_ID/templates/46955909/project_constructions.json

Returns 201 Created as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions