Instantly Install & Auth
Overview
Configure Instantly.ai API v2 authentication. Instantly uses Bearer token auth with scoped API keys. There is no official SDK — all integrations use direct REST calls to https://api.instantly.ai/api/v2/.
Prerequisites
- Instantly.ai account on Hypergrowth plan ($97/mo) or higher (required for API v2 access)
- Node.js 18+ or Python 3.10+
- Access to Instantly dashboard at
https://app.instantly.ai
Instructions
Step 1: Generate API Key
- Log into
https://app.instantly.ai
- Navigate to Settings > Integrations > API
- Click Create New API Key
- Select scopes (e.g.,
campaigns:read, leads:all, accounts:read)
- Copy the key — it is shown only once
set -euo pipefail
# Create .env file with your API key
cat > .env << 'ENVEOF'
INSTANTLY_API_KEY=your-api-key-here
INSTANTLY_BASE_URL=https://api.instantly.ai/api/v2
ENVEOF
echo "Created .env with Instantly config"
Available API scopes (resource:action format):
| Scope |
Access |
campaigns:read |
List/get campaigns and analytics |
campaigns:update |
Create, patch, activate, pause campaigns |
campaigns:all |
Full campaign CRUD + analytics |
accounts:read |
List/get email accounts |
accounts:update |
Create, warmup, pause accounts |
leads:read |
List/get leads and lead lists |
leads:update |
Create, move, delete leads |
leads:all |
Full lead CRUD |
all:all |
Unrestricted access (dev only) |
Step 2: Create API Client Wrapper (TypeScript)
// src/instantly.ts
import "dotenv/config";
const BASE = process.env.INSTANTLY_BASE_URL || "https://api.instantly.ai/api/v2";
const API_KEY = process.env.INSTANTLY_API_KEY;
if (!API_KEY) throw new Error("INSTANTLY_API_KEY is required");
export async function instantly<T = unknown>(
path: string,
options: RequestInit = {}
): Promise<T> {
const url = `${BASE}${path}`;
const res = await fetch(url, {
...options,
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${API_KEY}`,
...options.headers,
},
});
if (!res.ok) {
const body = await res.text();
throw new Error(`Instantly API ${res.status}: ${body}`);
}
return res.json() as Promise<T>;
}
Step 3: Create API Client Wrapper (Python)
# instantly_client.py
import os
import httpx
from dotenv import load_dotenv
load_dotenv()
BASE_URL = os.getenv("INSTANTLY_BASE_URL", "https://api.instantly.ai/api/v2")
API_KEY = os.getenv("INSTANTLY_API_KEY")
if not API_KEY:
raise ValueError("INSTANTLY_API_KEY environment variable is required")
client = httpx.Client(
base_url=BASE_URL,
headers={
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
},
timeout=30.0,
)
def instantly_get(path: str, params: dict = None):
r = client.get(path, params=params)
r.raise_for_status()
return r.json()
def instantly_post(path: str, json_data: dict = None):
r = client.post(path, json=json_data)
r.raise_for_status()
return r.json()
Step 4: Verify Connection
// verify.ts — run with: npx tsx verify.ts
import { instantly } from "./src/instantly";
interface Campaign {
id: string;
name: string;
status: number;
}
async function verify() {
// List campaigns — if this returns, auth is working
const campaigns = await instantly<Campaign[]>("/campaigns?limit=1");
console.log("Auth verified. Campaigns found:", campaigns.length >= 0);
// List email accounts
const accounts = await instantly<{ email: string }[]>("/accounts?limit=1");
console.log("Accounts accessible:", accounts.length >= 0);
console.log("Instantly API v2 connection is working.");
}
verify().catch((err) => {
console.error("Auth failed:", err.message);
process.exit(1);
});
Output
.env file with INSTANTLY_API_KEY and INSTANTLY_BASE_URL
- Reusable API client wrapper (
src/instantly.ts or instantly_client.py)
- Verified connection to Instantly API v2
Error Handling
| Error |
Cause |
Solution |
401 Unauthorized |
Invalid or expired API key |
Regenerate key in Settings > Integrations |
403 Forbidden |
Key missing required scope |
Edit key scopes or create new key with correct permissions |
429 Too Many Requests |
Rate limit exceeded |
Implement exponential backoff (see instantly-rate-limits) |
ECONNREFUSED |
Network/firewall issue |
Ensure outbound HTTPS to api.instantly.ai is allowed |
API key not found |
Key was revoked |
Generate a new key from the dashboard |
Resources
Next Steps
After successful auth, proceed to instantly-hello-world for your first API call.
1---
2name: instantly-install-auth
3description: |
4 Set up Instantly.ai API v2 authentication and project configuration.
5 Use when creating a new Instantly integration, generating API keys,
6 or configuring environment variables for the Instantly outreach platform.
7 Trigger with phrases like "install instantly", "setup instantly",
8 "instantly auth", "configure instantly API key", "instantly credentials".
9allowed-tools: Read, Write, Edit, Bash(npm:*), Bash(pip:*), Bash(curl:*), Grep
10version: 1.0.0
11license: MIT
12author: Jeremy Longshore <jeremy@intentsolutions.io>
13compatible-with: claude-code, codex, openclaw
14tags: [saas, instantly, api, authentication, email-outreach]
15metadata:
16 source: https://skillmd.com/skills/aibot88/instantly-install-auth
17---
18
19# Instantly Install & Auth
20
21## Overview
22Configure Instantly.ai API v2 authentication. Instantly uses Bearer token auth with scoped API keys. There is no official SDK — all integrations use direct REST calls to `https://api.instantly.ai/api/v2/`.
23
24## Prerequisites
25- Instantly.ai account on Hypergrowth plan ($97/mo) or higher (required for API v2 access)
26- Node.js 18+ or Python 3.10+
27- Access to Instantly dashboard at `https://app.instantly.ai`
28
29## Instructions
30
31### Step 1: Generate API Key
321. Log into `https://app.instantly.ai`
332. Navigate to **Settings > Integrations > API**
343. Click **Create New API Key**
354. Select scopes (e.g., `campaigns:read`, `leads:all`, `accounts:read`)
365. Copy the key — it is shown only once
37
38```bash
39set -euo pipefail
40# Create .env file with your API key
41cat > .env << 'ENVEOF'
42INSTANTLY_API_KEY=your-api-key-here
43INSTANTLY_BASE_URL=https://api.instantly.ai/api/v2
44ENVEOF
45echo "Created .env with Instantly config"
46```
47
48Available API scopes (resource:action format):
49| Scope | Access |
50|-------|--------|
51| `campaigns:read` | List/get campaigns and analytics |
52| `campaigns:update` | Create, patch, activate, pause campaigns |
53| `campaigns:all` | Full campaign CRUD + analytics |
54| `accounts:read` | List/get email accounts |
55| `accounts:update` | Create, warmup, pause accounts |
56| `leads:read` | List/get leads and lead lists |
57| `leads:update` | Create, move, delete leads |
58| `leads:all` | Full lead CRUD |
59| `all:all` | Unrestricted access (dev only) |
60
61### Step 2: Create API Client Wrapper (TypeScript)
62```typescript
63// src/instantly.ts
64import "dotenv/config";
65
66const BASE = process.env.INSTANTLY_BASE_URL || "https://api.instantly.ai/api/v2";
67const API_KEY = process.env.INSTANTLY_API_KEY;
68
69if (!API_KEY) throw new Error("INSTANTLY_API_KEY is required");
70
71export async function instantly<T = unknown>(
72 path: string,
73 options: RequestInit = {}
74): Promise<T> {
75 const url = `${BASE}${path}`;
76 const res = await fetch(url, {
77 ...options,
78 headers: {
79 "Content-Type": "application/json",
80 Authorization: `Bearer ${API_KEY}`,
81 ...options.headers,
82 },
83 });
84
85 if (!res.ok) {
86 const body = await res.text();
87 throw new Error(`Instantly API ${res.status}: ${body}`);
88 }
89
90 return res.json() as Promise<T>;
91}
92```
93
94### Step 3: Create API Client Wrapper (Python)
95```python
96# instantly_client.py
97import os
98import httpx
99from dotenv import load_dotenv
100
101load_dotenv()
102
103BASE_URL = os.getenv("INSTANTLY_BASE_URL", "https://api.instantly.ai/api/v2")
104API_KEY = os.getenv("INSTANTLY_API_KEY")
105
106if not API_KEY:
107 raise ValueError("INSTANTLY_API_KEY environment variable is required")
108
109client = httpx.Client(
110 base_url=BASE_URL,
111 headers={
112 "Authorization": f"Bearer {API_KEY}",
113 "Content-Type": "application/json",
114 },
115 timeout=30.0,
116)
117
118def instantly_get(path: str, params: dict = None):
119 r = client.get(path, params=params)
120 r.raise_for_status()
121 return r.json()
122
123def instantly_post(path: str, json_data: dict = None):
124 r = client.post(path, json=json_data)
125 r.raise_for_status()
126 return r.json()
127```
128
129### Step 4: Verify Connection
130```typescript
131// verify.ts — run with: npx tsx verify.ts
132import { instantly } from "./src/instantly";
133
134interface Campaign {
135 id: string;
136 name: string;
137 status: number;
138}
139
140async function verify() {
141 // List campaigns — if this returns, auth is working
142 const campaigns = await instantly<Campaign[]>("/campaigns?limit=1");
143 console.log("Auth verified. Campaigns found:", campaigns.length >= 0);
144
145 // List email accounts
146 const accounts = await instantly<{ email: string }[]>("/accounts?limit=1");
147 console.log("Accounts accessible:", accounts.length >= 0);
148
149 console.log("Instantly API v2 connection is working.");
150}
151
152verify().catch((err) => {
153 console.error("Auth failed:", err.message);
154 process.exit(1);
155});
156```
157
158## Output
159- `.env` file with `INSTANTLY_API_KEY` and `INSTANTLY_BASE_URL`
160- Reusable API client wrapper (`src/instantly.ts` or `instantly_client.py`)
161- Verified connection to Instantly API v2
162
163## Error Handling
164| Error | Cause | Solution |
165|-------|-------|----------|
166| `401 Unauthorized` | Invalid or expired API key | Regenerate key in Settings > Integrations |
167| `403 Forbidden` | Key missing required scope | Edit key scopes or create new key with correct permissions |
168| `429 Too Many Requests` | Rate limit exceeded | Implement exponential backoff (see `instantly-rate-limits`) |
169| `ECONNREFUSED` | Network/firewall issue | Ensure outbound HTTPS to `api.instantly.ai` is allowed |
170| `API key not found` | Key was revoked | Generate a new key from the dashboard |
171
172## Resources
173- [Instantly API v2 Docs](https://developer.instantly.ai/)
174- [API v1 to v2 Migration Guide](https://developer.instantly.ai/api-v1-docs)
175- [Instantly Help Center](https://help.instantly.ai)
176
177## Next Steps
178After successful auth, proceed to `instantly-hello-world` for your first API call.