Sitelet https://github.com/basecamp/hey-cli/issues/468
Skip to content

hey compose --json should return a send receipt (thread id, urls, envelope) #468

Description

@heredia21

Context

Automation that sends with hey compose --json currently gets a success envelope (ok / a short summary) and nothing that identifies the message that was just created. Scripts already know --to and --subject because they passed them in; they do not get thread_id / topic_id, an app_url, the resolved from, or created_at.

To attach a send to a later hey thread or hey reply, the only workaround is a second search (usually --to the same address) and hoping the newest hit is the one just sent. That is racy and extra API traffic.

Related: #446 asks for a pre-send dry-run of resolved recipients. This request is the post-send receipt.

No account-specific details below.

Ask

On a successful hey compose (and ideally hey reply) with --json / --quiet, return a stable receipt, for example:

  • thread_id / topic_id
  • message_id if that is a distinct object
  • app_url (and/or API url) for the thread
  • resolved from, to, cc, bcc
  • subject
  • created_at

On failure, keep a non-zero exit and include enough structured error to log without scraping stderr.

--ids-only after a send could print the new thread id.

Why it matters

Agent and campaign scripts need to write a complete send log in the same process as the send. A receipt makes that one step instead of compose + search + guess.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs APIRequires HEY API changes before or alongside the CLI workNeeds SDKRequires hey-sdk changes before or alongside the CLI work

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions