feat(api): add message injection endpoint#19
Open
dathtd119 wants to merge 2 commits intomoazbuilds:masterfrom
Open
feat(api): add message injection endpoint#19dathtd119 wants to merge 2 commits intomoazbuilds:masterfrom
dathtd119 wants to merge 2 commits intomoazbuilds:masterfrom
Conversation
POST /api/inject allows external systems to inject messages into claudeclaw sessions via HTTP. Requires apiToken in settings.json.
- POST /api/inject now auto-sends agent stdout to Telegram (first allowedUserId) after runUserMessage completes - Add telegram.receiveEnabled config flag (default true); when false, daemon skips startPolling but keeps token available for sending. Allows send-only instances to share a bot token without 409 conflict.
Fenrur
added a commit
to Fenrur/claudeclaw
that referenced
this pull request
Mar 13, 2026
- Add /api/inject POST endpoint for external message injection - Add bearer token auth (apiToken in settings) - Add receiveEnabled toggle for Telegram send-only mode - json() helper accepts optional status parameter Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
justmaker
pushed a commit
to justmaker/claudeclaw
that referenced
this pull request
Mar 31, 2026
- tsconfig.json 新增 strict: true 和 skipLibCheck: true - 修復 5 個 type error(含先前 commit 已修的 3 個) - src/ui/server.ts: server.port 可能為 undefined,加 fallback - src/config.ts: parseSettings 參數數量不符(已在前次 commit 修復) - src/whisper.ts: Dirent 無 path 屬性(已在前次 commit 修復) - bun run tsc --noEmit 零 error 通過
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.
Summary
POST /api/injectendpoint for external systems to inject messages into claudeclaw sessions via HTTPapiTokenfield in settings.jsonjson()helper to support HTTP status codesUse Case
Allows n8n workflows (or any external system) to programmatically send messages to a running claudeclaw daemon, replacing the need for a separate hook API.
Configuration
Add to
settings.json:{ "apiToken": "your-secret-token-here" }API
Response:
{ "ok": true, "result": "...", "exitCode": 0 }Files Changed
src/config.ts—apiTokenfield in Settingssrc/ui/http.ts—json()now accepts optional status codesrc/ui/auth.ts— Bearer token validation (new)src/ui/server.ts—POST /api/injecthandlerTest plan