@zernio/node 0.2.505 → 0.2.507

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/dist/index.d.mts CHANGED
@@ -2107,6 +2107,10 @@ type ApiKey = {
2107
2107
  * 'read-write' allows all operations, 'read' restricts to GET requests only
2108
2108
  */
2109
2109
  permission?: 'read-write' | 'read';
2110
+ /**
2111
+ * Resource groups this key can NOT access (opt-out denylist). Absent or empty means legacy full access. A key with any group disabled is a restricted key (zrk_ prefix) and can never manage API keys, invites, or member identity. Each operation's group is published as x-resource-group. With 'messages' disabled, the KEY cannot access private messages; the ACCOUNT's pre-existing webhook subscriptions are a separate grant surface.
2112
+ */
2113
+ disabledResourceGroups?: Array<('publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks')>;
2110
2114
  };
2111
2115
  /**
2112
2116
  * 'full' grants access to all profiles, 'profiles' restricts to specific profiles
@@ -4951,6 +4955,7 @@ type PostsListResponse = {
4951
4955
  type PostUpdateResponse = {
4952
4956
  message?: string;
4953
4957
  post?: Post;
4958
+ warnings?: Array<(string)>;
4954
4959
  };
4955
4960
  type Profile = {
4956
4961
  _id?: string;
@@ -11319,6 +11324,13 @@ type ListApiKeysResponse = ({
11319
11324
  });
11320
11325
  type ListApiKeysError = ({
11321
11326
  error?: string;
11327
+ } | {
11328
+ error?: string;
11329
+ code?: 'insufficient_permissions' | 'unclassified_resource';
11330
+ /**
11331
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
11332
+ */
11333
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
11322
11334
  });
