@productcraft/notify 0.3.0 → 0.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/README.md +8 -6
- package/api.md +199 -12
- package/dist/index.cjs +221 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1842 -160
- package/dist/index.d.ts +1842 -160
- package/dist/index.js +221 -16
- package/dist/index.js.map +1 -1
- package/dist/testing.cjs +132 -0
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.cts +2 -2
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +132 -0
- package/dist/testing.js.map +1 -1
- package/manifest.json +106 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -3,13 +3,53 @@ export { APIConnectionError, APIError, APIPromise, APITimeoutError, APIUserAbort
|
|
|
3
3
|
import { Client } from 'openapi-fetch';
|
|
4
4
|
|
|
5
5
|
/** Error codes this API documents. Open: codes added later still type-check. See https://productcraft.co/docs/errors. */
|
|
6
|
-
type NotifyErrorCode = "BAD_REQUEST" | "VALIDATION_ERROR" | "UNAUTHORIZED" | "PAYMENT_REQUIRED" | "FORBIDDEN" | "NOT_FOUND" | "METHOD_NOT_ALLOWED" | "NOT_ACCEPTABLE" | "REQUEST_TIMEOUT" | "CONFLICT" | "GONE" | "PRECONDITION_FAILED" | "PAYLOAD_TOO_LARGE" | "UNSUPPORTED_MEDIA_TYPE" | "UNPROCESSABLE_ENTITY" | "PRECONDITION_REQUIRED" | "RATE_LIMITED" | "INTERNAL_SERVER_ERROR" | "NOT_IMPLEMENTED" | "BAD_GATEWAY" | "SERVICE_UNAVAILABLE" | "GATEWAY_TIMEOUT" | "SERVICE_NOT_ENABLED" | "INVALID_CREDENTIALS" | "SESSION_REVOKED" | "MCP_NOT_PERMITTED" | "MCP_WORKSPACE_MISMATCH" | "PAK_NOT_PERMITTED" | "ACTIONS_NOT_GRANTABLE" | "IDEMPOTENCY_KEY_REUSE" | "IDEMPOTENCY_KEY_REQUIRED" | "IDEMPOTENCY_IN_PROGRESS" | "WEBHOOK_ENDPOINT_LIMIT" | "WEBHOOK_ENDPOINT_NOT_FOUND" | "WEBHOOK_ENDPOINT_NOT_SUBSCRIBED" | "WEBHOOK_EVENT_NOT_FOUND" | "WEBHOOK_EVENT_TYPE_UNKNOWN" | "NOTIFICATION_TYPE_NOT_FOUND" | "NOTIFICATION_TYPE_ARCHIVED" | "RECIPIENT_NOT_FOUND" | "TOO_MANY_RECIPIENTS" | "DATA_TOO_LARGE" | "TEMPLATE_MISSING" | "TEMPLATE_INVALID" | "CHANNEL_NOT_CONFIGURED" | "CREDENTIAL_INVALID" | "CREDENTIAL_NOT_FOUND" | "CREDENTIAL_MISMATCH" | "DEVICE_TOKEN_INVALID" | "WEBPUSH_ENDPOINT_NOT_ALLOWED" | "RECIPIENT_TOKEN_INVALID" | "RECIPIENT_TOKEN_EXPIRED" | "RECIPIENT_TOKEN_SCOPE" | "ORIGIN_NOT_ALLOWED" | "STREAM_LIMIT" | "LIMIT_EXCEEDED" | "BATCHED_TYPE_NOT_SCHEDULABLE" | "BATCH_NOT_FOUND" | "BATCH_NOT_OPEN" | "SEND_AT_OUT_OF_RANGE" | "UNSAFE_URL" | "AUTH_USER_ALREADY_LINKED" | "DEVICE_NOT_FOUND" | "CATEGORY_NOT_FOUND" | "CATEGORY_KEY_TAKEN" | "CATEGORY_IN_USE" | "NOTIFICATION_TYPE_KEY_TAKEN" | "TEMPLATE_NOT_FOUND" | "TEMPLATE_VERSION_NOT_FOUND" | "PREFERENCE_LOCKED" | "NOTIFICATION_NOT_FOUND" | "DELIVERY_NOT_FOUND" | "CONFIRMATION_REQUIRED" | "INBOX_ITEM_NOT_FOUND" | "RECIPIENT_ERASED" | "DEVICE_MOVE_LIMIT" | (string & {});
|
|
6
|
+
type NotifyErrorCode = "BAD_REQUEST" | "VALIDATION_ERROR" | "UNAUTHORIZED" | "PAYMENT_REQUIRED" | "FORBIDDEN" | "NOT_FOUND" | "METHOD_NOT_ALLOWED" | "NOT_ACCEPTABLE" | "REQUEST_TIMEOUT" | "CONFLICT" | "GONE" | "PRECONDITION_FAILED" | "PAYLOAD_TOO_LARGE" | "UNSUPPORTED_MEDIA_TYPE" | "UNPROCESSABLE_ENTITY" | "PRECONDITION_REQUIRED" | "RATE_LIMITED" | "INTERNAL_SERVER_ERROR" | "NOT_IMPLEMENTED" | "BAD_GATEWAY" | "SERVICE_UNAVAILABLE" | "GATEWAY_TIMEOUT" | "SERVICE_NOT_ENABLED" | "INVALID_CREDENTIALS" | "SESSION_REVOKED" | "MCP_NOT_PERMITTED" | "MCP_WORKSPACE_MISMATCH" | "PAK_NOT_PERMITTED" | "ACTIONS_NOT_GRANTABLE" | "IDEMPOTENCY_KEY_REUSE" | "IDEMPOTENCY_KEY_REQUIRED" | "IDEMPOTENCY_IN_PROGRESS" | "WEBHOOK_ENDPOINT_LIMIT" | "WEBHOOK_ENDPOINT_NOT_FOUND" | "WEBHOOK_ENDPOINT_NOT_SUBSCRIBED" | "WEBHOOK_EVENT_NOT_FOUND" | "WEBHOOK_EVENT_TYPE_UNKNOWN" | "NOTIFICATION_TYPE_NOT_FOUND" | "NOTIFICATION_TYPE_ARCHIVED" | "RECIPIENT_NOT_FOUND" | "TOO_MANY_RECIPIENTS" | "DATA_TOO_LARGE" | "TEMPLATE_MISSING" | "TEMPLATE_INVALID" | "CHANNEL_NOT_CONFIGURED" | "CREDENTIAL_INVALID" | "CREDENTIAL_NOT_FOUND" | "CREDENTIAL_MISMATCH" | "DEVICE_TOKEN_INVALID" | "WEBPUSH_ENDPOINT_NOT_ALLOWED" | "RECIPIENT_TOKEN_INVALID" | "RECIPIENT_TOKEN_EXPIRED" | "RECIPIENT_TOKEN_SCOPE" | "ORIGIN_NOT_ALLOWED" | "STREAM_LIMIT" | "LIMIT_EXCEEDED" | "BATCHED_TYPE_NOT_SCHEDULABLE" | "APPROVAL_NOT_FOUND" | "APPROVAL_NOT_PENDING" | "APPROVAL_REASON_REQUIRED" | "APPROVAL_TYPE_SEND_REFUSED" | "NOT_AN_APPROVAL_TYPE" | "NOT_AN_APPROVER" | "BATCH_NOT_FOUND" | "BATCH_NOT_OPEN" | "SEND_AT_OUT_OF_RANGE" | "UNSAFE_URL" | "AUTH_USER_ALREADY_LINKED" | "DEVICE_NOT_FOUND" | "CATEGORY_NOT_FOUND" | "CATEGORY_KEY_TAKEN" | "CATEGORY_IN_USE" | "NOTIFICATION_TYPE_KEY_TAKEN" | "TEMPLATE_NOT_FOUND" | "TEMPLATE_VERSION_NOT_FOUND" | "PREFERENCE_LOCKED" | "NOTIFICATION_NOT_FOUND" | "DELIVERY_NOT_FOUND" | "CONFIRMATION_REQUIRED" | "INBOX_ITEM_NOT_FOUND" | "RECIPIENT_ERASED" | "DEVICE_MOVE_LIMIT" | (string & {});
|
|
7
7
|
declare const NotifyErrorCode: {
|
|
8
|
-
values: readonly ["BAD_REQUEST", "VALIDATION_ERROR", "UNAUTHORIZED", "PAYMENT_REQUIRED", "FORBIDDEN", "NOT_FOUND", "METHOD_NOT_ALLOWED", "NOT_ACCEPTABLE", "REQUEST_TIMEOUT", "CONFLICT", "GONE", "PRECONDITION_FAILED", "PAYLOAD_TOO_LARGE", "UNSUPPORTED_MEDIA_TYPE", "UNPROCESSABLE_ENTITY", "PRECONDITION_REQUIRED", "RATE_LIMITED", "INTERNAL_SERVER_ERROR", "NOT_IMPLEMENTED", "BAD_GATEWAY", "SERVICE_UNAVAILABLE", "GATEWAY_TIMEOUT", "SERVICE_NOT_ENABLED", "INVALID_CREDENTIALS", "SESSION_REVOKED", "MCP_NOT_PERMITTED", "MCP_WORKSPACE_MISMATCH", "PAK_NOT_PERMITTED", "ACTIONS_NOT_GRANTABLE", "IDEMPOTENCY_KEY_REUSE", "IDEMPOTENCY_KEY_REQUIRED", "IDEMPOTENCY_IN_PROGRESS", "WEBHOOK_ENDPOINT_LIMIT", "WEBHOOK_ENDPOINT_NOT_FOUND", "WEBHOOK_ENDPOINT_NOT_SUBSCRIBED", "WEBHOOK_EVENT_NOT_FOUND", "WEBHOOK_EVENT_TYPE_UNKNOWN", "NOTIFICATION_TYPE_NOT_FOUND", "NOTIFICATION_TYPE_ARCHIVED", "RECIPIENT_NOT_FOUND", "TOO_MANY_RECIPIENTS", "DATA_TOO_LARGE", "TEMPLATE_MISSING", "TEMPLATE_INVALID", "CHANNEL_NOT_CONFIGURED", "CREDENTIAL_INVALID", "CREDENTIAL_NOT_FOUND", "CREDENTIAL_MISMATCH", "DEVICE_TOKEN_INVALID", "WEBPUSH_ENDPOINT_NOT_ALLOWED", "RECIPIENT_TOKEN_INVALID", "RECIPIENT_TOKEN_EXPIRED", "RECIPIENT_TOKEN_SCOPE", "ORIGIN_NOT_ALLOWED", "STREAM_LIMIT", "LIMIT_EXCEEDED", "BATCHED_TYPE_NOT_SCHEDULABLE", "BATCH_NOT_FOUND", "BATCH_NOT_OPEN", "SEND_AT_OUT_OF_RANGE", "UNSAFE_URL", "AUTH_USER_ALREADY_LINKED", "DEVICE_NOT_FOUND", "CATEGORY_NOT_FOUND", "CATEGORY_KEY_TAKEN", "CATEGORY_IN_USE", "NOTIFICATION_TYPE_KEY_TAKEN", "TEMPLATE_NOT_FOUND", "TEMPLATE_VERSION_NOT_FOUND", "PREFERENCE_LOCKED", "NOTIFICATION_NOT_FOUND", "DELIVERY_NOT_FOUND", "CONFIRMATION_REQUIRED", "INBOX_ITEM_NOT_FOUND", "RECIPIENT_ERASED", "DEVICE_MOVE_LIMIT"];
|
|
8
|
+
values: readonly ["BAD_REQUEST", "VALIDATION_ERROR", "UNAUTHORIZED", "PAYMENT_REQUIRED", "FORBIDDEN", "NOT_FOUND", "METHOD_NOT_ALLOWED", "NOT_ACCEPTABLE", "REQUEST_TIMEOUT", "CONFLICT", "GONE", "PRECONDITION_FAILED", "PAYLOAD_TOO_LARGE", "UNSUPPORTED_MEDIA_TYPE", "UNPROCESSABLE_ENTITY", "PRECONDITION_REQUIRED", "RATE_LIMITED", "INTERNAL_SERVER_ERROR", "NOT_IMPLEMENTED", "BAD_GATEWAY", "SERVICE_UNAVAILABLE", "GATEWAY_TIMEOUT", "SERVICE_NOT_ENABLED", "INVALID_CREDENTIALS", "SESSION_REVOKED", "MCP_NOT_PERMITTED", "MCP_WORKSPACE_MISMATCH", "PAK_NOT_PERMITTED", "ACTIONS_NOT_GRANTABLE", "IDEMPOTENCY_KEY_REUSE", "IDEMPOTENCY_KEY_REQUIRED", "IDEMPOTENCY_IN_PROGRESS", "WEBHOOK_ENDPOINT_LIMIT", "WEBHOOK_ENDPOINT_NOT_FOUND", "WEBHOOK_ENDPOINT_NOT_SUBSCRIBED", "WEBHOOK_EVENT_NOT_FOUND", "WEBHOOK_EVENT_TYPE_UNKNOWN", "NOTIFICATION_TYPE_NOT_FOUND", "NOTIFICATION_TYPE_ARCHIVED", "RECIPIENT_NOT_FOUND", "TOO_MANY_RECIPIENTS", "DATA_TOO_LARGE", "TEMPLATE_MISSING", "TEMPLATE_INVALID", "CHANNEL_NOT_CONFIGURED", "CREDENTIAL_INVALID", "CREDENTIAL_NOT_FOUND", "CREDENTIAL_MISMATCH", "DEVICE_TOKEN_INVALID", "WEBPUSH_ENDPOINT_NOT_ALLOWED", "RECIPIENT_TOKEN_INVALID", "RECIPIENT_TOKEN_EXPIRED", "RECIPIENT_TOKEN_SCOPE", "ORIGIN_NOT_ALLOWED", "STREAM_LIMIT", "LIMIT_EXCEEDED", "BATCHED_TYPE_NOT_SCHEDULABLE", "APPROVAL_NOT_FOUND", "APPROVAL_NOT_PENDING", "APPROVAL_REASON_REQUIRED", "APPROVAL_TYPE_SEND_REFUSED", "NOT_AN_APPROVAL_TYPE", "NOT_AN_APPROVER", "BATCH_NOT_FOUND", "BATCH_NOT_OPEN", "SEND_AT_OUT_OF_RANGE", "UNSAFE_URL", "AUTH_USER_ALREADY_LINKED", "DEVICE_NOT_FOUND", "CATEGORY_NOT_FOUND", "CATEGORY_KEY_TAKEN", "CATEGORY_IN_USE", "NOTIFICATION_TYPE_KEY_TAKEN", "TEMPLATE_NOT_FOUND", "TEMPLATE_VERSION_NOT_FOUND", "PREFERENCE_LOCKED", "NOTIFICATION_NOT_FOUND", "DELIVERY_NOT_FOUND", "CONFIRMATION_REQUIRED", "INBOX_ITEM_NOT_FOUND", "RECIPIENT_ERASED", "DEVICE_MOVE_LIMIT"];
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
// Generated by scripts/gen-sdk.mjs from Specs/notify.json. Do not edit.
|
|
12
12
|
type paths = {
|
|
13
|
+
"/v1/client/approvals/{approval_id}": {
|
|
14
|
+
parameters: {
|
|
15
|
+
query?: never;
|
|
16
|
+
header?: never;
|
|
17
|
+
path?: never;
|
|
18
|
+
cookie?: never;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Get an approval request
|
|
22
|
+
* @description One request the recipient was asked to answer: the question, who asked, its status and, once decided, who answered and why.
|
|
23
|
+
*/
|
|
24
|
+
get: operations["ClientApprovalsController_retrieve"];
|
|
25
|
+
put?: never;
|
|
26
|
+
post?: never;
|
|
27
|
+
delete?: never;
|
|
28
|
+
options?: never;
|
|
29
|
+
head?: never;
|
|
30
|
+
patch?: never;
|
|
31
|
+
trace?: never;
|
|
32
|
+
};
|
|
33
|
+
"/v1/client/approvals/{approval_id}/decision": {
|
|
34
|
+
parameters: {
|
|
35
|
+
query?: never;
|
|
36
|
+
header?: never;
|
|
37
|
+
path?: never;
|
|
38
|
+
cookie?: never;
|
|
39
|
+
};
|
|
40
|
+
get?: never;
|
|
41
|
+
put?: never;
|
|
42
|
+
/**
|
|
43
|
+
* Answer an approval request
|
|
44
|
+
* @description Approve or reject, with an optional reason (required when the type says so). The first answer of any approver decides; the requester gets the signed `approval.resolved` webhook. Answering again, or after the request expired, is a 409.
|
|
45
|
+
*/
|
|
46
|
+
post: operations["ClientApprovalsController_decide"];
|
|
47
|
+
delete?: never;
|
|
48
|
+
options?: never;
|
|
49
|
+
head?: never;
|
|
50
|
+
patch?: never;
|
|
51
|
+
trace?: never;
|
|
52
|
+
};
|
|
13
53
|
"/v1/client/devices": {
|
|
14
54
|
parameters: {
|
|
15
55
|
query?: never;
|
|
@@ -194,6 +234,90 @@ type paths = {
|
|
|
194
234
|
patch?: never;
|
|
195
235
|
trace?: never;
|
|
196
236
|
};
|
|
237
|
+
"/v1/workspaces/{workspace_id}/approvals": {
|
|
238
|
+
parameters: {
|
|
239
|
+
query?: never;
|
|
240
|
+
header?: never;
|
|
241
|
+
path?: never;
|
|
242
|
+
cookie?: never;
|
|
243
|
+
};
|
|
244
|
+
/**
|
|
245
|
+
* List approval requests
|
|
246
|
+
* @description Newest first; filter by `status` and `type`. Pass `next_cursor` as `cursor` until `has_more` is false.
|
|
247
|
+
*/
|
|
248
|
+
get: operations["ApprovalsController_list"];
|
|
249
|
+
put?: never;
|
|
250
|
+
/**
|
|
251
|
+
* Request an approval
|
|
252
|
+
* @description Asks one or more people a yes/no question on the type's channels and records the first answer. In the inbox the item gets Approve and Reject buttons (or render it with `<NotifyApproval/>`); emails and pushes carry a signed link per approver (`approval.url`, `approval.approve_url`, `approval.reject_url`) to a hosted page that needs no sign-in. The answer arrives as the signed `approval.resolved` webhook and on `GET /approvals/{approval_id}`. Nobody answered by `expires_at`: the type's `timeout_outcome` applies (default `expired`). Pass `wait_seconds` (up to 15) to wait for the answer in this call. The type must have `approval` set; its notifications can only be sent here. An `Idempotency-Key` is required: the same key and body return the same request (200), a different body is a 409.
|
|
253
|
+
*/
|
|
254
|
+
post: operations["ApprovalsController_create"];
|
|
255
|
+
delete?: never;
|
|
256
|
+
options?: never;
|
|
257
|
+
head?: never;
|
|
258
|
+
patch?: never;
|
|
259
|
+
trace?: never;
|
|
260
|
+
};
|
|
261
|
+
"/v1/workspaces/{workspace_id}/approvals/{approval_id}": {
|
|
262
|
+
parameters: {
|
|
263
|
+
query?: never;
|
|
264
|
+
header?: never;
|
|
265
|
+
path?: never;
|
|
266
|
+
cookie?: never;
|
|
267
|
+
};
|
|
268
|
+
/**
|
|
269
|
+
* Get an approval request
|
|
270
|
+
* @description Its status, the answer (who, when, why, from where) and its trail. With `wait_seconds` (up to 15) a pending request is long-polled: the call returns as soon as someone answers, or after that many seconds.
|
|
271
|
+
*/
|
|
272
|
+
get: operations["ApprovalsController_retrieve"];
|
|
273
|
+
put?: never;
|
|
274
|
+
post?: never;
|
|
275
|
+
delete?: never;
|
|
276
|
+
options?: never;
|
|
277
|
+
head?: never;
|
|
278
|
+
patch?: never;
|
|
279
|
+
trace?: never;
|
|
280
|
+
};
|
|
281
|
+
"/v1/workspaces/{workspace_id}/approvals/{approval_id}/cancel": {
|
|
282
|
+
parameters: {
|
|
283
|
+
query?: never;
|
|
284
|
+
header?: never;
|
|
285
|
+
path?: never;
|
|
286
|
+
cookie?: never;
|
|
287
|
+
};
|
|
288
|
+
get?: never;
|
|
289
|
+
put?: never;
|
|
290
|
+
/**
|
|
291
|
+
* Cancel an approval request
|
|
292
|
+
* @description Withdraws a pending request: approvers see it as cancelled, nothing more is sent, and `approval.resolved` fires with `status: cancelled`. Takes no Idempotency-Key: cancelling twice is a 409 the second time.
|
|
293
|
+
*/
|
|
294
|
+
post: operations["ApprovalsController_cancel"];
|
|
295
|
+
delete?: never;
|
|
296
|
+
options?: never;
|
|
297
|
+
head?: never;
|
|
298
|
+
patch?: never;
|
|
299
|
+
trace?: never;
|
|
300
|
+
};
|
|
301
|
+
"/v1/workspaces/{workspace_id}/approvals/{approval_id}/decision": {
|
|
302
|
+
parameters: {
|
|
303
|
+
query?: never;
|
|
304
|
+
header?: never;
|
|
305
|
+
path?: never;
|
|
306
|
+
cookie?: never;
|
|
307
|
+
};
|
|
308
|
+
get?: never;
|
|
309
|
+
put?: never;
|
|
310
|
+
/**
|
|
311
|
+
* Record an approver's answer
|
|
312
|
+
* @description For answers you collected yourself (your own UI, a phone call): records `approve` or `reject` for one of the approvers, exactly as if they had pressed the button (`decided_via: api`). Never give this to the agent that made the request: it is how a human's answer gets in, so it is not an MCP tool.
|
|
313
|
+
*/
|
|
314
|
+
post: operations["ApprovalsController_recordDecision"];
|
|
315
|
+
delete?: never;
|
|
316
|
+
options?: never;
|
|
317
|
+
head?: never;
|
|
318
|
+
patch?: never;
|
|
319
|
+
trace?: never;
|
|
320
|
+
};
|
|
197
321
|
"/v1/workspaces/{workspace_id}/batches": {
|
|
198
322
|
parameters: {
|
|
199
323
|
query?: never;
|
|
@@ -1338,6 +1462,240 @@ type components = {
|
|
|
1338
1462
|
ApnsCredentialEnvironment: "sandbox" | "production" | "both";
|
|
1339
1463
|
/** @enum {string} */
|
|
1340
1464
|
ApnsEnvironment: "sandbox" | "production";
|
|
1465
|
+
ApprovalConfigDto: {
|
|
1466
|
+
/**
|
|
1467
|
+
* @description How long a request waits for an answer when the caller sets none.
|
|
1468
|
+
* @default 86400
|
|
1469
|
+
*/
|
|
1470
|
+
default_expires_in_seconds?: number;
|
|
1471
|
+
/**
|
|
1472
|
+
* @description Whether the approver must give a reason: `optional`, `required_on_reject` or `required`.
|
|
1473
|
+
* @default optional
|
|
1474
|
+
*/
|
|
1475
|
+
reason?: components["schemas"]["NotifyApprovalReasonPolicy"];
|
|
1476
|
+
/**
|
|
1477
|
+
* @description What an unanswered request becomes: `expired` (the safe default: the agent should not act), or `approved` / `rejected` for low-risk "go ahead unless someone objects" requests.
|
|
1478
|
+
* @default expired
|
|
1479
|
+
*/
|
|
1480
|
+
timeout_outcome?: components["schemas"]["NotifyApprovalTimeoutOutcome"];
|
|
1481
|
+
};
|
|
1482
|
+
ApprovalConfigViewDto: {
|
|
1483
|
+
/** @description Default expiry in seconds. */
|
|
1484
|
+
default_expires_in_seconds: number;
|
|
1485
|
+
/** @description Reason policy. */
|
|
1486
|
+
reason: components["schemas"]["NotifyApprovalReasonPolicy"];
|
|
1487
|
+
/** @description What an unanswered request becomes. */
|
|
1488
|
+
timeout_outcome: components["schemas"]["NotifyApprovalTimeoutOutcome"];
|
|
1489
|
+
};
|
|
1490
|
+
ApprovalDetailDto: {
|
|
1491
|
+
/** @description Approver external ids (null entries for erased recipients are dropped). */
|
|
1492
|
+
approvers: string[];
|
|
1493
|
+
/** @description The details. */
|
|
1494
|
+
body: string | null;
|
|
1495
|
+
/**
|
|
1496
|
+
* Format: date-time
|
|
1497
|
+
* @description Created.
|
|
1498
|
+
*/
|
|
1499
|
+
created_at: string;
|
|
1500
|
+
/**
|
|
1501
|
+
* Format: date-time
|
|
1502
|
+
* @description When it was answered, expired or cancelled.
|
|
1503
|
+
*/
|
|
1504
|
+
decided_at: string | null;
|
|
1505
|
+
/** @description Who answered (external id); null while pending, on timeout or cancel. */
|
|
1506
|
+
decided_by: string | null;
|
|
1507
|
+
/** @description Where the answer came from: `inbox` (in-app buttons or `<NotifyApproval/>`), `hosted_page` (the link in an email or push), `api` (your backend), `timeout`. */
|
|
1508
|
+
decided_via: components["schemas"]["NotifyApprovalDecidedVia"] | null;
|
|
1509
|
+
/** @description The request's trail, oldest first: who asked, who was notified, every answer (refused ones too), the webhook. */
|
|
1510
|
+
events: components["schemas"]["ApprovalEventDto"][];
|
|
1511
|
+
/**
|
|
1512
|
+
* Format: date-time
|
|
1513
|
+
* @description When it times out.
|
|
1514
|
+
*/
|
|
1515
|
+
expires_at: string;
|
|
1516
|
+
/**
|
|
1517
|
+
* Format: uuid
|
|
1518
|
+
* @description The approval request id.
|
|
1519
|
+
*/
|
|
1520
|
+
id: string;
|
|
1521
|
+
/** @description Your metadata, as sent. */
|
|
1522
|
+
metadata: {
|
|
1523
|
+
[key: string]: unknown;
|
|
1524
|
+
};
|
|
1525
|
+
/**
|
|
1526
|
+
* Format: uuid
|
|
1527
|
+
* @description The notification that carried it (see the message log for every channel's delivery).
|
|
1528
|
+
*/
|
|
1529
|
+
notification_id: string | null;
|
|
1530
|
+
/** @description The approver's reason, if they gave one. */
|
|
1531
|
+
reason: string | null;
|
|
1532
|
+
/** @description Who asked. */
|
|
1533
|
+
requester: components["schemas"]["ApprovalRequesterViewDto"];
|
|
1534
|
+
/** @description `pending` until someone answers; then `approved` or `rejected`; `expired` (or the type's timeout outcome) when nobody answered in time; `cancelled` when the requester withdrew it. */
|
|
1535
|
+
status: components["schemas"]["NotifyApprovalStatus"];
|
|
1536
|
+
/** @description The question. */
|
|
1537
|
+
title: string;
|
|
1538
|
+
/**
|
|
1539
|
+
* @description The notification type key.
|
|
1540
|
+
* @example deploy.approval
|
|
1541
|
+
*/
|
|
1542
|
+
type: string;
|
|
1543
|
+
};
|
|
1544
|
+
ApprovalDto: {
|
|
1545
|
+
/** @description Approver external ids (null entries for erased recipients are dropped). */
|
|
1546
|
+
approvers: string[];
|
|
1547
|
+
/** @description The details. */
|
|
1548
|
+
body: string | null;
|
|
1549
|
+
/**
|
|
1550
|
+
* Format: date-time
|
|
1551
|
+
* @description Created.
|
|
1552
|
+
*/
|
|
1553
|
+
created_at: string;
|
|
1554
|
+
/**
|
|
1555
|
+
* Format: date-time
|
|
1556
|
+
* @description When it was answered, expired or cancelled.
|
|
1557
|
+
*/
|
|
1558
|
+
decided_at: string | null;
|
|
1559
|
+
/** @description Who answered (external id); null while pending, on timeout or cancel. */
|
|
1560
|
+
decided_by: string | null;
|
|
1561
|
+
/** @description Where the answer came from: `inbox` (in-app buttons or `<NotifyApproval/>`), `hosted_page` (the link in an email or push), `api` (your backend), `timeout`. */
|
|
1562
|
+
decided_via: components["schemas"]["NotifyApprovalDecidedVia"] | null;
|
|
1563
|
+
/**
|
|
1564
|
+
* Format: date-time
|
|
1565
|
+
* @description When it times out.
|
|
1566
|
+
*/
|
|
1567
|
+
expires_at: string;
|
|
1568
|
+
/**
|
|
1569
|
+
* Format: uuid
|
|
1570
|
+
* @description The approval request id.
|
|
1571
|
+
*/
|
|
1572
|
+
id: string;
|
|
1573
|
+
/** @description Your metadata, as sent. */
|
|
1574
|
+
metadata: {
|
|
1575
|
+
[key: string]: unknown;
|
|
1576
|
+
};
|
|
1577
|
+
/**
|
|
1578
|
+
* Format: uuid
|
|
1579
|
+
* @description The notification that carried it (see the message log for every channel's delivery).
|
|
1580
|
+
*/
|
|
1581
|
+
notification_id: string | null;
|
|
1582
|
+
/** @description The approver's reason, if they gave one. */
|
|
1583
|
+
reason: string | null;
|
|
1584
|
+
/** @description Who asked. */
|
|
1585
|
+
requester: components["schemas"]["ApprovalRequesterViewDto"];
|
|
1586
|
+
/** @description `pending` until someone answers; then `approved` or `rejected`; `expired` (or the type's timeout outcome) when nobody answered in time; `cancelled` when the requester withdrew it. */
|
|
1587
|
+
status: components["schemas"]["NotifyApprovalStatus"];
|
|
1588
|
+
/** @description The question. */
|
|
1589
|
+
title: string;
|
|
1590
|
+
/**
|
|
1591
|
+
* @description The notification type key.
|
|
1592
|
+
* @example deploy.approval
|
|
1593
|
+
*/
|
|
1594
|
+
type: string;
|
|
1595
|
+
};
|
|
1596
|
+
ApprovalEventDto: {
|
|
1597
|
+
/** @description Who: `pak:<id>`, `mcp:<user id>`, `recipient:<external id>`, `timeout`. */
|
|
1598
|
+
actor: string | null;
|
|
1599
|
+
/**
|
|
1600
|
+
* Format: date-time
|
|
1601
|
+
* @description When.
|
|
1602
|
+
*/
|
|
1603
|
+
at: string;
|
|
1604
|
+
/** @description Details (status, channel, reason). */
|
|
1605
|
+
detail: {
|
|
1606
|
+
[key: string]: unknown;
|
|
1607
|
+
};
|
|
1608
|
+
/**
|
|
1609
|
+
* @description `requested`, `notified`, `decided`, `expired`, `cancelled`, `webhook_queued`, `decision_refused`.
|
|
1610
|
+
* @example decided
|
|
1611
|
+
*/
|
|
1612
|
+
kind: string;
|
|
1613
|
+
};
|
|
1614
|
+
ApprovalListResponseDto: {
|
|
1615
|
+
/** @description Requests, newest first. */
|
|
1616
|
+
data: components["schemas"]["ApprovalDto"][];
|
|
1617
|
+
/** @description The cursor for the next page. */
|
|
1618
|
+
pagination: components["schemas"]["PaginationDto"];
|
|
1619
|
+
};
|
|
1620
|
+
ApprovalRequesterDto: {
|
|
1621
|
+
/**
|
|
1622
|
+
* @description Your id for the requester (a run id, an agent id).
|
|
1623
|
+
* @example run_8f2c
|
|
1624
|
+
*/
|
|
1625
|
+
id?: string;
|
|
1626
|
+
/**
|
|
1627
|
+
* @description `agent` (an AI agent), `service` (a backend job) or `user` (a person in your app).
|
|
1628
|
+
* @example agent
|
|
1629
|
+
*/
|
|
1630
|
+
kind: components["schemas"]["NotifyApprovalRequesterKind"];
|
|
1631
|
+
/**
|
|
1632
|
+
* @description Shown to the approver: "Requested by Deploy bot".
|
|
1633
|
+
* @example Deploy bot
|
|
1634
|
+
*/
|
|
1635
|
+
name: string;
|
|
1636
|
+
};
|
|
1637
|
+
ApprovalRequesterViewDto: {
|
|
1638
|
+
/** @description Your id for it. */
|
|
1639
|
+
id: string | null;
|
|
1640
|
+
/** @description Requester kind; `api_key` when none was given and a key called. */
|
|
1641
|
+
kind: components["schemas"]["NotifyApprovalRequesterViewKind"];
|
|
1642
|
+
/** @description Name shown to approvers. */
|
|
1643
|
+
name: string;
|
|
1644
|
+
};
|
|
1645
|
+
/**
|
|
1646
|
+
* ApprovalResolvedEvent
|
|
1647
|
+
* @description An approval request ended: an approver approved or rejected it (with their reason), nobody answered in time (`decided_via: timeout`), or the requester cancelled it. Sent once per request. Your `metadata` comes back unchanged, so you can resume the action you asked about.
|
|
1648
|
+
* @example {
|
|
1649
|
+
* "created_at": "2026-11-05T09:00:00.000Z",
|
|
1650
|
+
* "data": {
|
|
1651
|
+
* "approval_id": "0193a5f2-7c1e-7b3a-9f10-2b6c4d8e9a40",
|
|
1652
|
+
* "decided_at": "2026-11-18T10:21:07.000Z",
|
|
1653
|
+
* "decided_by": "user_123",
|
|
1654
|
+
* "decided_via": "inbox",
|
|
1655
|
+
* "metadata": {
|
|
1656
|
+
* "deployment_id": "dep_91"
|
|
1657
|
+
* },
|
|
1658
|
+
* "notification_id": "0193a5f2-7c1e-7b3a-9f10-2b6c4d8e9a01",
|
|
1659
|
+
* "reason": "Looks good, ship it.",
|
|
1660
|
+
* "requester": {
|
|
1661
|
+
* "id": "run_8f2c",
|
|
1662
|
+
* "kind": "agent",
|
|
1663
|
+
* "name": "Deploy bot"
|
|
1664
|
+
* },
|
|
1665
|
+
* "status": "approved",
|
|
1666
|
+
* "type_key": "deploy.approval"
|
|
1667
|
+
* },
|
|
1668
|
+
* "id": "evt_3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f",
|
|
1669
|
+
* "type": "approval.resolved",
|
|
1670
|
+
* "workspace_id": "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"
|
|
1671
|
+
* }
|
|
1672
|
+
*/
|
|
1673
|
+
ApprovalResolvedEvent: {
|
|
1674
|
+
/**
|
|
1675
|
+
* Format: date-time
|
|
1676
|
+
* @description When the event happened (the same on every retry).
|
|
1677
|
+
* @example 2026-11-05T09:00:00.000Z
|
|
1678
|
+
*/
|
|
1679
|
+
created_at: string;
|
|
1680
|
+
data: components["schemas"]["NotifyApprovalResolvedDataDto"];
|
|
1681
|
+
/**
|
|
1682
|
+
* @description The event id, also sent as `webhook-id`; the same on every retry and replay.
|
|
1683
|
+
* @example evt_3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
|
|
1684
|
+
*/
|
|
1685
|
+
id: string;
|
|
1686
|
+
/** @description Present and true only on a delivery made by "Send test"; its `data` is the catalogue example. */
|
|
1687
|
+
test?: boolean;
|
|
1688
|
+
/**
|
|
1689
|
+
* @description The event type. Switch on it to narrow the event.
|
|
1690
|
+
* @enum {string}
|
|
1691
|
+
*/
|
|
1692
|
+
type: "approval.resolved";
|
|
1693
|
+
/**
|
|
1694
|
+
* Format: uuid
|
|
1695
|
+
* @description The workspace the event belongs to, so you can route without opening `data`. Absent on "Send test" deliveries.
|
|
1696
|
+
*/
|
|
1697
|
+
workspace_id?: string;
|
|
1698
|
+
};
|
|
1341
1699
|
BatchDeliveryDto: {
|
|
1342
1700
|
/** @description Channel. */
|
|
1343
1701
|
channel: string;
|
|
@@ -1822,6 +2180,63 @@ type components = {
|
|
|
1822
2180
|
/** @description Opted out of every non-critical notification. */
|
|
1823
2181
|
unsubscribed_all: boolean;
|
|
1824
2182
|
};
|
|
2183
|
+
CreateApprovalDto: {
|
|
2184
|
+
/**
|
|
2185
|
+
* @description Who may answer: up to 10 existing recipients (your user ids). Each gets the request on the type's channels; the first answer decides.
|
|
2186
|
+
* @example [
|
|
2187
|
+
* "user_123"
|
|
2188
|
+
* ]
|
|
2189
|
+
*/
|
|
2190
|
+
approvers: string[];
|
|
2191
|
+
/**
|
|
2192
|
+
* @description What the approver needs to decide (plain text, line breaks kept). `approval.body` in templates.
|
|
2193
|
+
* @example 3 migrations, 41 commits. Rollback: redeploy v2.13.
|
|
2194
|
+
*/
|
|
2195
|
+
body?: string;
|
|
2196
|
+
/**
|
|
2197
|
+
* @description Template data for the type's templates, like a send's `data` (at most 16 KB as JSON).
|
|
2198
|
+
* @example {
|
|
2199
|
+
* "service": "api",
|
|
2200
|
+
* "version": "v2.14"
|
|
2201
|
+
* }
|
|
2202
|
+
*/
|
|
2203
|
+
data?: {
|
|
2204
|
+
[key: string]: unknown;
|
|
2205
|
+
};
|
|
2206
|
+
/**
|
|
2207
|
+
* @description When nobody answered by then, the request ends with the type's `timeout_outcome` (default: the type's `default_expires_in_seconds`).
|
|
2208
|
+
* @example 3600
|
|
2209
|
+
*/
|
|
2210
|
+
expires_in_seconds?: number;
|
|
2211
|
+
/**
|
|
2212
|
+
* @description Yours, never shown to the approver: returned on the request and in the `approval.resolved` webhook (at most 4 KB), for example the id of the action to run.
|
|
2213
|
+
* @example {
|
|
2214
|
+
* "deployment_id": "dep_91"
|
|
2215
|
+
* }
|
|
2216
|
+
*/
|
|
2217
|
+
metadata?: {
|
|
2218
|
+
[key: string]: unknown;
|
|
2219
|
+
};
|
|
2220
|
+
/** @description Who is asking. Defaults to the API key or the MCP agent that calls. */
|
|
2221
|
+
requester?: components["schemas"]["ApprovalRequesterDto"];
|
|
2222
|
+
/** @description Tenant for the inbox filter, like a send's `tenant`. */
|
|
2223
|
+
tenant?: string;
|
|
2224
|
+
/**
|
|
2225
|
+
* @description The question, in one line. Templates get it as `approval.title`.
|
|
2226
|
+
* @example Deploy api v2.14 to production?
|
|
2227
|
+
*/
|
|
2228
|
+
title: string;
|
|
2229
|
+
/**
|
|
2230
|
+
* @description The key of a notification type with `approval` set.
|
|
2231
|
+
* @example deploy.approval
|
|
2232
|
+
*/
|
|
2233
|
+
type: string;
|
|
2234
|
+
/**
|
|
2235
|
+
* @description Wait up to this many seconds for an answer before responding (0: respond at once). An agent can then poll `GET /approvals/{approval_id}?wait_seconds=15`.
|
|
2236
|
+
* @default 0
|
|
2237
|
+
*/
|
|
2238
|
+
wait_seconds?: number;
|
|
2239
|
+
};
|
|
1825
2240
|
CreateCategoryDto: {
|
|
1826
2241
|
/** @description Android notification channel id for FCM pushes of this category; null means the category key. */
|
|
1827
2242
|
android_channel_id?: string | null;
|
|
@@ -1851,6 +2266,8 @@ type components = {
|
|
|
1851
2266
|
transactional?: boolean;
|
|
1852
2267
|
};
|
|
1853
2268
|
CreateNotificationTypeDto: {
|
|
2269
|
+
/** @description Makes this an approval request type: notifications of it carry a yes/no question from an agent or your backend, sent only with `POST /approvals`. Inbox items get Approve and Reject buttons; email and push templates get `approval.url`, `approval.approve_url` and `approval.reject_url` (a hosted page, signed per approver). Not with `batch`. Null removes it. */
|
|
2270
|
+
approval?: components["schemas"]["ApprovalConfigDto"] | null;
|
|
1854
2271
|
/** @description Batch notifications of this type per recipient (a window, or a daily/weekly digest): email and push send one message per batch, rendered with `batch.count`, `batch.items` and `batch.actors`; the inbox collapses. Not for critical types, and only with `always` routing (no fallback steps). Null removes it; open batches still close as configured when they were opened. */
|
|
1855
2272
|
batch?: components["schemas"]["BatchDto"] | null;
|
|
1856
2273
|
/**
|
|
@@ -1944,7 +2361,7 @@ type components = {
|
|
|
1944
2361
|
* "delivery.sent"
|
|
1945
2362
|
* ]
|
|
1946
2363
|
*/
|
|
1947
|
-
event_types?: ("notification.accepted" | "delivery.sent" | "delivery.delivered" | "delivery.failed" | "delivery.bounced" | "delivery.skipped" | "inbox_item.read" | "inbox_item.archived" | "inbox_item.interacted" | "device.pruned" | "device.moved" | "credential.invalid" | "email.auto_paused" | "recipient.deleted")[];
|
|
2364
|
+
event_types?: ("notification.accepted" | "delivery.sent" | "delivery.delivered" | "delivery.failed" | "delivery.bounced" | "delivery.skipped" | "inbox_item.read" | "inbox_item.archived" | "inbox_item.interacted" | "device.pruned" | "device.moved" | "credential.invalid" | "email.auto_paused" | "recipient.deleted" | "notification.webhook" | "approval.resolved")[];
|
|
1948
2365
|
/**
|
|
1949
2366
|
* Format: uri
|
|
1950
2367
|
* @description Where to send events: an absolute https:// URL on a public host.
|
|
@@ -2003,6 +2420,12 @@ type components = {
|
|
|
2003
2420
|
CredentialProvider: "apns" | "fcm" | "vapid";
|
|
2004
2421
|
/** @enum {string} */
|
|
2005
2422
|
CredentialStatus: "active" | "invalid" | "superseded";
|
|
2423
|
+
DecideApprovalDto: {
|
|
2424
|
+
/** @description `approve` or `reject`. */
|
|
2425
|
+
decision: components["schemas"]["NotifyApprovalDecision"];
|
|
2426
|
+
/** @description Why (required when the type says so). */
|
|
2427
|
+
reason?: string;
|
|
2428
|
+
};
|
|
2006
2429
|
DeliveryAttemptDto: {
|
|
2007
2430
|
/** @description Attempt number, from 1. */
|
|
2008
2431
|
attempt: number;
|
|
@@ -2763,6 +3186,8 @@ type components = {
|
|
|
2763
3186
|
settings: components["schemas"]["ExportSettingsDto"];
|
|
2764
3187
|
};
|
|
2765
3188
|
ExportNotificationTypeDto: {
|
|
3189
|
+
/** @description Approval request config; null for ordinary types. */
|
|
3190
|
+
approval: components["schemas"]["ApprovalConfigViewDto"] | null;
|
|
2766
3191
|
/**
|
|
2767
3192
|
* Format: date-time
|
|
2768
3193
|
* @description When archived.
|
|
@@ -2796,7 +3221,7 @@ type components = {
|
|
|
2796
3221
|
* @description Channel.
|
|
2797
3222
|
* @enum {string}
|
|
2798
3223
|
*/
|
|
2799
|
-
channel: "inbox" | "email" | "push" | "webpush";
|
|
3224
|
+
channel: "inbox" | "email" | "push" | "webpush" | "webhook";
|
|
2800
3225
|
/** @description Locale. */
|
|
2801
3226
|
locale: string;
|
|
2802
3227
|
}[];
|
|
@@ -3350,6 +3775,8 @@ type components = {
|
|
|
3350
3775
|
/** @enum {string} */
|
|
3351
3776
|
NotificationStatus: "scheduled" | "accepted" | "planned" | "cancelled";
|
|
3352
3777
|
NotificationTypeDto: {
|
|
3778
|
+
/** @description Approval request config; null for ordinary types. */
|
|
3779
|
+
approval: components["schemas"]["ApprovalConfigViewDto"] | null;
|
|
3353
3780
|
/**
|
|
3354
3781
|
* Format: date-time
|
|
3355
3782
|
* @description When archived; archived types cannot be sent.
|
|
@@ -3411,9 +3838,153 @@ type components = {
|
|
|
3411
3838
|
/** @description The cursor for the next page. */
|
|
3412
3839
|
pagination: components["schemas"]["PaginationDto"];
|
|
3413
3840
|
};
|
|
3841
|
+
/**
|
|
3842
|
+
* NotificationWebhookEvent
|
|
3843
|
+
* @description The webhook channel (tasks/notify-api/025): a notification type that routes to `webhook` delivers here, once per recipient. Unlike the other events it carries the send's `data` and the rendered webhook template, because it is a channel you configured. Filter an endpoint by `type_key` to receive only some types.
|
|
3844
|
+
* @example {
|
|
3845
|
+
* "created_at": "2026-11-05T09:00:00.000Z",
|
|
3846
|
+
* "data": {
|
|
3847
|
+
* "data": {
|
|
3848
|
+
* "amount": "12.00",
|
|
3849
|
+
* "invoice": "inv_123"
|
|
3850
|
+
* },
|
|
3851
|
+
* "delivery_id": "0193a5f2-7c1e-7b3a-9f10-2b6c4d8e9a02",
|
|
3852
|
+
* "notification_id": "0193a5f2-7c1e-7b3a-9f10-2b6c4d8e9a01",
|
|
3853
|
+
* "recipient": {
|
|
3854
|
+
* "external_id": "user_123",
|
|
3855
|
+
* "id": "0193a5f2-7c1e-7b3a-9f10-2b6c4d8e9a10"
|
|
3856
|
+
* },
|
|
3857
|
+
* "rendered": {
|
|
3858
|
+
* "body": "12.00 EUR from Ada",
|
|
3859
|
+
* "title": "Invoice inv_123 paid"
|
|
3860
|
+
* },
|
|
3861
|
+
* "type_key": "invoice.paid"
|
|
3862
|
+
* },
|
|
3863
|
+
* "id": "evt_3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f",
|
|
3864
|
+
* "type": "notification.webhook",
|
|
3865
|
+
* "workspace_id": "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"
|
|
3866
|
+
* }
|
|
3867
|
+
*/
|
|
3868
|
+
NotificationWebhookEvent: {
|
|
3869
|
+
/**
|
|
3870
|
+
* Format: date-time
|
|
3871
|
+
* @description When the event happened (the same on every retry).
|
|
3872
|
+
* @example 2026-11-05T09:00:00.000Z
|
|
3873
|
+
*/
|
|
3874
|
+
created_at: string;
|
|
3875
|
+
data: components["schemas"]["NotifyNotificationWebhookDataDto"];
|
|
3876
|
+
/**
|
|
3877
|
+
* @description The event id, also sent as `webhook-id`; the same on every retry and replay.
|
|
3878
|
+
* @example evt_3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
|
|
3879
|
+
*/
|
|
3880
|
+
id: string;
|
|
3881
|
+
/** @description Present and true only on a delivery made by "Send test"; its `data` is the catalogue example. */
|
|
3882
|
+
test?: boolean;
|
|
3883
|
+
/**
|
|
3884
|
+
* @description The event type. Switch on it to narrow the event.
|
|
3885
|
+
* @enum {string}
|
|
3886
|
+
*/
|
|
3887
|
+
type: "notification.webhook";
|
|
3888
|
+
/**
|
|
3889
|
+
* Format: uuid
|
|
3890
|
+
* @description The workspace the event belongs to, so you can route without opening `data`. Absent on "Send test" deliveries.
|
|
3891
|
+
*/
|
|
3892
|
+
workspace_id?: string;
|
|
3893
|
+
};
|
|
3894
|
+
/** @enum {string} */
|
|
3895
|
+
NotifyApprovalDecidedVia: "inbox" | "hosted_page" | "api" | "timeout";
|
|
3896
|
+
/** @enum {string} */
|
|
3897
|
+
NotifyApprovalDecision: "approve" | "reject";
|
|
3898
|
+
/** @enum {string} */
|
|
3899
|
+
NotifyApprovalOutcome: "approved" | "rejected" | "expired" | "cancelled";
|
|
3900
|
+
/** @enum {string} */
|
|
3901
|
+
NotifyApprovalOutcomeVia: "inbox" | "hosted_page" | "api" | "timeout";
|
|
3902
|
+
/** @enum {string} */
|
|
3903
|
+
NotifyApprovalReasonPolicy: "optional" | "required_on_reject" | "required";
|
|
3904
|
+
NotifyApprovalRequesterDto: {
|
|
3905
|
+
/**
|
|
3906
|
+
* @description Your id for the requester.
|
|
3907
|
+
* @example run_8f2c
|
|
3908
|
+
*/
|
|
3909
|
+
id: string | null;
|
|
3910
|
+
/**
|
|
3911
|
+
* @description `agent`, `service`, `user`, or `api_key` when none was given.
|
|
3912
|
+
* @example agent
|
|
3913
|
+
*/
|
|
3914
|
+
kind: string;
|
|
3915
|
+
/**
|
|
3916
|
+
* @description The name approvers saw.
|
|
3917
|
+
* @example Deploy bot
|
|
3918
|
+
*/
|
|
3919
|
+
name: string;
|
|
3920
|
+
};
|
|
3921
|
+
/** @enum {string} */
|
|
3922
|
+
NotifyApprovalRequesterKind: "agent" | "service" | "user";
|
|
3923
|
+
/** @enum {string} */
|
|
3924
|
+
NotifyApprovalRequesterViewKind: "agent" | "service" | "user" | "api_key";
|
|
3925
|
+
NotifyApprovalResolvedDataDto: {
|
|
3926
|
+
/**
|
|
3927
|
+
* Format: uuid
|
|
3928
|
+
* @description The approval request.
|
|
3929
|
+
* @example 0193a5f2-7c1e-7b3a-9f10-2b6c4d8e9a40
|
|
3930
|
+
*/
|
|
3931
|
+
approval_id: string;
|
|
3932
|
+
/**
|
|
3933
|
+
* Format: date-time
|
|
3934
|
+
* @description When it was decided, expired or cancelled.
|
|
3935
|
+
* @example 2026-11-18T10:21:07.000Z
|
|
3936
|
+
*/
|
|
3937
|
+
decided_at: string;
|
|
3938
|
+
/**
|
|
3939
|
+
* @description The approver who answered (your id for them); null on a timeout or cancel.
|
|
3940
|
+
* @example user_123
|
|
3941
|
+
*/
|
|
3942
|
+
decided_by: string | null;
|
|
3943
|
+
/**
|
|
3944
|
+
* @description Where the answer came from; `api` also for a cancel.
|
|
3945
|
+
* @example inbox
|
|
3946
|
+
*/
|
|
3947
|
+
decided_via: components["schemas"]["NotifyApprovalOutcomeVia"];
|
|
3948
|
+
/**
|
|
3949
|
+
* @description Your `metadata`, as sent with the request.
|
|
3950
|
+
* @example {
|
|
3951
|
+
* "deployment_id": "dep_91"
|
|
3952
|
+
* }
|
|
3953
|
+
*/
|
|
3954
|
+
metadata: {
|
|
3955
|
+
[key: string]: unknown;
|
|
3956
|
+
};
|
|
3957
|
+
/**
|
|
3958
|
+
* Format: uuid
|
|
3959
|
+
* @description The notification that carried the request.
|
|
3960
|
+
* @example 0193a5f2-7c1e-7b3a-9f10-2b6c4d8e9a01
|
|
3961
|
+
*/
|
|
3962
|
+
notification_id: string | null;
|
|
3963
|
+
/**
|
|
3964
|
+
* @description Their reason, if they gave one.
|
|
3965
|
+
* @example Looks good, ship it.
|
|
3966
|
+
*/
|
|
3967
|
+
reason: string | null;
|
|
3968
|
+
/** @description Who asked. */
|
|
3969
|
+
requester: components["schemas"]["NotifyApprovalRequesterDto"];
|
|
3970
|
+
/**
|
|
3971
|
+
* @description The outcome. On a timeout it is the type's `timeout_outcome` (`expired` by default) with `decided_via: timeout`.
|
|
3972
|
+
* @example approved
|
|
3973
|
+
*/
|
|
3974
|
+
status: components["schemas"]["NotifyApprovalOutcome"];
|
|
3975
|
+
/**
|
|
3976
|
+
* @description The approval type key.
|
|
3977
|
+
* @example deploy.approval
|
|
3978
|
+
*/
|
|
3979
|
+
type_key: string;
|
|
3980
|
+
};
|
|
3981
|
+
/** @enum {string} */
|
|
3982
|
+
NotifyApprovalStatus: "pending" | "approved" | "rejected" | "expired" | "cancelled";
|
|
3983
|
+
/** @enum {string} */
|
|
3984
|
+
NotifyApprovalTimeoutOutcome: "expired" | "approved" | "rejected";
|
|
3985
|
+
/** @enum {string} */
|
|
3986
|
+
NotifyBatchInboxMode: "collapse" | "each";
|
|
3414
3987
|
/** @enum {string} */
|
|
3415
|
-
NotifyBatchInboxMode: "collapse" | "each";
|
|
3416
|
-
/** @enum {string} */
|
|
3417
3988
|
NotifyBatchMode: "window" | "digest";
|
|
3418
3989
|
/** @enum {string} */
|
|
3419
3990
|
NotifyBatchState: "open" | "flushed" | "cancelled";
|
|
@@ -3464,7 +4035,7 @@ type components = {
|
|
|
3464
4035
|
privacy_url: string | null;
|
|
3465
4036
|
};
|
|
3466
4037
|
/** @enum {string} */
|
|
3467
|
-
NotifyChannel: "inbox" | "email" | "push" | "webpush";
|
|
4038
|
+
NotifyChannel: "inbox" | "email" | "push" | "webpush" | "webhook";
|
|
3468
4039
|
NotifyCredentialInvalidDataDto: {
|
|
3469
4040
|
/**
|
|
3470
4041
|
* @description The bundle id, FCM project id, or `-`.
|
|
@@ -3650,7 +4221,7 @@ type components = {
|
|
|
3650
4221
|
/** @enum {string} */
|
|
3651
4222
|
NotifyEmailPauseReason: "complaints" | "bounces";
|
|
3652
4223
|
/** @description Error codes this API returns (open set: a client must accept codes it does not know; new codes are not a breaking change). Each is documented at https://productcraft.co/docs/errors#<code>. */
|
|
3653
|
-
NotifyErrorCode: ("BAD_REQUEST" | "VALIDATION_ERROR" | "UNAUTHORIZED" | "PAYMENT_REQUIRED" | "FORBIDDEN" | "NOT_FOUND" | "METHOD_NOT_ALLOWED" | "NOT_ACCEPTABLE" | "REQUEST_TIMEOUT" | "CONFLICT" | "GONE" | "PRECONDITION_FAILED" | "PAYLOAD_TOO_LARGE" | "UNSUPPORTED_MEDIA_TYPE" | "UNPROCESSABLE_ENTITY" | "PRECONDITION_REQUIRED" | "RATE_LIMITED" | "INTERNAL_SERVER_ERROR" | "NOT_IMPLEMENTED" | "BAD_GATEWAY" | "SERVICE_UNAVAILABLE" | "GATEWAY_TIMEOUT" | "SERVICE_NOT_ENABLED" | "INVALID_CREDENTIALS" | "SESSION_REVOKED" | "MCP_NOT_PERMITTED" | "MCP_WORKSPACE_MISMATCH" | "PAK_NOT_PERMITTED" | "ACTIONS_NOT_GRANTABLE" | "IDEMPOTENCY_KEY_REUSE" | "IDEMPOTENCY_KEY_REQUIRED" | "IDEMPOTENCY_IN_PROGRESS" | "WEBHOOK_ENDPOINT_LIMIT" | "WEBHOOK_ENDPOINT_NOT_FOUND" | "WEBHOOK_ENDPOINT_NOT_SUBSCRIBED" | "WEBHOOK_EVENT_NOT_FOUND" | "WEBHOOK_EVENT_TYPE_UNKNOWN" | "NOTIFICATION_TYPE_NOT_FOUND" | "NOTIFICATION_TYPE_ARCHIVED" | "RECIPIENT_NOT_FOUND" | "TOO_MANY_RECIPIENTS" | "DATA_TOO_LARGE" | "TEMPLATE_MISSING" | "TEMPLATE_INVALID" | "CHANNEL_NOT_CONFIGURED" | "CREDENTIAL_INVALID" | "CREDENTIAL_NOT_FOUND" | "CREDENTIAL_MISMATCH" | "DEVICE_TOKEN_INVALID" | "WEBPUSH_ENDPOINT_NOT_ALLOWED" | "RECIPIENT_TOKEN_INVALID" | "RECIPIENT_TOKEN_EXPIRED" | "RECIPIENT_TOKEN_SCOPE" | "ORIGIN_NOT_ALLOWED" | "STREAM_LIMIT" | "LIMIT_EXCEEDED" | "BATCHED_TYPE_NOT_SCHEDULABLE" | "BATCH_NOT_FOUND" | "BATCH_NOT_OPEN" | "SEND_AT_OUT_OF_RANGE" | "UNSAFE_URL" | "AUTH_USER_ALREADY_LINKED" | "DEVICE_NOT_FOUND" | "CATEGORY_NOT_FOUND" | "CATEGORY_KEY_TAKEN" | "CATEGORY_IN_USE" | "NOTIFICATION_TYPE_KEY_TAKEN" | "TEMPLATE_NOT_FOUND" | "TEMPLATE_VERSION_NOT_FOUND" | "PREFERENCE_LOCKED" | "NOTIFICATION_NOT_FOUND" | "DELIVERY_NOT_FOUND" | "CONFIRMATION_REQUIRED" | "INBOX_ITEM_NOT_FOUND" | "RECIPIENT_ERASED" | "DEVICE_MOVE_LIMIT") | string;
|
|
4224
|
+
NotifyErrorCode: ("BAD_REQUEST" | "VALIDATION_ERROR" | "UNAUTHORIZED" | "PAYMENT_REQUIRED" | "FORBIDDEN" | "NOT_FOUND" | "METHOD_NOT_ALLOWED" | "NOT_ACCEPTABLE" | "REQUEST_TIMEOUT" | "CONFLICT" | "GONE" | "PRECONDITION_FAILED" | "PAYLOAD_TOO_LARGE" | "UNSUPPORTED_MEDIA_TYPE" | "UNPROCESSABLE_ENTITY" | "PRECONDITION_REQUIRED" | "RATE_LIMITED" | "INTERNAL_SERVER_ERROR" | "NOT_IMPLEMENTED" | "BAD_GATEWAY" | "SERVICE_UNAVAILABLE" | "GATEWAY_TIMEOUT" | "SERVICE_NOT_ENABLED" | "INVALID_CREDENTIALS" | "SESSION_REVOKED" | "MCP_NOT_PERMITTED" | "MCP_WORKSPACE_MISMATCH" | "PAK_NOT_PERMITTED" | "ACTIONS_NOT_GRANTABLE" | "IDEMPOTENCY_KEY_REUSE" | "IDEMPOTENCY_KEY_REQUIRED" | "IDEMPOTENCY_IN_PROGRESS" | "WEBHOOK_ENDPOINT_LIMIT" | "WEBHOOK_ENDPOINT_NOT_FOUND" | "WEBHOOK_ENDPOINT_NOT_SUBSCRIBED" | "WEBHOOK_EVENT_NOT_FOUND" | "WEBHOOK_EVENT_TYPE_UNKNOWN" | "NOTIFICATION_TYPE_NOT_FOUND" | "NOTIFICATION_TYPE_ARCHIVED" | "RECIPIENT_NOT_FOUND" | "TOO_MANY_RECIPIENTS" | "DATA_TOO_LARGE" | "TEMPLATE_MISSING" | "TEMPLATE_INVALID" | "CHANNEL_NOT_CONFIGURED" | "CREDENTIAL_INVALID" | "CREDENTIAL_NOT_FOUND" | "CREDENTIAL_MISMATCH" | "DEVICE_TOKEN_INVALID" | "WEBPUSH_ENDPOINT_NOT_ALLOWED" | "RECIPIENT_TOKEN_INVALID" | "RECIPIENT_TOKEN_EXPIRED" | "RECIPIENT_TOKEN_SCOPE" | "ORIGIN_NOT_ALLOWED" | "STREAM_LIMIT" | "LIMIT_EXCEEDED" | "BATCHED_TYPE_NOT_SCHEDULABLE" | "APPROVAL_NOT_FOUND" | "APPROVAL_NOT_PENDING" | "APPROVAL_REASON_REQUIRED" | "APPROVAL_TYPE_SEND_REFUSED" | "NOT_AN_APPROVAL_TYPE" | "NOT_AN_APPROVER" | "BATCH_NOT_FOUND" | "BATCH_NOT_OPEN" | "SEND_AT_OUT_OF_RANGE" | "UNSAFE_URL" | "AUTH_USER_ALREADY_LINKED" | "DEVICE_NOT_FOUND" | "CATEGORY_NOT_FOUND" | "CATEGORY_KEY_TAKEN" | "CATEGORY_IN_USE" | "NOTIFICATION_TYPE_KEY_TAKEN" | "TEMPLATE_NOT_FOUND" | "TEMPLATE_VERSION_NOT_FOUND" | "PREFERENCE_LOCKED" | "NOTIFICATION_NOT_FOUND" | "DELIVERY_NOT_FOUND" | "CONFIRMATION_REQUIRED" | "INBOX_ITEM_NOT_FOUND" | "RECIPIENT_ERASED" | "DEVICE_MOVE_LIMIT") | string;
|
|
3654
4225
|
NotifyInboxItemEventDataDto: {
|
|
3655
4226
|
/**
|
|
3656
4227
|
* Format: uuid
|
|
@@ -3711,6 +4282,39 @@ type components = {
|
|
|
3711
4282
|
*/
|
|
3712
4283
|
type_key: string;
|
|
3713
4284
|
};
|
|
4285
|
+
NotifyNotificationWebhookDataDto: {
|
|
4286
|
+
/**
|
|
4287
|
+
* @description The send's `data`, as you sent it, merged with the template's fixed `payload`.
|
|
4288
|
+
* @example {
|
|
4289
|
+
* "amount": "12.00",
|
|
4290
|
+
* "invoice": "inv_123"
|
|
4291
|
+
* }
|
|
4292
|
+
*/
|
|
4293
|
+
data: {
|
|
4294
|
+
[key: string]: unknown;
|
|
4295
|
+
};
|
|
4296
|
+
/**
|
|
4297
|
+
* Format: uuid
|
|
4298
|
+
* @description The webhook delivery (one per recipient).
|
|
4299
|
+
* @example 0193a5f2-7c1e-7b3a-9f10-2b6c4d8e9a02
|
|
4300
|
+
*/
|
|
4301
|
+
delivery_id: string;
|
|
4302
|
+
/**
|
|
4303
|
+
* Format: uuid
|
|
4304
|
+
* @description The notification.
|
|
4305
|
+
* @example 0193a5f2-7c1e-7b3a-9f10-2b6c4d8e9a01
|
|
4306
|
+
*/
|
|
4307
|
+
notification_id: string;
|
|
4308
|
+
/** @description Who the notification is for. */
|
|
4309
|
+
recipient: components["schemas"]["NotifyWebhookRecipientDto"];
|
|
4310
|
+
/** @description The rendered webhook template text. */
|
|
4311
|
+
rendered: components["schemas"]["NotifyWebhookChannelRenderedDto"];
|
|
4312
|
+
/**
|
|
4313
|
+
* @description The notification type key.
|
|
4314
|
+
* @example invoice.paid
|
|
4315
|
+
*/
|
|
4316
|
+
type_key: string;
|
|
4317
|
+
};
|
|
3714
4318
|
/** @enum {string} */
|
|
3715
4319
|
NotifyQuietHoursSource: "recipient" | "workspace";
|
|
3716
4320
|
NotifyRecipientDeletedDataDto: {
|
|
@@ -3861,7 +4465,19 @@ type components = {
|
|
|
3861
4465
|
updated_at: string | null;
|
|
3862
4466
|
};
|
|
3863
4467
|
/** @enum {string} */
|
|
3864
|
-
NotifyWebhookChannel: "inbox" | "email" | "push" | "webpush";
|
|
4468
|
+
NotifyWebhookChannel: "inbox" | "email" | "push" | "webpush" | "webhook";
|
|
4469
|
+
NotifyWebhookChannelRenderedDto: {
|
|
4470
|
+
/**
|
|
4471
|
+
* @description The webhook template's `body`, rendered.
|
|
4472
|
+
* @example 12.00 EUR from Ada
|
|
4473
|
+
*/
|
|
4474
|
+
body: string | null;
|
|
4475
|
+
/**
|
|
4476
|
+
* @description The webhook template's `title`, rendered; null when it has none.
|
|
4477
|
+
* @example Invoice inv_123 paid
|
|
4478
|
+
*/
|
|
4479
|
+
title: string | null;
|
|
4480
|
+
};
|
|
3865
4481
|
/** @enum {string} */
|
|
3866
4482
|
NotifyWebhookCredentialProvider: "apns" | "fcm" | "vapid";
|
|
3867
4483
|
/** @enum {string} */
|
|
@@ -4043,7 +4659,7 @@ type components = {
|
|
|
4043
4659
|
channels: components["schemas"]["PreviewChannelDto"][];
|
|
4044
4660
|
/** @description Variables used by some channels but not others: variable → the channels missing it. */
|
|
4045
4661
|
cross_channel_mismatches: {
|
|
4046
|
-
[key: string]: ("inbox" | "email" | "push" | "webpush")[];
|
|
4662
|
+
[key: string]: ("inbox" | "email" | "push" | "webpush" | "webhook")[];
|
|
4047
4663
|
};
|
|
4048
4664
|
};
|
|
4049
4665
|
PutTemplateDto: {
|
|
@@ -4251,6 +4867,17 @@ type components = {
|
|
|
4251
4867
|
*/
|
|
4252
4868
|
timezone?: string | null;
|
|
4253
4869
|
};
|
|
4870
|
+
RecordApprovalDecisionDto: {
|
|
4871
|
+
/**
|
|
4872
|
+
* @description The approver who answered (one of `approvers`), for answers you collected yourself.
|
|
4873
|
+
* @example user_123
|
|
4874
|
+
*/
|
|
4875
|
+
approver: string;
|
|
4876
|
+
/** @description `approve` or `reject`. */
|
|
4877
|
+
decision: components["schemas"]["NotifyApprovalDecision"];
|
|
4878
|
+
/** @description Why (required when the type says so). */
|
|
4879
|
+
reason?: string;
|
|
4880
|
+
};
|
|
4254
4881
|
RegisterDeviceDto: {
|
|
4255
4882
|
/**
|
|
4256
4883
|
* @description The app the token belongs to: the iOS bundle id for `apns`, the Firebase project id for `fcm`, the site origin for `webpush`. Push is sent with the credential configured for this app.
|
|
@@ -4283,6 +4910,8 @@ type components = {
|
|
|
4283
4910
|
title: string;
|
|
4284
4911
|
};
|
|
4285
4912
|
ReplaceNotificationTypeDto: {
|
|
4913
|
+
/** @description Makes this an approval request type: notifications of it carry a yes/no question from an agent or your backend, sent only with `POST /approvals`. Inbox items get Approve and Reject buttons; email and push templates get `approval.url`, `approval.approve_url` and `approval.reject_url` (a hosted page, signed per approver). Not with `batch`. Null removes it. */
|
|
4914
|
+
approval?: components["schemas"]["ApprovalConfigDto"] | null;
|
|
4286
4915
|
/** @description Batch notifications of this type per recipient (a window, or a daily/weekly digest): email and push send one message per batch, rendered with `batch.count`, `batch.items` and `batch.actors`; the inbox collapses. Not for critical types, and only with `always` routing (no fallback steps). Null removes it; open batches still close as configured when they were opened. */
|
|
4287
4916
|
batch?: components["schemas"]["BatchDto"] | null;
|
|
4288
4917
|
/**
|
|
@@ -4325,7 +4954,7 @@ type components = {
|
|
|
4325
4954
|
* @description Channel.
|
|
4326
4955
|
* @enum {string}
|
|
4327
4956
|
*/
|
|
4328
|
-
channel: "inbox" | "email" | "push" | "webpush";
|
|
4957
|
+
channel: "inbox" | "email" | "push" | "webpush" | "webhook";
|
|
4329
4958
|
/** @description Locale (BCP 47). */
|
|
4330
4959
|
locale: string;
|
|
4331
4960
|
}[];
|
|
@@ -4487,7 +5116,7 @@ type components = {
|
|
|
4487
5116
|
* @example notification.accepted
|
|
4488
5117
|
* @enum {string}
|
|
4489
5118
|
*/
|
|
4490
|
-
event_type: "notification.accepted" | "delivery.sent" | "delivery.delivered" | "delivery.failed" | "delivery.bounced" | "delivery.skipped" | "inbox_item.read" | "inbox_item.archived" | "inbox_item.interacted" | "device.pruned" | "device.moved" | "credential.invalid" | "email.auto_paused" | "recipient.deleted";
|
|
5119
|
+
event_type: "notification.accepted" | "delivery.sent" | "delivery.delivered" | "delivery.failed" | "delivery.bounced" | "delivery.skipped" | "inbox_item.read" | "inbox_item.archived" | "inbox_item.interacted" | "device.pruned" | "device.moved" | "credential.invalid" | "email.auto_paused" | "recipient.deleted" | "notification.webhook" | "approval.resolved";
|
|
4491
5120
|
};
|
|
4492
5121
|
SetupRowDto: {
|
|
4493
5122
|
/**
|
|
@@ -4776,6 +5405,8 @@ type components = {
|
|
|
4776
5405
|
unsubscribed_all?: boolean;
|
|
4777
5406
|
};
|
|
4778
5407
|
UpdateNotificationTypeDto: {
|
|
5408
|
+
/** @description Makes this an approval request type: notifications of it carry a yes/no question from an agent or your backend, sent only with `POST /approvals`. Inbox items get Approve and Reject buttons; email and push templates get `approval.url`, `approval.approve_url` and `approval.reject_url` (a hosted page, signed per approver). Not with `batch`. Null removes it. */
|
|
5409
|
+
approval?: components["schemas"]["ApprovalConfigDto"] | null;
|
|
4779
5410
|
/** @description Batch notifications of this type per recipient (a window, or a daily/weekly digest): email and push send one message per batch, rendered with `batch.count`, `batch.items` and `batch.actors`; the inbox collapses. Not for critical types, and only with `always` routing (no fallback steps). Null removes it; open batches still close as configured when they were opened. */
|
|
4780
5411
|
batch?: components["schemas"]["BatchDto"] | null;
|
|
4781
5412
|
/**
|
|
@@ -4918,7 +5549,7 @@ type components = {
|
|
|
4918
5549
|
* "delivery.sent"
|
|
4919
5550
|
* ]
|
|
4920
5551
|
*/
|
|
4921
|
-
event_types?: ("notification.accepted" | "delivery.sent" | "delivery.delivered" | "delivery.failed" | "delivery.bounced" | "delivery.skipped" | "inbox_item.read" | "inbox_item.archived" | "inbox_item.interacted" | "device.pruned" | "device.moved" | "credential.invalid" | "email.auto_paused" | "recipient.deleted")[];
|
|
5552
|
+
event_types?: ("notification.accepted" | "delivery.sent" | "delivery.delivered" | "delivery.failed" | "delivery.bounced" | "delivery.skipped" | "inbox_item.read" | "inbox_item.archived" | "inbox_item.interacted" | "device.pruned" | "device.moved" | "credential.invalid" | "email.auto_paused" | "recipient.deleted" | "notification.webhook" | "approval.resolved")[];
|
|
4922
5553
|
/**
|
|
4923
5554
|
* Format: uri
|
|
4924
5555
|
* @description A new absolute https:// URL on a public host.
|
|
@@ -5354,7 +5985,7 @@ type components = {
|
|
|
5354
5985
|
* @description Every event type this product sends; `x-webhooks` maps each to its payload schema. New types can be added, so treat it as open.
|
|
5355
5986
|
* @enum {string}
|
|
5356
5987
|
*/
|
|
5357
|
-
WebhookEventType: "notification.accepted" | "delivery.sent" | "delivery.delivered" | "delivery.failed" | "delivery.bounced" | "delivery.skipped" | "inbox_item.read" | "inbox_item.archived" | "inbox_item.interacted" | "device.pruned" | "device.moved" | "credential.invalid" | "email.auto_paused" | "recipient.deleted";
|
|
5988
|
+
WebhookEventType: "notification.accepted" | "delivery.sent" | "delivery.delivered" | "delivery.failed" | "delivery.bounced" | "delivery.skipped" | "inbox_item.read" | "inbox_item.archived" | "inbox_item.interacted" | "device.pruned" | "device.moved" | "credential.invalid" | "email.auto_paused" | "recipient.deleted" | "notification.webhook" | "approval.resolved";
|
|
5358
5989
|
WebhookEventTypeDto: {
|
|
5359
5990
|
/**
|
|
5360
5991
|
* @description Group shown in the event picker.
|
|
@@ -5417,20 +6048,22 @@ type components = {
|
|
|
5417
6048
|
pathItems: never;
|
|
5418
6049
|
};
|
|
5419
6050
|
interface operations {
|
|
5420
|
-
|
|
6051
|
+
ClientApprovalsController_retrieve: {
|
|
5421
6052
|
parameters: {
|
|
5422
6053
|
query?: never;
|
|
5423
6054
|
header?: never;
|
|
5424
|
-
path
|
|
5425
|
-
|
|
5426
|
-
|
|
5427
|
-
|
|
5428
|
-
|
|
5429
|
-
|
|
6055
|
+
path: {
|
|
6056
|
+
/**
|
|
6057
|
+
* @description Id of the approval.
|
|
6058
|
+
* @example 3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
|
|
6059
|
+
*/
|
|
6060
|
+
approval_id: string;
|
|
5430
6061
|
};
|
|
6062
|
+
cookie?: never;
|
|
5431
6063
|
};
|
|
6064
|
+
requestBody?: never;
|
|
5432
6065
|
responses: {
|
|
5433
|
-
/** @description
|
|
6066
|
+
/** @description The request. */
|
|
5434
6067
|
200: {
|
|
5435
6068
|
headers: {
|
|
5436
6069
|
"X-RateLimit-Limit-long": components["headers"]["X-RateLimit-Limit-long"];
|
|
@@ -5443,33 +6076,7 @@ interface operations {
|
|
|
5443
6076
|
[name: string]: unknown;
|
|
5444
6077
|
};
|
|
5445
6078
|
content: {
|
|
5446
|
-
"application/json": components["schemas"]["
|
|
5447
|
-
};
|
|
5448
|
-
};
|
|
5449
|
-
/** @description Registered (new, or moved from another recipient). */
|
|
5450
|
-
201: {
|
|
5451
|
-
headers: {
|
|
5452
|
-
"X-RateLimit-Limit-long": components["headers"]["X-RateLimit-Limit-long"];
|
|
5453
|
-
"X-RateLimit-Limit-short": components["headers"]["X-RateLimit-Limit-short"];
|
|
5454
|
-
"X-RateLimit-Remaining-long": components["headers"]["X-RateLimit-Remaining-long"];
|
|
5455
|
-
"X-RateLimit-Remaining-short": components["headers"]["X-RateLimit-Remaining-short"];
|
|
5456
|
-
"X-RateLimit-Reset-long": components["headers"]["X-RateLimit-Reset-long"];
|
|
5457
|
-
"X-RateLimit-Reset-short": components["headers"]["X-RateLimit-Reset-short"];
|
|
5458
|
-
"X-Request-Id": components["headers"]["RequestId"];
|
|
5459
|
-
[name: string]: unknown;
|
|
5460
|
-
};
|
|
5461
|
-
content: {
|
|
5462
|
-
"application/json": components["schemas"]["DeviceDto"];
|
|
5463
|
-
};
|
|
5464
|
-
};
|
|
5465
|
-
/** @description `VALIDATION_ERROR`: a field is invalid (`errors` names it). */
|
|
5466
|
-
400: {
|
|
5467
|
-
headers: {
|
|
5468
|
-
"X-Request-Id": components["headers"]["RequestId"];
|
|
5469
|
-
[name: string]: unknown;
|
|
5470
|
-
};
|
|
5471
|
-
content: {
|
|
5472
|
-
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
6079
|
+
"application/json": components["schemas"]["ApprovalDto"];
|
|
5473
6080
|
};
|
|
5474
6081
|
};
|
|
5475
6082
|
/** @description `RECIPIENT_TOKEN_INVALID`: no recipient token, a malformed or forged one, an API key, or a revoked token (mint a new one); `RECIPIENT_TOKEN_EXPIRED`: the token expired (mint a new one). */
|
|
@@ -5482,7 +6089,7 @@ interface operations {
|
|
|
5482
6089
|
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
5483
6090
|
};
|
|
5484
6091
|
};
|
|
5485
|
-
/** @description `RECIPIENT_TOKEN_SCOPE`: the token lacks the `
|
|
6092
|
+
/** @description `RECIPIENT_TOKEN_SCOPE`: the token lacks the `inbox:read` scope; `ORIGIN_NOT_ALLOWED`: the browser origin is not in the workspace client origins; `SERVICE_NOT_ENABLED`: Notify is turned off for the workspace. */
|
|
5486
6093
|
403: {
|
|
5487
6094
|
headers: {
|
|
5488
6095
|
"X-Request-Id": components["headers"]["RequestId"];
|
|
@@ -5492,8 +6099,8 @@ interface operations {
|
|
|
5492
6099
|
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
5493
6100
|
};
|
|
5494
6101
|
};
|
|
5495
|
-
/** @description `
|
|
5496
|
-
|
|
6102
|
+
/** @description `APPROVAL_NOT_FOUND`: no such request for this recipient. */
|
|
6103
|
+
404: {
|
|
5497
6104
|
headers: {
|
|
5498
6105
|
"X-Request-Id": components["headers"]["RequestId"];
|
|
5499
6106
|
[name: string]: unknown;
|
|
@@ -5517,23 +6124,27 @@ interface operations {
|
|
|
5517
6124
|
};
|
|
5518
6125
|
};
|
|
5519
6126
|
};
|
|
5520
|
-
|
|
6127
|
+
ClientApprovalsController_decide: {
|
|
5521
6128
|
parameters: {
|
|
5522
6129
|
query?: never;
|
|
5523
6130
|
header?: never;
|
|
5524
6131
|
path: {
|
|
5525
6132
|
/**
|
|
5526
|
-
* @description Id of the
|
|
6133
|
+
* @description Id of the approval.
|
|
5527
6134
|
* @example 3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
|
|
5528
6135
|
*/
|
|
5529
|
-
|
|
6136
|
+
approval_id: string;
|
|
5530
6137
|
};
|
|
5531
6138
|
cookie?: never;
|
|
5532
6139
|
};
|
|
5533
|
-
requestBody
|
|
6140
|
+
requestBody: {
|
|
6141
|
+
content: {
|
|
6142
|
+
"application/json": components["schemas"]["DecideApprovalDto"];
|
|
6143
|
+
};
|
|
6144
|
+
};
|
|
5534
6145
|
responses: {
|
|
5535
|
-
/** @description
|
|
5536
|
-
|
|
6146
|
+
/** @description Decided. */
|
|
6147
|
+
200: {
|
|
5537
6148
|
headers: {
|
|
5538
6149
|
"X-RateLimit-Limit-long": components["headers"]["X-RateLimit-Limit-long"];
|
|
5539
6150
|
"X-RateLimit-Limit-short": components["headers"]["X-RateLimit-Limit-short"];
|
|
@@ -5544,7 +6155,19 @@ interface operations {
|
|
|
5544
6155
|
"X-Request-Id": components["headers"]["RequestId"];
|
|
5545
6156
|
[name: string]: unknown;
|
|
5546
6157
|
};
|
|
5547
|
-
content
|
|
6158
|
+
content: {
|
|
6159
|
+
"application/json": components["schemas"]["ApprovalDto"];
|
|
6160
|
+
};
|
|
6161
|
+
};
|
|
6162
|
+
/** @description `VALIDATION_ERROR`: `decision` must be `approve` or `reject`. */
|
|
6163
|
+
400: {
|
|
6164
|
+
headers: {
|
|
6165
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
6166
|
+
[name: string]: unknown;
|
|
6167
|
+
};
|
|
6168
|
+
content: {
|
|
6169
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
6170
|
+
};
|
|
5548
6171
|
};
|
|
5549
6172
|
/** @description `RECIPIENT_TOKEN_INVALID`: no recipient token, a malformed or forged one, an API key, or a revoked token (mint a new one); `RECIPIENT_TOKEN_EXPIRED`: the token expired (mint a new one). */
|
|
5550
6173
|
401: {
|
|
@@ -5556,7 +6179,7 @@ interface operations {
|
|
|
5556
6179
|
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
5557
6180
|
};
|
|
5558
6181
|
};
|
|
5559
|
-
/** @description `RECIPIENT_TOKEN_SCOPE`: the token lacks the `
|
|
6182
|
+
/** @description `RECIPIENT_TOKEN_SCOPE`: the token lacks the `inbox:write` scope; `ORIGIN_NOT_ALLOWED`: the browser origin is not in the workspace client origins; `SERVICE_NOT_ENABLED`: Notify is turned off for the workspace. */
|
|
5560
6183
|
403: {
|
|
5561
6184
|
headers: {
|
|
5562
6185
|
"X-Request-Id": components["headers"]["RequestId"];
|
|
@@ -5566,7 +6189,7 @@ interface operations {
|
|
|
5566
6189
|
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
5567
6190
|
};
|
|
5568
6191
|
};
|
|
5569
|
-
/** @description `
|
|
6192
|
+
/** @description `APPROVAL_NOT_FOUND`: no such request for this recipient. */
|
|
5570
6193
|
404: {
|
|
5571
6194
|
headers: {
|
|
5572
6195
|
"X-Request-Id": components["headers"]["RequestId"];
|
|
@@ -5576,6 +6199,26 @@ interface operations {
|
|
|
5576
6199
|
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
5577
6200
|
};
|
|
5578
6201
|
};
|
|
6202
|
+
/** @description `APPROVAL_NOT_PENDING`: already answered, expired or cancelled. */
|
|
6203
|
+
409: {
|
|
6204
|
+
headers: {
|
|
6205
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
6206
|
+
[name: string]: unknown;
|
|
6207
|
+
};
|
|
6208
|
+
content: {
|
|
6209
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
6210
|
+
};
|
|
6211
|
+
};
|
|
6212
|
+
/** @description `APPROVAL_REASON_REQUIRED`: a reason is required. */
|
|
6213
|
+
422: {
|
|
6214
|
+
headers: {
|
|
6215
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
6216
|
+
[name: string]: unknown;
|
|
6217
|
+
};
|
|
6218
|
+
content: {
|
|
6219
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
6220
|
+
};
|
|
6221
|
+
};
|
|
5579
6222
|
/** @description `RATE_LIMITED`: over 60 client calls per minute for this recipient; `Retry-After` gives the seconds to wait. Per-IP limit: more than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds. */
|
|
5580
6223
|
429: {
|
|
5581
6224
|
headers: {
|
|
@@ -5591,48 +6234,222 @@ interface operations {
|
|
|
5591
6234
|
};
|
|
5592
6235
|
};
|
|
5593
6236
|
};
|
|
5594
|
-
|
|
6237
|
+
ClientController_registerDevice: {
|
|
5595
6238
|
parameters: {
|
|
5596
|
-
query?:
|
|
5597
|
-
/**
|
|
5598
|
-
* @description `all`, or only `unread` or `unseen` items.
|
|
5599
|
-
* @example all
|
|
5600
|
-
*/
|
|
5601
|
-
status?: components["schemas"]["ClientInboxStatusFilter"];
|
|
5602
|
-
/**
|
|
5603
|
-
* @description Only this category (its key).
|
|
5604
|
-
* @example billing
|
|
5605
|
-
*/
|
|
5606
|
-
category?: string;
|
|
5607
|
-
/**
|
|
5608
|
-
* @description Only this tenant (the `tenant` of the send).
|
|
5609
|
-
* @example org_42
|
|
5610
|
-
*/
|
|
5611
|
-
tenant?: string;
|
|
5612
|
-
/**
|
|
5613
|
-
* @description `true` lists archived items instead of the active ones.
|
|
5614
|
-
* @example false
|
|
5615
|
-
*/
|
|
5616
|
-
archived?: boolean;
|
|
5617
|
-
/**
|
|
5618
|
-
* @description Opaque cursor for pagination: the `next_cursor` of the previous page.
|
|
5619
|
-
* @example eyJjcmVhdGVkX2F0IjoiMjAyNi0xMS0wMVQwMDowMDowMFoifQ
|
|
5620
|
-
*/
|
|
5621
|
-
cursor?: string;
|
|
5622
|
-
/**
|
|
5623
|
-
* @description Page size.
|
|
5624
|
-
* @example 25
|
|
5625
|
-
*/
|
|
5626
|
-
limit?: number;
|
|
5627
|
-
};
|
|
6239
|
+
query?: never;
|
|
5628
6240
|
header?: never;
|
|
5629
6241
|
path?: never;
|
|
5630
6242
|
cookie?: never;
|
|
5631
6243
|
};
|
|
5632
|
-
requestBody
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
6244
|
+
requestBody: {
|
|
6245
|
+
content: {
|
|
6246
|
+
"application/json": components["schemas"]["RegisterDeviceDto"];
|
|
6247
|
+
};
|
|
6248
|
+
};
|
|
6249
|
+
responses: {
|
|
6250
|
+
/** @description Already registered to this recipient: refreshed. */
|
|
6251
|
+
200: {
|
|
6252
|
+
headers: {
|
|
6253
|
+
"X-RateLimit-Limit-long": components["headers"]["X-RateLimit-Limit-long"];
|
|
6254
|
+
"X-RateLimit-Limit-short": components["headers"]["X-RateLimit-Limit-short"];
|
|
6255
|
+
"X-RateLimit-Remaining-long": components["headers"]["X-RateLimit-Remaining-long"];
|
|
6256
|
+
"X-RateLimit-Remaining-short": components["headers"]["X-RateLimit-Remaining-short"];
|
|
6257
|
+
"X-RateLimit-Reset-long": components["headers"]["X-RateLimit-Reset-long"];
|
|
6258
|
+
"X-RateLimit-Reset-short": components["headers"]["X-RateLimit-Reset-short"];
|
|
6259
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
6260
|
+
[name: string]: unknown;
|
|
6261
|
+
};
|
|
6262
|
+
content: {
|
|
6263
|
+
"application/json": components["schemas"]["DeviceDto"];
|
|
6264
|
+
};
|
|
6265
|
+
};
|
|
6266
|
+
/** @description Registered (new, or moved from another recipient). */
|
|
6267
|
+
201: {
|
|
6268
|
+
headers: {
|
|
6269
|
+
"X-RateLimit-Limit-long": components["headers"]["X-RateLimit-Limit-long"];
|
|
6270
|
+
"X-RateLimit-Limit-short": components["headers"]["X-RateLimit-Limit-short"];
|
|
6271
|
+
"X-RateLimit-Remaining-long": components["headers"]["X-RateLimit-Remaining-long"];
|
|
6272
|
+
"X-RateLimit-Remaining-short": components["headers"]["X-RateLimit-Remaining-short"];
|
|
6273
|
+
"X-RateLimit-Reset-long": components["headers"]["X-RateLimit-Reset-long"];
|
|
6274
|
+
"X-RateLimit-Reset-short": components["headers"]["X-RateLimit-Reset-short"];
|
|
6275
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
6276
|
+
[name: string]: unknown;
|
|
6277
|
+
};
|
|
6278
|
+
content: {
|
|
6279
|
+
"application/json": components["schemas"]["DeviceDto"];
|
|
6280
|
+
};
|
|
6281
|
+
};
|
|
6282
|
+
/** @description `VALIDATION_ERROR`: a field is invalid (`errors` names it). */
|
|
6283
|
+
400: {
|
|
6284
|
+
headers: {
|
|
6285
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
6286
|
+
[name: string]: unknown;
|
|
6287
|
+
};
|
|
6288
|
+
content: {
|
|
6289
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
6290
|
+
};
|
|
6291
|
+
};
|
|
6292
|
+
/** @description `RECIPIENT_TOKEN_INVALID`: no recipient token, a malformed or forged one, an API key, or a revoked token (mint a new one); `RECIPIENT_TOKEN_EXPIRED`: the token expired (mint a new one). */
|
|
6293
|
+
401: {
|
|
6294
|
+
headers: {
|
|
6295
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
6296
|
+
[name: string]: unknown;
|
|
6297
|
+
};
|
|
6298
|
+
content: {
|
|
6299
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
6300
|
+
};
|
|
6301
|
+
};
|
|
6302
|
+
/** @description `RECIPIENT_TOKEN_SCOPE`: the token lacks the `devices:write` scope; `ORIGIN_NOT_ALLOWED`: the browser origin is not in the workspace client origins; `SERVICE_NOT_ENABLED`: Notify is turned off for the workspace. */
|
|
6303
|
+
403: {
|
|
6304
|
+
headers: {
|
|
6305
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
6306
|
+
[name: string]: unknown;
|
|
6307
|
+
};
|
|
6308
|
+
content: {
|
|
6309
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
6310
|
+
};
|
|
6311
|
+
};
|
|
6312
|
+
/** @description `DEVICE_TOKEN_INVALID`: the token or subscription is malformed for its channel (or `environment` is missing for APNs); `WEBPUSH_ENDPOINT_NOT_ALLOWED`: the endpoint is not https on a known push service. */
|
|
6313
|
+
422: {
|
|
6314
|
+
headers: {
|
|
6315
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
6316
|
+
[name: string]: unknown;
|
|
6317
|
+
};
|
|
6318
|
+
content: {
|
|
6319
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
6320
|
+
};
|
|
6321
|
+
};
|
|
6322
|
+
/** @description `RATE_LIMITED`: over 60 client calls per minute for this recipient; `Retry-After` gives the seconds to wait. Per-IP limit: more than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds. */
|
|
6323
|
+
429: {
|
|
6324
|
+
headers: {
|
|
6325
|
+
"Retry-After": components["headers"]["Retry-After"];
|
|
6326
|
+
"Retry-After-long": components["headers"]["Retry-After-long"];
|
|
6327
|
+
"Retry-After-short": components["headers"]["Retry-After-short"];
|
|
6328
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
6329
|
+
[name: string]: unknown;
|
|
6330
|
+
};
|
|
6331
|
+
content: {
|
|
6332
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
6333
|
+
};
|
|
6334
|
+
};
|
|
6335
|
+
};
|
|
6336
|
+
};
|
|
6337
|
+
ClientController_removeDevice: {
|
|
6338
|
+
parameters: {
|
|
6339
|
+
query?: never;
|
|
6340
|
+
header?: never;
|
|
6341
|
+
path: {
|
|
6342
|
+
/**
|
|
6343
|
+
* @description Id of the device.
|
|
6344
|
+
* @example 3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
|
|
6345
|
+
*/
|
|
6346
|
+
device_id: string;
|
|
6347
|
+
};
|
|
6348
|
+
cookie?: never;
|
|
6349
|
+
};
|
|
6350
|
+
requestBody?: never;
|
|
6351
|
+
responses: {
|
|
6352
|
+
/** @description Removed. */
|
|
6353
|
+
204: {
|
|
6354
|
+
headers: {
|
|
6355
|
+
"X-RateLimit-Limit-long": components["headers"]["X-RateLimit-Limit-long"];
|
|
6356
|
+
"X-RateLimit-Limit-short": components["headers"]["X-RateLimit-Limit-short"];
|
|
6357
|
+
"X-RateLimit-Remaining-long": components["headers"]["X-RateLimit-Remaining-long"];
|
|
6358
|
+
"X-RateLimit-Remaining-short": components["headers"]["X-RateLimit-Remaining-short"];
|
|
6359
|
+
"X-RateLimit-Reset-long": components["headers"]["X-RateLimit-Reset-long"];
|
|
6360
|
+
"X-RateLimit-Reset-short": components["headers"]["X-RateLimit-Reset-short"];
|
|
6361
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
6362
|
+
[name: string]: unknown;
|
|
6363
|
+
};
|
|
6364
|
+
content?: never;
|
|
6365
|
+
};
|
|
6366
|
+
/** @description `RECIPIENT_TOKEN_INVALID`: no recipient token, a malformed or forged one, an API key, or a revoked token (mint a new one); `RECIPIENT_TOKEN_EXPIRED`: the token expired (mint a new one). */
|
|
6367
|
+
401: {
|
|
6368
|
+
headers: {
|
|
6369
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
6370
|
+
[name: string]: unknown;
|
|
6371
|
+
};
|
|
6372
|
+
content: {
|
|
6373
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
6374
|
+
};
|
|
6375
|
+
};
|
|
6376
|
+
/** @description `RECIPIENT_TOKEN_SCOPE`: the token lacks the `devices:write` scope; `ORIGIN_NOT_ALLOWED`: the browser origin is not in the workspace client origins; `SERVICE_NOT_ENABLED`: Notify is turned off for the workspace. */
|
|
6377
|
+
403: {
|
|
6378
|
+
headers: {
|
|
6379
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
6380
|
+
[name: string]: unknown;
|
|
6381
|
+
};
|
|
6382
|
+
content: {
|
|
6383
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
6384
|
+
};
|
|
6385
|
+
};
|
|
6386
|
+
/** @description `DEVICE_NOT_FOUND`: the recipient has no device with this id. */
|
|
6387
|
+
404: {
|
|
6388
|
+
headers: {
|
|
6389
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
6390
|
+
[name: string]: unknown;
|
|
6391
|
+
};
|
|
6392
|
+
content: {
|
|
6393
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
6394
|
+
};
|
|
6395
|
+
};
|
|
6396
|
+
/** @description `RATE_LIMITED`: over 60 client calls per minute for this recipient; `Retry-After` gives the seconds to wait. Per-IP limit: more than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds. */
|
|
6397
|
+
429: {
|
|
6398
|
+
headers: {
|
|
6399
|
+
"Retry-After": components["headers"]["Retry-After"];
|
|
6400
|
+
"Retry-After-long": components["headers"]["Retry-After-long"];
|
|
6401
|
+
"Retry-After-short": components["headers"]["Retry-After-short"];
|
|
6402
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
6403
|
+
[name: string]: unknown;
|
|
6404
|
+
};
|
|
6405
|
+
content: {
|
|
6406
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
6407
|
+
};
|
|
6408
|
+
};
|
|
6409
|
+
};
|
|
6410
|
+
};
|
|
6411
|
+
ClientController_list: {
|
|
6412
|
+
parameters: {
|
|
6413
|
+
query?: {
|
|
6414
|
+
/**
|
|
6415
|
+
* @description `all`, or only `unread` or `unseen` items.
|
|
6416
|
+
* @example all
|
|
6417
|
+
*/
|
|
6418
|
+
status?: components["schemas"]["ClientInboxStatusFilter"];
|
|
6419
|
+
/**
|
|
6420
|
+
* @description Only this category (its key).
|
|
6421
|
+
* @example billing
|
|
6422
|
+
*/
|
|
6423
|
+
category?: string;
|
|
6424
|
+
/**
|
|
6425
|
+
* @description Only this tenant (the `tenant` of the send).
|
|
6426
|
+
* @example org_42
|
|
6427
|
+
*/
|
|
6428
|
+
tenant?: string;
|
|
6429
|
+
/**
|
|
6430
|
+
* @description `true` lists archived items instead of the active ones.
|
|
6431
|
+
* @example false
|
|
6432
|
+
*/
|
|
6433
|
+
archived?: boolean;
|
|
6434
|
+
/**
|
|
6435
|
+
* @description Opaque cursor for pagination: the `next_cursor` of the previous page.
|
|
6436
|
+
* @example eyJjcmVhdGVkX2F0IjoiMjAyNi0xMS0wMVQwMDowMDowMFoifQ
|
|
6437
|
+
*/
|
|
6438
|
+
cursor?: string;
|
|
6439
|
+
/**
|
|
6440
|
+
* @description Page size.
|
|
6441
|
+
* @example 25
|
|
6442
|
+
*/
|
|
6443
|
+
limit?: number;
|
|
6444
|
+
};
|
|
6445
|
+
header?: never;
|
|
6446
|
+
path?: never;
|
|
6447
|
+
cookie?: never;
|
|
6448
|
+
};
|
|
6449
|
+
requestBody?: never;
|
|
6450
|
+
responses: {
|
|
6451
|
+
/** @description A page of items. */
|
|
6452
|
+
200: {
|
|
5636
6453
|
headers: {
|
|
5637
6454
|
"X-RateLimit-Limit-long": components["headers"]["X-RateLimit-Limit-long"];
|
|
5638
6455
|
"X-RateLimit-Limit-short": components["headers"]["X-RateLimit-Limit-short"];
|
|
@@ -6028,10 +6845,483 @@ interface operations {
|
|
|
6028
6845
|
[name: string]: unknown;
|
|
6029
6846
|
};
|
|
6030
6847
|
content: {
|
|
6031
|
-
"application/json": components["schemas"]["ClientPreferencesDto"];
|
|
6848
|
+
"application/json": components["schemas"]["ClientPreferencesDto"];
|
|
6849
|
+
};
|
|
6850
|
+
};
|
|
6851
|
+
/** @description `RECIPIENT_TOKEN_INVALID`: no recipient token, a malformed or forged one, an API key, or a revoked token (mint a new one); `RECIPIENT_TOKEN_EXPIRED`: the token expired (mint a new one). */
|
|
6852
|
+
401: {
|
|
6853
|
+
headers: {
|
|
6854
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
6855
|
+
[name: string]: unknown;
|
|
6856
|
+
};
|
|
6857
|
+
content: {
|
|
6858
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
6859
|
+
};
|
|
6860
|
+
};
|
|
6861
|
+
/** @description `RECIPIENT_TOKEN_SCOPE`: the token lacks the `preferences:read` scope; `ORIGIN_NOT_ALLOWED`: the browser origin is not in the workspace client origins; `SERVICE_NOT_ENABLED`: Notify is turned off for the workspace. */
|
|
6862
|
+
403: {
|
|
6863
|
+
headers: {
|
|
6864
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
6865
|
+
[name: string]: unknown;
|
|
6866
|
+
};
|
|
6867
|
+
content: {
|
|
6868
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
6869
|
+
};
|
|
6870
|
+
};
|
|
6871
|
+
/** @description `RATE_LIMITED`: over 60 client calls per minute for this recipient; `Retry-After` gives the seconds to wait. Per-IP limit: more than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds. */
|
|
6872
|
+
429: {
|
|
6873
|
+
headers: {
|
|
6874
|
+
"Retry-After": components["headers"]["Retry-After"];
|
|
6875
|
+
"Retry-After-long": components["headers"]["Retry-After-long"];
|
|
6876
|
+
"Retry-After-short": components["headers"]["Retry-After-short"];
|
|
6877
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
6878
|
+
[name: string]: unknown;
|
|
6879
|
+
};
|
|
6880
|
+
content: {
|
|
6881
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
6882
|
+
};
|
|
6883
|
+
};
|
|
6884
|
+
};
|
|
6885
|
+
};
|
|
6886
|
+
ClientController_updatePreferences: {
|
|
6887
|
+
parameters: {
|
|
6888
|
+
query?: never;
|
|
6889
|
+
header?: never;
|
|
6890
|
+
path?: never;
|
|
6891
|
+
cookie?: never;
|
|
6892
|
+
};
|
|
6893
|
+
requestBody: {
|
|
6894
|
+
content: {
|
|
6895
|
+
"application/json": components["schemas"]["UpdateClientPreferencesDto"];
|
|
6896
|
+
};
|
|
6897
|
+
};
|
|
6898
|
+
responses: {
|
|
6899
|
+
/** @description The preferences after the change. */
|
|
6900
|
+
200: {
|
|
6901
|
+
headers: {
|
|
6902
|
+
"X-RateLimit-Limit-long": components["headers"]["X-RateLimit-Limit-long"];
|
|
6903
|
+
"X-RateLimit-Limit-short": components["headers"]["X-RateLimit-Limit-short"];
|
|
6904
|
+
"X-RateLimit-Remaining-long": components["headers"]["X-RateLimit-Remaining-long"];
|
|
6905
|
+
"X-RateLimit-Remaining-short": components["headers"]["X-RateLimit-Remaining-short"];
|
|
6906
|
+
"X-RateLimit-Reset-long": components["headers"]["X-RateLimit-Reset-long"];
|
|
6907
|
+
"X-RateLimit-Reset-short": components["headers"]["X-RateLimit-Reset-short"];
|
|
6908
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
6909
|
+
[name: string]: unknown;
|
|
6910
|
+
};
|
|
6911
|
+
content: {
|
|
6912
|
+
"application/json": components["schemas"]["ClientPreferencesDto"];
|
|
6913
|
+
};
|
|
6914
|
+
};
|
|
6915
|
+
/** @description `VALIDATION_ERROR`: a field is invalid (`errors` names it). */
|
|
6916
|
+
400: {
|
|
6917
|
+
headers: {
|
|
6918
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
6919
|
+
[name: string]: unknown;
|
|
6920
|
+
};
|
|
6921
|
+
content: {
|
|
6922
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
6923
|
+
};
|
|
6924
|
+
};
|
|
6925
|
+
/** @description `RECIPIENT_TOKEN_INVALID`: no recipient token, a malformed or forged one, an API key, or a revoked token (mint a new one); `RECIPIENT_TOKEN_EXPIRED`: the token expired (mint a new one). */
|
|
6926
|
+
401: {
|
|
6927
|
+
headers: {
|
|
6928
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
6929
|
+
[name: string]: unknown;
|
|
6930
|
+
};
|
|
6931
|
+
content: {
|
|
6932
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
6933
|
+
};
|
|
6934
|
+
};
|
|
6935
|
+
/** @description `RECIPIENT_TOKEN_SCOPE`: the token lacks the `preferences:write` scope; `ORIGIN_NOT_ALLOWED`: the browser origin is not in the workspace client origins; `SERVICE_NOT_ENABLED`: Notify is turned off for the workspace. */
|
|
6936
|
+
403: {
|
|
6937
|
+
headers: {
|
|
6938
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
6939
|
+
[name: string]: unknown;
|
|
6940
|
+
};
|
|
6941
|
+
content: {
|
|
6942
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
6943
|
+
};
|
|
6944
|
+
};
|
|
6945
|
+
/** @description `PREFERENCE_LOCKED`: the channel is mandatory for the category; `CATEGORY_NOT_FOUND` / `NOTIFICATION_TYPE_NOT_FOUND`: no category or type with that key. */
|
|
6946
|
+
422: {
|
|
6947
|
+
headers: {
|
|
6948
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
6949
|
+
[name: string]: unknown;
|
|
6950
|
+
};
|
|
6951
|
+
content: {
|
|
6952
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
6953
|
+
};
|
|
6954
|
+
};
|
|
6955
|
+
/** @description `RATE_LIMITED`: over 60 client calls per minute for this recipient; `Retry-After` gives the seconds to wait. Per-IP limit: more than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds. */
|
|
6956
|
+
429: {
|
|
6957
|
+
headers: {
|
|
6958
|
+
"Retry-After": components["headers"]["Retry-After"];
|
|
6959
|
+
"Retry-After-long": components["headers"]["Retry-After-long"];
|
|
6960
|
+
"Retry-After-short": components["headers"]["Retry-After-short"];
|
|
6961
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
6962
|
+
[name: string]: unknown;
|
|
6963
|
+
};
|
|
6964
|
+
content: {
|
|
6965
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
6966
|
+
};
|
|
6967
|
+
};
|
|
6968
|
+
};
|
|
6969
|
+
};
|
|
6970
|
+
ClientController_vapidPublicKey: {
|
|
6971
|
+
parameters: {
|
|
6972
|
+
query?: never;
|
|
6973
|
+
header?: never;
|
|
6974
|
+
path?: never;
|
|
6975
|
+
cookie?: never;
|
|
6976
|
+
};
|
|
6977
|
+
requestBody?: never;
|
|
6978
|
+
responses: {
|
|
6979
|
+
/** @description The public key. */
|
|
6980
|
+
200: {
|
|
6981
|
+
headers: {
|
|
6982
|
+
"X-RateLimit-Limit-long": components["headers"]["X-RateLimit-Limit-long"];
|
|
6983
|
+
"X-RateLimit-Limit-short": components["headers"]["X-RateLimit-Limit-short"];
|
|
6984
|
+
"X-RateLimit-Remaining-long": components["headers"]["X-RateLimit-Remaining-long"];
|
|
6985
|
+
"X-RateLimit-Remaining-short": components["headers"]["X-RateLimit-Remaining-short"];
|
|
6986
|
+
"X-RateLimit-Reset-long": components["headers"]["X-RateLimit-Reset-long"];
|
|
6987
|
+
"X-RateLimit-Reset-short": components["headers"]["X-RateLimit-Reset-short"];
|
|
6988
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
6989
|
+
[name: string]: unknown;
|
|
6990
|
+
};
|
|
6991
|
+
content: {
|
|
6992
|
+
"application/json": components["schemas"]["VapidPublicKeyDto"];
|
|
6993
|
+
};
|
|
6994
|
+
};
|
|
6995
|
+
/** @description `RECIPIENT_TOKEN_INVALID`: no recipient token, a malformed or forged one, an API key, or a revoked token (mint a new one); `RECIPIENT_TOKEN_EXPIRED`: the token expired (mint a new one). */
|
|
6996
|
+
401: {
|
|
6997
|
+
headers: {
|
|
6998
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
6999
|
+
[name: string]: unknown;
|
|
7000
|
+
};
|
|
7001
|
+
content: {
|
|
7002
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
7003
|
+
};
|
|
7004
|
+
};
|
|
7005
|
+
/** @description `RECIPIENT_TOKEN_SCOPE`: the token lacks the `devices:write` scope; `ORIGIN_NOT_ALLOWED`: the browser origin is not in the workspace client origins; `SERVICE_NOT_ENABLED`: Notify is turned off for the workspace. */
|
|
7006
|
+
403: {
|
|
7007
|
+
headers: {
|
|
7008
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
7009
|
+
[name: string]: unknown;
|
|
7010
|
+
};
|
|
7011
|
+
content: {
|
|
7012
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
7013
|
+
};
|
|
7014
|
+
};
|
|
7015
|
+
/** @description `CHANNEL_NOT_CONFIGURED`: the workspace has no web push key yet (generate one in the console or with `POST /channels/webpush/vapid-keys`). */
|
|
7016
|
+
404: {
|
|
7017
|
+
headers: {
|
|
7018
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
7019
|
+
[name: string]: unknown;
|
|
7020
|
+
};
|
|
7021
|
+
content: {
|
|
7022
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
7023
|
+
};
|
|
7024
|
+
};
|
|
7025
|
+
/** @description `RATE_LIMITED`: over 60 client calls per minute for this recipient; `Retry-After` gives the seconds to wait. Per-IP limit: more than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds. */
|
|
7026
|
+
429: {
|
|
7027
|
+
headers: {
|
|
7028
|
+
"Retry-After": components["headers"]["Retry-After"];
|
|
7029
|
+
"Retry-After-long": components["headers"]["Retry-After-long"];
|
|
7030
|
+
"Retry-After-short": components["headers"]["Retry-After-short"];
|
|
7031
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
7032
|
+
[name: string]: unknown;
|
|
7033
|
+
};
|
|
7034
|
+
content: {
|
|
7035
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
7036
|
+
};
|
|
7037
|
+
};
|
|
7038
|
+
};
|
|
7039
|
+
};
|
|
7040
|
+
ApprovalsController_list: {
|
|
7041
|
+
parameters: {
|
|
7042
|
+
query?: {
|
|
7043
|
+
/**
|
|
7044
|
+
* @description Only requests in this status.
|
|
7045
|
+
* @example pending
|
|
7046
|
+
*/
|
|
7047
|
+
status?: components["schemas"]["NotifyApprovalStatus"];
|
|
7048
|
+
/**
|
|
7049
|
+
* @description Only this type key.
|
|
7050
|
+
* @example deploy.approval
|
|
7051
|
+
*/
|
|
7052
|
+
type?: string;
|
|
7053
|
+
/**
|
|
7054
|
+
* @description Opaque cursor for pagination: the `next_cursor` of the previous page.
|
|
7055
|
+
* @example eyJjcmVhdGVkX2F0IjoiMjAyNi0xMS0wMVQwMDowMDowMFoifQ
|
|
7056
|
+
*/
|
|
7057
|
+
cursor?: string;
|
|
7058
|
+
/**
|
|
7059
|
+
* @description Page size.
|
|
7060
|
+
* @example 25
|
|
7061
|
+
*/
|
|
7062
|
+
limit?: number;
|
|
7063
|
+
};
|
|
7064
|
+
header?: never;
|
|
7065
|
+
path: {
|
|
7066
|
+
/**
|
|
7067
|
+
* @description Id of the workspace.
|
|
7068
|
+
* @example 3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
|
|
7069
|
+
*/
|
|
7070
|
+
workspace_id: string;
|
|
7071
|
+
};
|
|
7072
|
+
cookie?: never;
|
|
7073
|
+
};
|
|
7074
|
+
requestBody?: never;
|
|
7075
|
+
responses: {
|
|
7076
|
+
/** @description A page of requests. */
|
|
7077
|
+
200: {
|
|
7078
|
+
headers: {
|
|
7079
|
+
"X-RateLimit-Limit-long": components["headers"]["X-RateLimit-Limit-long"];
|
|
7080
|
+
"X-RateLimit-Limit-short": components["headers"]["X-RateLimit-Limit-short"];
|
|
7081
|
+
"X-RateLimit-Remaining-long": components["headers"]["X-RateLimit-Remaining-long"];
|
|
7082
|
+
"X-RateLimit-Remaining-short": components["headers"]["X-RateLimit-Remaining-short"];
|
|
7083
|
+
"X-RateLimit-Reset-long": components["headers"]["X-RateLimit-Reset-long"];
|
|
7084
|
+
"X-RateLimit-Reset-short": components["headers"]["X-RateLimit-Reset-short"];
|
|
7085
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
7086
|
+
[name: string]: unknown;
|
|
7087
|
+
};
|
|
7088
|
+
content: {
|
|
7089
|
+
"application/json": components["schemas"]["ApprovalListResponseDto"];
|
|
7090
|
+
};
|
|
7091
|
+
};
|
|
7092
|
+
/** @description `VALIDATION_ERROR` on a bad filter, or `BAD_REQUEST`: invalid cursor. */
|
|
7093
|
+
400: {
|
|
7094
|
+
headers: {
|
|
7095
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
7096
|
+
[name: string]: unknown;
|
|
7097
|
+
};
|
|
7098
|
+
content: {
|
|
7099
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
7100
|
+
};
|
|
7101
|
+
};
|
|
7102
|
+
/** @description Missing, expired, revoked or invalid bearer token (`UNAUTHORIZED`): send a workspace API key or a console session as `Authorization: Bearer <token>`. A recipient token is refused here with `RECIPIENT_TOKEN_INVALID`: it works only on the client API (`/v1/client/…`). */
|
|
7103
|
+
401: {
|
|
7104
|
+
headers: {
|
|
7105
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
7106
|
+
[name: string]: unknown;
|
|
7107
|
+
};
|
|
7108
|
+
content: {
|
|
7109
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
7110
|
+
};
|
|
7111
|
+
};
|
|
7112
|
+
/** @description The caller lacks the action, or the workspace has not enabled Notify (`SERVICE_NOT_ENABLED`). Also `FORBIDDEN` when the credential belongs to another workspace than the URL names, or the URL uses the workspace slug instead of its id (a UUID). */
|
|
7113
|
+
403: {
|
|
7114
|
+
headers: {
|
|
7115
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
7116
|
+
[name: string]: unknown;
|
|
7117
|
+
};
|
|
7118
|
+
content: {
|
|
7119
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
7120
|
+
};
|
|
7121
|
+
};
|
|
7122
|
+
/** @description More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds. */
|
|
7123
|
+
429: {
|
|
7124
|
+
headers: {
|
|
7125
|
+
"Retry-After": components["headers"]["Retry-After"];
|
|
7126
|
+
"Retry-After-long": components["headers"]["Retry-After-long"];
|
|
7127
|
+
"Retry-After-short": components["headers"]["Retry-After-short"];
|
|
7128
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
7129
|
+
[name: string]: unknown;
|
|
7130
|
+
};
|
|
7131
|
+
content: {
|
|
7132
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
7133
|
+
};
|
|
7134
|
+
};
|
|
7135
|
+
};
|
|
7136
|
+
};
|
|
7137
|
+
ApprovalsController_create: {
|
|
7138
|
+
parameters: {
|
|
7139
|
+
query?: never;
|
|
7140
|
+
header: {
|
|
7141
|
+
/** @description Required. 1 to 256 characters of `A-Z a-z 0-9 . _ : -`, for example the id of the action you ask about (`deploy:dep_91`). */
|
|
7142
|
+
"Idempotency-Key": string;
|
|
7143
|
+
};
|
|
7144
|
+
path: {
|
|
7145
|
+
/**
|
|
7146
|
+
* @description Id of the workspace.
|
|
7147
|
+
* @example 3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
|
|
7148
|
+
*/
|
|
7149
|
+
workspace_id: string;
|
|
7150
|
+
};
|
|
7151
|
+
cookie?: never;
|
|
7152
|
+
};
|
|
7153
|
+
requestBody: {
|
|
7154
|
+
content: {
|
|
7155
|
+
"application/json": components["schemas"]["CreateApprovalDto"];
|
|
7156
|
+
};
|
|
7157
|
+
};
|
|
7158
|
+
responses: {
|
|
7159
|
+
/** @description The same Idempotency-Key and body: the existing request. */
|
|
7160
|
+
200: {
|
|
7161
|
+
headers: {
|
|
7162
|
+
/** @description `true` when this response is a replay of an earlier request with the same `Idempotency-Key`. */
|
|
7163
|
+
"Idempotent-Replay"?: "true";
|
|
7164
|
+
"X-RateLimit-Limit-long": components["headers"]["X-RateLimit-Limit-long"];
|
|
7165
|
+
"X-RateLimit-Limit-short": components["headers"]["X-RateLimit-Limit-short"];
|
|
7166
|
+
"X-RateLimit-Remaining-long": components["headers"]["X-RateLimit-Remaining-long"];
|
|
7167
|
+
"X-RateLimit-Remaining-short": components["headers"]["X-RateLimit-Remaining-short"];
|
|
7168
|
+
"X-RateLimit-Reset-long": components["headers"]["X-RateLimit-Reset-long"];
|
|
7169
|
+
"X-RateLimit-Reset-short": components["headers"]["X-RateLimit-Reset-short"];
|
|
7170
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
7171
|
+
[name: string]: unknown;
|
|
7172
|
+
};
|
|
7173
|
+
content: {
|
|
7174
|
+
"application/json": components["schemas"]["ApprovalDto"];
|
|
7175
|
+
};
|
|
7176
|
+
};
|
|
7177
|
+
/** @description Requested (and decided, if an answer came within `wait_seconds`). */
|
|
7178
|
+
201: {
|
|
7179
|
+
headers: {
|
|
7180
|
+
/** @description `true` when this response is a replay of an earlier request with the same `Idempotency-Key`. */
|
|
7181
|
+
"Idempotent-Replay"?: "true";
|
|
7182
|
+
"X-RateLimit-Limit-long": components["headers"]["X-RateLimit-Limit-long"];
|
|
7183
|
+
"X-RateLimit-Limit-short": components["headers"]["X-RateLimit-Limit-short"];
|
|
7184
|
+
"X-RateLimit-Remaining-long": components["headers"]["X-RateLimit-Remaining-long"];
|
|
7185
|
+
"X-RateLimit-Remaining-short": components["headers"]["X-RateLimit-Remaining-short"];
|
|
7186
|
+
"X-RateLimit-Reset-long": components["headers"]["X-RateLimit-Reset-long"];
|
|
7187
|
+
"X-RateLimit-Reset-short": components["headers"]["X-RateLimit-Reset-short"];
|
|
7188
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
7189
|
+
[name: string]: unknown;
|
|
7190
|
+
};
|
|
7191
|
+
content: {
|
|
7192
|
+
"application/json": components["schemas"]["ApprovalDto"];
|
|
7193
|
+
};
|
|
7194
|
+
};
|
|
7195
|
+
/** @description `IDEMPOTENCY_KEY_REQUIRED`; `VALIDATION_ERROR`: a field is invalid. */
|
|
7196
|
+
400: {
|
|
7197
|
+
headers: {
|
|
7198
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
7199
|
+
[name: string]: unknown;
|
|
7200
|
+
};
|
|
7201
|
+
content: {
|
|
7202
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
7203
|
+
};
|
|
7204
|
+
};
|
|
7205
|
+
/** @description Missing, expired, revoked or invalid bearer token (`UNAUTHORIZED`): send a workspace API key or a console session as `Authorization: Bearer <token>`. A recipient token is refused here with `RECIPIENT_TOKEN_INVALID`: it works only on the client API (`/v1/client/…`). */
|
|
7206
|
+
401: {
|
|
7207
|
+
headers: {
|
|
7208
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
7209
|
+
[name: string]: unknown;
|
|
7210
|
+
};
|
|
7211
|
+
content: {
|
|
7212
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
7213
|
+
};
|
|
7214
|
+
};
|
|
7215
|
+
/** @description The caller lacks the action, or the workspace has not enabled Notify (`SERVICE_NOT_ENABLED`). Also `FORBIDDEN` when the credential belongs to another workspace than the URL names, or the URL uses the workspace slug instead of its id (a UUID). */
|
|
7216
|
+
403: {
|
|
7217
|
+
headers: {
|
|
7218
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
7219
|
+
[name: string]: unknown;
|
|
7220
|
+
};
|
|
7221
|
+
content: {
|
|
7222
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
7223
|
+
};
|
|
7224
|
+
};
|
|
7225
|
+
/** @description `NOTIFICATION_TYPE_NOT_FOUND`: no type with this key. */
|
|
7226
|
+
404: {
|
|
7227
|
+
headers: {
|
|
7228
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
7229
|
+
[name: string]: unknown;
|
|
7230
|
+
};
|
|
7231
|
+
content: {
|
|
7232
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
7233
|
+
};
|
|
7234
|
+
};
|
|
7235
|
+
/** @description `IDEMPOTENCY_KEY_REUSE`: the key was used with a different body. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key). */
|
|
7236
|
+
409: {
|
|
7237
|
+
headers: {
|
|
7238
|
+
/** @description Seconds to wait before retrying with the same key (sent with `IDEMPOTENCY_IN_PROGRESS`). */
|
|
7239
|
+
"Retry-After"?: number;
|
|
7240
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
7241
|
+
[name: string]: unknown;
|
|
7242
|
+
};
|
|
7243
|
+
content: {
|
|
7244
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
7245
|
+
};
|
|
7246
|
+
};
|
|
7247
|
+
/** @description `NOT_AN_APPROVAL_TYPE`: the type has no `approval`; `NOTIFICATION_TYPE_ARCHIVED`; `RECIPIENT_NOT_FOUND`: an approver is not a recipient (`details.missing`). */
|
|
7248
|
+
422: {
|
|
7249
|
+
headers: {
|
|
7250
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
7251
|
+
[name: string]: unknown;
|
|
7252
|
+
};
|
|
7253
|
+
content: {
|
|
7254
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
7255
|
+
};
|
|
7256
|
+
};
|
|
7257
|
+
/** @description `RATE_LIMITED`: over the workspace send limit; see `Retry-After`. Per-IP limit: more than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds. */
|
|
7258
|
+
429: {
|
|
7259
|
+
headers: {
|
|
7260
|
+
"Retry-After": components["headers"]["Retry-After"];
|
|
7261
|
+
"Retry-After-long": components["headers"]["Retry-After-long"];
|
|
7262
|
+
"Retry-After-short": components["headers"]["Retry-After-short"];
|
|
7263
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
7264
|
+
[name: string]: unknown;
|
|
7265
|
+
};
|
|
7266
|
+
content: {
|
|
7267
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
7268
|
+
};
|
|
7269
|
+
};
|
|
7270
|
+
};
|
|
7271
|
+
};
|
|
7272
|
+
ApprovalsController_retrieve: {
|
|
7273
|
+
parameters: {
|
|
7274
|
+
query?: {
|
|
7275
|
+
/**
|
|
7276
|
+
* @description While `pending`, wait up to this many seconds for an answer before responding (long poll).
|
|
7277
|
+
* @example 0
|
|
7278
|
+
*/
|
|
7279
|
+
wait_seconds?: number;
|
|
7280
|
+
};
|
|
7281
|
+
header?: never;
|
|
7282
|
+
path: {
|
|
7283
|
+
/**
|
|
7284
|
+
* @description Id of the workspace.
|
|
7285
|
+
* @example 3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
|
|
7286
|
+
*/
|
|
7287
|
+
workspace_id: string;
|
|
7288
|
+
/**
|
|
7289
|
+
* @description The approval request id.
|
|
7290
|
+
* @example 3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
|
|
7291
|
+
*/
|
|
7292
|
+
approval_id: string;
|
|
7293
|
+
};
|
|
7294
|
+
cookie?: never;
|
|
7295
|
+
};
|
|
7296
|
+
requestBody?: never;
|
|
7297
|
+
responses: {
|
|
7298
|
+
/** @description The request. */
|
|
7299
|
+
200: {
|
|
7300
|
+
headers: {
|
|
7301
|
+
"X-RateLimit-Limit-long": components["headers"]["X-RateLimit-Limit-long"];
|
|
7302
|
+
"X-RateLimit-Limit-short": components["headers"]["X-RateLimit-Limit-short"];
|
|
7303
|
+
"X-RateLimit-Remaining-long": components["headers"]["X-RateLimit-Remaining-long"];
|
|
7304
|
+
"X-RateLimit-Remaining-short": components["headers"]["X-RateLimit-Remaining-short"];
|
|
7305
|
+
"X-RateLimit-Reset-long": components["headers"]["X-RateLimit-Reset-long"];
|
|
7306
|
+
"X-RateLimit-Reset-short": components["headers"]["X-RateLimit-Reset-short"];
|
|
7307
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
7308
|
+
[name: string]: unknown;
|
|
7309
|
+
};
|
|
7310
|
+
content: {
|
|
7311
|
+
"application/json": components["schemas"]["ApprovalDetailDto"];
|
|
6032
7312
|
};
|
|
6033
7313
|
};
|
|
6034
|
-
/** @description `
|
|
7314
|
+
/** @description `VALIDATION_ERROR`: `wait_seconds` out of range. */
|
|
7315
|
+
400: {
|
|
7316
|
+
headers: {
|
|
7317
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
7318
|
+
[name: string]: unknown;
|
|
7319
|
+
};
|
|
7320
|
+
content: {
|
|
7321
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
7322
|
+
};
|
|
7323
|
+
};
|
|
7324
|
+
/** @description Missing, expired, revoked or invalid bearer token (`UNAUTHORIZED`): send a workspace API key or a console session as `Authorization: Bearer <token>`. A recipient token is refused here with `RECIPIENT_TOKEN_INVALID`: it works only on the client API (`/v1/client/…`). */
|
|
6035
7325
|
401: {
|
|
6036
7326
|
headers: {
|
|
6037
7327
|
"X-Request-Id": components["headers"]["RequestId"];
|
|
@@ -6041,7 +7331,7 @@ interface operations {
|
|
|
6041
7331
|
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
6042
7332
|
};
|
|
6043
7333
|
};
|
|
6044
|
-
/** @description
|
|
7334
|
+
/** @description The caller lacks the action, or the workspace has not enabled Notify (`SERVICE_NOT_ENABLED`). Also `FORBIDDEN` when the credential belongs to another workspace than the URL names, or the URL uses the workspace slug instead of its id (a UUID). */
|
|
6045
7335
|
403: {
|
|
6046
7336
|
headers: {
|
|
6047
7337
|
"X-Request-Id": components["headers"]["RequestId"];
|
|
@@ -6051,7 +7341,17 @@ interface operations {
|
|
|
6051
7341
|
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
6052
7342
|
};
|
|
6053
7343
|
};
|
|
6054
|
-
/** @description `
|
|
7344
|
+
/** @description `APPROVAL_NOT_FOUND`: no approval request with this id in this workspace. */
|
|
7345
|
+
404: {
|
|
7346
|
+
headers: {
|
|
7347
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
7348
|
+
[name: string]: unknown;
|
|
7349
|
+
};
|
|
7350
|
+
content: {
|
|
7351
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
7352
|
+
};
|
|
7353
|
+
};
|
|
7354
|
+
/** @description More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds. */
|
|
6055
7355
|
429: {
|
|
6056
7356
|
headers: {
|
|
6057
7357
|
"Retry-After": components["headers"]["Retry-After"];
|
|
@@ -6066,20 +7366,27 @@ interface operations {
|
|
|
6066
7366
|
};
|
|
6067
7367
|
};
|
|
6068
7368
|
};
|
|
6069
|
-
|
|
7369
|
+
ApprovalsController_cancel: {
|
|
6070
7370
|
parameters: {
|
|
6071
7371
|
query?: never;
|
|
6072
7372
|
header?: never;
|
|
6073
|
-
path
|
|
6074
|
-
|
|
6075
|
-
|
|
6076
|
-
|
|
6077
|
-
|
|
6078
|
-
|
|
7373
|
+
path: {
|
|
7374
|
+
/**
|
|
7375
|
+
* @description Id of the workspace.
|
|
7376
|
+
* @example 3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
|
|
7377
|
+
*/
|
|
7378
|
+
workspace_id: string;
|
|
7379
|
+
/**
|
|
7380
|
+
* @description The approval request id.
|
|
7381
|
+
* @example 3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
|
|
7382
|
+
*/
|
|
7383
|
+
approval_id: string;
|
|
6079
7384
|
};
|
|
7385
|
+
cookie?: never;
|
|
6080
7386
|
};
|
|
7387
|
+
requestBody?: never;
|
|
6081
7388
|
responses: {
|
|
6082
|
-
/** @description
|
|
7389
|
+
/** @description Cancelled. */
|
|
6083
7390
|
200: {
|
|
6084
7391
|
headers: {
|
|
6085
7392
|
"X-RateLimit-Limit-long": components["headers"]["X-RateLimit-Limit-long"];
|
|
@@ -6092,11 +7399,11 @@ interface operations {
|
|
|
6092
7399
|
[name: string]: unknown;
|
|
6093
7400
|
};
|
|
6094
7401
|
content: {
|
|
6095
|
-
"application/json": components["schemas"]["
|
|
7402
|
+
"application/json": components["schemas"]["ApprovalDto"];
|
|
6096
7403
|
};
|
|
6097
7404
|
};
|
|
6098
|
-
/** @description
|
|
6099
|
-
|
|
7405
|
+
/** @description Missing, expired, revoked or invalid bearer token (`UNAUTHORIZED`): send a workspace API key or a console session as `Authorization: Bearer <token>`. A recipient token is refused here with `RECIPIENT_TOKEN_INVALID`: it works only on the client API (`/v1/client/…`). */
|
|
7406
|
+
401: {
|
|
6100
7407
|
headers: {
|
|
6101
7408
|
"X-Request-Id": components["headers"]["RequestId"];
|
|
6102
7409
|
[name: string]: unknown;
|
|
@@ -6105,8 +7412,8 @@ interface operations {
|
|
|
6105
7412
|
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
6106
7413
|
};
|
|
6107
7414
|
};
|
|
6108
|
-
/** @description
|
|
6109
|
-
|
|
7415
|
+
/** @description The caller lacks the action, or the workspace has not enabled Notify (`SERVICE_NOT_ENABLED`). Also `FORBIDDEN` when the credential belongs to another workspace than the URL names, or the URL uses the workspace slug instead of its id (a UUID). */
|
|
7416
|
+
403: {
|
|
6110
7417
|
headers: {
|
|
6111
7418
|
"X-Request-Id": components["headers"]["RequestId"];
|
|
6112
7419
|
[name: string]: unknown;
|
|
@@ -6115,8 +7422,8 @@ interface operations {
|
|
|
6115
7422
|
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
6116
7423
|
};
|
|
6117
7424
|
};
|
|
6118
|
-
/** @description `
|
|
6119
|
-
|
|
7425
|
+
/** @description `APPROVAL_NOT_FOUND`: no approval request with this id in this workspace. */
|
|
7426
|
+
404: {
|
|
6120
7427
|
headers: {
|
|
6121
7428
|
"X-Request-Id": components["headers"]["RequestId"];
|
|
6122
7429
|
[name: string]: unknown;
|
|
@@ -6125,8 +7432,8 @@ interface operations {
|
|
|
6125
7432
|
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
6126
7433
|
};
|
|
6127
7434
|
};
|
|
6128
|
-
/** @description `
|
|
6129
|
-
|
|
7435
|
+
/** @description `APPROVAL_NOT_PENDING`: it was already answered, expired or cancelled. */
|
|
7436
|
+
409: {
|
|
6130
7437
|
headers: {
|
|
6131
7438
|
"X-Request-Id": components["headers"]["RequestId"];
|
|
6132
7439
|
[name: string]: unknown;
|
|
@@ -6135,7 +7442,7 @@ interface operations {
|
|
|
6135
7442
|
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
6136
7443
|
};
|
|
6137
7444
|
};
|
|
6138
|
-
/** @description
|
|
7445
|
+
/** @description More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds. */
|
|
6139
7446
|
429: {
|
|
6140
7447
|
headers: {
|
|
6141
7448
|
"Retry-After": components["headers"]["Retry-After"];
|
|
@@ -6150,16 +7457,31 @@ interface operations {
|
|
|
6150
7457
|
};
|
|
6151
7458
|
};
|
|
6152
7459
|
};
|
|
6153
|
-
|
|
7460
|
+
ApprovalsController_recordDecision: {
|
|
6154
7461
|
parameters: {
|
|
6155
7462
|
query?: never;
|
|
6156
7463
|
header?: never;
|
|
6157
|
-
path
|
|
7464
|
+
path: {
|
|
7465
|
+
/**
|
|
7466
|
+
* @description Id of the workspace.
|
|
7467
|
+
* @example 3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
|
|
7468
|
+
*/
|
|
7469
|
+
workspace_id: string;
|
|
7470
|
+
/**
|
|
7471
|
+
* @description The approval request id.
|
|
7472
|
+
* @example 3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
|
|
7473
|
+
*/
|
|
7474
|
+
approval_id: string;
|
|
7475
|
+
};
|
|
6158
7476
|
cookie?: never;
|
|
6159
7477
|
};
|
|
6160
|
-
requestBody
|
|
7478
|
+
requestBody: {
|
|
7479
|
+
content: {
|
|
7480
|
+
"application/json": components["schemas"]["RecordApprovalDecisionDto"];
|
|
7481
|
+
};
|
|
7482
|
+
};
|
|
6161
7483
|
responses: {
|
|
6162
|
-
/** @description
|
|
7484
|
+
/** @description Decided. */
|
|
6163
7485
|
200: {
|
|
6164
7486
|
headers: {
|
|
6165
7487
|
"X-RateLimit-Limit-long": components["headers"]["X-RateLimit-Limit-long"];
|
|
@@ -6172,10 +7494,20 @@ interface operations {
|
|
|
6172
7494
|
[name: string]: unknown;
|
|
6173
7495
|
};
|
|
6174
7496
|
content: {
|
|
6175
|
-
"application/json": components["schemas"]["
|
|
7497
|
+
"application/json": components["schemas"]["ApprovalDto"];
|
|
6176
7498
|
};
|
|
6177
7499
|
};
|
|
6178
|
-
/** @description `
|
|
7500
|
+
/** @description `VALIDATION_ERROR`: a field is invalid. */
|
|
7501
|
+
400: {
|
|
7502
|
+
headers: {
|
|
7503
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
7504
|
+
[name: string]: unknown;
|
|
7505
|
+
};
|
|
7506
|
+
content: {
|
|
7507
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
7508
|
+
};
|
|
7509
|
+
};
|
|
7510
|
+
/** @description Missing, expired, revoked or invalid bearer token (`UNAUTHORIZED`): send a workspace API key or a console session as `Authorization: Bearer <token>`. A recipient token is refused here with `RECIPIENT_TOKEN_INVALID`: it works only on the client API (`/v1/client/…`). */
|
|
6179
7511
|
401: {
|
|
6180
7512
|
headers: {
|
|
6181
7513
|
"X-Request-Id": components["headers"]["RequestId"];
|
|
@@ -6185,7 +7517,7 @@ interface operations {
|
|
|
6185
7517
|
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
6186
7518
|
};
|
|
6187
7519
|
};
|
|
6188
|
-
/** @description
|
|
7520
|
+
/** @description The caller lacks the action, or the workspace has not enabled Notify (`SERVICE_NOT_ENABLED`). Also `FORBIDDEN` when the credential belongs to another workspace than the URL names, or the URL uses the workspace slug instead of its id (a UUID). */
|
|
6189
7521
|
403: {
|
|
6190
7522
|
headers: {
|
|
6191
7523
|
"X-Request-Id": components["headers"]["RequestId"];
|
|
@@ -6195,7 +7527,7 @@ interface operations {
|
|
|
6195
7527
|
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
6196
7528
|
};
|
|
6197
7529
|
};
|
|
6198
|
-
/** @description `
|
|
7530
|
+
/** @description `APPROVAL_NOT_FOUND`, or `RECIPIENT_NOT_FOUND`: no recipient with that external id. */
|
|
6199
7531
|
404: {
|
|
6200
7532
|
headers: {
|
|
6201
7533
|
"X-Request-Id": components["headers"]["RequestId"];
|
|
@@ -6205,7 +7537,27 @@ interface operations {
|
|
|
6205
7537
|
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
6206
7538
|
};
|
|
6207
7539
|
};
|
|
6208
|
-
/** @description `
|
|
7540
|
+
/** @description `APPROVAL_NOT_PENDING`: already answered, expired or cancelled. */
|
|
7541
|
+
409: {
|
|
7542
|
+
headers: {
|
|
7543
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
7544
|
+
[name: string]: unknown;
|
|
7545
|
+
};
|
|
7546
|
+
content: {
|
|
7547
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
7548
|
+
};
|
|
7549
|
+
};
|
|
7550
|
+
/** @description `NOT_AN_APPROVER`: that recipient was not asked; `APPROVAL_REASON_REQUIRED`: the type needs a reason. */
|
|
7551
|
+
422: {
|
|
7552
|
+
headers: {
|
|
7553
|
+
"X-Request-Id": components["headers"]["RequestId"];
|
|
7554
|
+
[name: string]: unknown;
|
|
7555
|
+
};
|
|
7556
|
+
content: {
|
|
7557
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
7558
|
+
};
|
|
7559
|
+
};
|
|
7560
|
+
/** @description More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds. */
|
|
6209
7561
|
429: {
|
|
6210
7562
|
headers: {
|
|
6211
7563
|
"Retry-After": components["headers"]["Retry-After"];
|
|
@@ -8628,7 +9980,7 @@ interface operations {
|
|
|
8628
9980
|
* @description Template channel.
|
|
8629
9981
|
* @example inbox
|
|
8630
9982
|
*/
|
|
8631
|
-
channel: "inbox" | "email" | "push" | "webpush";
|
|
9983
|
+
channel: "inbox" | "email" | "push" | "webpush" | "webhook";
|
|
8632
9984
|
/**
|
|
8633
9985
|
* @description Template locale (BCP 47).
|
|
8634
9986
|
* @example pt-PT
|
|
@@ -8729,7 +10081,7 @@ interface operations {
|
|
|
8729
10081
|
* @description Template channel.
|
|
8730
10082
|
* @example inbox
|
|
8731
10083
|
*/
|
|
8732
|
-
channel: "inbox" | "email" | "push" | "webpush";
|
|
10084
|
+
channel: "inbox" | "email" | "push" | "webpush" | "webhook";
|
|
8733
10085
|
/**
|
|
8734
10086
|
* @description Template locale (BCP 47).
|
|
8735
10087
|
* @example pt-PT
|
|
@@ -8860,7 +10212,7 @@ interface operations {
|
|
|
8860
10212
|
* @description Template channel.
|
|
8861
10213
|
* @example inbox
|
|
8862
10214
|
*/
|
|
8863
|
-
channel: "inbox" | "email" | "push" | "webpush";
|
|
10215
|
+
channel: "inbox" | "email" | "push" | "webpush" | "webhook";
|
|
8864
10216
|
/**
|
|
8865
10217
|
* @description Template locale (BCP 47).
|
|
8866
10218
|
* @example pt-PT
|
|
@@ -8959,7 +10311,7 @@ interface operations {
|
|
|
8959
10311
|
* @description Template channel.
|
|
8960
10312
|
* @example inbox
|
|
8961
10313
|
*/
|
|
8962
|
-
channel: "inbox" | "email" | "push" | "webpush";
|
|
10314
|
+
channel: "inbox" | "email" | "push" | "webpush" | "webhook";
|
|
8963
10315
|
/**
|
|
8964
10316
|
* @description Template locale (BCP 47).
|
|
8965
10317
|
* @example pt-PT
|
|
@@ -9064,7 +10416,7 @@ interface operations {
|
|
|
9064
10416
|
* @description Template channel.
|
|
9065
10417
|
* @example inbox
|
|
9066
10418
|
*/
|
|
9067
|
-
channel: "inbox" | "email" | "push" | "webpush";
|
|
10419
|
+
channel: "inbox" | "email" | "push" | "webpush" | "webhook";
|
|
9068
10420
|
/**
|
|
9069
10421
|
* @description Template locale (BCP 47).
|
|
9070
10422
|
* @example pt-PT
|
|
@@ -9370,7 +10722,7 @@ interface operations {
|
|
|
9370
10722
|
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
9371
10723
|
};
|
|
9372
10724
|
};
|
|
9373
|
-
/** @description `RECIPIENT_NOT_FOUND`: no recipient can be notified (`details.skipped` lists why); `NOTIFICATION_TYPE_ARCHIVED`; `TEMPLATE_MISSING`: no template for any requested channel; `SEND_AT_OUT_OF_RANGE`; `BATCHED_TYPE_NOT_SCHEDULABLE`: the type batches (send it now); `UNSAFE_URL`; `VALIDATION_ERROR`: a channel outside the type's routing. */
|
|
10725
|
+
/** @description `RECIPIENT_NOT_FOUND`: no recipient can be notified (`details.skipped` lists why); `NOTIFICATION_TYPE_ARCHIVED`; `TEMPLATE_MISSING`: no template for any requested channel; `SEND_AT_OUT_OF_RANGE`; `BATCHED_TYPE_NOT_SCHEDULABLE`: the type batches (send it now); `APPROVAL_TYPE_SEND_REFUSED`: an approval type, sent with `POST /approvals`; `UNSAFE_URL`; `VALIDATION_ERROR`: a channel outside the type's routing. */
|
|
9374
10726
|
422: {
|
|
9375
10727
|
headers: {
|
|
9376
10728
|
"X-Request-Id": components["headers"]["RequestId"];
|
|
@@ -12519,7 +13871,7 @@ interface operations {
|
|
|
12519
13871
|
* "notification.accepted"
|
|
12520
13872
|
* ]
|
|
12521
13873
|
*/
|
|
12522
|
-
type?: ("notification.accepted" | "delivery.sent" | "delivery.delivered" | "delivery.failed" | "delivery.bounced" | "delivery.skipped" | "inbox_item.read" | "inbox_item.archived" | "inbox_item.interacted" | "device.pruned" | "device.moved" | "credential.invalid" | "email.auto_paused" | "recipient.deleted")[];
|
|
13874
|
+
type?: ("notification.accepted" | "delivery.sent" | "delivery.delivered" | "delivery.failed" | "delivery.bounced" | "delivery.skipped" | "inbox_item.read" | "inbox_item.archived" | "inbox_item.interacted" | "device.pruned" | "device.moved" | "credential.invalid" | "email.auto_paused" | "recipient.deleted" | "notification.webhook" | "approval.resolved")[];
|
|
12523
13875
|
/**
|
|
12524
13876
|
* @description Only events sent (or queued) to this endpoint.
|
|
12525
13877
|
* @example 3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
|
|
@@ -12905,6 +14257,42 @@ type NotificationStatus = components["schemas"]["NotificationStatus"];
|
|
|
12905
14257
|
declare const NotificationStatus: {
|
|
12906
14258
|
values: readonly ["scheduled", "accepted", "planned", "cancelled"];
|
|
12907
14259
|
};
|
|
14260
|
+
type NotifyApprovalDecidedVia = components["schemas"]["NotifyApprovalDecidedVia"];
|
|
14261
|
+
declare const NotifyApprovalDecidedVia: {
|
|
14262
|
+
values: readonly ["inbox", "hosted_page", "api", "timeout"];
|
|
14263
|
+
};
|
|
14264
|
+
type NotifyApprovalDecision = components["schemas"]["NotifyApprovalDecision"];
|
|
14265
|
+
declare const NotifyApprovalDecision: {
|
|
14266
|
+
values: readonly ["approve", "reject"];
|
|
14267
|
+
};
|
|
14268
|
+
type NotifyApprovalOutcome = components["schemas"]["NotifyApprovalOutcome"];
|
|
14269
|
+
declare const NotifyApprovalOutcome: {
|
|
14270
|
+
values: readonly ["approved", "rejected", "expired", "cancelled"];
|
|
14271
|
+
};
|
|
14272
|
+
type NotifyApprovalOutcomeVia = components["schemas"]["NotifyApprovalOutcomeVia"];
|
|
14273
|
+
declare const NotifyApprovalOutcomeVia: {
|
|
14274
|
+
values: readonly ["inbox", "hosted_page", "api", "timeout"];
|
|
14275
|
+
};
|
|
14276
|
+
type NotifyApprovalReasonPolicy = components["schemas"]["NotifyApprovalReasonPolicy"];
|
|
14277
|
+
declare const NotifyApprovalReasonPolicy: {
|
|
14278
|
+
values: readonly ["optional", "required_on_reject", "required"];
|
|
14279
|
+
};
|
|
14280
|
+
type NotifyApprovalRequesterKind = components["schemas"]["NotifyApprovalRequesterKind"];
|
|
14281
|
+
declare const NotifyApprovalRequesterKind: {
|
|
14282
|
+
values: readonly ["agent", "service", "user"];
|
|
14283
|
+
};
|
|
14284
|
+
type NotifyApprovalRequesterViewKind = components["schemas"]["NotifyApprovalRequesterViewKind"];
|
|
14285
|
+
declare const NotifyApprovalRequesterViewKind: {
|
|
14286
|
+
values: readonly ["agent", "service", "user", "api_key"];
|
|
14287
|
+
};
|
|
14288
|
+
type NotifyApprovalStatus = components["schemas"]["NotifyApprovalStatus"];
|
|
14289
|
+
declare const NotifyApprovalStatus: {
|
|
14290
|
+
values: readonly ["pending", "approved", "rejected", "expired", "cancelled"];
|
|
14291
|
+
};
|
|
14292
|
+
type NotifyApprovalTimeoutOutcome = components["schemas"]["NotifyApprovalTimeoutOutcome"];
|
|
14293
|
+
declare const NotifyApprovalTimeoutOutcome: {
|
|
14294
|
+
values: readonly ["expired", "approved", "rejected"];
|
|
14295
|
+
};
|
|
12908
14296
|
type NotifyBatchInboxMode = components["schemas"]["NotifyBatchInboxMode"];
|
|
12909
14297
|
declare const NotifyBatchInboxMode: {
|
|
12910
14298
|
values: readonly ["collapse", "each"];
|
|
@@ -12919,7 +14307,7 @@ declare const NotifyBatchState: {
|
|
|
12919
14307
|
};
|
|
12920
14308
|
type NotifyChannel = components["schemas"]["NotifyChannel"];
|
|
12921
14309
|
declare const NotifyChannel: {
|
|
12922
|
-
values: readonly ["inbox", "email", "push", "webpush"];
|
|
14310
|
+
values: readonly ["inbox", "email", "push", "webpush", "webhook"];
|
|
12923
14311
|
};
|
|
12924
14312
|
/**
|
|
12925
14313
|
* Why a delivery was skipped, held, retried or failed. Open enum: new reasons may be added.
|
|
@@ -12986,7 +14374,7 @@ declare const NotifyStatsChannel: {
|
|
|
12986
14374
|
};
|
|
12987
14375
|
type NotifyWebhookChannel = components["schemas"]["NotifyWebhookChannel"];
|
|
12988
14376
|
declare const NotifyWebhookChannel: {
|
|
12989
|
-
values: readonly ["inbox", "email", "push", "webpush"];
|
|
14377
|
+
values: readonly ["inbox", "email", "push", "webpush", "webhook"];
|
|
12990
14378
|
};
|
|
12991
14379
|
type NotifyWebhookCredentialProvider = components["schemas"]["NotifyWebhookCredentialProvider"];
|
|
12992
14380
|
declare const NotifyWebhookCredentialProvider: {
|
|
@@ -13057,10 +14445,22 @@ declare const WebhookEventStatus: {
|
|
|
13057
14445
|
*/
|
|
13058
14446
|
type WebhookEventType = components["schemas"]["WebhookEventType"];
|
|
13059
14447
|
declare const WebhookEventType: {
|
|
13060
|
-
values: readonly ["notification.accepted", "delivery.sent", "delivery.delivered", "delivery.failed", "delivery.bounced", "delivery.skipped", "inbox_item.read", "inbox_item.archived", "inbox_item.interacted", "device.pruned", "device.moved", "credential.invalid", "email.auto_paused", "recipient.deleted"];
|
|
14448
|
+
values: readonly ["notification.accepted", "delivery.sent", "delivery.delivered", "delivery.failed", "delivery.bounced", "delivery.skipped", "inbox_item.read", "inbox_item.archived", "inbox_item.interacted", "device.pruned", "device.moved", "credential.invalid", "email.auto_paused", "recipient.deleted", "notification.webhook", "approval.resolved"];
|
|
13061
14449
|
};
|
|
13062
14450
|
interface ApnsCredential extends Open<components["schemas"]["ApnsCredentialDto"]> {
|
|
13063
14451
|
}
|
|
14452
|
+
interface ApprovalConfigView extends Open<components["schemas"]["ApprovalConfigViewDto"]> {
|
|
14453
|
+
}
|
|
14454
|
+
interface ApprovalDetail extends Open<components["schemas"]["ApprovalDetailDto"]> {
|
|
14455
|
+
}
|
|
14456
|
+
interface Approval extends Open<components["schemas"]["ApprovalDto"]> {
|
|
14457
|
+
}
|
|
14458
|
+
interface ApprovalEvent extends Open<components["schemas"]["ApprovalEventDto"]> {
|
|
14459
|
+
}
|
|
14460
|
+
interface ApprovalList extends Open<components["schemas"]["ApprovalListResponseDto"]> {
|
|
14461
|
+
}
|
|
14462
|
+
interface ApprovalRequesterView extends Open<components["schemas"]["ApprovalRequesterViewDto"]> {
|
|
14463
|
+
}
|
|
13064
14464
|
interface BatchDelivery extends Open<components["schemas"]["BatchDeliveryDto"]> {
|
|
13065
14465
|
}
|
|
13066
14466
|
interface BatchDetail extends Open<components["schemas"]["BatchDetailDto"]> {
|
|
@@ -13159,6 +14559,10 @@ interface NotificationType extends Open<components["schemas"]["NotificationTypeD
|
|
|
13159
14559
|
}
|
|
13160
14560
|
interface NotificationTypeList extends Open<components["schemas"]["NotificationTypeListResponseDto"]> {
|
|
13161
14561
|
}
|
|
14562
|
+
interface NotifyApprovalRequester extends Open<components["schemas"]["NotifyApprovalRequesterDto"]> {
|
|
14563
|
+
}
|
|
14564
|
+
interface NotifyApprovalResolvedData extends Open<components["schemas"]["NotifyApprovalResolvedDataDto"]> {
|
|
14565
|
+
}
|
|
13162
14566
|
interface NotifyBrandingView extends Open<components["schemas"]["NotifyBrandingViewDto"]> {
|
|
13163
14567
|
}
|
|
13164
14568
|
interface NotifyCredentialInvalidData extends Open<components["schemas"]["NotifyCredentialInvalidDataDto"]> {
|
|
@@ -13173,6 +14577,8 @@ interface NotifyInboxItemEventData extends Open<components["schemas"]["NotifyInb
|
|
|
13173
14577
|
}
|
|
13174
14578
|
interface NotifyNotificationAcceptedData extends Open<components["schemas"]["NotifyNotificationAcceptedDataDto"]> {
|
|
13175
14579
|
}
|
|
14580
|
+
interface NotifyNotificationWebhookData extends Open<components["schemas"]["NotifyNotificationWebhookDataDto"]> {
|
|
14581
|
+
}
|
|
13176
14582
|
interface NotifyRecipientDeletedData extends Open<components["schemas"]["NotifyRecipientDeletedDataDto"]> {
|
|
13177
14583
|
}
|
|
13178
14584
|
interface NotifySettings extends Open<components["schemas"]["NotifySettingsDto"]> {
|
|
@@ -13183,6 +14589,8 @@ interface NotifyStatsDay extends Open<components["schemas"]["NotifyStatsDayDto"]
|
|
|
13183
14589
|
}
|
|
13184
14590
|
interface NotifyStats extends Open<components["schemas"]["NotifyStatsResponseDto"]> {
|
|
13185
14591
|
}
|
|
14592
|
+
interface NotifyWebhookChannelRendered extends Open<components["schemas"]["NotifyWebhookChannelRenderedDto"]> {
|
|
14593
|
+
}
|
|
13186
14594
|
interface NotifyWebhookRecipient extends Open<components["schemas"]["NotifyWebhookRecipientDto"]> {
|
|
13187
14595
|
}
|
|
13188
14596
|
interface Pagination extends Open<components["schemas"]["PaginationDto"]> {
|
|
@@ -13271,6 +14679,8 @@ interface WebhookEventTypeInfo extends Open<components["schemas"]["WebhookEventT
|
|
|
13271
14679
|
}
|
|
13272
14680
|
interface WebhookPagination extends Open<components["schemas"]["WebhookPaginationDto"]> {
|
|
13273
14681
|
}
|
|
14682
|
+
/** Params for `me.approvals.decide` (POST /v1/client/approvals/{approval_id}/decision). */
|
|
14683
|
+
type MeApprovalDecideParams = NonNullable<paths["/v1/client/approvals/{approval_id}/decision"]["post"]["requestBody"]>["content"]["application/json"];
|
|
13274
14684
|
/** Params for `me.devices.register` (POST /v1/client/devices). */
|
|
13275
14685
|
type MeDeviceRegisterParams = NonNullable<paths["/v1/client/devices"]["post"]["requestBody"]>["content"]["application/json"];
|
|
13276
14686
|
/** Params for `me.inbox.list` (GET /v1/client/inbox). */
|
|
@@ -13281,6 +14691,14 @@ type MeInboxMarkParams = NonNullable<paths["/v1/client/inbox/mark"]["post"]["req
|
|
|
13281
14691
|
type MeInboxInteractParams = NonNullable<paths["/v1/client/inbox/{item_id}/interact"]["post"]["requestBody"]>["content"]["application/json"];
|
|
13282
14692
|
/** Params for `me.preferences.update` (PATCH /v1/client/preferences). */
|
|
13283
14693
|
type MePreferenceUpdateParams = NonNullable<paths["/v1/client/preferences"]["patch"]["requestBody"]>["content"]["application/json"];
|
|
14694
|
+
/** Params for `approvals.list` (GET /v1/workspaces/{workspace_id}/approvals). */
|
|
14695
|
+
type ApprovalListParams = NonNullable<paths["/v1/workspaces/{workspace_id}/approvals"]["get"]["parameters"]["query"]>;
|
|
14696
|
+
/** Params for `approvals.create` (POST /v1/workspaces/{workspace_id}/approvals). */
|
|
14697
|
+
type ApprovalCreateParams = NonNullable<paths["/v1/workspaces/{workspace_id}/approvals"]["post"]["requestBody"]>["content"]["application/json"];
|
|
14698
|
+
/** Params for `approvals.retrieve` (GET /v1/workspaces/{workspace_id}/approvals/{approval_id}). */
|
|
14699
|
+
type ApprovalRetrieveParams = NonNullable<paths["/v1/workspaces/{workspace_id}/approvals/{approval_id}"]["get"]["parameters"]["query"]>;
|
|
14700
|
+
/** Params for `approvals.recordDecision` (POST /v1/workspaces/{workspace_id}/approvals/{approval_id}/decision). */
|
|
14701
|
+
type ApprovalRecordDecisionParams = NonNullable<paths["/v1/workspaces/{workspace_id}/approvals/{approval_id}/decision"]["post"]["requestBody"]>["content"]["application/json"];
|
|
13284
14702
|
/** Params for `batches.list` (GET /v1/workspaces/{workspace_id}/batches). */
|
|
13285
14703
|
type BatchListParams = NonNullable<paths["/v1/workspaces/{workspace_id}/batches"]["get"]["parameters"]["query"]>;
|
|
13286
14704
|
/** Params for `categories.list` (GET /v1/workspaces/{workspace_id}/categories). */
|
|
@@ -13362,6 +14780,14 @@ type WebhookEventReplayParams = NonNullable<paths["/v1/workspaces/{workspace_id}
|
|
|
13362
14780
|
|
|
13363
14781
|
/** Compile-time marker for event types this SDK does not know. Never a runtime value. */
|
|
13364
14782
|
declare const UnknownWebhookEventType: unique symbol;
|
|
14783
|
+
/**
|
|
14784
|
+
* `approval.resolved`: An approval request ended: an approver approved or rejected it (with their reason), nobody answered in time (`decided_via: timeout`), or the requester cancelled it. Sent once per request. Your `metadata` comes back unchanged, so you can resume the action you asked about.
|
|
14785
|
+
*
|
|
14786
|
+
* A `approval.resolved` event (Approvals), POSTed as JSON to every enabled endpoint subscribed to it and signed with the Standard Webhooks headers. Answer with any 2xx within 15 s to acknowledge it; anything else, or no answer, is retried after 1 min, 5 min, 30 min, 2 h, 6 h, 24 h.
|
|
14787
|
+
*/
|
|
14788
|
+
type ApprovalResolvedEvent = Open<components["schemas"]["ApprovalResolvedEvent"]> & {
|
|
14789
|
+
type: "approval.resolved";
|
|
14790
|
+
};
|
|
13365
14791
|
/**
|
|
13366
14792
|
* `credential.invalid`: Apple or Google refused an APNs key or FCM service account. Push through it stops until you upload a working one.
|
|
13367
14793
|
*
|
|
@@ -13466,6 +14892,14 @@ type InboxItemReadEvent = Open<components["schemas"]["InboxItemReadEvent"]> & {
|
|
|
13466
14892
|
type NotificationAcceptedEvent = Open<components["schemas"]["NotificationAcceptedEvent"]> & {
|
|
13467
14893
|
type: "notification.accepted";
|
|
13468
14894
|
};
|
|
14895
|
+
/**
|
|
14896
|
+
* `notification.webhook`: The webhook channel (tasks/notify-api/025): a notification type that routes to `webhook` delivers here, once per recipient. Unlike the other events it carries the send's `data` and the rendered webhook template, because it is a channel you configured. Filter an endpoint by `type_key` to receive only some types.
|
|
14897
|
+
*
|
|
14898
|
+
* A `notification.webhook` event (Notifications), POSTed as JSON to every enabled endpoint subscribed to it and signed with the Standard Webhooks headers. Answer with any 2xx within 15 s to acknowledge it; anything else, or no answer, is retried after 1 min, 5 min, 30 min, 2 h, 6 h, 24 h.
|
|
14899
|
+
*/
|
|
14900
|
+
type NotificationWebhookEvent = Open<components["schemas"]["NotificationWebhookEvent"]> & {
|
|
14901
|
+
type: "notification.webhook";
|
|
14902
|
+
};
|
|
13469
14903
|
/**
|
|
13470
14904
|
* `recipient.deleted`: A recipient was erased with their devices, preferences and inbox. Carries your id for them only.
|
|
13471
14905
|
*
|
|
@@ -13484,7 +14918,7 @@ interface UnknownWebhookEvent {
|
|
|
13484
14918
|
readonly [key: string]: unknown;
|
|
13485
14919
|
}
|
|
13486
14920
|
/** Every event `webhooks.unwrap` can return: the known payloads, then `UnknownWebhookEvent`. */
|
|
13487
|
-
type UnwrapWebhookEvent = CredentialInvalidEvent | DeliveryBouncedEvent | DeliveryDeliveredEvent | DeliveryFailedEvent | DeliverySentEvent | DeliverySkippedEvent | DeviceMovedEvent | DevicePrunedEvent | EmailAutoPausedEvent | InboxItemArchivedEvent | InboxItemInteractedEvent | InboxItemReadEvent | NotificationAcceptedEvent | RecipientDeletedEvent | UnknownWebhookEvent;
|
|
14921
|
+
type UnwrapWebhookEvent = ApprovalResolvedEvent | CredentialInvalidEvent | DeliveryBouncedEvent | DeliveryDeliveredEvent | DeliveryFailedEvent | DeliverySentEvent | DeliverySkippedEvent | DeviceMovedEvent | DevicePrunedEvent | EmailAutoPausedEvent | InboxItemArchivedEvent | InboxItemInteractedEvent | InboxItemReadEvent | NotificationAcceptedEvent | NotificationWebhookEvent | RecipientDeletedEvent | UnknownWebhookEvent;
|
|
13488
14922
|
interface WebhookUnwrapParams {
|
|
13489
14923
|
/** The raw request body (string or bytes). A parsed object throws: the signature covers the exact bytes. */
|
|
13490
14924
|
payload: WebhookPayload;
|
|
@@ -13514,6 +14948,131 @@ declare class APIResource {
|
|
|
13514
14948
|
protected readonly _b: Bound;
|
|
13515
14949
|
constructor(client: APIClient, bound?: Bound);
|
|
13516
14950
|
}
|
|
14951
|
+
/** `approvals` */
|
|
14952
|
+
declare class ApprovalsResource extends APIResource {
|
|
14953
|
+
/**
|
|
14954
|
+
* Cancel an approval request
|
|
14955
|
+
*
|
|
14956
|
+
* Withdraws a pending request: approvers see it as cancelled, nothing more is sent, and `approval.resolved` fires with `status: cancelled`. Takes no Idempotency-Key: cancelling twice is a 409 the second time.
|
|
14957
|
+
*
|
|
14958
|
+
* Credential: `bearer`.
|
|
14959
|
+
*
|
|
14960
|
+
* @param approvalId - The approval request id.
|
|
14961
|
+
* @param options - Per-request options.
|
|
14962
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED, RECIPIENT_TOKEN_INVALID: Missing, expired, revoked or invalid bearer token (`UNAUTHORIZED`): send a workspace API key or a console session as `Authorization: Bearer <token>`. A recipient token is refused here with `RECIPIENT_TOKEN_INVALID`: it works only on the client API (`/v1/client/…`).
|
|
14963
|
+
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action, or the workspace has not enabled Notify (`SERVICE_NOT_ENABLED`). Also `FORBIDDEN` when the credential belongs to another workspace than the URL names, or the URL uses the workspace slug instead of its id (a UUID).
|
|
14964
|
+
* @throws {NotFoundError} 404 NOT_FOUND, APPROVAL_NOT_FOUND: `APPROVAL_NOT_FOUND`: no approval request with this id in this workspace.
|
|
14965
|
+
* @throws {ConflictError} 409 CONFLICT, APPROVAL_NOT_PENDING: `APPROVAL_NOT_PENDING`: it was already answered, expired or cancelled.
|
|
14966
|
+
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
14967
|
+
* @see POST /v1/workspaces/{workspace_id}/approvals/{approval_id}/cancel
|
|
14968
|
+
* @see https://productcraft.co/docs/notify/api-reference#post-v1-workspaces-workspace-id-approvals-approval-id-cancel
|
|
14969
|
+
* @example
|
|
14970
|
+
* ```ts
|
|
14971
|
+
* const approval = await notify.approvals.cancel("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
14972
|
+
* ```
|
|
14973
|
+
*/
|
|
14974
|
+
cancel(approvalId: string, options?: RequestOptions): APIPromise<WithLastResponse<Approval>>;
|
|
14975
|
+
/**
|
|
14976
|
+
* Request an approval
|
|
14977
|
+
*
|
|
14978
|
+
* Asks one or more people a yes/no question on the type's channels and records the first answer. In the inbox the item gets Approve and Reject buttons (or render it with `<NotifyApproval/>`); emails and pushes carry a signed link per approver (`approval.url`, `approval.approve_url`, `approval.reject_url`) to a hosted page that needs no sign-in. The answer arrives as the signed `approval.resolved` webhook and on `GET /approvals/{approval_id}`. Nobody answered by `expires_at`: the type's `timeout_outcome` applies (default `expired`). Pass `wait_seconds` (up to 15) to wait for the answer in this call. The type must have `approval` set; its notifications can only be sent here. An `Idempotency-Key` is required: the same key and body return the same request (200), a different body is a 409.
|
|
14979
|
+
*
|
|
14980
|
+
* Credential: `bearer`.
|
|
14981
|
+
*
|
|
14982
|
+
* @param params - `Notify.ApprovalCreateParams`.
|
|
14983
|
+
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
14984
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, IDEMPOTENCY_KEY_REQUIRED: `IDEMPOTENCY_KEY_REQUIRED`; `VALIDATION_ERROR`: a field is invalid.
|
|
14985
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED, RECIPIENT_TOKEN_INVALID: Missing, expired, revoked or invalid bearer token (`UNAUTHORIZED`): send a workspace API key or a console session as `Authorization: Bearer <token>`. A recipient token is refused here with `RECIPIENT_TOKEN_INVALID`: it works only on the client API (`/v1/client/…`).
|
|
14986
|
+
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action, or the workspace has not enabled Notify (`SERVICE_NOT_ENABLED`). Also `FORBIDDEN` when the credential belongs to another workspace than the URL names, or the URL uses the workspace slug instead of its id (a UUID).
|
|
14987
|
+
* @throws {NotFoundError} 404 NOT_FOUND, NOTIFICATION_TYPE_NOT_FOUND: `NOTIFICATION_TYPE_NOT_FOUND`: no type with this key.
|
|
14988
|
+
* @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `IDEMPOTENCY_KEY_REUSE`: the key was used with a different body. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).
|
|
14989
|
+
* @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, NOT_AN_APPROVAL_TYPE, NOTIFICATION_TYPE_ARCHIVED, RECIPIENT_NOT_FOUND: `NOT_AN_APPROVAL_TYPE`: the type has no `approval`; `NOTIFICATION_TYPE_ARCHIVED`; `RECIPIENT_NOT_FOUND`: an approver is not a recipient (`details.missing`).
|
|
14990
|
+
* @throws {RateLimitError} 429 RATE_LIMITED: `RATE_LIMITED`: over the workspace send limit; see `Retry-After`. Per-IP limit: more than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
14991
|
+
* @see POST /v1/workspaces/{workspace_id}/approvals
|
|
14992
|
+
* @see https://productcraft.co/docs/notify/api-reference#post-v1-workspaces-workspace-id-approvals
|
|
14993
|
+
* @example
|
|
14994
|
+
* ```ts
|
|
14995
|
+
* const approval = await notify.approvals.create({
|
|
14996
|
+
* approvers: ["user_123"],
|
|
14997
|
+
* title: "Deploy api v2.14 to production?",
|
|
14998
|
+
* type: "deploy.approval",
|
|
14999
|
+
* });
|
|
15000
|
+
* ```
|
|
15001
|
+
*/
|
|
15002
|
+
create(params: ApprovalCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<Approval>>;
|
|
15003
|
+
/**
|
|
15004
|
+
* List approval requests
|
|
15005
|
+
*
|
|
15006
|
+
* Newest first; filter by `status` and `type`. Pass `next_cursor` as `cursor` until `has_more` is false.
|
|
15007
|
+
*
|
|
15008
|
+
* Credential: `bearer`.
|
|
15009
|
+
*
|
|
15010
|
+
* @param params - `Notify.ApprovalListParams`.
|
|
15011
|
+
* @param options - Per-request options.
|
|
15012
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR` on a bad filter, or `BAD_REQUEST`: invalid cursor.
|
|
15013
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED, RECIPIENT_TOKEN_INVALID: Missing, expired, revoked or invalid bearer token (`UNAUTHORIZED`): send a workspace API key or a console session as `Authorization: Bearer <token>`. A recipient token is refused here with `RECIPIENT_TOKEN_INVALID`: it works only on the client API (`/v1/client/…`).
|
|
15014
|
+
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action, or the workspace has not enabled Notify (`SERVICE_NOT_ENABLED`). Also `FORBIDDEN` when the credential belongs to another workspace than the URL names, or the URL uses the workspace slug instead of its id (a UUID).
|
|
15015
|
+
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
15016
|
+
* @see GET /v1/workspaces/{workspace_id}/approvals
|
|
15017
|
+
* @see https://productcraft.co/docs/notify/api-reference#get-v1-workspaces-workspace-id-approvals
|
|
15018
|
+
* @example
|
|
15019
|
+
* ```ts
|
|
15020
|
+
* for await (const approval of notify.approvals.list()) {
|
|
15021
|
+
* console.log(approval);
|
|
15022
|
+
* }
|
|
15023
|
+
* const page = await notify.approvals.list({}, { timeout: 5_000 });
|
|
15024
|
+
* ```
|
|
15025
|
+
*/
|
|
15026
|
+
list(params?: ApprovalListParams, options?: RequestOptions): PagePromise<Approval>;
|
|
15027
|
+
/**
|
|
15028
|
+
* Record an approver's answer
|
|
15029
|
+
*
|
|
15030
|
+
* For answers you collected yourself (your own UI, a phone call): records `approve` or `reject` for one of the approvers, exactly as if they had pressed the button (`decided_via: api`). Never give this to the agent that made the request: it is how a human's answer gets in, so it is not an MCP tool.
|
|
15031
|
+
*
|
|
15032
|
+
* Credential: `bearer`.
|
|
15033
|
+
*
|
|
15034
|
+
* @param approvalId - The approval request id.
|
|
15035
|
+
* @param params - `Notify.ApprovalRecordDecisionParams`.
|
|
15036
|
+
* @param options - Per-request options.
|
|
15037
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: a field is invalid.
|
|
15038
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED, RECIPIENT_TOKEN_INVALID: Missing, expired, revoked or invalid bearer token (`UNAUTHORIZED`): send a workspace API key or a console session as `Authorization: Bearer <token>`. A recipient token is refused here with `RECIPIENT_TOKEN_INVALID`: it works only on the client API (`/v1/client/…`).
|
|
15039
|
+
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action, or the workspace has not enabled Notify (`SERVICE_NOT_ENABLED`). Also `FORBIDDEN` when the credential belongs to another workspace than the URL names, or the URL uses the workspace slug instead of its id (a UUID).
|
|
15040
|
+
* @throws {NotFoundError} 404 NOT_FOUND, APPROVAL_NOT_FOUND, RECIPIENT_NOT_FOUND: `APPROVAL_NOT_FOUND`, or `RECIPIENT_NOT_FOUND`: no recipient with that external id.
|
|
15041
|
+
* @throws {ConflictError} 409 CONFLICT, APPROVAL_NOT_PENDING: `APPROVAL_NOT_PENDING`: already answered, expired or cancelled.
|
|
15042
|
+
* @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, NOT_AN_APPROVER, APPROVAL_REASON_REQUIRED: `NOT_AN_APPROVER`: that recipient was not asked; `APPROVAL_REASON_REQUIRED`: the type needs a reason.
|
|
15043
|
+
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
15044
|
+
* @see POST /v1/workspaces/{workspace_id}/approvals/{approval_id}/decision
|
|
15045
|
+
* @see https://productcraft.co/docs/notify/api-reference#post-v1-workspaces-workspace-id-approvals-approval-id-decision
|
|
15046
|
+
* @example
|
|
15047
|
+
* ```ts
|
|
15048
|
+
* const approval = await notify.approvals.recordDecision("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { approver: "user_123", decision: "approve" });
|
|
15049
|
+
* ```
|
|
15050
|
+
*/
|
|
15051
|
+
recordDecision(approvalId: string, params: ApprovalRecordDecisionParams, options?: RequestOptions): APIPromise<WithLastResponse<Approval>>;
|
|
15052
|
+
/**
|
|
15053
|
+
* Get an approval request
|
|
15054
|
+
*
|
|
15055
|
+
* Its status, the answer (who, when, why, from where) and its trail. With `wait_seconds` (up to 15) a pending request is long-polled: the call returns as soon as someone answers, or after that many seconds.
|
|
15056
|
+
*
|
|
15057
|
+
* Credential: `bearer`.
|
|
15058
|
+
*
|
|
15059
|
+
* @param approvalId - The approval request id.
|
|
15060
|
+
* @param params - `Notify.ApprovalRetrieveParams`.
|
|
15061
|
+
* @param options - Per-request options.
|
|
15062
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: `wait_seconds` out of range.
|
|
15063
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED, RECIPIENT_TOKEN_INVALID: Missing, expired, revoked or invalid bearer token (`UNAUTHORIZED`): send a workspace API key or a console session as `Authorization: Bearer <token>`. A recipient token is refused here with `RECIPIENT_TOKEN_INVALID`: it works only on the client API (`/v1/client/…`).
|
|
15064
|
+
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action, or the workspace has not enabled Notify (`SERVICE_NOT_ENABLED`). Also `FORBIDDEN` when the credential belongs to another workspace than the URL names, or the URL uses the workspace slug instead of its id (a UUID).
|
|
15065
|
+
* @throws {NotFoundError} 404 NOT_FOUND, APPROVAL_NOT_FOUND: `APPROVAL_NOT_FOUND`: no approval request with this id in this workspace.
|
|
15066
|
+
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
15067
|
+
* @see GET /v1/workspaces/{workspace_id}/approvals/{approval_id}
|
|
15068
|
+
* @see https://productcraft.co/docs/notify/api-reference#get-v1-workspaces-workspace-id-approvals-approval-id
|
|
15069
|
+
* @example
|
|
15070
|
+
* ```ts
|
|
15071
|
+
* const approvalDetail = await notify.approvals.retrieve("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
15072
|
+
* ```
|
|
15073
|
+
*/
|
|
15074
|
+
retrieve(approvalId: string, params?: ApprovalRetrieveParams, options?: RequestOptions): APIPromise<WithLastResponse<ApprovalDetail>>;
|
|
15075
|
+
}
|
|
13517
15076
|
/** `batches` */
|
|
13518
15077
|
declare class BatchesResource extends APIResource {
|
|
13519
15078
|
/**
|
|
@@ -13991,7 +15550,7 @@ declare class NotificationTypesTemplatesResource extends APIResource {
|
|
|
13991
15550
|
* await notify.notificationTypes.templates.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", "inbox", "pt-PT");
|
|
13992
15551
|
* ```
|
|
13993
15552
|
*/
|
|
13994
|
-
delete(typeId: string, channel: "inbox" | "email" | "push" | "webpush", locale: string, options?: RequestOptions): APIPromise<void>;
|
|
15553
|
+
delete(typeId: string, channel: "inbox" | "email" | "push" | "webpush" | "webhook", locale: string, options?: RequestOptions): APIPromise<void>;
|
|
13995
15554
|
/**
|
|
13996
15555
|
* Get a template
|
|
13997
15556
|
*
|
|
@@ -14013,7 +15572,7 @@ declare class NotificationTypesTemplatesResource extends APIResource {
|
|
|
14013
15572
|
* const template = await notify.notificationTypes.templates.retrieve("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", "inbox", "pt-PT");
|
|
14014
15573
|
* ```
|
|
14015
15574
|
*/
|
|
14016
|
-
retrieve(typeId: string, channel: "inbox" | "email" | "push" | "webpush", locale: string, options?: RequestOptions): APIPromise<WithLastResponse<Template>>;
|
|
15575
|
+
retrieve(typeId: string, channel: "inbox" | "email" | "push" | "webpush" | "webhook", locale: string, options?: RequestOptions): APIPromise<WithLastResponse<Template>>;
|
|
14017
15576
|
/**
|
|
14018
15577
|
* Revert a template
|
|
14019
15578
|
*
|
|
@@ -14038,7 +15597,7 @@ declare class NotificationTypesTemplatesResource extends APIResource {
|
|
|
14038
15597
|
* const template = await notify.notificationTypes.templates.revert("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", "inbox", "pt-PT", { version: 1 });
|
|
14039
15598
|
* ```
|
|
14040
15599
|
*/
|
|
14041
|
-
revert(typeId: string, channel: "inbox" | "email" | "push" | "webpush", locale: string, params: NotificationTypeTemplateRevertParams, options?: RequestOptions): APIPromise<WithLastResponse<Template>>;
|
|
15600
|
+
revert(typeId: string, channel: "inbox" | "email" | "push" | "webpush" | "webhook", locale: string, params: NotificationTypeTemplateRevertParams, options?: RequestOptions): APIPromise<WithLastResponse<Template>>;
|
|
14042
15601
|
/**
|
|
14043
15602
|
* Create or replace a template
|
|
14044
15603
|
*
|
|
@@ -14064,7 +15623,7 @@ declare class NotificationTypesTemplatesResource extends APIResource {
|
|
|
14064
15623
|
* const template = await notify.notificationTypes.templates.update("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", "inbox", "pt-PT", { body: { body: "We received **{{amount}}**.", title: "Invoice {{invoice_id}} paid" } });
|
|
14065
15624
|
* ```
|
|
14066
15625
|
*/
|
|
14067
|
-
update(typeId: string, channel: "inbox" | "email" | "push" | "webpush", locale: string, params: NotificationTypeTemplateUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<Template>>;
|
|
15626
|
+
update(typeId: string, channel: "inbox" | "email" | "push" | "webpush" | "webhook", locale: string, params: NotificationTypeTemplateUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<Template>>;
|
|
14068
15627
|
/**
|
|
14069
15628
|
* List a template's versions
|
|
14070
15629
|
*
|
|
@@ -14088,7 +15647,7 @@ declare class NotificationTypesTemplatesResource extends APIResource {
|
|
|
14088
15647
|
* const templateVersionList = await notify.notificationTypes.templates.versions("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", "inbox", "pt-PT");
|
|
14089
15648
|
* ```
|
|
14090
15649
|
*/
|
|
14091
|
-
versions(typeId: string, channel: "inbox" | "email" | "push" | "webpush", locale: string, options?: RequestOptions): APIPromise<WithLastResponse<TemplateVersionList>>;
|
|
15650
|
+
versions(typeId: string, channel: "inbox" | "email" | "push" | "webpush" | "webhook", locale: string, options?: RequestOptions): APIPromise<WithLastResponse<TemplateVersionList>>;
|
|
14092
15651
|
}
|
|
14093
15652
|
/** `notificationTypes` */
|
|
14094
15653
|
declare class NotificationTypesResource extends APIResource {
|
|
@@ -14248,16 +15807,7 @@ declare class NotificationTypesResource extends APIResource {
|
|
|
14248
15807
|
* @example
|
|
14249
15808
|
* ```ts
|
|
14250
15809
|
* const notificationType = await notify.notificationTypes.update("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", {
|
|
14251
|
-
*
|
|
14252
|
-
* inbox: "collapse",
|
|
14253
|
-
* key: "post_id",
|
|
14254
|
-
* max_items: 10,
|
|
14255
|
-
* max_window_seconds: 3600,
|
|
14256
|
-
* mode: "window",
|
|
14257
|
-
* schedule: { frequency: "daily", time: "09:00", weekday: "monday" },
|
|
14258
|
-
* sliding: false,
|
|
14259
|
-
* window_seconds: 300,
|
|
14260
|
-
* },
|
|
15810
|
+
* approval: { default_expires_in_seconds: 86400, reason: "optional", timeout_outcome: "expired" },
|
|
14261
15811
|
* });
|
|
14262
15812
|
* ```
|
|
14263
15813
|
*/
|
|
@@ -14388,7 +15938,7 @@ declare class NotificationsResource extends APIResource {
|
|
|
14388
15938
|
* @throws {NotFoundError} 404 NOT_FOUND, NOTIFICATION_TYPE_NOT_FOUND: `NOTIFICATION_TYPE_NOT_FOUND`: no type with this key.
|
|
14389
15939
|
* @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `IDEMPOTENCY_KEY_REUSE`: the key was used with a different body. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).
|
|
14390
15940
|
* @throws {APIError} 413 PAYLOAD_TOO_LARGE, DATA_TOO_LARGE: `DATA_TOO_LARGE`: `data` is over 16 KB.
|
|
14391
|
-
* @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, RECIPIENT_NOT_FOUND, NOTIFICATION_TYPE_ARCHIVED, TEMPLATE_MISSING, SEND_AT_OUT_OF_RANGE, BATCHED_TYPE_NOT_SCHEDULABLE, UNSAFE_URL, VALIDATION_ERROR: `RECIPIENT_NOT_FOUND`: no recipient can be notified (`details.skipped` lists why); `NOTIFICATION_TYPE_ARCHIVED`; `TEMPLATE_MISSING`: no template for any requested channel; `SEND_AT_OUT_OF_RANGE`; `BATCHED_TYPE_NOT_SCHEDULABLE`: the type batches (send it now); `UNSAFE_URL`; `VALIDATION_ERROR`: a channel outside the type's routing.
|
|
15941
|
+
* @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, RECIPIENT_NOT_FOUND, NOTIFICATION_TYPE_ARCHIVED, TEMPLATE_MISSING, SEND_AT_OUT_OF_RANGE, BATCHED_TYPE_NOT_SCHEDULABLE, APPROVAL_TYPE_SEND_REFUSED, UNSAFE_URL, VALIDATION_ERROR: `RECIPIENT_NOT_FOUND`: no recipient can be notified (`details.skipped` lists why); `NOTIFICATION_TYPE_ARCHIVED`; `TEMPLATE_MISSING`: no template for any requested channel; `SEND_AT_OUT_OF_RANGE`; `BATCHED_TYPE_NOT_SCHEDULABLE`: the type batches (send it now); `APPROVAL_TYPE_SEND_REFUSED`: an approval type, sent with `POST /approvals`; `UNSAFE_URL`; `VALIDATION_ERROR`: a channel outside the type's routing.
|
|
14392
15942
|
* @throws {RateLimitError} 429 RATE_LIMITED: `RATE_LIMITED`: over 3,000 recipients a minute in this workspace; see `Retry-After`. Per-IP limit: more than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
14393
15943
|
* @see POST /v1/workspaces/{workspace_id}/notifications
|
|
14394
15944
|
* @see https://productcraft.co/docs/notify/api-reference#post-v1-workspaces-workspace-id-notifications
|
|
@@ -15213,6 +16763,7 @@ declare class WebhooksResource extends APIResource {
|
|
|
15213
16763
|
/** `notify` */
|
|
15214
16764
|
declare class NotifyResources extends APIResource {
|
|
15215
16765
|
#private;
|
|
16766
|
+
get approvals(): ApprovalsResource;
|
|
15216
16767
|
get batches(): BatchesResource;
|
|
15217
16768
|
get categories(): CategoriesResource;
|
|
15218
16769
|
get channels(): ChannelsResource;
|
|
@@ -15227,6 +16778,57 @@ declare class NotifyResources extends APIResource {
|
|
|
15227
16778
|
get stats(): StatsResource;
|
|
15228
16779
|
get webhooks(): WebhooksResource;
|
|
15229
16780
|
}
|
|
16781
|
+
/** `approvals` */
|
|
16782
|
+
declare class ClientApprovalsResource extends APIResource {
|
|
16783
|
+
/**
|
|
16784
|
+
* Answer an approval request
|
|
16785
|
+
*
|
|
16786
|
+
* Approve or reject, with an optional reason (required when the type says so). The first answer of any approver decides; the requester gets the signed `approval.resolved` webhook. Answering again, or after the request expired, is a 409.
|
|
16787
|
+
*
|
|
16788
|
+
* Credential: `recipient_token`.
|
|
16789
|
+
* - `recipient_token`: A recipient token minted by your backend with `POST /v1/workspaces/{workspace_id}/recipient-tokens`. Only the client API (`/v1/client/…`) accepts it.
|
|
16790
|
+
*
|
|
16791
|
+
* @param approvalId - Id of the approval.
|
|
16792
|
+
* @param params - `Notify.MeApprovalDecideParams`.
|
|
16793
|
+
* @param options - Per-request options.
|
|
16794
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: `decision` must be `approve` or `reject`.
|
|
16795
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED, RECIPIENT_TOKEN_INVALID, RECIPIENT_TOKEN_EXPIRED: `RECIPIENT_TOKEN_INVALID`: no recipient token, a malformed or forged one, an API key, or a revoked token (mint a new one); `RECIPIENT_TOKEN_EXPIRED`: the token expired (mint a new one).
|
|
16796
|
+
* @throws {PermissionDeniedError} 403 FORBIDDEN, RECIPIENT_TOKEN_SCOPE, ORIGIN_NOT_ALLOWED, SERVICE_NOT_ENABLED: `RECIPIENT_TOKEN_SCOPE`: the token lacks the `inbox:write` scope; `ORIGIN_NOT_ALLOWED`: the browser origin is not in the workspace client origins; `SERVICE_NOT_ENABLED`: Notify is turned off for the workspace.
|
|
16797
|
+
* @throws {NotFoundError} 404 NOT_FOUND, APPROVAL_NOT_FOUND: `APPROVAL_NOT_FOUND`: no such request for this recipient.
|
|
16798
|
+
* @throws {ConflictError} 409 CONFLICT, APPROVAL_NOT_PENDING: `APPROVAL_NOT_PENDING`: already answered, expired or cancelled.
|
|
16799
|
+
* @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, APPROVAL_REASON_REQUIRED: `APPROVAL_REASON_REQUIRED`: a reason is required.
|
|
16800
|
+
* @throws {RateLimitError} 429 RATE_LIMITED: `RATE_LIMITED`: over 60 client calls per minute for this recipient; `Retry-After` gives the seconds to wait. Per-IP limit: more than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
16801
|
+
* @see POST /v1/client/approvals/{approval_id}/decision
|
|
16802
|
+
* @see https://productcraft.co/docs/notify/api-reference#post-v1-client-approvals-approval-id-decision
|
|
16803
|
+
* @example
|
|
16804
|
+
* ```ts
|
|
16805
|
+
* const approval = await notify.client({ token: "rt_example_recipient_token" }).approvals.decide("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { decision: "approve" });
|
|
16806
|
+
* ```
|
|
16807
|
+
*/
|
|
16808
|
+
decide(approvalId: string, params: MeApprovalDecideParams, options?: RequestOptions): APIPromise<WithLastResponse<Approval>>;
|
|
16809
|
+
/**
|
|
16810
|
+
* Get an approval request
|
|
16811
|
+
*
|
|
16812
|
+
* One request the recipient was asked to answer: the question, who asked, its status and, once decided, who answered and why.
|
|
16813
|
+
*
|
|
16814
|
+
* Credential: `recipient_token`.
|
|
16815
|
+
* - `recipient_token`: A recipient token minted by your backend with `POST /v1/workspaces/{workspace_id}/recipient-tokens`. Only the client API (`/v1/client/…`) accepts it.
|
|
16816
|
+
*
|
|
16817
|
+
* @param approvalId - Id of the approval.
|
|
16818
|
+
* @param options - Per-request options.
|
|
16819
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED, RECIPIENT_TOKEN_INVALID, RECIPIENT_TOKEN_EXPIRED: `RECIPIENT_TOKEN_INVALID`: no recipient token, a malformed or forged one, an API key, or a revoked token (mint a new one); `RECIPIENT_TOKEN_EXPIRED`: the token expired (mint a new one).
|
|
16820
|
+
* @throws {PermissionDeniedError} 403 FORBIDDEN, RECIPIENT_TOKEN_SCOPE, ORIGIN_NOT_ALLOWED, SERVICE_NOT_ENABLED: `RECIPIENT_TOKEN_SCOPE`: the token lacks the `inbox:read` scope; `ORIGIN_NOT_ALLOWED`: the browser origin is not in the workspace client origins; `SERVICE_NOT_ENABLED`: Notify is turned off for the workspace.
|
|
16821
|
+
* @throws {NotFoundError} 404 NOT_FOUND, APPROVAL_NOT_FOUND: `APPROVAL_NOT_FOUND`: no such request for this recipient.
|
|
16822
|
+
* @throws {RateLimitError} 429 RATE_LIMITED: `RATE_LIMITED`: over 60 client calls per minute for this recipient; `Retry-After` gives the seconds to wait. Per-IP limit: more than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
16823
|
+
* @see GET /v1/client/approvals/{approval_id}
|
|
16824
|
+
* @see https://productcraft.co/docs/notify/api-reference#get-v1-client-approvals-approval-id
|
|
16825
|
+
* @example
|
|
16826
|
+
* ```ts
|
|
16827
|
+
* const approval = await notify.client({ token: "rt_example_recipient_token" }).approvals.retrieve("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
16828
|
+
* ```
|
|
16829
|
+
*/
|
|
16830
|
+
retrieve(approvalId: string, options?: RequestOptions): APIPromise<WithLastResponse<Approval>>;
|
|
16831
|
+
}
|
|
15230
16832
|
/** `devices` */
|
|
15231
16833
|
declare class ClientDevicesResource extends APIResource {
|
|
15232
16834
|
/**
|
|
@@ -15442,6 +17044,7 @@ declare class ClientWebpushResource extends APIResource {
|
|
|
15442
17044
|
/** `notify.client(…)`: Browser- and app-safe calls for one recipient (inbox, devices, preferences), authenticated by the short-lived recipient token your backend mints with `recipientTokens.mint`. Sends only that token, never an API key. */
|
|
15443
17045
|
declare class NotifyClient extends APIResource {
|
|
15444
17046
|
#private;
|
|
17047
|
+
get approvals(): ClientApprovalsResource;
|
|
15445
17048
|
get devices(): ClientDevicesResource;
|
|
15446
17049
|
get inbox(): ClientInboxResource;
|
|
15447
17050
|
get preferences(): ClientPreferencesResource;
|
|
@@ -15475,6 +17078,15 @@ type __DeviceState = DeviceState;
|
|
|
15475
17078
|
type __InboxItemStatusFilter = InboxItemStatusFilter;
|
|
15476
17079
|
type __InboxMarkAction = InboxMarkAction;
|
|
15477
17080
|
type __NotificationStatus = NotificationStatus;
|
|
17081
|
+
type __NotifyApprovalDecidedVia = NotifyApprovalDecidedVia;
|
|
17082
|
+
type __NotifyApprovalDecision = NotifyApprovalDecision;
|
|
17083
|
+
type __NotifyApprovalOutcome = NotifyApprovalOutcome;
|
|
17084
|
+
type __NotifyApprovalOutcomeVia = NotifyApprovalOutcomeVia;
|
|
17085
|
+
type __NotifyApprovalReasonPolicy = NotifyApprovalReasonPolicy;
|
|
17086
|
+
type __NotifyApprovalRequesterKind = NotifyApprovalRequesterKind;
|
|
17087
|
+
type __NotifyApprovalRequesterViewKind = NotifyApprovalRequesterViewKind;
|
|
17088
|
+
type __NotifyApprovalStatus = NotifyApprovalStatus;
|
|
17089
|
+
type __NotifyApprovalTimeoutOutcome = NotifyApprovalTimeoutOutcome;
|
|
15478
17090
|
type __NotifyBatchInboxMode = NotifyBatchInboxMode;
|
|
15479
17091
|
type __NotifyBatchMode = NotifyBatchMode;
|
|
15480
17092
|
type __NotifyBatchState = NotifyBatchState;
|
|
@@ -15504,6 +17116,12 @@ type __WebhookEndpointStatus = WebhookEndpointStatus;
|
|
|
15504
17116
|
type __WebhookEventStatus = WebhookEventStatus;
|
|
15505
17117
|
type __WebhookEventType = WebhookEventType;
|
|
15506
17118
|
type __ApnsCredential = ApnsCredential;
|
|
17119
|
+
type __ApprovalConfigView = ApprovalConfigView;
|
|
17120
|
+
type __ApprovalDetail = ApprovalDetail;
|
|
17121
|
+
type __Approval = Approval;
|
|
17122
|
+
type __ApprovalEvent = ApprovalEvent;
|
|
17123
|
+
type __ApprovalList = ApprovalList;
|
|
17124
|
+
type __ApprovalRequesterView = ApprovalRequesterView;
|
|
15507
17125
|
type __BatchDelivery = BatchDelivery;
|
|
15508
17126
|
type __BatchDetail = BatchDetail;
|
|
15509
17127
|
type __BatchList = BatchList;
|
|
@@ -15556,6 +17174,8 @@ type __Notification = Notification;
|
|
|
15556
17174
|
type __NotificationList = NotificationList;
|
|
15557
17175
|
type __NotificationType = NotificationType;
|
|
15558
17176
|
type __NotificationTypeList = NotificationTypeList;
|
|
17177
|
+
type __NotifyApprovalRequester = NotifyApprovalRequester;
|
|
17178
|
+
type __NotifyApprovalResolvedData = NotifyApprovalResolvedData;
|
|
15559
17179
|
type __NotifyBrandingView = NotifyBrandingView;
|
|
15560
17180
|
type __NotifyCredentialInvalidData = NotifyCredentialInvalidData;
|
|
15561
17181
|
type __NotifyDeliveryEventData = NotifyDeliveryEventData;
|
|
@@ -15563,11 +17183,13 @@ type __NotifyDeviceEventData = NotifyDeviceEventData;
|
|
|
15563
17183
|
type __NotifyEmailAutoPausedData = NotifyEmailAutoPausedData;
|
|
15564
17184
|
type __NotifyInboxItemEventData = NotifyInboxItemEventData;
|
|
15565
17185
|
type __NotifyNotificationAcceptedData = NotifyNotificationAcceptedData;
|
|
17186
|
+
type __NotifyNotificationWebhookData = NotifyNotificationWebhookData;
|
|
15566
17187
|
type __NotifyRecipientDeletedData = NotifyRecipientDeletedData;
|
|
15567
17188
|
type __NotifySettings = NotifySettings;
|
|
15568
17189
|
type __NotifyStatsCounts = NotifyStatsCounts;
|
|
15569
17190
|
type __NotifyStatsDay = NotifyStatsDay;
|
|
15570
17191
|
type __NotifyStats = NotifyStats;
|
|
17192
|
+
type __NotifyWebhookChannelRendered = NotifyWebhookChannelRendered;
|
|
15571
17193
|
type __NotifyWebhookRecipient = NotifyWebhookRecipient;
|
|
15572
17194
|
type __Pagination = Pagination;
|
|
15573
17195
|
type __PlanBatch = PlanBatch;
|
|
@@ -15613,11 +17235,16 @@ type __WebhookEventDetail = WebhookEventDetail;
|
|
|
15613
17235
|
type __WebhookEvent = WebhookEvent;
|
|
15614
17236
|
type __WebhookEventTypeInfo = WebhookEventTypeInfo;
|
|
15615
17237
|
type __WebhookPagination = WebhookPagination;
|
|
17238
|
+
type __MeApprovalDecideParams = MeApprovalDecideParams;
|
|
15616
17239
|
type __MeDeviceRegisterParams = MeDeviceRegisterParams;
|
|
15617
17240
|
type __MeInboxListParams = MeInboxListParams;
|
|
15618
17241
|
type __MeInboxMarkParams = MeInboxMarkParams;
|
|
15619
17242
|
type __MeInboxInteractParams = MeInboxInteractParams;
|
|
15620
17243
|
type __MePreferenceUpdateParams = MePreferenceUpdateParams;
|
|
17244
|
+
type __ApprovalListParams = ApprovalListParams;
|
|
17245
|
+
type __ApprovalCreateParams = ApprovalCreateParams;
|
|
17246
|
+
type __ApprovalRetrieveParams = ApprovalRetrieveParams;
|
|
17247
|
+
type __ApprovalRecordDecisionParams = ApprovalRecordDecisionParams;
|
|
15621
17248
|
type __BatchListParams = BatchListParams;
|
|
15622
17249
|
type __CategoryListParams = CategoryListParams;
|
|
15623
17250
|
type __CategoryCreateParams = CategoryCreateParams;
|
|
@@ -15658,6 +17285,7 @@ type __WebhookEndpointTestParams = WebhookEndpointTestParams;
|
|
|
15658
17285
|
type __WebhookEventListParams = WebhookEventListParams;
|
|
15659
17286
|
type __WebhookEventReplayParams = WebhookEventReplayParams;
|
|
15660
17287
|
type __ErrorCode = NotifyErrorCode;
|
|
17288
|
+
type __ApprovalResolvedEvent = ApprovalResolvedEvent;
|
|
15661
17289
|
type __CredentialInvalidEvent = CredentialInvalidEvent;
|
|
15662
17290
|
type __DeliveryBouncedEvent = DeliveryBouncedEvent;
|
|
15663
17291
|
type __DeliveryDeliveredEvent = DeliveryDeliveredEvent;
|
|
@@ -15671,6 +17299,7 @@ type __InboxItemArchivedEvent = InboxItemArchivedEvent;
|
|
|
15671
17299
|
type __InboxItemInteractedEvent = InboxItemInteractedEvent;
|
|
15672
17300
|
type __InboxItemReadEvent = InboxItemReadEvent;
|
|
15673
17301
|
type __NotificationAcceptedEvent = NotificationAcceptedEvent;
|
|
17302
|
+
type __NotificationWebhookEvent = NotificationWebhookEvent;
|
|
15674
17303
|
type __RecipientDeletedEvent = RecipientDeletedEvent;
|
|
15675
17304
|
type __UnknownWebhookEvent = UnknownWebhookEvent;
|
|
15676
17305
|
type __UnwrapWebhookEvent = UnwrapWebhookEvent;
|
|
@@ -15703,7 +17332,7 @@ declare class Notify extends NotifyResources {
|
|
|
15703
17332
|
token: string;
|
|
15704
17333
|
}) => NotifyClient);
|
|
15705
17334
|
}
|
|
15706
|
-
/** Public types: `Notify.ApnsCredential`, `Notify.
|
|
17335
|
+
/** Public types: `Notify.ApnsCredential`, `Notify.MeApprovalDecideParams`, … */
|
|
15707
17336
|
declare namespace Notify {
|
|
15708
17337
|
type RequestOptions = __RequestOptions;
|
|
15709
17338
|
type PollOptions = __PollOptions;
|
|
@@ -15786,6 +17415,42 @@ declare namespace Notify {
|
|
|
15786
17415
|
const NotificationStatus: {
|
|
15787
17416
|
values: readonly ["scheduled", "accepted", "planned", "cancelled"];
|
|
15788
17417
|
};
|
|
17418
|
+
type NotifyApprovalDecidedVia = __NotifyApprovalDecidedVia;
|
|
17419
|
+
const NotifyApprovalDecidedVia: {
|
|
17420
|
+
values: readonly ["inbox", "hosted_page", "api", "timeout"];
|
|
17421
|
+
};
|
|
17422
|
+
type NotifyApprovalDecision = __NotifyApprovalDecision;
|
|
17423
|
+
const NotifyApprovalDecision: {
|
|
17424
|
+
values: readonly ["approve", "reject"];
|
|
17425
|
+
};
|
|
17426
|
+
type NotifyApprovalOutcome = __NotifyApprovalOutcome;
|
|
17427
|
+
const NotifyApprovalOutcome: {
|
|
17428
|
+
values: readonly ["approved", "rejected", "expired", "cancelled"];
|
|
17429
|
+
};
|
|
17430
|
+
type NotifyApprovalOutcomeVia = __NotifyApprovalOutcomeVia;
|
|
17431
|
+
const NotifyApprovalOutcomeVia: {
|
|
17432
|
+
values: readonly ["inbox", "hosted_page", "api", "timeout"];
|
|
17433
|
+
};
|
|
17434
|
+
type NotifyApprovalReasonPolicy = __NotifyApprovalReasonPolicy;
|
|
17435
|
+
const NotifyApprovalReasonPolicy: {
|
|
17436
|
+
values: readonly ["optional", "required_on_reject", "required"];
|
|
17437
|
+
};
|
|
17438
|
+
type NotifyApprovalRequesterKind = __NotifyApprovalRequesterKind;
|
|
17439
|
+
const NotifyApprovalRequesterKind: {
|
|
17440
|
+
values: readonly ["agent", "service", "user"];
|
|
17441
|
+
};
|
|
17442
|
+
type NotifyApprovalRequesterViewKind = __NotifyApprovalRequesterViewKind;
|
|
17443
|
+
const NotifyApprovalRequesterViewKind: {
|
|
17444
|
+
values: readonly ["agent", "service", "user", "api_key"];
|
|
17445
|
+
};
|
|
17446
|
+
type NotifyApprovalStatus = __NotifyApprovalStatus;
|
|
17447
|
+
const NotifyApprovalStatus: {
|
|
17448
|
+
values: readonly ["pending", "approved", "rejected", "expired", "cancelled"];
|
|
17449
|
+
};
|
|
17450
|
+
type NotifyApprovalTimeoutOutcome = __NotifyApprovalTimeoutOutcome;
|
|
17451
|
+
const NotifyApprovalTimeoutOutcome: {
|
|
17452
|
+
values: readonly ["expired", "approved", "rejected"];
|
|
17453
|
+
};
|
|
15789
17454
|
type NotifyBatchInboxMode = __NotifyBatchInboxMode;
|
|
15790
17455
|
const NotifyBatchInboxMode: {
|
|
15791
17456
|
values: readonly ["collapse", "each"];
|
|
@@ -15800,7 +17465,7 @@ declare namespace Notify {
|
|
|
15800
17465
|
};
|
|
15801
17466
|
type NotifyChannel = __NotifyChannel;
|
|
15802
17467
|
const NotifyChannel: {
|
|
15803
|
-
values: readonly ["inbox", "email", "push", "webpush"];
|
|
17468
|
+
values: readonly ["inbox", "email", "push", "webpush", "webhook"];
|
|
15804
17469
|
};
|
|
15805
17470
|
type NotifyDeliveryReason = __NotifyDeliveryReason;
|
|
15806
17471
|
const NotifyDeliveryReason: {
|
|
@@ -15828,7 +17493,7 @@ declare namespace Notify {
|
|
|
15828
17493
|
};
|
|
15829
17494
|
type NotifyWebhookChannel = __NotifyWebhookChannel;
|
|
15830
17495
|
const NotifyWebhookChannel: {
|
|
15831
|
-
values: readonly ["inbox", "email", "push", "webpush"];
|
|
17496
|
+
values: readonly ["inbox", "email", "push", "webpush", "webhook"];
|
|
15832
17497
|
};
|
|
15833
17498
|
type NotifyWebhookCredentialProvider = __NotifyWebhookCredentialProvider;
|
|
15834
17499
|
const NotifyWebhookCredentialProvider: {
|
|
@@ -15896,9 +17561,15 @@ declare namespace Notify {
|
|
|
15896
17561
|
};
|
|
15897
17562
|
type WebhookEventType = __WebhookEventType;
|
|
15898
17563
|
const WebhookEventType: {
|
|
15899
|
-
values: readonly ["notification.accepted", "delivery.sent", "delivery.delivered", "delivery.failed", "delivery.bounced", "delivery.skipped", "inbox_item.read", "inbox_item.archived", "inbox_item.interacted", "device.pruned", "device.moved", "credential.invalid", "email.auto_paused", "recipient.deleted"];
|
|
17564
|
+
values: readonly ["notification.accepted", "delivery.sent", "delivery.delivered", "delivery.failed", "delivery.bounced", "delivery.skipped", "inbox_item.read", "inbox_item.archived", "inbox_item.interacted", "device.pruned", "device.moved", "credential.invalid", "email.auto_paused", "recipient.deleted", "notification.webhook", "approval.resolved"];
|
|
15900
17565
|
};
|
|
15901
17566
|
type ApnsCredential = __ApnsCredential;
|
|
17567
|
+
type ApprovalConfigView = __ApprovalConfigView;
|
|
17568
|
+
type ApprovalDetail = __ApprovalDetail;
|
|
17569
|
+
type Approval = __Approval;
|
|
17570
|
+
type ApprovalEvent = __ApprovalEvent;
|
|
17571
|
+
type ApprovalList = __ApprovalList;
|
|
17572
|
+
type ApprovalRequesterView = __ApprovalRequesterView;
|
|
15902
17573
|
type BatchDelivery = __BatchDelivery;
|
|
15903
17574
|
type BatchDetail = __BatchDetail;
|
|
15904
17575
|
type BatchList = __BatchList;
|
|
@@ -15954,6 +17625,8 @@ declare namespace Notify {
|
|
|
15954
17625
|
type NotificationList = __NotificationList;
|
|
15955
17626
|
type NotificationType = __NotificationType;
|
|
15956
17627
|
type NotificationTypeList = __NotificationTypeList;
|
|
17628
|
+
type NotifyApprovalRequester = __NotifyApprovalRequester;
|
|
17629
|
+
type NotifyApprovalResolvedData = __NotifyApprovalResolvedData;
|
|
15957
17630
|
type NotifyBrandingView = __NotifyBrandingView;
|
|
15958
17631
|
type NotifyCredentialInvalidData = __NotifyCredentialInvalidData;
|
|
15959
17632
|
type NotifyDeliveryEventData = __NotifyDeliveryEventData;
|
|
@@ -15961,11 +17634,13 @@ declare namespace Notify {
|
|
|
15961
17634
|
type NotifyEmailAutoPausedData = __NotifyEmailAutoPausedData;
|
|
15962
17635
|
type NotifyInboxItemEventData = __NotifyInboxItemEventData;
|
|
15963
17636
|
type NotifyNotificationAcceptedData = __NotifyNotificationAcceptedData;
|
|
17637
|
+
type NotifyNotificationWebhookData = __NotifyNotificationWebhookData;
|
|
15964
17638
|
type NotifyRecipientDeletedData = __NotifyRecipientDeletedData;
|
|
15965
17639
|
type NotifySettings = __NotifySettings;
|
|
15966
17640
|
type NotifyStatsCounts = __NotifyStatsCounts;
|
|
15967
17641
|
type NotifyStatsDay = __NotifyStatsDay;
|
|
15968
17642
|
type NotifyStats = __NotifyStats;
|
|
17643
|
+
type NotifyWebhookChannelRendered = __NotifyWebhookChannelRendered;
|
|
15969
17644
|
type NotifyWebhookRecipient = __NotifyWebhookRecipient;
|
|
15970
17645
|
type Pagination = __Pagination;
|
|
15971
17646
|
type PlanBatch = __PlanBatch;
|
|
@@ -16012,11 +17687,16 @@ declare namespace Notify {
|
|
|
16012
17687
|
type WebhookEvent = __WebhookEvent;
|
|
16013
17688
|
type WebhookEventTypeInfo = __WebhookEventTypeInfo;
|
|
16014
17689
|
type WebhookPagination = __WebhookPagination;
|
|
17690
|
+
type MeApprovalDecideParams = __MeApprovalDecideParams;
|
|
16015
17691
|
type MeDeviceRegisterParams = __MeDeviceRegisterParams;
|
|
16016
17692
|
type MeInboxListParams = __MeInboxListParams;
|
|
16017
17693
|
type MeInboxMarkParams = __MeInboxMarkParams;
|
|
16018
17694
|
type MeInboxInteractParams = __MeInboxInteractParams;
|
|
16019
17695
|
type MePreferenceUpdateParams = __MePreferenceUpdateParams;
|
|
17696
|
+
type ApprovalListParams = __ApprovalListParams;
|
|
17697
|
+
type ApprovalCreateParams = __ApprovalCreateParams;
|
|
17698
|
+
type ApprovalRetrieveParams = __ApprovalRetrieveParams;
|
|
17699
|
+
type ApprovalRecordDecisionParams = __ApprovalRecordDecisionParams;
|
|
16020
17700
|
type BatchListParams = __BatchListParams;
|
|
16021
17701
|
type CategoryListParams = __CategoryListParams;
|
|
16022
17702
|
type CategoryCreateParams = __CategoryCreateParams;
|
|
@@ -16057,6 +17737,7 @@ declare namespace Notify {
|
|
|
16057
17737
|
type WebhookEventListParams = __WebhookEventListParams;
|
|
16058
17738
|
type WebhookEventReplayParams = __WebhookEventReplayParams;
|
|
16059
17739
|
type ErrorCode = __ErrorCode;
|
|
17740
|
+
type ApprovalResolvedEvent = __ApprovalResolvedEvent;
|
|
16060
17741
|
type CredentialInvalidEvent = __CredentialInvalidEvent;
|
|
16061
17742
|
type DeliveryBouncedEvent = __DeliveryBouncedEvent;
|
|
16062
17743
|
type DeliveryDeliveredEvent = __DeliveryDeliveredEvent;
|
|
@@ -16070,6 +17751,7 @@ declare namespace Notify {
|
|
|
16070
17751
|
type InboxItemInteractedEvent = __InboxItemInteractedEvent;
|
|
16071
17752
|
type InboxItemReadEvent = __InboxItemReadEvent;
|
|
16072
17753
|
type NotificationAcceptedEvent = __NotificationAcceptedEvent;
|
|
17754
|
+
type NotificationWebhookEvent = __NotificationWebhookEvent;
|
|
16073
17755
|
type RecipientDeletedEvent = __RecipientDeletedEvent;
|
|
16074
17756
|
type UnknownWebhookEvent = __UnknownWebhookEvent;
|
|
16075
17757
|
type UnwrapWebhookEvent = __UnwrapWebhookEvent;
|