Skip to content

Postbox endpoints are plain HTTP - perfect for cURL, shell scripts, cron jobs, and CI pipelines.

Terminal window
curl -X POST "https://usepostbox.com/api/.../f/{slug}" \
-H "Content-Type: application/json" \
-d '{"rating": 5, "comment": "Great product"}'
#!/bin/bash
# deploy-notify.sh - Notify on successful deploy
ENDPOINT="https://usepostbox.com/api/.../f/{slug}"
VERSION=$(git describe --tags --always)
BRANCH=$(git rev-parse --abbrev-ref HEAD)
DEPLOYER=$(whoami)
curl -s -X POST "$ENDPOINT" \
-H "Content-Type: application/json" \
-d "{
\"version\": \"$VERSION\",
\"branch\": \"$BRANCH\",
\"deployer\": \"$DEPLOYER\",
\"timestamp\": \"$(date -u +%Y-%m-%dT%H:%M:%SZ)\"
}"

Collect system metrics every hour:

Terminal window
# crontab -e
0 * * * * /path/to/collect-metrics.sh
collect-metrics.sh
#!/bin/bash
ENDPOINT="https://usepostbox.com/api/.../f/{slug}"
LOAD=$(uptime | awk -F'load average:' '{print $2}' | awk '{print $1}' | tr -d ',')
DISK=$(df -h / | tail -1 | awk '{print $5}')
curl -s -X POST "$ENDPOINT" \
-H "Content-Type: application/json" \
-d "{\"hostname\": \"$(hostname)\", \"load\": \"$LOAD\", \"disk_usage\": \"$DISK\"}"

Report build results to Postbox:

# GitHub Actions example
- name: Report to Postbox
if: always()
run: |
curl -s -X POST "$POSTBOX_ENDPOINT" \
-H "Content-Type: application/json" \
-d "{
\"repo\": \"${{ github.repository }}\",
\"branch\": \"${{ github.ref_name }}\",
\"status\": \"${{ job.status }}\",
\"commit\": \"${{ github.sha }}\",
\"run_url\": \"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\"
}"
env:
POSTBOX_ENDPOINT: ${{ secrets.POSTBOX_ENDPOINT }}

For reading submissions or managing forms from scripts, use your API key:

Terminal window
# List recent submissions
curl "https://usepostbox.com/api/forms/{form_id}/submissions" \
-H "Authorization: Bearer {api_key}" | jq '.data[:5]'