feat: add raw API command #13
Merged
Merged
Conversation
Member
Author
|
@codex please review |
|
Codex Review: Didn't find any major issues. Another round soon, please! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Merging this branch changes the coverage (1 decrease, 1 increase)
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. Changed unit test files
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds
chatwoot apias an authenticated raw API escape hatch for Chatwoot endpoints that do not yet have first-class CLI commands.Account-relative paths like
/conversations/123are expanded to/api/v1/accounts/<id>/conversations/123, so users do not need to type the full account API path. The command reuses the existing authenticated client and sends the configured Chatwoot API token headers automatically.First-class commands remain preferred. Raw API usage is documented as an escape hatch with stricter safety expectations.
Details
chatwoot apisupports curl-like options for endpoint-level calls:-X/--method-d/--data@file@--H/--headerJSON responses are pretty-printed. Non-JSON responses are passed through as-is.
Absolute URLs are rejected to avoid sending saved API tokens to arbitrary hosts.
The bundled agent skill now includes:
Agents are instructed to consult the application Swagger before making raw API calls. Mutating raw API calls are treated as privileged actions and must show the exact method, path, and body before execution. Writes must not be performed without explicit user confirmation.