| name | customerio |
| description | Interact with the Customer.io App API via the cio CLI. Use this skill when the user wants to manage Customer.io resources such as customers, segments, campaigns, broadcasts, newsletters, collections, exports, messages, objects, webhooks, or transactional messages. Also use when the user asks to query, filter, create, update, or delete Customer.io data from the command line. |
Customer.io CLI (cio)
A CLI tool wrapping the Customer.io App API.
Prerequisites
Before using this skill, ensure the cio CLI is installed and authenticated.
1. Install cio
Check if cio is available:
command -v cio || echo "NOT INSTALLED"
If not installed, install from GitHub Releases:
gh release list -R Leechael/customerio-skills
gh release download -R Leechael/customerio-skills --pattern 'cio-*.tar.gz'
tar -xzf cio-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz
install -m 0755 cio /usr/local/bin/cio
If /usr/local/bin is not writable, use ~/.local/bin (or another writable directory in $PATH).
2. Configure API Token
Run cio status to check authentication:
cio status
If the token is not configured, the user needs to set CUSTOMERIO_API_TOKEN:
export CUSTOMERIO_API_TOKEN="your-app-api-key"
Get an App API key from: https://fly.customer.io/settings/api_credentials
Recommended: use 1Password CLI to avoid storing secrets in shell config:
echo 'CUSTOMERIO_API_TOKEN=op://vault-name/Customer.io/api-token' > .env
op run --env-file=.env -- cio status
This way the token is never written to disk in plaintext. See https://developer.1password.com/docs/service-accounts/use-with-1password-cli for setup.
Quick Reference
cio --region eu ...
cio ... --jq '.field'
cio status
cio customers ls
cio customers ls --body '{"ids":["u1","u2"]}'
cio customers search --email user@example.com
cio customers get <id>
cio customers activities <id>
cio customers segments <id>
cio customers messages <id>
cio segments ls
cio segments get <id>
cio segments create --body '{"segment":{"name":"VIP"}}'
cio segments rm <id>
cio segments count <id>
cio segments members <id>
cio campaigns ls
cio campaigns get <id>
cio campaigns metrics <id>
cio campaigns actions <id>
cio broadcasts ls
cio broadcasts get <id>
cio broadcasts trigger <id>
cio broadcasts metrics <id>
cio newsletters ls
cio newsletters get <id>
cio newsletters metrics <id>
cio transactional ls
cio transactional get <id>
cio transactional deliveries <id>
cio send email --body '{"to":"u@e.com","transactional_message_id":"1",...}'
cio send push --body '...'
cio send sms --body '...'
cio collections ls
cio collections get <id>
cio collections create --body '{"name":"n","data":[...]}'
cio collections update <id> --body '...'
cio collections content <id>
cio exports ls
cio exports create-customers
cio exports create-customers --body '{"filters":{...}}'
cio exports create-deliveries
cio exports get <id>
cio exports download <id>
cio objects get <type> <id>
cio objects search
cio messages get <id>
cio messages deliveries <id>
cio webhooks ls
cio webhooks get <id>
cio webhooks create --body '...'
cio sender-identities ls
cio snippets ls
cio snippets upsert --body '...'
cio esp-suppression ls
cio esp-suppression search
cio imports create --body '...'
cio info ip-addresses
cio workspaces ls
Body Input
Commands that accept a body support two input methods:
cio segments create --body '{"segment":{"name":"Test"}}'
echo '{"segment":{"name":"Test"}}' | cio segments create
JQ Filtering
Use --jq to extract specific fields from any response:
cio segments ls --jq '.segments[].name'
cio customers get u1 --jq '.customer.email'
cio campaigns ls --jq '.campaigns | map(select(.active)) | length'