Overview
MossDesk is designed to be agent-operable — every action available in the dashboard can be performed via CLI or API. This makes MossDesk a natural fit for AI coding agents that can run shell commands or make HTTP requests.How it works
AI agents interact with MossDesk through:- CLI commands — Agents execute
mosscommands in a terminal, using--jsonfor structured output - API calls — Agents make HTTP requests to the REST API with an
X-API-Keyheader - Exit codes — Agents can branch on success/failure using standardized exit codes
Compatible agents
Setting up Claude Code
Add the following to your project’sCLAUDE.md:
Structured output with --json
Every CLI command supports the --json flag, which outputs data in a consistent JSON envelope:
Exit codes for control flow
Agents can use exit codes to handle errors programmatically:
Example in a script:
Example agent flows
Daily CRM review
Post-meeting logging
Pipeline management
Best practices
- Always use
--json— Table output is for humans; JSON output is for agents - Check exit codes — Don’t assume success; handle errors gracefully
- Use
--request-id— Pass a unique request ID for tracing and debugging - Use
--idempotency-key— Prevent duplicate creates when retrying - Scope API keys — Create a dedicated API key with minimum required scopes for each agent