Skip to main content
Use an API key for direct server-side requests, OAuth for linked accounts, or a supported payment protocol for keyless requests. Public health and discovery endpoints do not require an API key.

Get your API key

Sign up at developers.influship.com and find your API key under API Keys. New API customers receive 500 one-time starter credits with no expiry; no card is required to use them. Each key uses the same account balance. See Pricing for exhaustion and paid-billing behavior.

Set it as an environment variable

Or add it to your .env file:
.env
Never commit API keys to version control. Use environment variables or a secrets manager.

Pass it in requests

The SDK reads from the INFLUSHIP_API_KEY environment variable automatically, so you can also omit the constructor argument entirely if the variable is set.

When authentication fails

An invalid or revoked API key returns 401 unauthorized. An invalid OAuth token also returns 401. A request without credentials to a supported payment-enabled endpoint returns a 402 payment challenge. Follow the selected payment protocol rather than treating the challenge as an invalid key. Other protected endpoints require credentials. A typical API-key failure looks like this:
If you receive this unexpectedly, check that the key is correctly set and has not been revoked.

Key rotation

Creating another key does not revoke your existing keys. Rotate without interrupting traffic:
  1. Create a new key in API Keys in the dashboard.
  2. Update your application’s secret and deploy the new configuration.
  3. Verify that requests using the new key succeed.
  4. Revoke the old key after all callers have switched.
Revocation stops new requests using that key. Remove it from any remaining clients.

Organization and billing

API keys share their account’s starter-credit balance and billing settings. Creating another key does not add credits. API-key rate-limit windows are scoped to the key; OAuth calls use the linked credential’s rate-limit scope. Monitor the returned headers rather than assuming keys have separate billing balances. See Rate limits and Pricing.