11323
11335
  type CreateApiKeyData = {
11324
11336
  body: {
@@ -11339,6 +11351,10 @@ type CreateApiKeyData = {
11339
11351
  * 'read-write' allows all operations (default), 'read' restricts to GET requests only
11340
11352
  */
11341
11353
  permission?: 'read-write' | 'read';
11354
+ /**
11355
+ * Resource groups to DISABLE on this key (opt-out denylist). Omit for a legacy full-access key. A key with any group disabled mints with the zrk_ prefix, gets 403 with code=insufficient_permissions and required_group on operations in disabled groups (each operation's group is published as x-resource-group), and can never manage API keys, invites, or member identity. With 'messages' disabled, the KEY cannot access private messages; the ACCOUNT's pre-existing webhook subscriptions are a separate grant surface.
11356
+ */
11357
+ disabledResourceGroups?: Array<('publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks')>;
11342
11358
  };
11343
11359
  };
11344
11360
  type CreateApiKeyResponse = ({
@@ -11347,6 +11363,13 @@ type CreateApiKeyResponse = ({
11347
11363
  });
11348
11364
  type CreateApiKeyError = (unknown | {
11349
11365
  error?: string;
11366
+ } | {
11367
+ error?: string;
11368
+ code?: 'insufficient_permissions' | 'unclassified_resource';
11369
+ /**
11370
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
11371
+ */
11372
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
11350
11373
  });
11351
11374
  type DeleteApiKeyData = {
11352
11375
  path: {
@@ -11358,13 +11381,27 @@ type DeleteApiKeyResponse = ({
11358
11381
  });
11359
11382
  type DeleteApiKeyError = ({
11360
11383
  error?: string;
11384
+ } | {
11385
+ error?: string;
11386
+ code?: 'insufficient_permissions' | 'unclassified_resource';
11387
+ /**
11388
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
11389
+ */
11390
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
11361
11391
  });
11362
11392
  type ListConnectedAppsResponse = ({
11363
11393
  connectedApps?: Array<ConnectedApp>;
11364
11394
  });
11365
11395
  type ListConnectedAppsError = ({
11366
11396
  error?: string;
11367
- } | ErrorResponse);
11397
+ } | {
11398
+ error?: string;
11399
+ code?: 'insufficient_permissions' | 'unclassified_resource';
11400
+ /**
11401
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
11402
+ */
11403
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
11404
+ });
11368
11405
  type RevokeConnectedAppData = {
11369
11406
  path: {
11370
11407
  /**
@@ -11387,6 +11424,13 @@ type RevokeConnectedAppResponse = ({
11387
11424
  });
11388
11425
  type RevokeConnectedAppError = (ErrorResponse | {
11389
11426
  error?: string;
11427
+ } | {
11428
+ error?: string;
11429
+ code?: 'insufficient_permissions' | 'unclassified_resource';
11430
+ /**
11431
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
11432
+ */
11433
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
11390
11434
  });
11391
11435
  type CreateInviteTokenData = {
11392
11436
  body: {
@@ -11418,6 +11462,13 @@ type CreateInviteTokenResponse = ({
11418
11462
  });
11419
11463
  type CreateInviteTokenError = (unknown | {
11420
11464
  error?: string;
11465
+ } | {
11466
+ error?: string;
11467
+ code?: 'insufficient_permissions' | 'unclassified_resource';
11468
+ /**
11469
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
11470
+ */
11471
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
11421
11472
  });
11422
11473
  type GetConnectUrlData = {
11423
11474
  path: {
@@ -15506,6 +15557,13 @@ type CreateWebhookSettingsResponse = ({
15506
15557
  });
15507
15558
  type CreateWebhookSettingsError = (unknown | {
15508
15559
  error?: string;
15560
+ } | {
15561
+ error?: string;
15562
+ code?: 'insufficient_permissions' | 'unclassified_resource';
15563
+ /**
15564
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
15565
+ */
15566
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
15509
15567
  });
15510
15568
  type UpdateWebhookSettingsData = {
15511
15569
  body: {
@@ -15547,6 +15605,13 @@ type UpdateWebhookSettingsResponse = ({
15547
15605
  });
15548
15606
  type UpdateWebhookSettingsError = (unknown | {
15549
15607
  error?: string;
15608
+ } | {
15609
+ error?: string;
15610
+ code?: 'insufficient_permissions' | 'unclassified_resource';
15611
+ /**
15612
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
15613
+ */
15614
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
15550
15615
  });
15551
15616
  type DeleteWebhookSettingsData = {
15552
15617
  query: {
@@ -15617,6 +15682,13 @@ type GetWebhookLogsResponse = ({
15617
15682
  });
15618
15683
  type GetWebhookLogsError = (unknown | {
15619
15684
  error?: string;
15685
+ } | {
15686
+ error?: string;
15687
+ code?: 'insufficient_permissions' | 'unclassified_resource';
15688
+ /**
15689
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
15690
+ */
15691
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
15620
15692
  });
15621
15693
  type TestWebhookData = {
15622
15694
  body: {
package/dist/index.d.ts CHANGED
@@ -2107,6 +2107,10 @@ type ApiKey = {
2107
2107
  * 'read-write' allows all operations, 'read' restricts to GET requests only
2108
2108
  */
2109
2109
  permission?: 'read-write' | 'read';
2110
+ /**
2111
+ * Resource groups this key can NOT access (opt-out denylist). Absent or empty means legacy full access. A key with any group disabled is a restricted key (zrk_ prefix) and can never manage API keys, invites, or member identity. Each operation's group is published as x-resource-group. With 'messages' disabled, the KEY cannot access private messages; the ACCOUNT's pre-existing webhook subscriptions are a separate grant surface.
2112
+ */
2113
+ disabledResourceGroups?: Array<('publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks')>;
2110
2114
  };
2111
2115
  /**
2112
2116
  * 'full' grants access to all profiles, 'profiles' restricts to specific profiles
@@ -4951,6 +4955,7 @@ type PostsListResponse = {
4951
4955
  type PostUpdateResponse = {
4952
4956
  message?: string;
4953
4957
  post?: Post;
4958
+ warnings?: Array<(string)>;
4954
4959
  };
4955
4960
  type Profile = {
4956
4961
  _id?: string;
@@ -11319,6 +11324,13 @@ type ListApiKeysResponse = ({
11319
11324
  });
11320
11325
  type ListApiKeysError = ({
11321
11326
  error?: string;
11327
+ } | {
11328
+ error?: string;
11329
+ code?: 'insufficient_permissions' | 'unclassified_resource';
11330
+ /**
11331
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
11332
+ */
11333
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
11322
11334
  });
11323
11335
  type CreateApiKeyData = {
11324
11336
  body: {
@@ -11339,6 +11351,10 @@ type CreateApiKeyData = {
11339
11351
  * 'read-write' allows all operations (default), 'read' restricts to GET requests only
11340
11352
  */
11341
11353
  permission?: 'read-write' | 'read';
11354
+ /**
11355
+ * Resource groups to DISABLE on this key (opt-out denylist). Omit for a legacy full-access key. A key with any group disabled mints with the zrk_ prefix, gets 403 with code=insufficient_permissions and required_group on operations in disabled groups (each operation's group is published as x-resource-group), and can never manage API keys, invites, or member identity. With 'messages' disabled, the KEY cannot access private messages; the ACCOUNT's pre-existing webhook subscriptions are a separate grant surface.
11356
+ */
11357
+ disabledResourceGroups?: Array<('publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks')>;
11342
11358
  };
11343
11359
  };
11344
11360
  type CreateApiKeyResponse = ({
@@ -11347,6 +11363,13 @@ type CreateApiKeyResponse = ({
11347
11363
  });
11348
11364
  type CreateApiKeyError = (unknown | {
11349
11365
  error?: string;
11366
+ } | {
11367
+ error?: string;
11368
+ code?: 'insufficient_permissions' | 'unclassified_resource';
11369
+ /**
11370
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
11371
+ */
11372
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
11350
11373
  });
11351
11374
  type DeleteApiKeyData = {
11352
11375
  path: {
@@ -11358,13 +11381,27 @@ type DeleteApiKeyResponse = ({
11358
11381
  });
11359
11382
  type DeleteApiKeyError = ({
11360
11383
  error?: string;
11384
+ } | {
11385
+ error?: string;
11386
+ code?: 'insufficient_permissions' | 'unclassified_resource';
11387
+ /**
11388
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
11389
+ */
11390
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
11361
11391
  });
11362
11392
  type ListConnectedAppsResponse = ({
11363
11393
  connectedApps?: Array<ConnectedApp>;
11364
11394
  });
11365
11395
  type ListConnectedAppsError = ({
11366
11396
  error?: string;
11367
- } | ErrorResponse);
11397
+ } | {
11398
+ error?: string;
11399
+ code?: 'insufficient_permissions' | 'unclassified_resource';
11400
+ /**
11401
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
11402
+ */
11403
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
11404
+ });
11368
11405
  type RevokeConnectedAppData = {
11369
11406
  path: {
11370
11407
  /**
@@ -11387,6 +11424,13 @@ type RevokeConnectedAppResponse = ({
11387
11424
  });
11388
11425
  type RevokeConnectedAppError = (ErrorResponse | {
11389
11426
  error?: string;
11427
+ } | {
11428
+ error?: string;
11429
+ code?: 'insufficient_permissions' | 'unclassified_resource';
11430
+ /**
11431
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
11432
+ */
11433
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
11390
11434
  });
11391
11435
  type CreateInviteTokenData = {
11392
11436
  body: {
@@ -11418,6 +11462,13 @@ type CreateInviteTokenResponse = ({
11418
11462
  });
11419
11463
  type CreateInviteTokenError = (unknown | {
11420
11464
  error?: string;
11465
+ } | {
11466
+ error?: string;
11467
+ code?: 'insufficient_permissions' | 'unclassified_resource';
11468
+ /**
11469
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
11470
+ */
11471
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
11421
11472
  });
11422
11473
  type GetConnectUrlData = {
11423
11474
  path: {
@@ -15506,6 +15557,13 @@ type CreateWebhookSettingsResponse = ({
15506
15557
  });
15507
15558
  type CreateWebhookSettingsError = (unknown | {
15508
15559
  error?: string;
15560
+ } | {
15561
+ error?: string;
15562
+ code?: 'insufficient_permissions' | 'unclassified_resource';
15563
+ /**
15564
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
15565
+ */
15566
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
15509
15567
  });
15510
15568
  type UpdateWebhookSettingsData = {
15511
15569
  body: {
@@ -15547,6 +15605,13 @@ type UpdateWebhookSettingsResponse = ({
15547
15605
  });
15548
15606
  type UpdateWebhookSettingsError = (unknown | {
15549
15607
  error?: string;
15608
+ } | {
15609
+ error?: string;
15610
+ code?: 'insufficient_permissions' | 'unclassified_resource';
15611
+ /**
15612
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
15613
+ */
15614
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
15550
15615
  });
15551
15616
  type DeleteWebhookSettingsData = {
15552
15617
  query: {
@@ -15617,6 +15682,13 @@ type GetWebhookLogsResponse = ({
15617
15682
  });
15618
15683
  type GetWebhookLogsError = (unknown | {
15619
15684
  error?: string;
15685
+ } | {
15686
+ error?: string;
15687
+ code?: 'insufficient_permissions' | 'unclassified_resource';
15688
+ /**
15689
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
15690
+ */
15691
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
15620
15692
  });
15621
15693
  type TestWebhookData = {
15622
15694
  body: {
package/dist/index.js CHANGED
@@ -36,7 +36,7 @@ module.exports = __toCommonJS(index_exports);
36
36
  // package.json
37
37
  var package_default = {
38
38
  name: "@zernio/node",
39
- version: "0.2.505",
39
+ version: "0.2.507",
40
40
  description: "The official Node.js library for the Zernio API",
41
41
  main: "dist/index.js",
42
42
  module: "dist/index.mjs",
package/dist/index.mjs CHANGED
@@ -5,7 +5,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
5
5
  // package.json
6
6
  var package_default = {
7
7
  name: "@zernio/node",
8
- version: "0.2.505",
8
+ version: "0.2.507",
9
9
  description: "The official Node.js library for the Zernio API",
10
10
  main: "dist/index.js",
11
11
  module: "dist/index.mjs",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zernio/node",
3
- "version": "0.2.505",
3
+ "version": "0.2.507",
4
4
  "description": "The official Node.js library for the Zernio API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -865,6 +865,9 @@ export const getPost = <ThrowOnError extends boolean = false>(options: OptionsLe
865
865
  * or `queuedFromProfile`). If `isDraft` is omitted the post keeps its current draft status, so sending only
866
866
  * `scheduledFor` to a draft returns 200 but the post remains a draft.
867
867
  *
868
+ * Non-draft updates run the same per-platform validation as post creation (media requirements, platform-specific
869
+ * field rules, etc.) against the resulting platforms, returning 400 on failure.
870
+ *
868
871
  */
869
872
  export const updatePost = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UpdatePostData, ThrowOnError>) => {
870
873
  return (options?.client ?? client).put<UpdatePostResponse, UpdatePostError, ThrowOnError>({
@@ -1232,9 +1235,10 @@ export const deleteApiKey = <ThrowOnError extends boolean = false>(options: Opti
1232
1235
  * Returns the OAuth clients (AI assistants and MCP connectors) the authenticated
1233
1236
  * user has authorized and that still hold a live token.
1234
1237
  *
1235
- * Requires a session or a full-scope API key. A profile-scoped API key or an
1236
- * OAuth access token is rejected with 403: an app must not be able to enumerate
1237
- * its sibling authorizations.
1238
+ * Requires a session or a full-access API key. A profile-scoped API key, a
1239
+ * restricted (zrk_) API key, or an OAuth access token is rejected with 403: an
1240
+ * app must not be able to enumerate its sibling authorizations, and connected-app
1241
+ * management is admin-plane.
1238
1242
  *
1239
1243
  */
1240
1244
  export const listConnectedApps = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<unknown, ThrowOnError>) => {
@@ -1253,6 +1257,9 @@ export const listConnectedApps = <ThrowOnError extends boolean = false>(options?
1253
1257
  * Idempotent while the authorization is still on record: revoking an app that
1254
1258
  * was already revoked returns 200 with `revokedTokens: 0`.
1255
1259
  *
1260
+ * Requires a session or a full-access API key. A profile-scoped API key, a
1261
+ * restricted (zrk_) API key, or an OAuth access token is rejected with 403.
1262
+ *
1256
1263
  */
1257
1264
  export const revokeConnectedApp = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<RevokeConnectedAppData, ThrowOnError>) => {
1258
1265
  return (options?.client ?? client).delete<RevokeConnectedAppResponse, RevokeConnectedAppError, ThrowOnError>({
@@ -1266,6 +1273,9 @@ export const revokeConnectedApp = <ThrowOnError extends boolean = false>(options
1266
1273
  * Generate a secure invite link to grant team members access to your profiles.
1267
1274
  * Invites expire after 7 days and are single-use.
1268
1275
  *
1276
+ * Returns 403 when a requested profile is not found or not owned, or when
1277
+ * called with a restricted (zrk_) API key: invite management is admin-plane.
1278
+ *
1269
1279
  */
1270
1280
  export const createInviteToken = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CreateInviteTokenData, ThrowOnError>) => {
1271
1281
  return (options?.client ?? client).post<CreateInviteTokenResponse, CreateInviteTokenError, ThrowOnError>({
@@ -2806,6 +2816,11 @@ export const getWebhookSettings = <ThrowOnError extends boolean = false>(options
2806
2816
  *
2807
2817
  * Webhooks are automatically disabled after 10 consecutive delivery failures.
2808
2818
  *
2819
+ * A restricted (zrk_) API key can only subscribe to events whose resource group
2820
+ * the key holds; an event outside the key's groups is rejected with 403. Note
2821
+ * that the KEY cannot access private messages; the ACCOUNT's pre-existing
2822
+ * webhook subscriptions are a separate grant surface.
2823
+ *
2809
2824
  */
2810
2825
  export const createWebhookSettings = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CreateWebhookSettingsData, ThrowOnError>) => {
2811
2826
  return (options?.client ?? client).post<CreateWebhookSettingsResponse, CreateWebhookSettingsError, ThrowOnError>({
@@ -2822,6 +2837,9 @@ export const createWebhookSettings = <ThrowOnError extends boolean = false>(opti
2822
2837
  *
2823
2838
  * Webhooks are automatically disabled after 10 consecutive delivery failures.
2824
2839
  *
2840
+ * A restricted (zrk_) API key can only set `events` to events whose resource
2841
+ * group the key holds; an event outside the key's groups is rejected with 403.
2842
+ *
2825
2843
  */
2826
2844
  export const updateWebhookSettings = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UpdateWebhookSettingsData, ThrowOnError>) => {
2827
2845
  return (options?.client ?? client).put<UpdateWebhookSettingsResponse, UpdateWebhookSettingsError, ThrowOnError>({
@@ -2847,6 +2865,10 @@ export const deleteWebhookSettings = <ThrowOnError extends boolean = false>(opti
2847
2865
  * Logs are retained for 30 days. Supports filtering by status, event type, webhook ID, and event ID,
2848
2866
  * plus offset-based pagination.
2849
2867
  *
2868
+ * For a restricted (zrk_) API key, rows for events outside the key's resource
2869
+ * groups are omitted (`pagination.total` may over-count), and an `event` filter
2870
+ * naming such an event is rejected with 403.
2871
+ *
2850
2872
  */
2851
2873
  export const getWebhookLogs = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<GetWebhookLogsData, ThrowOnError>) => {
2852
2874
  return (options?.client ?? client).get<GetWebhookLogsResponse, GetWebhookLogsError, ThrowOnError>({
@@ -920,6 +920,10 @@ export type ApiKey = {
920
920
  * 'read-write' allows all operations, 'read' restricts to GET requests only
921
921
  */
922
922
  permission?: 'read-write' | 'read';
923
+ /**
924
+ * Resource groups this key can NOT access (opt-out denylist). Absent or empty means legacy full access. A key with any group disabled is a restricted key (zrk_ prefix) and can never manage API keys, invites, or member identity. Each operation's group is published as x-resource-group. With 'messages' disabled, the KEY cannot access private messages; the ACCOUNT's pre-existing webhook subscriptions are a separate grant surface.
925
+ */
926
+ disabledResourceGroups?: Array<('publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks')>;
923
927
  };
924
928
 
925
929
  /**
@@ -3878,6 +3882,7 @@ export type PostsListResponse = {
3878
3882
  export type PostUpdateResponse = {
3879
3883
  message?: string;
3880
3884
  post?: Post;
3885
+ warnings?: Array<(string)>;
3881
3886
  };
3882
3887
 
3883
3888
  export type Profile = {
@@ -10613,6 +10618,13 @@ export type ListApiKeysResponse = ({
10613
10618
 
10614
10619
  export type ListApiKeysError = ({
10615
10620
  error?: string;
10621
+ } | {
10622
+ error?: string;
10623
+ code?: 'insufficient_permissions' | 'unclassified_resource';
10624
+ /**
10625
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
10626
+ */
10627
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
10616
10628
  });
10617
10629
 
10618
10630
  export type CreateApiKeyData = {
@@ -10634,6 +10646,10 @@ export type CreateApiKeyData = {
10634
10646
  * 'read-write' allows all operations (default), 'read' restricts to GET requests only
10635
10647
  */
10636
10648
  permission?: 'read-write' | 'read';
10649
+ /**
10650
+ * Resource groups to DISABLE on this key (opt-out denylist). Omit for a legacy full-access key. A key with any group disabled mints with the zrk_ prefix, gets 403 with code=insufficient_permissions and required_group on operations in disabled groups (each operation's group is published as x-resource-group), and can never manage API keys, invites, or member identity. With 'messages' disabled, the KEY cannot access private messages; the ACCOUNT's pre-existing webhook subscriptions are a separate grant surface.
10651
+ */
10652
+ disabledResourceGroups?: Array<('publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks')>;
10637
10653
  };
10638
10654
  };
10639
10655
 
@@ -10644,6 +10660,13 @@ export type CreateApiKeyResponse = ({
10644
10660
 
10645
10661
  export type CreateApiKeyError = (unknown | {
10646
10662
  error?: string;
10663
+ } | {
10664
+ error?: string;
10665
+ code?: 'insufficient_permissions' | 'unclassified_resource';
10666
+ /**
10667
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
10668
+ */
10669
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
10647
10670
  });
10648
10671
 
10649
10672
  export type DeleteApiKeyData = {
@@ -10658,6 +10681,13 @@ export type DeleteApiKeyResponse = ({
10658
10681
 
10659
10682
  export type DeleteApiKeyError = ({
10660
10683
  error?: string;
10684
+ } | {
10685
+ error?: string;
10686
+ code?: 'insufficient_permissions' | 'unclassified_resource';
10687
+ /**
10688
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
10689
+ */
10690
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
10661
10691
  });
10662
10692
 
10663
10693
  export type ListConnectedAppsResponse = ({
@@ -10666,7 +10696,14 @@ export type ListConnectedAppsResponse = ({
10666
10696
 
10667
10697
  export type ListConnectedAppsError = ({
10668
10698
  error?: string;
10669
- } | ErrorResponse);
10699
+ } | {
10700
+ error?: string;
10701
+ code?: 'insufficient_permissions' | 'unclassified_resource';
10702
+ /**
10703
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
10704
+ */
10705
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
10706
+ });
10670
10707
 
10671
10708
  export type RevokeConnectedAppData = {
10672
10709
  path: {
@@ -10692,6 +10729,13 @@ export type RevokeConnectedAppResponse = ({
10692
10729
 
10693
10730
  export type RevokeConnectedAppError = (ErrorResponse | {
10694
10731
  error?: string;
10732
+ } | {
10733
+ error?: string;
10734
+ code?: 'insufficient_permissions' | 'unclassified_resource';
10735
+ /**
10736
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
10737
+ */
10738
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
10695
10739
  });
10696
10740
 
10697
10741
  export type CreateInviteTokenData = {
@@ -10726,6 +10770,13 @@ export type CreateInviteTokenResponse = ({
10726
10770
 
10727
10771
  export type CreateInviteTokenError = (unknown | {
10728
10772
  error?: string;
10773
+ } | {
10774
+ error?: string;
10775
+ code?: 'insufficient_permissions' | 'unclassified_resource';
10776
+ /**
10777
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
10778
+ */
10779
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
10729
10780
  });
10730
10781
 
10731
10782
  export type GetConnectUrlData = {
@@ -15137,6 +15188,13 @@ export type CreateWebhookSettingsResponse = ({
15137
15188
 
15138
15189
  export type CreateWebhookSettingsError = (unknown | {
15139
15190
  error?: string;
15191
+ } | {
15192
+ error?: string;
15193
+ code?: 'insufficient_permissions' | 'unclassified_resource';
15194
+ /**
15195
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
15196
+ */
15197
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
15140
15198
  });
15141
15199
 
15142
15200
  export type UpdateWebhookSettingsData = {
@@ -15181,6 +15239,13 @@ export type UpdateWebhookSettingsResponse = ({
15181
15239
 
15182
15240
  export type UpdateWebhookSettingsError = (unknown | {
15183
15241
  error?: string;
15242
+ } | {
15243
+ error?: string;
15244
+ code?: 'insufficient_permissions' | 'unclassified_resource';
15245
+ /**
15246
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
15247
+ */
15248
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
15184
15249
  });
15185
15250
 
15186
15251
  export type DeleteWebhookSettingsData = {
@@ -15257,6 +15322,13 @@ export type GetWebhookLogsResponse = ({
15257
15322
 
15258
15323
  export type GetWebhookLogsError = (unknown | {
15259
15324
  error?: string;
15325
+ } | {
15326
+ error?: string;
15327
+ code?: 'insufficient_permissions' | 'unclassified_resource';
15328
+ /**
15329
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
15330
+ */
15331
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
15260
15332
  });
15261
15333
 
15262
15334
  export type TestWebhookData = {