Skip to main content

Authentication

Every request needs an API key passed in the X-API-Key header.

Get your API key

Sign up at developers.influship.com and find your API key in the dashboard under Settings > API Keys.

Set it as an environment variable

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

Pass it in requests

import Influship from 'influship';

const client = new Influship({
  apiKey: process.env.INFLUSHIP_API_KEY,
});
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

A missing or invalid key returns a 401 response:
{
  "error": {
    "code": "unauthorized",
    "message": "Invalid or missing API key",
    "status_code": 401
  }
}
If you receive this unexpectedly, check that the key is correctly set and has not been revoked.

Key rotation

Generate a new key from the dashboard at any time. Old keys are revoked immediately when a new one is created — update your environment variables before generating a replacement if you have live traffic.

Organization and billing

Each API key belongs to one organization. Rate limits and billing are tracked per key.