-
Notifications
You must be signed in to change notification settings - Fork 0
Webhooks Patterns
The plugin itself doesn't subscribe to Box webhooks — there's no place to host a webhook receiver inside a Claude Code or Cowork plugin runtime. But if you self-host a server (anywhere with a public HTTPS endpoint), you can wire Box events to trigger box-memory workflows automatically.
Full reference at
references/webhooks.md.
- You operate your own HTTPS-reachable server
- You want automatic actions on Box-side changes (file uploaded → auto-companion generated)
- You have IT / DevOps capacity to maintain the receiver + HMAC verification
If none of those apply, skip webhooks. The plugin works fine in pull-mode (user invokes skills or Claude does on demand).
Box webhooks v2 (GA) let you subscribe to events on specific files or folders. When the event fires, Box POSTs the event payload to your address.
-
30+ trigger types:
FILE.UPLOADED,FILE.COPIED,FILE.MOVED,FILE.DELETED,FILE.RENAMED,METADATA_INSTANCE.CREATED/UPDATED/DELETED,FOLDER.CREATED,COMMENT.CREATED, etc. - Target = a file ID or folder ID (subscribe per-resource, not per-account)
- Up to 5 webhooks per resource, 1,000 per Box application
- HMAC-SHA256 signature verification via webhook primary/secondary key headers
- Retry: ~24 h with exponential backoff
- Address must be HTTPS and publicly reachable from Box's IP ranges
Trigger: FILE.UPLOADED on the workspace's files/ folder.
Receiver flow:
- Verify HMAC signature
- Extract
source.id,source.parent.id,source.name - If file is a supported binary (PDF / DOCX / image / CAD / Office), trigger companion generation
- Your agent loop invokes
/box-companion <file_id>— the plugin handles the rest (uses Box AI Extract on Business+, falls back to sparse on Personal) - Companion
.mdis written to Box;_index.jsonupdated
Latency budget: webhook delivery (~seconds) + agent invocation (~seconds) + companion gen (~tens of seconds with AI). End-to-end typically <2 minutes.
Trigger: METADATA_INSTANCE.UPDATED and METADATA_INSTANCE.DELETED on memory files.
Receiver flow:
- Verify signature
- Mark the affected folder "needs reindex" in your control plane
- Throttle: aggregate over a 5-minute window
- Agent loop invokes
/box-index-rebuild --team=<affected>once per window
Trigger: FILE.UPLOADED (new version of an existing binary).
Receiver flow:
- Verify signature
- Look up existing companion via
_index.json.by_companion_for[<file_id>] - Compare binary's current sha1 to companion's stored sha1
- If different → companion is stale. Either auto-regenerate via
/box-companionor notify the user
import hmac, hashlib
def verify_box_webhook(body_bytes, header_signature, primary_key, secondary_key):
expected_primary = hmac.new(
primary_key.encode('utf-8'), body_bytes, hashlib.sha256
).hexdigest()
if hmac.compare_digest(expected_primary, header_signature):
return True
expected_secondary = hmac.new(
secondary_key.encode('utf-8'), body_bytes, hashlib.sha256
).hexdigest()
return hmac.compare_digest(expected_secondary, header_signature)Box guidance: Webhooks v2 signatures.
Use the Box MCP's create_webhook tool, or POST /2.0/webhooks via the SDK:
{
"target": {"id": "<folder_id>", "type": "folder"},
"address": "https://your-receiver.example.com/box-webhook",
"triggers": ["FILE.UPLOADED", "FILE.COPIED"]
}Box Automate (GA Apr 2026) is Box-hosted workflow automation. For "on upload → run AI on the file → write metadata" you can use Automate without hosting a receiver. The downside vs webhooks: Automate doesn't write companion markdown files (only metadata), so you lose the human-readable companion artifact and the hash-anchored review record.
Use Automate when: in-Box metadata is sufficient, no companion markdown needed. Use webhooks when: you want the full companion markdown artifact, or you need to coordinate with non-Box systems.
Webhooks are incompatible with the on-prem (air-gapped) variant — they require a publicly reachable HTTPS endpoint, which violates the air-gap claim. Use webhooks only with the cloud plugin.
For event-driven on-prem behavior, use a periodic local FS scan (cron job runs /box-index-rebuild) or Box Drive's local change notifications (FSEvents / ReadDirectoryChangesW).
-
references/webhooks.md— full reference with all patterns - Box webhooks v2 guide
- Box Automate — Box-hosted alternative
box-memory · MIT · Repo · Latest release · Issues · Air-gapped variant
Getting started
Concepts
Features
Skills reference
- Skills Reference (all)
- box-init
- box-status
- box-tier-detect
- box-mcp-check
- box-write
- box-recall
- box-ai-recall
- box-companion
- box-ai-extract
- box-team
- box-ai-agent
- box-index-rebuild
Integrations
Operations
Project