Skip to main content
Invoke uses API keys to authenticate every request. Your key identifies your account and must be included in all SDK calls and direct API requests.

Get your API key

Find your API key in the Invoke dashboard under Settings → API Keys.

Passing your API key

SDK

The @invoke/sdk package reads INVOKE_API_KEY automatically from process.env:
import { Invoke } from "@invoke/sdk"

const invoke = new Invoke({
  apiKey: process.env.INVOKE_API_KEY!,
})

Direct API requests

Send your key as the X-API-Key header:
curl -X POST https://api.invokehq.run/outcomes/reconcile \
  -H "X-API-Key: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{ ... }'
Or as a query parameter (less preferred):
https://api.invokehq.run/outcomes/reconcile?api_key=your_api_key

Environment variable

Set your key in your environment or .env file:
INVOKE_API_KEY=your_api_key
See Environment Variables for all variables the SDK and CLI read.

Authentication errors

ErrorCauseFix
401 UnauthorizedMissing or invalid API keyCheck the key is set and correct
403 ForbiddenKey is valid but lacks permissionCheck your account plan and key scope
The SDK throws before making any network call if apiKey is missing or empty.

Next steps