Skip to main content
All Trackly SMS API requests require authentication using an API key. API keys are scoped to your account and can be created and managed from the dashboard.

Getting Your API Key

1

Navigate to API Keys

Log into the Trackly SMS Dashboard and go to Settings > API Keys
2

Create a New Key

Click Create API Key and give it a descriptive name (e.g., “Production API”, “Development”)
3

Copy Your Key

Copy the API key immediately - it won’t be shown again
Keep your API keys secure. Never commit them to version control or expose them in client-side code.

Using Your API Key

Include your API key in the X-Api-Key header with every request:
curl -X POST https://app.tracklysms.com/api/v1/messages \
  -H "X-Api-Key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"to": "+14155551234", "body": "Hello!", "from_phone_number_id": "pn_abc123"}'

Authentication Errors

If authentication fails, you’ll receive a 401 Unauthorized response:
{
  "error": "API key required",
  "code": "missing_api_key"
}

API Key Best Practices

Use Environment Variables

Store API keys in environment variables, not in code

Rotate Regularly

Create new keys periodically and revoke old ones

Separate Environments

Use different keys for development and production

Monitor Usage

Check the “Last Used” timestamp to detect unauthorized use

Managing API Keys

From the API Keys page in the dashboard, you can:
ActionDescription
CreateGenerate a new API key with a custom name
ViewSee key name, creation date, and last used timestamp
DeletePermanently revoke a key (cannot be undone)
Deleting an API key immediately invalidates it. Any requests using that key will fail with a 401 error.

Linking Discord with API Keys

If you use our Discord integration, you can link your Discord account to your Trackly account using an API key:
/sms link your_api_key_here
This allows you to:
  • View usage and balance from Discord
  • Create and manage support tickets
  • Receive real-time alerts
See Discord Integration for details.