API Keys Command
Manage API keys for authentication and access control.
Overview
ahasend apikeys [subcommand] [flags]
Available subcommands:
list
- List all API keys
create
- Create a new API key
get
- Get detailed information about a specific API key
update
- Update an existing API key
delete
- Delete an API key
API keys are used to authenticate requests to the AhaSend API. You can create multiple API keys with different scopes and labels to organize access for different applications or team members.
Each API key has:
- A unique identifier and secret
- Configurable scopes (permissions) - see API Key Scopes
- Optional labels for organization
- Creation and last used timestamps
List API Keys
Create API Key
# Send messages from any domain
ahasend apikeys create --label "Production API" --scope "messages:send:all"
# Multiple specific scopes
ahasend apikeys create \
--label "Analytics Only" \
--scope "statistics-transactional:read:all" \
--scope "suppressions:read"
# Domain-specific messaging
ahasend apikeys create \
--label "Newsletter Service" \
--scope "messages:send:{example.com}" \
--scope "suppressions:write"
Get API Key Details
ahasend apikeys get ak_1234567890abcdef
Update API Key
# Update label
ahasend apikeys update ak_1234567890abcdef --label "Updated Label"
# Update scope
ahasend apikeys update ak_1234567890abcdef --scope "messages:send:{example.com}"
Delete API Key
ahasend apikeys delete ak_1234567890abcdef
Deleting an API key is irreversible. Applications using this key will lose access immediately.
Next Steps