> This page is part of the [Customer.io documentation](https://docs.customer.io). For the complete index, see [llms.txt](https://docs.customer.io/llms.txt).

# Customer.io CLI reference

While the CLI is optimized for AI agents, you can also use it directly in your terminal. Understanding how the CLI works can also help you structure prompts (or skills) to do the right things in Customer.io.

In general, LLMs will use the CLI in the following order:

1.  Find `skills` to learn more about how to do things in Customer.io
2.  Find the right `schema` for the endpoint you want to call
3.  Use `api` to make the API call

## Skills[](#skills)

The CLI has a set of `skills` that can be used to learn more about how to do things in Customer.io. You can list the available skills with `cio skills list`.

```bash
# List all skills
cio skills list

# Read a specific skill
cio skills read <skill_name>
```

## Discover endpoints[](#discover-endpoints)

Use `cio schema` to explore what’s available without leaving the terminal:

```bash
# List all resources
cio schema

# List endpoints for a resource
cio schema campaigns

# Get full details for a specific endpoint
cio schema campaigns.list
```

## Make API calls[](#make-api-calls)

Use `cio api <path>` for any endpoint. You’ll resolve path placeholders like `{environment_id}` from `--params`:

```bash
# List campaigns in a workspace
cio api /v1/environments/{environment_id}/campaigns \
  --params '{"environment_id": "123"}'

# Get a specific campaign
cio api /v1/environments/{environment_id}/campaigns/{campaign_id} \
  --params '{"environment_id": "123", "campaign_id": "456"}'
```

The CLI defaults to GET requests. Pass `--json` to send a POST, or override with `-X`:

```bash
# Create a campaign (POST inferred from --json)
cio api /v1/environments/{environment_id}/campaigns \
  --params '{"environment_id": "123"}' \
  --json '{"campaign": {"name": "Welcome Flow", "type": "none"}}'

# Delete a campaign
cio api /v1/environments/{environment_id}/campaigns/{campaign_id} \
  --params '{"environment_id": "123", "campaign_id": "456"}' -X DELETE
```

## Filter and format output[](#filter-and-format-output)

Use `--jq` to filter responses with jq expressions:

```bash
# Only active campaigns
cio api /v1/environments/{environment_id}/campaigns \
  --params '{"environment_id": "123"}' \
  --jq '.campaigns[] | select(.state == "active") | {id, name}'
```

### Paginate results[](#paginate-results)

```bash
# Manual pagination
cio api /v1/environments/{environment_id}/campaigns \
  --params '{"environment_id": "123"}' --page 2 --limit 50

# Auto-paginate (outputs NDJSON — one JSON object per line)
cio api /v1/environments/{environment_id}/campaigns \
  --params '{"environment_id": "123"}' --page-all
```

## Dry run: make sure requests are valid[](#dry-run-make-sure-requests-are-valid)

Use `--dry-run` to validate a request without executing it:

```bash
cio api /v1/environments/{environment_id}/campaigns \
  --params '{"environment_id": "123"}' \
  --json '{"campaign": {"name": "Welcome Flow", "type": "none"}}' --dry-run
```

## CLI reference[](#cli-reference)

Flag

Environment variable

Description

`--token`

`CIO_TOKEN`

Service account token override

`-X, --method`

HTTP method override

`--json`

JSON request body (or `@filename`)

`--params`

Path and query parameters as JSON

`--jq`

jq expression filter

`--dry-run`

Preview request without executing

`--page`

Page number

`--limit`

Page size

`--page-all`

Auto-paginate, output NDJSON

`--timeout`

`CIO_TIMEOUT`

Request timeout (default: 30s)

### Exit codes[](#exit-codes)

Code

Meaning

0

Success

1

General error

2

Validation or input error

3

Authentication error

4

Authorization error

5

API error (4xx/5xx)