@seclai/sdk 1.2.0 → 1.4.0
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/CHANGELOG.md +174 -0
- package/README.md +150 -1
- package/dist/index.cjs +402 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1105 -31
- package/dist/index.d.ts +1105 -31
- package/dist/index.js +402 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [1.4.0] - 2026-07-25
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- Sync the bundled OpenAPI spec, adding 22 paths and 22 schemas
|
|
8
|
+
- Extend `listModels()` with `supportsInputMedia` and `supportsOutputMedia` capability filters
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Add `getMe()` returning the authenticated user's account id and organization memberships
|
|
13
|
+
- Add `disableAgent()`, `enableAgent()`, and `getAgentCallers()` to pause and resume an agent across every trigger path
|
|
14
|
+
- Add `setEmailTriggerConfig()` to set the alias, sender allowlist, and inbound-handling flags on an `EMAIL_RECEIVED` trigger
|
|
15
|
+
- Add agent-email opt-out methods `listAgentEmailOptOuts()` and `removeAgentEmailOptOut()`
|
|
16
|
+
- Add inbound sender blocklist methods `listBlockedEmailSenders()`, `blockEmailSender()`, `unblockEmailSender()`, and `setAutoBlockMode()`
|
|
17
|
+
- Add inbound-email observability methods `listInboundEmailRejections()`, `getInboundEmailStatus()`, `cancelQueuedEmailRuns()`, and `resumeInboundEmail()`
|
|
18
|
+
- Add email domain management: `listEmailDomains()`, `addEmailDomain()`, `removeEmailDomain()`, `verifyEmailDomain()`, `setPrimaryEmailDomain()`, `useSharedEmailDomain()`, `sendEmailDomainTestEmail()`, and `getDmarcSummary()`
|
|
19
|
+
- Add `getGenerationTiers()` mapping each media-generation modality and tier to its model and cost
|
|
20
|
+
- Add `searchDocs()` for keyword or semantic search over the Seclai documentation
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- Return `OrganizationAlertPreferenceResponse` from `updateOrganizationAlertPreference()` instead of `unknown`, so the response fields are reachable without a cast
|
|
25
|
+
|
|
26
|
+
## [1.3.0] - 2026-06-05
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
|
|
30
|
+
- Accept `MemoryBankAiAssistantRequest` in `aiAssistantMemoryBank()` instead of the solutions request type ([#9](https://github.com/seclai/seclai-javascript/pull/9))
|
|
31
|
+
|
|
32
|
+
### Added
|
|
33
|
+
|
|
34
|
+
- Add `getAgentAttachmentReferences()` to read an agent's static attachment-reference contract before staging uploads ([#9](https://github.com/seclai/seclai-javascript/pull/9))
|
|
35
|
+
- Add `downloadAgentRunAttachment()` returning the raw `Response` for a file emitted by a run step ([#9](https://github.com/seclai/seclai-javascript/pull/9))
|
|
36
|
+
- Add `deleteExperiment()` to soft-delete a model playground experiment ([#9](https://github.com/seclai/seclai-javascript/pull/9))
|
|
37
|
+
- Add `InsufficientCreditsResponse` and `InsufficientCreditsDetail` types for HTTP 402 responses ([#9](https://github.com/seclai/seclai-javascript/pull/9))
|
|
38
|
+
- Add `AgentRunToolCallResponse` and `ModalityRateResponse` types ([#9](https://github.com/seclai/seclai-javascript/pull/9))
|
|
39
|
+
|
|
40
|
+
## [1.2.0] - 2026-05-22
|
|
41
|
+
|
|
42
|
+
### Added
|
|
43
|
+
|
|
44
|
+
- Add `previewImportAgent()` to dry-run an agent definition import and surface unresolved entity refs ([#8](https://github.com/seclai/seclai-javascript/pull/8))
|
|
45
|
+
- Add agent import types, including `AgentDefinitionImportErrorResponse` with line and column positions into the canonical source echo ([#8](https://github.com/seclai/seclai-javascript/pull/8))
|
|
46
|
+
|
|
47
|
+
## [1.1.5] - 2026-04-24
|
|
48
|
+
|
|
49
|
+
### Added
|
|
50
|
+
|
|
51
|
+
- Add `listModels()` and `getModel()` for the model catalog ([#7](https://github.com/seclai/seclai-javascript/pull/7))
|
|
52
|
+
- Add model playground methods `listExperiments()`, `createExperiment()`, `getExperiment()`, and `cancelExperiment()` ([#7](https://github.com/seclai/seclai-javascript/pull/7))
|
|
53
|
+
- Add `SourceIndexMode` and model pricing types ([#7](https://github.com/seclai/seclai-javascript/pull/7))
|
|
54
|
+
|
|
55
|
+
## [1.1.4] - 2026-04-02
|
|
56
|
+
|
|
57
|
+
### Added
|
|
58
|
+
|
|
59
|
+
- Add `exportAgent()` returning a portable JSON snapshot of an agent definition ([#6](https://github.com/seclai/seclai-javascript/pull/6))
|
|
60
|
+
|
|
61
|
+
## [1.1.3] - 2026-03-27
|
|
62
|
+
|
|
63
|
+
### Changed
|
|
64
|
+
|
|
65
|
+
- Default the SSO domain, client id, and region so a profile only needs `sso_account_id`, and allow overriding each via `SECLAI_SSO_DOMAIN`, `SECLAI_SSO_CLIENT_ID`, and `SECLAI_SSO_REGION` ([#5](https://github.com/seclai/seclai-javascript/pull/5))
|
|
66
|
+
- Make `sso_account_id` optional when loading an SSO profile ([#5](https://github.com/seclai/seclai-javascript/pull/5))
|
|
67
|
+
|
|
68
|
+
### Added
|
|
69
|
+
|
|
70
|
+
- Export the SSO helpers `loadSsoProfile()`, `readSsoCache()`, `writeSsoCache()`, `deleteSsoCache()`, and `isTokenValid()`, plus the `DEFAULT_SSO_*` constants ([#5](https://github.com/seclai/seclai-javascript/pull/5))
|
|
71
|
+
- Add `GET /me` to the bundled OpenAPI spec; the corresponding `getMe()` client method arrived in 1.4.0 ([#5](https://github.com/seclai/seclai-javascript/pull/5))
|
|
72
|
+
|
|
73
|
+
## [1.1.2] - 2026-03-26
|
|
74
|
+
|
|
75
|
+
### Changed
|
|
76
|
+
|
|
77
|
+
- Update the bundled OpenAPI spec's auth descriptions to match the supported auth options ([`6d534c4`](https://github.com/seclai/seclai-javascript/commit/6d534c4))
|
|
78
|
+
|
|
79
|
+
## [1.1.1] - 2026-03-26
|
|
80
|
+
|
|
81
|
+
### Added
|
|
82
|
+
|
|
83
|
+
- Add OAuth SSO authentication with `~/.seclai/config` profiles, an on-disk token cache, and automatic refresh ([#4](https://github.com/seclai/seclai-javascript/pull/4))
|
|
84
|
+
- Add an `accountId` option, sent as the `X-Account-Id` header, to switch organization account context ([#4](https://github.com/seclai/seclai-javascript/pull/4))
|
|
85
|
+
- Add an `accessToken` option accepting either a static bearer token or a provider function called per request ([#4](https://github.com/seclai/seclai-javascript/pull/4))
|
|
86
|
+
|
|
87
|
+
## [1.1.0] - 2026-03-23
|
|
88
|
+
|
|
89
|
+
### Added
|
|
90
|
+
|
|
91
|
+
- Expand endpoint coverage to knowledge bases, memory banks, sources, source exports, embedding migrations, content, solutions, alerts, governance, evaluations, and the AI assistants ([#3](https://github.com/seclai/seclai-javascript/pull/3))
|
|
92
|
+
- Add `runStreamingAgent()`, an async iterator yielding every SSE event of a run ([#3](https://github.com/seclai/seclai-javascript/pull/3))
|
|
93
|
+
- Add `runAgentAndPoll()` for environments where SSE is impractical ([#3](https://github.com/seclai/seclai-javascript/pull/3))
|
|
94
|
+
- Add `requestRaw()` as a low-level escape hatch returning the raw `Response` ([#3](https://github.com/seclai/seclai-javascript/pull/3))
|
|
95
|
+
- Add `search()` across all resource types in an account ([#3](https://github.com/seclai/seclai-javascript/pull/3))
|
|
96
|
+
|
|
97
|
+
## [1.0.7] - 2026-01-30
|
|
98
|
+
|
|
99
|
+
### Added
|
|
100
|
+
|
|
101
|
+
- Add `uploadFileToContent()` to replace existing content with a file upload ([`729298f`](https://github.com/seclai/seclai-javascript/commit/729298f))
|
|
102
|
+
- Add a `metadata` option to the upload methods, sent as a JSON string form field ([`729298f`](https://github.com/seclai/seclai-javascript/commit/729298f))
|
|
103
|
+
|
|
104
|
+
### Fixed
|
|
105
|
+
|
|
106
|
+
- Export the `SourceFileUploadResponse` and `ContentFileUploadResponse` types ([`36bff73`](https://github.com/seclai/seclai-javascript/commit/36bff73))
|
|
107
|
+
|
|
108
|
+
## [1.0.6] - 2026-01-27
|
|
109
|
+
|
|
110
|
+
### Changed
|
|
111
|
+
|
|
112
|
+
- Accept a run id alone in `getAgentRun()` and `deleteAgentRun()`; the leading agent id is now an optional overload ([`fcf6ff9`](https://github.com/seclai/seclai-javascript/commit/fcf6ff9))
|
|
113
|
+
|
|
114
|
+
## [1.0.5] - 2026-01-27
|
|
115
|
+
|
|
116
|
+
### Added
|
|
117
|
+
|
|
118
|
+
- Add an `includeStepOutputs` option to `getAgentRun()` ([`795fd21`](https://github.com/seclai/seclai-javascript/commit/795fd21))
|
|
119
|
+
|
|
120
|
+
## [1.0.4] - 2026-01-27
|
|
121
|
+
|
|
122
|
+
### Changed
|
|
123
|
+
|
|
124
|
+
- Document the 200 MiB upload limit and the supported MIME types on the upload methods ([`bece917`](https://github.com/seclai/seclai-javascript/commit/bece917))
|
|
125
|
+
|
|
126
|
+
### Fixed
|
|
127
|
+
|
|
128
|
+
- Point the default base URL at `https://api.seclai.com` instead of `https://seclai.com` ([`bece917`](https://github.com/seclai/seclai-javascript/commit/bece917))
|
|
129
|
+
|
|
130
|
+
## [1.0.3] - 2026-01-13
|
|
131
|
+
|
|
132
|
+
### Fixed
|
|
133
|
+
|
|
134
|
+
- Drop the `/api` prefix from request paths so they match the deployed API ([`3d72194`](https://github.com/seclai/seclai-javascript/commit/3d72194))
|
|
135
|
+
|
|
136
|
+
## [1.0.2] - 2026-01-13
|
|
137
|
+
|
|
138
|
+
### Added
|
|
139
|
+
|
|
140
|
+
- Add `runStreamingAgentAndWait()` to block until a streaming run completes ([`b55503d`](https://github.com/seclai/seclai-javascript/commit/b55503d))
|
|
141
|
+
|
|
142
|
+
## [1.0.1] - 2026-01-12
|
|
143
|
+
|
|
144
|
+
### Added
|
|
145
|
+
|
|
146
|
+
- Add a documentation homepage link to the package metadata ([`3786d9d`](https://github.com/seclai/seclai-javascript/commit/3786d9d))
|
|
147
|
+
- Add a release script that stamps the version into the README ([`3786d9d`](https://github.com/seclai/seclai-javascript/commit/3786d9d))
|
|
148
|
+
|
|
149
|
+
## [1.0.0] - 2026-01-12
|
|
150
|
+
|
|
151
|
+
_Stable release. No functional changes since 0.0.1._
|
|
152
|
+
|
|
153
|
+
## [0.0.1] - 2026-01-12
|
|
154
|
+
|
|
155
|
+
_Initial release._
|
|
156
|
+
|
|
157
|
+
[1.4.0]: https://github.com/seclai/seclai-javascript/releases/tag/1.4.0
|
|
158
|
+
[1.3.0]: https://github.com/seclai/seclai-javascript/releases/tag/1.3.0
|
|
159
|
+
[1.2.0]: https://github.com/seclai/seclai-javascript/releases/tag/1.2.0
|
|
160
|
+
[1.1.5]: https://github.com/seclai/seclai-javascript/releases/tag/1.1.5
|
|
161
|
+
[1.1.4]: https://github.com/seclai/seclai-javascript/releases/tag/1.1.4
|
|
162
|
+
[1.1.3]: https://github.com/seclai/seclai-javascript/releases/tag/1.1.3
|
|
163
|
+
[1.1.2]: https://github.com/seclai/seclai-javascript/releases/tag/1.1.2
|
|
164
|
+
[1.1.1]: https://github.com/seclai/seclai-javascript/releases/tag/1.1.1
|
|
165
|
+
[1.1.0]: https://github.com/seclai/seclai-javascript/releases/tag/1.1.0
|
|
166
|
+
[1.0.7]: https://github.com/seclai/seclai-javascript/releases/tag/1.0.7
|
|
167
|
+
[1.0.6]: https://github.com/seclai/seclai-javascript/releases/tag/1.0.6
|
|
168
|
+
[1.0.5]: https://github.com/seclai/seclai-javascript/releases/tag/1.0.5
|
|
169
|
+
[1.0.4]: https://github.com/seclai/seclai-javascript/releases/tag/1.0.4
|
|
170
|
+
[1.0.3]: https://github.com/seclai/seclai-javascript/releases/tag/1.0.3
|
|
171
|
+
[1.0.2]: https://github.com/seclai/seclai-javascript/releases/tag/1.0.2
|
|
172
|
+
[1.0.1]: https://github.com/seclai/seclai-javascript/releases/tag/1.0.1
|
|
173
|
+
[1.0.0]: https://github.com/seclai/seclai-javascript/releases/tag/1.0.0
|
|
174
|
+
[0.0.1]: https://github.com/seclai/seclai-javascript/releases/tag/0.0.1
|
package/README.md
CHANGED
|
@@ -104,10 +104,29 @@ or set environment variables:
|
|
|
104
104
|
|
|
105
105
|
Online API documentation (latest):
|
|
106
106
|
|
|
107
|
-
https://seclai.github.io/seclai-javascript/1.
|
|
107
|
+
https://seclai.github.io/seclai-javascript/1.4.0/
|
|
108
|
+
|
|
109
|
+
Release history is in [`CHANGELOG.md`](CHANGELOG.md).
|
|
108
110
|
|
|
109
111
|
## Resources
|
|
110
112
|
|
|
113
|
+
### Identity
|
|
114
|
+
|
|
115
|
+
Discover who the credential belongs to and which organizations it can act for.
|
|
116
|
+
Each organization's `account_id` is what you pass as the client's `accountId`
|
|
117
|
+
option (sent as the `X-Account-Id` header) to target that org context.
|
|
118
|
+
|
|
119
|
+
```ts
|
|
120
|
+
const me = await client.getMe();
|
|
121
|
+
console.log(me.account_id); // the user's personal account
|
|
122
|
+
for (const org of me.organizations) {
|
|
123
|
+
console.log(org.name, org.account_id);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// Act as an organization
|
|
127
|
+
const orgClient = new Seclai({ accountId: me.organizations[0].account_id });
|
|
128
|
+
```
|
|
129
|
+
|
|
111
130
|
### Agents
|
|
112
131
|
|
|
113
132
|
```ts
|
|
@@ -118,6 +137,11 @@ const fetched = await client.getAgent("agent_id");
|
|
|
118
137
|
const updated = await client.updateAgent("agent_id", { name: "Renamed" });
|
|
119
138
|
await client.deleteAgent("agent_id");
|
|
120
139
|
|
|
140
|
+
// Pause / resume — a disabled agent stops firing from every trigger path
|
|
141
|
+
const callers = await client.getAgentCallers("agent_id"); // live agents calling this one
|
|
142
|
+
await client.disableAgent("agent_id"); // 409 if any caller above is still live
|
|
143
|
+
await client.enableAgent("agent_id");
|
|
144
|
+
|
|
121
145
|
// Definition (step workflow)
|
|
122
146
|
const def = await client.getAgentDefinition("agent_id");
|
|
123
147
|
await client.updateAgentDefinition("agent_id", { steps: [...], change_id: def.change_id });
|
|
@@ -202,6 +226,12 @@ const result = await client.runAgentAndPoll(
|
|
|
202
226
|
### Agent input uploads
|
|
203
227
|
|
|
204
228
|
```ts
|
|
229
|
+
// Discover which files (if any) the agent expects before staging uploads
|
|
230
|
+
const refs = await client.getAgentAttachmentReferences("agent_id");
|
|
231
|
+
if (refs.requires_uploads) {
|
|
232
|
+
// refs.agent lists the exact_names / indexes_max / patterns a run batch must satisfy
|
|
233
|
+
}
|
|
234
|
+
|
|
205
235
|
const upload = await client.uploadAgentInput("agent_id", {
|
|
206
236
|
file: new Uint8Array([...]),
|
|
207
237
|
fileName: "input.pdf",
|
|
@@ -209,6 +239,55 @@ const upload = await client.uploadAgentInput("agent_id", {
|
|
|
209
239
|
const status = await client.getAgentInputUploadStatus("agent_id", upload.upload_id);
|
|
210
240
|
```
|
|
211
241
|
|
|
242
|
+
### Agent run attachments
|
|
243
|
+
|
|
244
|
+
```ts
|
|
245
|
+
// Download a file emitted by a step in an agent run. The attachment_id is the
|
|
246
|
+
// URL-safe-base64 storage_key surfaced in run output manifests / webhooks.
|
|
247
|
+
const resp = await client.downloadAgentRunAttachment("run_id", "attachment_id");
|
|
248
|
+
const blob = await resp.blob(); // raw Response — stream or save the bytes
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### Agent email triggers
|
|
252
|
+
|
|
253
|
+
Configure the inbound address and handling rules on an agent's `EMAIL_RECEIVED`
|
|
254
|
+
trigger. Omitted fields are left unchanged; `null` (or `""` for `alias`) clears them.
|
|
255
|
+
|
|
256
|
+
```ts
|
|
257
|
+
const config = await client.setEmailTriggerConfig("agent_id", "trigger_id", {
|
|
258
|
+
alias: "support",
|
|
259
|
+
allowed_senders: ["example.com", "ops@partner.com"], // empty/null accepts any sender
|
|
260
|
+
ignore_auto_generated: true, // drop auto-replies/bulk mail to prevent loops
|
|
261
|
+
require_sender_auth: true, // require SPF or DMARC even on an open inbox
|
|
262
|
+
queue_on_quota: false, // park over-rate mail instead of failing it
|
|
263
|
+
});
|
|
264
|
+
console.log(config.email_addresses); // ["support.<accountID>@agent.seclai.com", ...]
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
### Agent email governance
|
|
268
|
+
|
|
269
|
+
```ts
|
|
270
|
+
// Recipients who opted out of this account's agent emails
|
|
271
|
+
const optOuts = await client.listAgentEmailOptOuts({ agentId: "agent_id", limit: 50 });
|
|
272
|
+
await client.removeAgentEmailOptOut("optout_id"); // opt them back in
|
|
273
|
+
|
|
274
|
+
// Blocked inbound senders (owner/admin only)
|
|
275
|
+
const blocked = await client.listBlockedEmailSenders({ limit: 50, offset: 0 });
|
|
276
|
+
await client.blockEmailSender({ sender_email: "spam.example.com", match_type: "domain" });
|
|
277
|
+
await client.unblockEmailSender("blocked_id");
|
|
278
|
+
|
|
279
|
+
// Auto-block on a governance BLOCK: "disabled" | "input" | "input_and_output"
|
|
280
|
+
await client.setAutoBlockMode({ mode: "input_and_output" });
|
|
281
|
+
|
|
282
|
+
// Inbound emails discarded before running an agent
|
|
283
|
+
const rejections = await client.listInboundEmailRejections({ agentId: "agent_id" });
|
|
284
|
+
|
|
285
|
+
// Account-wide overload circuit breaker
|
|
286
|
+
const status = await client.getInboundEmailStatus(); // { paused, queued_backlog }
|
|
287
|
+
await client.cancelQueuedEmailRuns(); // fail all QUEUED (over-quota parked) runs
|
|
288
|
+
await client.resumeInboundEmail(); // one-shot override; re-arms if still overloaded
|
|
289
|
+
```
|
|
290
|
+
|
|
212
291
|
### Agent AI assistant
|
|
213
292
|
|
|
214
293
|
```ts
|
|
@@ -436,11 +515,27 @@ await client.updateOrganizationAlertPreference("org_id", "alert_type", { ... });
|
|
|
436
515
|
### Models
|
|
437
516
|
|
|
438
517
|
```ts
|
|
518
|
+
// List models, optionally filtered by capability
|
|
519
|
+
const providers = await client.listModels({ supportsToolUse: true });
|
|
520
|
+
const imageModels = await client.listModels({ supportsOutputMedia: "image" });
|
|
521
|
+
const pdfModels = await client.listModels({ supportsInputMedia: "pdf" });
|
|
522
|
+
const model = await client.getModel("model_id");
|
|
523
|
+
|
|
524
|
+
// Media-generation quality tiers (fast/balanced/thorough) and what each resolves to
|
|
525
|
+
const tiers = await client.getGenerationTiers();
|
|
526
|
+
|
|
439
527
|
const alerts = await client.listModelAlerts();
|
|
440
528
|
await client.markModelAlertRead("alert_id");
|
|
441
529
|
await client.markAllModelAlertsRead();
|
|
442
530
|
const unread = await client.getUnreadModelAlertCount();
|
|
443
531
|
const recs = await client.getModelRecommendations("model_id");
|
|
532
|
+
|
|
533
|
+
// Model playground experiments
|
|
534
|
+
const experiment = await client.createExperiment({ model_ids: ["model_id"], prompt: "..." });
|
|
535
|
+
const experiments = await client.listExperiments();
|
|
536
|
+
const detail = await client.getExperiment("experiment_id");
|
|
537
|
+
await client.cancelExperiment("experiment_id");
|
|
538
|
+
await client.deleteExperiment("experiment_id"); // soft-delete, preserves audit history
|
|
444
539
|
```
|
|
445
540
|
|
|
446
541
|
### Search
|
|
@@ -450,6 +545,60 @@ const results = await client.search({ query: "quarterly report" });
|
|
|
450
545
|
const filtered = await client.search({ query: "my agent", entityType: "agent", limit: 5 });
|
|
451
546
|
```
|
|
452
547
|
|
|
548
|
+
### Documentation search
|
|
549
|
+
|
|
550
|
+
Search the Seclai docs. Results are global (not account-scoped) and each carries a
|
|
551
|
+
`doc_slug` plus an optional `anchor` for building a
|
|
552
|
+
`https://seclai.com/docs/<doc_slug>[#<anchor>]` link.
|
|
553
|
+
|
|
554
|
+
```ts
|
|
555
|
+
// Fast title/summary match, no AI cost
|
|
556
|
+
const hits = await client.searchDocs({ query: "email triggers" });
|
|
557
|
+
|
|
558
|
+
// Semantic body match — adds a `highlight` with the best matching sentence
|
|
559
|
+
const semantic = await client.searchDocs({
|
|
560
|
+
query: "how do I stop auto-reply loops",
|
|
561
|
+
mode: "semantic",
|
|
562
|
+
limit: 5,
|
|
563
|
+
});
|
|
564
|
+
```
|
|
565
|
+
|
|
566
|
+
### Email domains
|
|
567
|
+
|
|
568
|
+
Send and receive agent email on your own domain instead of the shared
|
|
569
|
+
`agent.seclai.com`. These endpoints require a user-bound credential (an
|
|
570
|
+
account-only API key is refused with 403) and, for mutations, an account owner/admin.
|
|
571
|
+
|
|
572
|
+
```ts
|
|
573
|
+
// Current domains, their DNS records, and what your plan allows
|
|
574
|
+
const { domains, can_add_custom, has_custom } = await client.listEmailDomains();
|
|
575
|
+
|
|
576
|
+
// Add a vanity subdomain (<slug>.seclai.com) or your own custom domain
|
|
577
|
+
const vanity = await client.addEmailDomain({ kind: "vanity", value: "acme" });
|
|
578
|
+
const custom = await client.addEmailDomain({
|
|
579
|
+
kind: "custom",
|
|
580
|
+
value: "agent.mycompany.com",
|
|
581
|
+
delegated: true, // let Seclai manage a dedicated Route53 zone
|
|
582
|
+
});
|
|
583
|
+
|
|
584
|
+
// Publish custom.dns_records at your DNS provider, then check without waiting
|
|
585
|
+
// for the background sweep
|
|
586
|
+
const checked = await client.verifyEmailDomain(custom.id);
|
|
587
|
+
|
|
588
|
+
// Promote a verified domain, or fall back to the shared domain
|
|
589
|
+
await client.setPrimaryEmailDomain(custom.id);
|
|
590
|
+
await client.useSharedEmailDomain(); // keeps the domain configured & verified
|
|
591
|
+
|
|
592
|
+
// Confirm delivery end-to-end (always sends to the account owner only)
|
|
593
|
+
await client.sendEmailDomainTestEmail(custom.id);
|
|
594
|
+
|
|
595
|
+
// DMARC aggregate-report summary
|
|
596
|
+
const dmarc = await client.getDmarcSummary(custom.id, { days: 30, topSources: 10 });
|
|
597
|
+
|
|
598
|
+
// Removing a delegated domain returns a cleanup_note about the registrar NS record
|
|
599
|
+
const { cleanup_note } = await client.removeEmailDomain(custom.id);
|
|
600
|
+
```
|
|
601
|
+
|
|
453
602
|
### Top-level AI assistant
|
|
454
603
|
|
|
455
604
|
```ts
|