Skip to content

api: support ClickUp v3 endpoints and multipart bodies in 'cu api' #30

Description

@timimsms

Context

cu api is the escape hatch for endpoints without dedicated commands, but it hardcodes the v2 base URL, making the entire ClickUp v3 API surface (Docs, Chat, Attachments v3, Audit Logs) unreachable. It also only supports raw string bodies, so multipart uploads (e.g. task attachments) are impossible even on v2.

Evidence

  • internal/cmd/api.go:77baseURL := "https://api.clickup.com/api/v2"; the endpoint argument is always appended to the v2 prefix with no way to target /api/v3.
  • cu api accepts only a raw --data string body; there is no --field/--file multipart support, so POST /task/{task_id}/attachment (multipart/form-data) cannot be exercised.

Suggested fix

  1. Add API version selection (e.g. --api-version 3) or accept full paths (cu api /api/v3/...) so both v2 and v3 endpoints are reachable.
  2. Add gh-api-style body construction: repeatable --field key=value and --file key=@path flags that switch the request to multipart/form-data, enabling attachment uploads.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions