> ## Documentation Index
> Fetch the complete documentation index at: https://developer.zapsterapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Exemplos

> Receitas práticas para usar a CLI da Zapster em scripts e automações.

## Disparar uma mensagem em CI

```bash theme={null}
#!/usr/bin/env bash
set -euo pipefail

zapsterapi auth login --token "$ZAPSTERAPI_TOKEN" >/dev/null

zapsterapi message send \
  --recipient "$RECIPIENT" \
  --text "Build $GITHUB_RUN_ID concluído com sucesso." \
  --json
```

## Verificar disponibilidade antes de enviar

```bash theme={null}
exists=$(zapsterapi recipient fetch --recipient "$NUMERO" --json | jq '.data.exists')
if [ "$exists" = "true" ]; then
  zapsterapi message send --recipient "$NUMERO" --text "Olá!"
else
  echo "Número não está no WhatsApp"
fi
```

## Listar instâncias e iterar

```bash theme={null}
zapsterapi instance list --json | jq -r '.data.rows[] | select(.status=="connected") | .id' | while read -r id; do
  echo "Instância conectada: $id"
done
```

## Alternar entre contas (cliente → time interno)

```bash theme={null}
zapsterapi auth login --token "$TOKEN_CLIENTE"
zapsterapi auth login --token "$TOKEN_INTERNO" --profile interno

zapsterapi message send --recipient 5511 --text "Para o cliente"
zapsterapi --profile interno message send --recipient 5511 --text "Para o time"
```

## Pedir pra um agente fazer

Veja o [Quickstart para Agentes](/pt-BR/v1/cli/agent-quickstart) — copie o prompt, cole no Claude Code, e o agente faz tudo.
