Skip to content

Commit a488089

Browse files
Brandon CharlesonBrandon Charleson
authored andcommitted
fix: Instantly API compatibility fixes
- Remove Content-Type header from DELETE requests (delete-lead, delete-campaign) - Remove Content-Type header from POST requests with empty body (pause-campaign, activate-campaign, pause-account, resume-account) - Fix timezone in create-campaign to use valid API enum value (America/Chicago) - Add Instantly plugin to plugins/index.ts - Update README.md with Instantly actions
1 parent 4cce460 commit a488089

File tree

9 files changed

+27
-6
lines changed

9 files changed

+27
-6
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ Visit [http://localhost:3000](http://localhost:3000) to get started.
8585
- **fal.ai**: Generate Image, Generate Video, Upscale Image, Remove Background, Image to Image
8686
- **Firecrawl**: Scrape URL, Search Web
8787
- **GitHub**: Create Issue, List Issues, Get Issue, Update Issue
88+
- **Instantly**: Create Lead, Get Lead, List Leads, Update Lead, Delete Lead, Update Lead Interest Status, Add Lead to Campaign, Create Campaign, Get Campaign, List Campaigns, Update Campaign, Delete Campaign, Activate Campaign, Pause Campaign, List Accounts, Get Account, Pause Account, Resume Account, Enable Warmup, Disable Warmup
8889
- **Linear**: Create Ticket, Find Issues
8990
- **Perplexity**: Search Web, Ask Question, Research Topic
9091
- **Resend**: Send Email

plugins/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import "./clerk";
2020
import "./fal";
2121
import "./firecrawl";
2222
import "./github";
23+
import "./instantly";
2324
import "./linear";
2425
import "./perplexity";
2526
import "./resend";

plugins/instantly/steps/activate-campaign.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ async function stepHandler(
4040
method: "POST",
4141
headers: {
4242
Authorization: `Bearer ${apiKey}`,
43-
"Content-Type": "application/json",
4443
},
4544
}
4645
);

plugins/instantly/steps/create-campaign.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,30 @@ async function stepHandler(
3434
}
3535

3636
try {
37+
// Default schedule: Monday-Friday, 9am-5pm in America/Chicago (Central Time)
38+
// Note: Instantly API only accepts specific timezone values from their enum
39+
const defaultSchedule = {
40+
schedules: [
41+
{
42+
name: "Default Schedule",
43+
timing: {
44+
from: "09:00",
45+
to: "17:00",
46+
},
47+
days: {
48+
"0": false, // Sunday
49+
"1": true, // Monday
50+
"2": true, // Tuesday
51+
"3": true, // Wednesday
52+
"4": true, // Thursday
53+
"5": true, // Friday
54+
"6": false, // Saturday
55+
},
56+
timezone: "America/Chicago",
57+
},
58+
],
59+
};
60+
3761
const response = await fetch(`${INSTANTLY_API_URL}/campaigns`, {
3862
method: "POST",
3963
headers: {
@@ -42,6 +66,7 @@ async function stepHandler(
4266
},
4367
body: JSON.stringify({
4468
name: input.name,
69+
campaign_schedule: defaultSchedule,
4570
}),
4671
});
4772

plugins/instantly/steps/delete-campaign.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ async function stepHandler(
4040
method: "DELETE",
4141
headers: {
4242
Authorization: `Bearer ${apiKey}`,
43-
"Content-Type": "application/json",
4443
},
4544
}
4645
);

plugins/instantly/steps/delete-lead.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ async function stepHandler(
3838
method: "DELETE",
3939
headers: {
4040
Authorization: `Bearer ${apiKey}`,
41-
"Content-Type": "application/json",
4241
},
4342
});
4443

plugins/instantly/steps/pause-account.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ async function stepHandler(
4040
method: "POST",
4141
headers: {
4242
Authorization: `Bearer ${apiKey}`,
43-
"Content-Type": "application/json",
4443
},
4544
}
4645
);

plugins/instantly/steps/pause-campaign.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ async function stepHandler(
4040
method: "POST",
4141
headers: {
4242
Authorization: `Bearer ${apiKey}`,
43-
"Content-Type": "application/json",
4443
},
4544
}
4645
);

plugins/instantly/steps/resume-account.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ async function stepHandler(
4040
method: "POST",
4141
headers: {
4242
Authorization: `Bearer ${apiKey}`,
43-
"Content-Type": "application/json",
4443
},
4544
}
4645
);

0 commit comments

Comments
 (0)