yirlo 1.2.1 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/package.json +1 -1
- package/yirlo.js +180 -191
package/README.md
CHANGED
|
@@ -9,8 +9,8 @@ Get an API key at https://yirlo.com/app/api-keys. Full API docs: https://yirlo.c
|
|
|
9
9
|
```js
|
|
10
10
|
import { Yirlo } from "yirlo";
|
|
11
11
|
const y = new Yirlo(process.env.YIRLO_API_KEY);
|
|
12
|
-
const
|
|
13
|
-
const { campaigns } = await y.listCampaigns({ project_id:
|
|
12
|
+
const { projects } = await y.listProjects();
|
|
13
|
+
const { campaigns } = await y.listCampaigns({ project_id: projects[0].id });
|
|
14
14
|
const hot = await y.listHotLeads();
|
|
15
15
|
```
|
|
16
16
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yirlo",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "Yirlo SDK, MCP server and terminal dashboard: run your AI cold email outreach (projects, campaigns, inbox, hot leads, budgets) from code, an AI agent or your terminal.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "yirlo.js",
|
package/yirlo.js
CHANGED
|
@@ -1,210 +1,199 @@
|
|
|
1
1
|
// Yirlo SDK for JavaScript (Node 18+ and browsers with fetch). https://yirlo.com/sdk/yirlo.js
|
|
2
|
-
//
|
|
3
|
-
// Usage: import { Yirlo } from "
|
|
2
|
+
// Generated from https://yirlo.com/api-docs/openapi.json: every call there that is not deprecated is a method here (docs: https://yirlo.com/api-docs).
|
|
3
|
+
// Usage: import { Yirlo } from "yirlo"; const y = new Yirlo(process.env.YIRLO_API_KEY); console.log(await y.getAccount());
|
|
4
4
|
export class YirloError extends Error { constructor(status, body) { super((body && body.detail) || `HTTP ${status}`); this.status = status; this.body = body; } }
|
|
5
5
|
export class Yirlo {
|
|
6
6
|
constructor(apiKey, { baseUrl = "https://yirlo.com" } = {}) { if (!apiKey) throw new Error("Pass your Yirlo API key (https://yirlo.com/app/api-keys)"); this.apiKey = apiKey; this.baseUrl = baseUrl.replace(/\/$/, ""); }
|
|
7
|
-
async request(method, path, { query, body } = {}) {
|
|
7
|
+
async request(method, path, { query, body, headers } = {}) {
|
|
8
8
|
const qs = query && Object.keys(query).length ? "?" + new URLSearchParams(Object.entries(query).filter(([, v]) => v != null)) : "";
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const a = { ...args }; for (const k of
|
|
15
|
-
const
|
|
16
|
-
|
|
9
|
+
if (!path.startsWith("/public/") && !path.startsWith("/px/")) path = "/public/api/v1" + path;
|
|
10
|
+
const r = await fetch(this.baseUrl + path + qs, { method, headers: { "X-API-Key": this.apiKey, "Content-Type": "application/json", ...(headers || {}) }, body: method === "GET" ? undefined : JSON.stringify(body || {}) });
|
|
11
|
+
const t = await r.text(); let j; try { j = t ? JSON.parse(t) : {}; } catch { j = { detail: t }; } if (!r.ok) throw new YirloError(r.status, j); return j;
|
|
12
|
+
}
|
|
13
|
+
_call(method, path, args, where, required, name, nulls = []) {
|
|
14
|
+
const a = { ...args }; for (const k of Object.keys(a)) if (a[k] === null && !nulls.includes(k)) delete a[k];
|
|
15
|
+
for (const k of required) if (a[k] === undefined) throw new Error(`${name}: ${k} is required`);
|
|
16
|
+
const query = {}, body = {}, headers = {};
|
|
17
|
+
for (const [k, v] of Object.entries(a)) { if (v === undefined) continue; const w = where[k] || (method === "GET" ? "query" : "body");
|
|
18
|
+
if (w === "path") path = path.replace("{" + k + "}", encodeURIComponent(v)); else if (w === "query") query[k] = v; else if (w === "header") headers[k] = String(v); else body[k] = v; }
|
|
19
|
+
return this.request(method, path, { query, body, headers });
|
|
17
20
|
}
|
|
18
21
|
/** Credit balance (1 credit = $0.01). Arguments: none. */
|
|
19
|
-
getBalance(args = {}) {
|
|
20
|
-
const a = { ...args }; for (const k of []) if (a[k] == null) throw new Error(`get_balance: ${k} is required`);
|
|
21
|
-
const path = "/billing/balance";
|
|
22
|
-
return this.request("GET", path);
|
|
23
|
-
}
|
|
22
|
+
getBalance(args = {}) { return this._call("GET", "/public/api/v1/billing/balance", args, {}, [], "get_balance", []); }
|
|
24
23
|
/** Every outreach project on the account. Arguments: none. */
|
|
25
|
-
listProjects(args = {}) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return this.request("GET", path);
|
|
29
|
-
}
|
|
30
|
-
/** Create a project from a company website (or, with no website, from what it sells, to whom and where). Answers at once with the project id and status creating; Yirlo analyses the company in about 1-2 minutes, then get_project shows status ready and its campaigns are paused until you start one. Arguments: domain?, no_website?. */
|
|
31
|
-
createProject(args = {}) {
|
|
32
|
-
const a = { ...args }; for (const k of []) if (a[k] == null) throw new Error(`create_project: ${k} is required`);
|
|
33
|
-
const path = "/agentapp/projects";
|
|
34
|
-
return this.request("POST", path, { body: a });
|
|
35
|
-
}
|
|
24
|
+
listProjects(args = {}) { return this._call("GET", "/public/api/v1/agentapp/projects", args, {}, [], "list_projects", []); }
|
|
25
|
+
/** Create a project from a company website (or, with no website, from what it sells, to whom and where). Answers at once with the project id and status creating; Yirlo sets the project up, then get_project shows status ready and its campaigns are paused until you start one. Arguments: domain?, no_website?. */
|
|
26
|
+
createProject(args = {}) { return this._call("POST", "/public/api/v1/agentapp/projects", args, {"domain": "body", "no_website": "body"}, [], "create_project", ["domain", "no_website"]); }
|
|
36
27
|
/** One project: company, settings, campaigns. For a project from create_project: status creating, ready or failed (with failure_reason and next_step). Arguments: project_id. */
|
|
37
|
-
getProject(args = {}) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
/** Emails sent, replies and hot leads for a project. Arguments: project_id. */
|
|
43
|
-
projectAnalytics(args = {}) {
|
|
44
|
-
const a = { ...args }; for (const k of ["project_id"]) if (a[k] == null) throw new Error(`project_analytics: ${k} is required`);
|
|
45
|
-
const path = "/agentapp/projects/{project_id}/analytics".replace("{project_id}", encodeURIComponent(a.project_id)); delete a.project_id;
|
|
46
|
-
return this.request("GET", path);
|
|
47
|
-
}
|
|
48
|
-
/** Daily budget and monthly cap. Arguments: project_id. */
|
|
49
|
-
getProjectBudget(args = {}) {
|
|
50
|
-
const a = { ...args }; for (const k of ["project_id"]) if (a[k] == null) throw new Error(`get_project_budget: ${k} is required`);
|
|
51
|
-
const path = "/agentapp/projects/{project_id}/budget".replace("{project_id}", encodeURIComponent(a.project_id)); delete a.project_id;
|
|
52
|
-
return this.request("GET", path);
|
|
53
|
-
}
|
|
54
|
-
/** Set the project daily budget in USD. Arguments: project_id, daily_budget_usd. */
|
|
55
|
-
setProjectBudget(args = {}) {
|
|
56
|
-
const a = { ...args }; for (const k of ["project_id", "daily_budget_usd"]) if (a[k] == null) throw new Error(`set_project_budget: ${k} is required`);
|
|
57
|
-
const path = "/agentapp/projects/{project_id}/budget".replace("{project_id}", encodeURIComponent(a.project_id)); delete a.project_id;
|
|
58
|
-
return this.request("PATCH", path, { body: a });
|
|
59
|
-
}
|
|
28
|
+
getProject(args = {}) { return this._call("GET", "/public/api/v1/agentapp/projects/{project_id}", args, {"project_id": "path"}, ["project_id"], "get_project", []); }
|
|
29
|
+
/** Get the project's monthly cap. Arguments: project_id. */
|
|
30
|
+
getMonthlyCap(args = {}) { return this._call("GET", "/public/api/v1/agentapp/projects/{project_id}/monthly-cap", args, {"project_id": "path"}, ["project_id"], "get_monthly_cap", []); }
|
|
31
|
+
/** Set the project's monthly cap. Arguments: project_id, monthly_cap_usd. */
|
|
32
|
+
setMonthlyCap(args = {}) { return this._call("PUT", "/public/api/v1/agentapp/projects/{project_id}/monthly-cap", args, {"project_id": "path", "monthly_cap_usd": "body"}, ["project_id", "monthly_cap_usd"], "set_monthly_cap", ["monthly_cap_usd"]); }
|
|
60
33
|
/** Campaigns (audiences), optionally for one project. Arguments: project_id?. */
|
|
61
|
-
listCampaigns(args = {}) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
return this.request("GET", path, { query: a });
|
|
65
|
-
}
|
|
34
|
+
listCampaigns(args = {}) { return this._call("GET", "/public/api/v1/agentapp/campaigns", args, {"project_id": "query"}, [], "list_campaigns", ["project_id"]); }
|
|
35
|
+
/** Create a campaign from a name that describes the people to reach, e.g. "Heads of support at Shopify fashion brands". Takes about 30 seconds. Arguments: project_id?, name, target_geography?. */
|
|
36
|
+
createCampaign(args = {}) { return this._call("POST", "/public/api/v1/agentapp/campaigns", args, {"project_id": "body", "name": "body", "target_geography": "body"}, ["name"], "create_campaign", ["target_geography"]); }
|
|
66
37
|
/** One campaign: audience, targeting and email instructions. Arguments: campaign_id. */
|
|
67
|
-
getCampaign(args = {}) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
/** Archive a campaign. Arguments: campaign_id. */
|
|
91
|
-
archiveCampaign(args = {}) {
|
|
92
|
-
const a = { ...args }; for (const k of ["campaign_id"]) if (a[k] == null) throw new Error(`archive_campaign: ${k} is required`);
|
|
93
|
-
const path = "/agentapp/campaigns/{campaign_id}/archive".replace("{campaign_id}", encodeURIComponent(a.campaign_id)); delete a.campaign_id;
|
|
94
|
-
return this.request("POST", path);
|
|
95
|
-
}
|
|
96
|
-
/** Set a campaign daily limit in USD. Arguments: campaign_id, daily_limit_usd. */
|
|
97
|
-
setCampaignBudget(args = {}) {
|
|
98
|
-
const a = { ...args }; for (const k of ["campaign_id", "daily_limit_usd"]) if (a[k] == null) throw new Error(`set_campaign_budget: ${k} is required`);
|
|
99
|
-
const path = "/agentapp/campaigns/{campaign_id}/budget".replace("{campaign_id}", encodeURIComponent(a.campaign_id)); delete a.campaign_id;
|
|
100
|
-
return this.request("PATCH", path, { body: a });
|
|
101
|
-
}
|
|
102
|
-
/** Leads found, contacted, replied, hot, bounced for a campaign. Arguments: campaign_id. */
|
|
103
|
-
campaignAnalytics(args = {}) {
|
|
104
|
-
const a = { ...args }; for (const k of ["campaign_id"]) if (a[k] == null) throw new Error(`campaign_analytics: ${k} is required`);
|
|
105
|
-
const path = "/agentapp/campaigns/{campaign_id}/analytics".replace("{campaign_id}", encodeURIComponent(a.campaign_id)); delete a.campaign_id;
|
|
106
|
-
return this.request("GET", path);
|
|
107
|
-
}
|
|
38
|
+
getCampaign(args = {}) { return this._call("GET", "/public/api/v1/agentapp/campaigns/{campaign_id}", args, {"campaign_id": "path"}, ["campaign_id"], "get_campaign", []); }
|
|
39
|
+
/** Update campaign definition. Arguments: campaign_id, name?, offer?, customer_problem?, target_role?, target_geography?, target_company_size?, positive_criteria?, negative_criteria?, example_clients?, instructions?, followup_instructions?, language?, followups?. */
|
|
40
|
+
updateCampaign(args = {}) { return this._call("PATCH", "/public/api/v1/agentapp/campaigns/{campaign_id}", args, {"campaign_id": "path", "name": "body", "offer": "body", "customer_problem": "body", "target_role": "body", "target_geography": "body", "target_company_size": "body", "positive_criteria": "body", "negative_criteria": "body", "example_clients": "body", "instructions": "body", "followup_instructions": "body", "language": "body", "followups": "body"}, ["campaign_id"], "update_campaign", ["name", "offer", "customer_problem", "target_role", "target_geography", "target_company_size", "positive_criteria", "negative_criteria", "example_clients", "instructions", "followup_instructions", "language", "followups"]); }
|
|
41
|
+
/** Get campaign My copy. Arguments: campaign_id. */
|
|
42
|
+
getCampaignMyCopy(args = {}) { return this._call("GET", "/public/api/v1/agentapp/campaigns/{campaign_id}/my-copy", args, {"campaign_id": "path"}, ["campaign_id"], "get_campaign_my_copy", []); }
|
|
43
|
+
/** Update campaign My copy. Arguments: campaign_id, mode?. */
|
|
44
|
+
updateCampaignMyCopy(args = {}) { return this._call("PATCH", "/public/api/v1/agentapp/campaigns/{campaign_id}/my-copy", args, {"campaign_id": "path", "mode": "body"}, ["campaign_id"], "update_campaign_my_copy", []); }
|
|
45
|
+
/** Set campaign My copy source. Arguments: campaign_id, source. */
|
|
46
|
+
setCampaignMyCopySource(args = {}) { return this._call("PUT", "/public/api/v1/agentapp/campaigns/{campaign_id}/my-copy/source", args, {"campaign_id": "path", "source": "body"}, ["campaign_id", "source"], "set_campaign_my_copy_source", []); }
|
|
47
|
+
/** Preview campaign first email. Arguments: campaign_id. */
|
|
48
|
+
previewCampaignMyCopy(args = {}) { return this._call("GET", "/public/api/v1/agentapp/campaigns/{campaign_id}/my-copy/preview", args, {"campaign_id": "path"}, ["campaign_id"], "preview_campaign_my_copy", []); }
|
|
49
|
+
/** Get project My copy. Arguments: project_id. */
|
|
50
|
+
getProjectMyCopy(args = {}) { return this._call("GET", "/public/api/v1/agentapp/projects/{project_id}/my-copy", args, {"project_id": "path"}, ["project_id"], "get_project_my_copy", []); }
|
|
51
|
+
/** Update project My copy. Arguments: project_id, mode?. */
|
|
52
|
+
updateProjectMyCopy(args = {}) { return this._call("PATCH", "/public/api/v1/agentapp/projects/{project_id}/my-copy", args, {"project_id": "path", "mode": "body"}, ["project_id"], "update_project_my_copy", []); }
|
|
53
|
+
/** Approve campaign lead list. Arguments: campaign_id. */
|
|
54
|
+
approveCampaign(args = {}) { return this._call("POST", "/public/api/v1/agentapp/campaigns/{campaign_id}/approve", args, {"campaign_id": "path"}, ["campaign_id"], "approve_campaign", []); }
|
|
55
|
+
/** Create a campaign from your own leads (up to 30,000). Each lead needs email, first_name, last_name, company_domain and job_title (linkedin_url optional). Answers with a task_id; check it with get_import. Every lead is emailed only after its address passes the email check. Arguments: project_id, name, leads, instructions?. */
|
|
56
|
+
importLeads(args = {}) { return this._call("POST", "/public/api/v1/agentapp/campaigns/import", args, {"project_id": "body", "name": "body", "leads": "body", "instructions": "body"}, ["project_id", "name", "leads"], "import_leads", []); }
|
|
57
|
+
/** Status and result of import_leads: pending, completed (with campaign_id and counts) or failed. Arguments: task_id. */
|
|
58
|
+
getImport(args = {}) { return this._call("GET", "/public/api/v1/agentapp/campaigns/import/{task_id}", args, {"task_id": "path"}, ["task_id"], "get_import", []); }
|
|
59
|
+
/** Campaign import: every lead's outcome. Arguments: task_id, offset?, limit?. */
|
|
60
|
+
getCampaignImportRows(args = {}) { return this._call("GET", "/public/api/v1/agentapp/campaigns/import/{task_id}/rows", args, {"task_id": "path", "offset": "query", "limit": "query"}, ["task_id"], "get_campaign_import_rows", []); }
|
|
108
61
|
/** Interested replies (hot leads), optionally for one project. Arguments: project_id?. */
|
|
109
|
-
listHotLeads(args = {}) {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
return this.request("GET", path, { query: a });
|
|
113
|
-
}
|
|
62
|
+
listHotLeads(args = {}) { return this._call("GET", "/public/api/v1/agentapp/hot-leads", args, {"project_id": "query"}, [], "list_hot_leads", ["project_id"]); }
|
|
63
|
+
/** List contacted leads. Arguments: campaign_id, limit?, offset?, order?, cursor?. */
|
|
64
|
+
listCampaignLeads(args = {}) { return this._call("GET", "/public/api/v1/agentapp/campaigns/{campaign_id}/leads", args, {"campaign_id": "path", "limit": "query", "offset": "query", "order": "query", "cursor": "query"}, ["campaign_id"], "list_campaign_leads", ["order", "cursor"]); }
|
|
114
65
|
/** Conversations in a project inbox. tab: need_reply, hot, all or replied. Arguments: project_id, tab?. */
|
|
115
|
-
listInbox(args = {}) {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
return this.request("GET", path, { query: a });
|
|
119
|
-
}
|
|
66
|
+
listInbox(args = {}) { return this._call("GET", "/public/api/v1/agentapp/projects/{project_id}/inbox", args, {"project_id": "path", "tab": "query"}, ["project_id"], "list_inbox", ["tab"]); }
|
|
67
|
+
/** List project inbox changes. Arguments: project_id, campaign_id?, since?, cursor?, limit?. */
|
|
68
|
+
listProjectInboxChanges(args = {}) { return this._call("GET", "/public/api/v1/agentapp/projects/{project_id}/inbox/changes", args, {"project_id": "path", "campaign_id": "query", "since": "query", "cursor": "query", "limit": "query"}, ["project_id"], "list_project_inbox_changes", ["campaign_id", "since", "cursor"]); }
|
|
120
69
|
/** The full thread with one lead. Arguments: campaign_id, person_id. */
|
|
121
|
-
readConversation(args = {}) {
|
|
122
|
-
const a = { ...args }; for (const k of ["campaign_id", "person_id"]) if (a[k] == null) throw new Error(`read_conversation: ${k} is required`);
|
|
123
|
-
const path = "/agentapp/campaigns/{campaign_id}/inbox/{person_id}".replace("{campaign_id}", encodeURIComponent(a.campaign_id)).replace("{person_id}", encodeURIComponent(a.person_id)); delete a.campaign_id; delete a.person_id;
|
|
124
|
-
return this.request("GET", path);
|
|
125
|
-
}
|
|
70
|
+
readConversation(args = {}) { return this._call("GET", "/public/api/v1/agentapp/campaigns/{campaign_id}/inbox/{person_id}", args, {"campaign_id": "path", "person_id": "path"}, ["campaign_id", "person_id"], "read_conversation", []); }
|
|
126
71
|
/** Send a reply to a lead in a thread. This sends a real email. Arguments: campaign_id, person_id, body_text. */
|
|
127
|
-
reply(args = {}) {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}
|
|
132
|
-
/** Set
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
}
|
|
72
|
+
reply(args = {}) { return this._call("POST", "/public/api/v1/agentapp/campaigns/{campaign_id}/inbox/{person_id}/reply", args, {"campaign_id": "path", "person_id": "path", "body_text": "body"}, ["campaign_id", "person_id", "body_text"], "reply", []); }
|
|
73
|
+
/** Read the lead note. Arguments: campaign_id, person_id. */
|
|
74
|
+
getLeadNote(args = {}) { return this._call("GET", "/public/api/v1/agentapp/campaigns/{campaign_id}/inbox/{person_id}/note", args, {"campaign_id": "path", "person_id": "path"}, ["campaign_id", "person_id"], "get_lead_note", []); }
|
|
75
|
+
/** Set the note on a lead. Arguments: campaign_id, person_id, note?. */
|
|
76
|
+
setLeadNote(args = {}) { return this._call("POST", "/public/api/v1/agentapp/campaigns/{campaign_id}/inbox/{person_id}/note", args, {"campaign_id": "path", "person_id": "path", "note": "body"}, ["campaign_id", "person_id"], "set_lead_note", ["note"]); }
|
|
77
|
+
/** Set a lead's deal status. Arguments: campaign_id, person_id, status?. */
|
|
78
|
+
setLeadStatus(args = {}) { return this._call("POST", "/public/api/v1/agentapp/campaigns/{campaign_id}/inbox/{person_id}/status", args, {"campaign_id": "path", "person_id": "path", "status": "body"}, ["campaign_id", "person_id"], "set_lead_status", ["status"]); }
|
|
79
|
+
/** Read the lead's deal status. Arguments: campaign_id, person_id. */
|
|
80
|
+
getLeadStatus(args = {}) { return this._call("GET", "/public/api/v1/agentapp/campaigns/{campaign_id}/inbox/{person_id}/status", args, {"campaign_id": "path", "person_id": "path"}, ["campaign_id", "person_id"], "get_lead_status", []); }
|
|
81
|
+
/** Mark the conversation as replied. Arguments: campaign_id, person_id. */
|
|
82
|
+
markReplied(args = {}) { return this._call("POST", "/public/api/v1/agentapp/campaigns/{campaign_id}/inbox/{person_id}/mark-replied", args, {"campaign_id": "path", "person_id": "path"}, ["campaign_id", "person_id"], "mark_replied", []); }
|
|
83
|
+
/** Daily budget and monthly cap. Arguments: project_id. */
|
|
84
|
+
getProjectBudget(args = {}) { return this._call("GET", "/public/api/v1/agentapp/projects/{project_id}/budget", args, {"project_id": "path"}, ["project_id"], "get_project_budget", []); }
|
|
85
|
+
/** Set the project daily budget in USD. Arguments: project_id, daily_budget_usd. */
|
|
86
|
+
setProjectBudget(args = {}) { return this._call("PATCH", "/public/api/v1/agentapp/projects/{project_id}/budget", args, {"project_id": "path", "daily_budget_usd": "body"}, ["project_id", "daily_budget_usd"], "set_project_budget", []); }
|
|
87
|
+
/** Set a campaign daily limit in USD. Arguments: campaign_id, daily_limit_usd. */
|
|
88
|
+
setCampaignBudget(args = {}) { return this._call("PATCH", "/public/api/v1/agentapp/campaigns/{campaign_id}/budget", args, {"campaign_id": "path", "daily_limit_usd": "body"}, ["campaign_id", "daily_limit_usd"], "set_campaign_budget", []); }
|
|
89
|
+
/** Pause a campaign. Arguments: campaign_id. */
|
|
90
|
+
stopCampaign(args = {}) { return this._call("POST", "/public/api/v1/agentapp/campaigns/{campaign_id}/stop", args, {"campaign_id": "path"}, ["campaign_id"], "stop_campaign", []); }
|
|
91
|
+
/** Start (resume) a campaign. Arguments: campaign_id. */
|
|
92
|
+
startCampaign(args = {}) { return this._call("POST", "/public/api/v1/agentapp/campaigns/{campaign_id}/start", args, {"campaign_id": "path"}, ["campaign_id"], "start_campaign", []); }
|
|
93
|
+
/** Archive a campaign. Arguments: campaign_id. */
|
|
94
|
+
archiveCampaign(args = {}) { return this._call("POST", "/public/api/v1/agentapp/campaigns/{campaign_id}/archive", args, {"campaign_id": "path"}, ["campaign_id"], "archive_campaign", []); }
|
|
95
|
+
/** Unarchive campaign. Arguments: campaign_id. */
|
|
96
|
+
unarchiveCampaign(args = {}) { return this._call("POST", "/public/api/v1/agentapp/campaigns/{campaign_id}/unarchive", args, {"campaign_id": "path"}, ["campaign_id"], "unarchive_campaign", []); }
|
|
97
|
+
/** Results for a campaign: emails sent, replies, reply rate, hot leads, spend and cost per lead. Arguments: campaign_id. */
|
|
98
|
+
campaignAnalytics(args = {}) { return this._call("GET", "/public/api/v1/agentapp/campaigns/{campaign_id}/analytics", args, {"campaign_id": "path"}, ["campaign_id"], "campaign_analytics", []); }
|
|
99
|
+
/** Emails sent, replies and hot leads for a project. Arguments: project_id. */
|
|
100
|
+
projectAnalytics(args = {}) { return this._call("GET", "/public/api/v1/agentapp/projects/{project_id}/analytics", args, {"project_id": "path"}, ["project_id"], "project_analytics", []); }
|
|
101
|
+
/** Campaign send state. Arguments: campaign_id. */
|
|
102
|
+
getCampaignStatus(args = {}) { return this._call("GET", "/public/api/v1/agentapp/campaigns/{campaign_id}/status", args, {"campaign_id": "path"}, ["campaign_id"], "get_campaign_status", []); }
|
|
103
|
+
/** Never email these addresses (every project). Arguments: people, list?. */
|
|
104
|
+
suppressEmails(args = {}) { return this._call("POST", "/public/api/v1/agentapp/suppress-list/people", args, {"people": "body", "list": "body"}, ["people"], "suppress_emails", []); }
|
|
105
|
+
/** People suppress lists. Arguments: none. */
|
|
106
|
+
listPeopleLists(args = {}) { return this._call("GET", "/public/api/v1/agentapp/suppress-list/people", args, {}, [], "list_people_lists", []); }
|
|
107
|
+
/** Read a people list. Arguments: list_name, limit?, offset?. */
|
|
108
|
+
readPeopleList(args = {}) { return this._call("GET", "/public/api/v1/agentapp/suppress-list/people/{list_name}", args, {"list_name": "path", "limit": "query", "offset": "query"}, ["list_name"], "read_people_list", []); }
|
|
109
|
+
/** Delete a people list. Arguments: list_name. */
|
|
110
|
+
deletePeopleList(args = {}) { return this._call("DELETE", "/public/api/v1/agentapp/suppress-list/people/{list_name}", args, {"list_name": "path"}, ["list_name"], "delete_people_list", []); }
|
|
111
|
+
/** Never email anyone at these company domains (every project). Arguments: domains, list?. */
|
|
112
|
+
suppressDomains(args = {}) { return this._call("POST", "/public/api/v1/agentapp/suppress-list/companies", args, {"domains": "body", "list": "body"}, ["domains"], "suppress_domains", []); }
|
|
113
|
+
/** Company suppress lists. Arguments: none. */
|
|
114
|
+
listCompanyLists(args = {}) { return this._call("GET", "/public/api/v1/agentapp/suppress-list/companies", args, {}, [], "list_company_lists", []); }
|
|
115
|
+
/** Read a company list. Arguments: list_name, limit?, offset?. */
|
|
116
|
+
readCompanyList(args = {}) { return this._call("GET", "/public/api/v1/agentapp/suppress-list/companies/{list_name}", args, {"list_name": "path", "limit": "query", "offset": "query"}, ["list_name"], "read_company_list", []); }
|
|
117
|
+
/** Delete a company list. Arguments: list_name. */
|
|
118
|
+
deleteCompanyList(args = {}) { return this._call("DELETE", "/public/api/v1/agentapp/suppress-list/companies/{list_name}", args, {"list_name": "path"}, ["list_name"], "delete_company_list", []); }
|
|
119
|
+
/** Add an https webhook to a project. Arguments: project_id?, url, events?. */
|
|
120
|
+
addWebhook(args = {}) { return this._call("POST", "/public/api/v1/agentapp/webhooks", args, {"project_id": "body", "url": "body", "events": "body"}, ["url"], "add_webhook", []); }
|
|
121
|
+
/** Webhooks for a project (events: reply.received, hot_lead.received, signal.lead). Arguments: project_id?. */
|
|
122
|
+
listWebhooks(args = {}) { return this._call("GET", "/public/api/v1/agentapp/webhooks", args, {"project_id": "query"}, [], "list_webhooks", []); }
|
|
123
|
+
/** Get a webhook. Arguments: webhook_id, project_id?. */
|
|
124
|
+
getWebhook(args = {}) { return this._call("GET", "/public/api/v1/agentapp/webhooks/{webhook_id}", args, {"webhook_id": "path", "project_id": "query"}, ["webhook_id"], "get_webhook", []); }
|
|
125
|
+
/** Remove a webhook from a project; it gets no more events. Arguments: project_id?, webhook_id. */
|
|
126
|
+
deleteWebhook(args = {}) { return this._call("DELETE", "/public/api/v1/agentapp/webhooks/{webhook_id}", args, {"project_id": "query", "webhook_id": "path"}, ["webhook_id"], "delete_webhook", []); }
|
|
127
|
+
/** Get autopilot settings. Arguments: project_id. */
|
|
128
|
+
getAutopilot(args = {}) { return this._call("GET", "/public/api/v1/agentapp/projects/{project_id}/autopilot", args, {"project_id": "path"}, ["project_id"], "get_autopilot", []); }
|
|
129
|
+
/** Set autopilot settings. Arguments: project_id, autopilot_enabled?, auto_reply_enabled?, auto_reply_delay_minutes?. */
|
|
130
|
+
setAutopilot(args = {}) { return this._call("PATCH", "/public/api/v1/agentapp/projects/{project_id}/autopilot", args, {"project_id": "path", "autopilot_enabled": "body", "auto_reply_enabled": "body", "auto_reply_delay_minutes": "body"}, ["project_id"], "set_autopilot", ["autopilot_enabled", "auto_reply_enabled", "auto_reply_delay_minutes"]); }
|
|
131
|
+
/** Outreach balance. Arguments: none. */
|
|
132
|
+
getBilling(args = {}) { return this._call("GET", "/public/api/v1/agentapp/billing", args, {}, [], "get_billing", []); }
|
|
133
|
+
/** Outreach spend by day. Arguments: days?. */
|
|
134
|
+
getBillingUsage(args = {}) { return this._call("GET", "/public/api/v1/agentapp/billing/usage", args, {"days": "query"}, [], "get_billing_usage", []); }
|
|
135
|
+
/** Credits activity. Arguments: none. */
|
|
136
|
+
getBillingActivity(args = {}) { return this._call("GET", "/public/api/v1/agentapp/billing/activity", args, {}, [], "get_billing_activity", []); }
|
|
137
|
+
/** Who this API key is: email, organization, plan and credit balance. A good first call; list_projects lists the projects. Arguments: none. */
|
|
138
|
+
getAccount(args = {}) { return this._call("GET", "/public/api/v1/me", args, {}, [], "get_account", []); }
|
|
139
|
+
/** Send feedback. Arguments: message. */
|
|
140
|
+
submitFeedback(args = {}) { return this._call("POST", "/public/api/v1/feedback", args, {"message": "body"}, ["message"], "submit_feedback", []); }
|
|
141
|
+
/** Your posts and how far each one has got. Arguments: project_id. */
|
|
142
|
+
listPosts(args = {}) { return this._call("GET", "/public/api/v1/agentapp/projects/{project_id}/posts", args, {"project_id": "path"}, ["project_id"], "list_posts", []); }
|
|
186
143
|
/** Import the people who commented on or replied to one of your LinkedIn or X posts: Yirlo finds their work emails and starts a campaign for them (each email is checked before it is sent). Check progress with list_posts. Arguments: project_id, url, sell?. */
|
|
187
|
-
leadsFromPost(args = {}) {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
}
|
|
144
|
+
leadsFromPost(args = {}) { return this._call("POST", "/public/api/v1/agentapp/projects/{project_id}/posts", args, {"project_id": "path", "url": "body", "sell": "body"}, ["project_id", "url"], "leads_from_post", []); }
|
|
145
|
+
/** Website signals: the script to put on your site, the private webhook address for form tools, the visitor lead limit, the last 30 days and the latest leads. Arguments: project_id. */
|
|
146
|
+
getSignals(args = {}) { return this._call("GET", "/public/api/v1/agentapp/projects/{project_id}/signals", args, {"project_id": "path"}, ["project_id"], "get_signals", []); }
|
|
147
|
+
/** How many recognized website visitors become leads a day; 0 turns it off, null or empty means no limit. Each lead found is paid from the balance. Arguments: project_id, visitor_leads_per_day?. */
|
|
148
|
+
setVisitorLeadLimit(args = {}) { return this._call("PATCH", "/public/api/v1/agentapp/projects/{project_id}/signals", args, {"project_id": "path", "visitor_leads_per_day": "body"}, ["project_id"], "set_visitor_lead_limit", ["visitor_leads_per_day"]); }
|
|
149
|
+
/** Pages where a form always or never counts for website signals (/signup, /blog/*; 50 each). Log-in and password reset forms never count unless listed in pages_always. Arguments: project_id, pages_always?, pages_never?. */
|
|
150
|
+
setSignalPages(args = {}) { return this._call("PATCH", "/public/api/v1/agentapp/projects/{project_id}/signals", args, {"project_id": "path", "pages_always": "body", "pages_never": "body"}, ["project_id"], "set_signal_pages", []); }
|
|
151
|
+
/** Website signals as CSV. Arguments: project_id. */
|
|
152
|
+
signalsCsv(args = {}) { return this._call("GET", "/public/api/v1/agentapp/projects/{project_id}/signals.csv", args, {"project_id": "path"}, ["project_id"], "signals_csv", []); }
|
|
153
|
+
/** Profiles we watch: LinkedIn profiles and X accounts whose new posts have their commenters emailed. Arguments: project_id. */
|
|
154
|
+
listMonitors(args = {}) { return this._call("GET", "/public/api/v1/agentapp/projects/{project_id}/monitors", args, {"project_id": "path"}, ["project_id"], "list_monitors", []); }
|
|
155
|
+
/** Watch a LinkedIn profile or an X account: people who comment on its new posts are found and emailed. Paid per person from the balance. Arguments: project_id, profile, every_hours?, max_people?, posts_per_day?. */
|
|
156
|
+
addMonitor(args = {}) { return this._call("POST", "/public/api/v1/agentapp/projects/{project_id}/monitors", args, {"project_id": "path", "profile": "body", "every_hours": "body", "max_people": "body", "posts_per_day": "body"}, ["project_id", "profile"], "add_monitor", []); }
|
|
157
|
+
/** Change a watched profile: every_hours, max_people, posts_per_day (null removes that limit), or status active / paused. Arguments: project_id, monitor_id, every_hours?, max_people?, posts_per_day?, status?. */
|
|
158
|
+
updateMonitor(args = {}) { return this._call("PATCH", "/public/api/v1/agentapp/projects/{project_id}/monitors/{monitor_id}", args, {"project_id": "path", "monitor_id": "path", "every_hours": "body", "max_people": "body", "posts_per_day": "body", "status": "body"}, ["project_id", "monitor_id"], "update_monitor", []); }
|
|
159
|
+
/** Stop watching a profile. Arguments: project_id, monitor_id. */
|
|
160
|
+
removeMonitor(args = {}) { return this._call("DELETE", "/public/api/v1/agentapp/projects/{project_id}/monitors/{monitor_id}", args, {"project_id": "path", "monitor_id": "path"}, ["project_id", "monitor_id"], "remove_monitor", []); }
|
|
161
|
+
/** What interested replies are steered to: a booked call, a demo, a free trial, a free resource (link or file) or a free campaign. Arguments: project_id. */
|
|
162
|
+
getReplyGoal(args = {}) { return this._call("GET", "/public/api/v1/agentapp/projects/{project_id}/reply-goal", args, {"project_id": "path"}, ["project_id"], "get_reply_goal", []); }
|
|
163
|
+
/** Set what interested replies get. type: booking, demo, trial, resource or free_campaign. A resource takes a link and/or file_id (from upload_reply_file); the file is attached to the first interested reply in each conversation. Arguments: project_id, type?, link?, instructions?, file_id?. */
|
|
164
|
+
setReplyGoal(args = {}) { return this._call("PATCH", "/public/api/v1/agentapp/projects/{project_id}/reply-goal", args, {"project_id": "path", "type": "body", "link": "body", "instructions": "body", "file_id": "body"}, ["project_id"], "set_reply_goal", []); }
|
|
165
|
+
/** Upload your lead magnet (PDF, image, Word, Excel, PowerPoint, CSV, TXT or ZIP; 10 MB at most) as base64. Answers with its id for set_reply_goal. Arguments: project_id, filename, data. */
|
|
166
|
+
uploadReplyFile(args = {}) { return this._call("POST", "/public/api/v1/agentapp/projects/{project_id}/reply-file", args, {"project_id": "path", "filename": "body", "data": "body"}, ["project_id", "filename", "data"], "upload_reply_file", []); }
|
|
167
|
+
/** Start here (no API key). Arguments: query?. */
|
|
168
|
+
startHere(args = {}) { return this._call("GET", "/public/api/v1/start", args, {"query": "query"}, [], "start_here", []); }
|
|
169
|
+
/** Conversion feed. Arguments: project_id. */
|
|
170
|
+
getConversions(args = {}) { return this._call("GET", "/public/api/v1/agentapp/projects/{project_id}/conversions", args, {"project_id": "path"}, ["project_id"], "get_conversions", []); }
|
|
171
|
+
/** Replace the conversion address. Arguments: project_id. */
|
|
172
|
+
rotateConversionUrl(args = {}) { return this._call("POST", "/public/api/v1/agentapp/projects/{project_id}/conversions/rotate", args, {"project_id": "path"}, ["project_id"], "rotate_conversion_url", []); }
|
|
173
|
+
/** Send a signup or purchase (conversion feed). Arguments: conversion_key, email, id?, type?. */
|
|
174
|
+
sendConversion(args = {}) { return this._call("POST", "/px/conv/{conversion_key}", args, {"conversion_key": "path", "email": "body", "id": "body", "type": "body"}, ["conversion_key", "email"], "send_conversion", []); }
|
|
175
|
+
/** Competitors. Arguments: project_id. */
|
|
176
|
+
listCompetitors(args = {}) { return this._call("GET", "/public/api/v1/agentapp/projects/{project_id}/competitors", args, {"project_id": "path"}, ["project_id"], "list_competitors", []); }
|
|
177
|
+
/** Add a competitor. Arguments: project_id, website. */
|
|
178
|
+
addCompetitor(args = {}) { return this._call("POST", "/public/api/v1/agentapp/projects/{project_id}/competitors", args, {"project_id": "path", "website": "body"}, ["project_id", "website"], "add_competitor", []); }
|
|
179
|
+
/** Set the competitor limits. Arguments: project_id, people_per_day?, people_per_company?. */
|
|
180
|
+
setCompetitorLimits(args = {}) { return this._call("PATCH", "/public/api/v1/agentapp/projects/{project_id}/competitors", args, {"project_id": "path", "people_per_day": "body", "people_per_company": "body"}, ["project_id"], "set_competitor_limits", ["people_per_day"]); }
|
|
181
|
+
/** Remove a competitor. Arguments: project_id, website. */
|
|
182
|
+
removeCompetitor(args = {}) { return this._call("DELETE", "/public/api/v1/agentapp/projects/{project_id}/competitors/{website}", args, {"project_id": "path", "website": "path"}, ["project_id", "website"], "remove_competitor", []); }
|
|
183
|
+
/** Your white label. Arguments: none. */
|
|
184
|
+
getWhiteLabel(args = {}) { return this._call("GET", "/public/api/v1/agentapp/white-label", args, {}, [], "get_white_label", []); }
|
|
185
|
+
/** Set your white label. Arguments: name?, price_per_email_usd?, logo_url?, color?, website?. */
|
|
186
|
+
setWhiteLabel(args = {}) { return this._call("PATCH", "/public/api/v1/agentapp/white-label", args, {"name": "body", "price_per_email_usd": "body", "logo_url": "body", "color": "body", "website": "body"}, [], "set_white_label", []); }
|
|
187
|
+
/** Add a client. Arguments: website, email. */
|
|
188
|
+
addWhiteLabelClient(args = {}) { return this._call("POST", "/public/api/v1/agentapp/white-label/clients", args, {"website": "body", "email": "body"}, ["website", "email"], "add_white_label_client", []); }
|
|
189
|
+
/** Request a payout. Arguments: none. */
|
|
190
|
+
requestWhiteLabelPayout(args = {}) { return this._call("POST", "/public/api/v1/agentapp/white-label/payout", args, {}, [], "request_white_label_payout", []); }
|
|
191
|
+
/** Send one signed sample event to a webhook. Arguments: project_id?, webhook_id. */
|
|
192
|
+
testWebhook(args = {}) { return this._call("POST", "/public/api/v1/agentapp/webhooks/{webhook_id}/test", args, {"project_id": "query", "webhook_id": "path"}, ["webhook_id"], "test_webhook", []); }
|
|
198
193
|
/** People on a project. Arguments: project_id. */
|
|
199
|
-
listTeam(args = {}) {
|
|
200
|
-
const a = { ...args }; for (const k of ["project_id"]) if (a[k] == null) throw new Error(`list_team: ${k} is required`);
|
|
201
|
-
const path = "/agentapp/projects/{project_id}/team".replace("{project_id}", encodeURIComponent(a.project_id)); delete a.project_id;
|
|
202
|
-
return this.request("GET", path);
|
|
203
|
-
}
|
|
194
|
+
listTeam(args = {}) { return this._call("GET", "/public/api/v1/agentapp/projects/{project_id}/team", args, {"project_id": "path"}, ["project_id"], "list_team", []); }
|
|
204
195
|
/** Invite someone to a project by email (owner only). Arguments: project_id, email. */
|
|
205
|
-
inviteTeammate(args = {}) {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
return this.request("POST", path, { body: a });
|
|
209
|
-
}
|
|
196
|
+
inviteTeammate(args = {}) { return this._call("POST", "/public/api/v1/agentapp/projects/{project_id}/team", args, {"project_id": "path", "email": "body"}, ["project_id", "email"], "invite_teammate", []); }
|
|
197
|
+
/** Remove someone from the project. Arguments: project_id, email. */
|
|
198
|
+
removeTeamMember(args = {}) { return this._call("DELETE", "/public/api/v1/agentapp/projects/{project_id}/team/{email}", args, {"project_id": "path", "email": "path"}, ["project_id", "email"], "remove_team_member", []); }
|
|
210
199
|
}
|