Skip to main content
The AhaSend CLI uses profile-based authentication to manage your API credentials and support multiple environments. Before running the examples, log in with a full API key, use your verified sender domain, and replace YOUR_RESOURCE_ID with a resource UUID from your test account. Create any named template, recipient, attachment, or JSON files first. Shell examples use Bash; examples that read JSON with jq need jq installed. Sends use sandbox mode.

Getting Started

Create a full API key under Account Settings → API Keys, with the scopes needed by your commands, and copy the account ID from account settings. See API authentication.

Interactive Login

You’ll be prompted for your API Key, Account ID, and an optional profile name.

Direct Login

CI Credentials

The CLI reads no environment variables for credentials. It authenticates through ahasend auth login profiles, --profile, or --api-key with --account-id. In CI, store secrets as environment variables and pass them explicitly through flags:

Profiles

Profiles let you manage multiple environments easily.

Creating Profiles

Switching Profiles

Check Status

Remove Profile

Configuration

Credentials are stored as plaintext in ~/.ahasend/config.yaml. Protect this file and keep it out of source control.
Keep your API keys secure. Never commit credentials to version control.

Testing Authentication

Verify your setup:

Next Steps