Skip to content

cards update --body silently discards HTML content #420

@bergatron

Description

@bergatron

Summary

basecamp cards update <id> --body '<html>' silently fails to update the card content. The API call succeeds (no error) but the content is not saved — it either stays unchanged or gets set to <p>-</p>.

Steps to reproduce

# This appears to succeed but doesn't actually update the content:
basecamp cards update 9786630080 --project 41746046 --body '<p>Hello <code>world</code></p>'

# Verify — content is unchanged:
basecamp cards show 9786630080 --project 41746046 --json | jq .content
# Returns the old content, not the new HTML

Expected behavior

The card's content field should be updated to the provided HTML string, matching what basecamp api put "buckets/{project}/card_tables/cards/{id}.json" -d '{"content":"<p>Hello</p>"}' does (which works correctly).

Actual behavior

The --body flag value is silently ignored. The API response shows Content: - in the CLI output. The raw API workaround confirms the API itself accepts the content fine — the issue is in how the cards update command maps --body to the API request.

Workaround

Use the raw API directly:

basecamp api put "buckets/{project}/card_tables/cards/{id}.json" \
  -d '{"content":"<p>Hello <code>world</code></p>"}'

Impact

This caused data loss in production — a card's original content (including embedded screenshots and video) was overwritten with <p>-</p> when attempting to update the body via the CLI. The silent failure made it difficult to diagnose.

Related: #410 (stdin support for body arguments across all write commands)

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