Documentation Index
Fetch the complete documentation index at: https://docs.mossdesk.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
MossDesk works in any CI/CD environment. Use the CLI for shell-based workflows or the API for HTTP-based integrations. Both support --json output and API key authentication.
API key management
Create a dedicated API key for CI/CD use:
moss key create --name "github-actions" --scope "read,write"
Store the key as a secret in your CI platform:
- GitHub Actions: Repository Settings > Secrets >
MOSS_API_KEY
- GitLab CI: Settings > CI/CD > Variables >
MOSS_API_KEY
GitHub Actions examples
Log deployment as interaction
name: Post-deploy CRM update
on:
deployment_status:
types: [success]
jobs:
update-crm:
runs-on: ubuntu-latest
steps:
- name: Install MossDesk CLI
run: npm install -g @mossdesk/cli
- name: Log deployment
env:
MOSS_API_KEY: ${{ secrets.MOSS_API_KEY }}
run: |
moss interaction log \
--contact-id "${{ vars.CUSTOMER_CONTACT_ID }}" \
--type note \
--content "Deployed ${{ github.sha }} to production" \
--json
Check overdue follow-ups on PR
name: CRM health check
on:
pull_request:
types: [opened]
jobs:
crm-check:
runs-on: ubuntu-latest
steps:
- name: Install MossDesk CLI
run: npm install -g @mossdesk/cli
- name: Check overdue follow-ups
env:
MOSS_API_KEY: ${{ secrets.MOSS_API_KEY }}
run: |
OVERDUE=$(moss followup overdue --json | jq '.meta.total')
if [ "$OVERDUE" -gt 0 ]; then
echo "::warning::You have $OVERDUE overdue follow-ups"
fi
Weekly pipeline report
name: Weekly pipeline report
on:
schedule:
- cron: '0 9 * * 1' # Monday 9am
jobs:
report:
runs-on: ubuntu-latest
steps:
- name: Install MossDesk CLI
run: npm install -g @mossdesk/cli
- name: Generate report
env:
MOSS_API_KEY: ${{ secrets.MOSS_API_KEY }}
run: |
echo "## Pipeline Summary"
moss pipeline show --json | jq -r '
.data | to_entries[] |
"- **\(.key)**: \(.value) deals"
'
API-based integration
For environments where you can’t install the CLI, use the REST API directly:
# Using curl
curl -s https://api.mossdesk.com/api/contacts \
-H "X-API-Key: $MOSS_API_KEY" \
-H "Content-Type: application/json" | jq '.data'
# Create a contact via API
curl -s -X POST https://api.mossdesk.com/api/contacts \
-H "X-API-Key: $MOSS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "Jane Smith", "email": "jane@acme.com"}' | jq '.data'
Scripting patterns
moss contact list --per-page 100 --json | jq -r '.data[].id' | while read id; do
moss contact show "$id" --json | jq '.data'
done
# Export contacts to CSV-like format
moss contact list --per-page 100 --json | jq -r '
.data[] | [.name, .email, .company_name] | @csv
'
Conditional deal updates
# Move deals older than 30 days in lead stage
moss deal list --stage lead --json | jq -r '
.data[] | select(.created_at < (now - 2592000 | strftime("%Y-%m-%d"))) | .id
' | while read id; do
moss deal move "$id" --stage lost --json
done
Idempotency
For CI/CD workflows that might retry, use idempotency keys to prevent duplicate operations:
moss contact create \
--name "Jane Smith" \
--email "jane@acme.com" \
--idempotency-key "deploy-${{ github.run_id }}" \
--json
The same idempotency key will return the original response without creating a duplicate.