@zernio/node 0.2.506 → 0.2.508

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
@@ -4821,6 +4825,10 @@ type PlatformTarget = {
4821
4825
  * Timestamp when the post was published to this platform
4822
4826
  */
4823
4827
  publishedAt?: string;
4828
+ /**
4829
+ * Set when a post that was successfully published later disappears from the platform (deleted on-platform or taken down by the platform). status stays "published" (it reflects the publish outcome); poll this field to detect post-publish removals. Absent while the post is live, and cleared if the post reappears. Detection runs with the analytics sync, so expect up to a few hours of lag.
4830
+ */
4831
+ removedFromPlatformAt?: (string) | null;
4824
4832
  /**
4825
4833
  * Present and true only when this Instagram reel was launched as a Trial through Zernio (created with platformSpecificData.trialParams). Use it to segment trial reels in analytics. Note: Instagram's Graph API exposes no readable trial field, so this reflects creation-time intent only. It indicates the reel STARTED as a trial, not whether or when it graduated.
4826
4834
  */
@@ -11320,6 +11328,13 @@ type ListApiKeysResponse = ({
11320
11328
  });
11321
11329
  type ListApiKeysError = ({
11322
11330
  error?: string;
11331
+ } | {
11332
+ error?: string;
11333
+ code?: 'insufficient_permissions' | 'unclassified_resource';
11334
+ /**
11335
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
11336
+ */
11337
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
11323
11338
  });
11324
11339
  type CreateApiKeyData = {
11325
11340
  body: {
@@ -11340,6 +11355,10 @@ type CreateApiKeyData = {
11340
11355
  * 'read-write' allows all operations (default), 'read' restricts to GET requests only
11341
11356
  */
11342
11357
  permission?: 'read-write' | 'read';
11358
+ /**
11359
+ * 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.
11360
+ */
11361
+ disabledResourceGroups?: Array<('publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks')>;
11343
11362
  };
11344
11363
  };
11345
11364
  type CreateApiKeyResponse = ({
@@ -11348,6 +11367,13 @@ type CreateApiKeyResponse = ({
11348
11367
  });
11349
11368
  type CreateApiKeyError = (unknown | {
11350
11369
  error?: string;
11370
+ } | {
11371
+ error?: string;
11372
+ code?: 'insufficient_permissions' | 'unclassified_resource';
11373
+ /**
11374
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
11375
+ */
11376
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
11351
11377
  });
11352
11378
  type DeleteApiKeyData = {
11353
11379
  path: {
@@ -11359,13 +11385,27 @@ type DeleteApiKeyResponse = ({
11359
11385
  });
11360
11386
  type DeleteApiKeyError = ({
11361
11387
  error?: string;
11388
+ } | {
11389
+ error?: string;
11390
+ code?: 'insufficient_permissions' | 'unclassified_resource';
11391
+ /**
11392
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
11393
+ */
11394
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
11362
11395
  });
11363
11396
  type ListConnectedAppsResponse = ({
11364
11397
  connectedApps?: Array<ConnectedApp>;
11365
11398
  });
11366
11399
  type ListConnectedAppsError = ({
11367
11400
  error?: string;
11368
- } | ErrorResponse);
11401
+ } | {
11402
+ error?: string;
11403
+ code?: 'insufficient_permissions' | 'unclassified_resource';
11404
+ /**
11405
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
11406
+ */
11407
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
11408
+ });
11369
11409
  type RevokeConnectedAppData = {
11370
11410
  path: {
11371
11411
  /**
@@ -11388,6 +11428,13 @@ type RevokeConnectedAppResponse = ({
11388
11428
  });
11389
11429
  type RevokeConnectedAppError = (ErrorResponse | {
11390
11430
  error?: string;
11431
+ } | {
11432
+ error?: string;
11433
+ code?: 'insufficient_permissions' | 'unclassified_resource';
11434
+ /**
11435
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
11436
+ */
11437
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
11391
11438
  });
11392
11439
  type CreateInviteTokenData = {
11393
11440
  body: {
@@ -11419,6 +11466,13 @@ type CreateInviteTokenResponse = ({
11419
11466
  });
11420
11467
  type CreateInviteTokenError = (unknown | {
11421
11468
  error?: string;
11469
+ } | {
11470
+ error?: string;
11471
+ code?: 'insufficient_permissions' | 'unclassified_resource';
11472
+ /**
11473
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
11474
+ */
11475
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
11422
11476
  });
11423
11477
  type GetConnectUrlData = {
11424
11478
  path: {
@@ -15507,6 +15561,13 @@ type CreateWebhookSettingsResponse = ({
15507
15561
  });
15508
15562
  type CreateWebhookSettingsError = (unknown | {
15509
15563
  error?: string;
15564
+ } | {
15565
+ error?: string;
15566
+ code?: 'insufficient_permissions' | 'unclassified_resource';
15567
+ /**
15568
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
15569
+ */
15570
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
15510
15571
  });
15511
15572
  type UpdateWebhookSettingsData = {
15512
15573
  body: {
@@ -15548,6 +15609,13 @@ type UpdateWebhookSettingsResponse = ({
15548
15609
  });
15549
15610
  type UpdateWebhookSettingsError = (unknown | {
15550
15611
  error?: string;
15612
+ } | {
15613
+ error?: string;
15614
+ code?: 'insufficient_permissions' | 'unclassified_resource';
15615
+ /**
15616
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
15617
+ */
15618
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
15551
15619
  });
15552
15620
  type DeleteWebhookSettingsData = {
15553
15621
  query: {
@@ -15618,6 +15686,13 @@ type GetWebhookLogsResponse = ({
15618
15686
  });
15619
15687
  type GetWebhookLogsError = (unknown | {
15620
15688
  error?: string;
15689
+ } | {
15690
+ error?: string;
15691
+ code?: 'insufficient_permissions' | 'unclassified_resource';
15692
+ /**
15693
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
15694
+ */
15695
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
15621
15696
  });
15622
15697
  type TestWebhookData = {
15623
15698
  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
@@ -4821,6 +4825,10 @@ type PlatformTarget = {
4821
4825
  * Timestamp when the post was published to this platform
4822
4826
  */
4823
4827
  publishedAt?: string;
4828
+ /**
4829
+ * Set when a post that was successfully published later disappears from the platform (deleted on-platform or taken down by the platform). status stays "published" (it reflects the publish outcome); poll this field to detect post-publish removals. Absent while the post is live, and cleared if the post reappears. Detection runs with the analytics sync, so expect up to a few hours of lag.
4830
+ */
4831
+ removedFromPlatformAt?: (string) | null;
4824
4832
  /**
4825
4833
  * Present and true only when this Instagram reel was launched as a Trial through Zernio (created with platformSpecificData.trialParams). Use it to segment trial reels in analytics. Note: Instagram's Graph API exposes no readable trial field, so this reflects creation-time intent only. It indicates the reel STARTED as a trial, not whether or when it graduated.
4826
4834
  */
@@ -11320,6 +11328,13 @@ type ListApiKeysResponse = ({
11320
11328
  });
11321
11329
  type ListApiKeysError = ({
11322
11330
  error?: string;
11331
+ } | {
11332
+ error?: string;
11333
+ code?: 'insufficient_permissions' | 'unclassified_resource';
11334
+ /**
11335
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
11336
+ */
11337
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
11323
11338
  });
11324
11339
  type CreateApiKeyData = {
11325
11340
  body: {
@@ -11340,6 +11355,10 @@ type CreateApiKeyData = {
11340
11355
  * 'read-write' allows all operations (default), 'read' restricts to GET requests only
11341
11356
  */
11342
11357
  permission?: 'read-write' | 'read';
11358
+ /**
11359
+ * 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.
11360
+ */
11361
+ disabledResourceGroups?: Array<('publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks')>;
11343
11362
  };
11344
11363
  };
11345
11364
  type CreateApiKeyResponse = ({
@@ -11348,6 +11367,13 @@ type CreateApiKeyResponse = ({
11348
11367
  });
11349
11368
  type CreateApiKeyError = (unknown | {
11350
11369
  error?: string;
11370
+ } | {
11371
+ error?: string;
11372
+ code?: 'insufficient_permissions' | 'unclassified_resource';
11373
+ /**
11374
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
11375
+ */
11376
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
11351
11377
  });
11352
11378
  type DeleteApiKeyData = {
11353
11379
  path: {
@@ -11359,13 +11385,27 @@ type DeleteApiKeyResponse = ({
11359
11385
  });
11360
11386
  type DeleteApiKeyError = ({
11361
11387
  error?: string;
11388
+ } | {
11389
+ error?: string;
11390
+ code?: 'insufficient_permissions' | 'unclassified_resource';
11391
+ /**
11392
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
11393
+ */
11394
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
11362
11395
  });
11363
11396
  type ListConnectedAppsResponse = ({
11364
11397
  connectedApps?: Array<ConnectedApp>;
11365
11398
  });
11366
11399
  type ListConnectedAppsError = ({
11367
11400
  error?: string;
11368
- } | ErrorResponse);
11401
+ } | {
11402
+ error?: string;
11403
+ code?: 'insufficient_permissions' | 'unclassified_resource';
11404
+ /**
11405
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
11406
+ */
11407
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
11408
+ });
11369
11409
  type RevokeConnectedAppData = {
11370
11410
  path: {
11371
11411
  /**
@@ -11388,6 +11428,13 @@ type RevokeConnectedAppResponse = ({
11388
11428
  });
11389
11429
  type RevokeConnectedAppError = (ErrorResponse | {
11390
11430
  error?: string;
11431
+ } | {
11432
+ error?: string;
11433
+ code?: 'insufficient_permissions' | 'unclassified_resource';
11434
+ /**
11435
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
11436
+ */
11437
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
11391
11438
  });
11392
11439
  type CreateInviteTokenData = {
11393
11440
  body: {
@@ -11419,6 +11466,13 @@ type CreateInviteTokenResponse = ({
11419
11466
  });
11420
11467
  type CreateInviteTokenError = (unknown | {
11421
11468
  error?: string;
11469
+ } | {
11470
+ error?: string;
11471
+ code?: 'insufficient_permissions' | 'unclassified_resource';
11472
+ /**
11473
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
11474
+ */
11475
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
11422
11476
  });
11423
11477
  type GetConnectUrlData = {
11424
11478
  path: {
@@ -15507,6 +15561,13 @@ type CreateWebhookSettingsResponse = ({
15507
15561
  });
15508
15562
  type CreateWebhookSettingsError = (unknown | {
15509
15563
  error?: string;
15564
+ } | {
15565
+ error?: string;
15566
+ code?: 'insufficient_permissions' | 'unclassified_resource';
15567
+ /**
15568
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
15569
+ */
15570
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
15510
15571
  });
15511
15572
  type UpdateWebhookSettingsData = {
15512
15573
  body: {
@@ -15548,6 +15609,13 @@ type UpdateWebhookSettingsResponse = ({
15548
15609
  });
15549
15610
  type UpdateWebhookSettingsError = (unknown | {
15550
15611
  error?: string;
15612
+ } | {
15613
+ error?: string;
15614
+ code?: 'insufficient_permissions' | 'unclassified_resource';
15615
+ /**
15616
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
15617
+ */
15618
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
15551
15619
  });
15552
15620
  type DeleteWebhookSettingsData = {
15553
15621
  query: {
@@ -15618,6 +15686,13 @@ type GetWebhookLogsResponse = ({
15618
15686
  });
15619
15687
  type GetWebhookLogsError = (unknown | {
15620
15688
  error?: string;
15689
+ } | {
15690
+ error?: string;
15691
+ code?: 'insufficient_permissions' | 'unclassified_resource';
15692
+ /**
15693
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
15694
+ */
15695
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
15621
15696
  });
15622
15697
  type TestWebhookData = {
15623
15698
  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.506",
39
+ version: "0.2.508",
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.506",
8
+ version: "0.2.508",
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.506",
3
+ "version": "0.2.508",
4
4
  "description": "The official Node.js library for the Zernio API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -1235,9 +1235,10 @@ export const deleteApiKey = <ThrowOnError extends boolean = false>(options: Opti
1235
1235
  * Returns the OAuth clients (AI assistants and MCP connectors) the authenticated
1236
1236
  * user has authorized and that still hold a live token.
1237
1237
  *
1238
- * Requires a session or a full-scope API key. A profile-scoped API key or an
1239
- * OAuth access token is rejected with 403: an app must not be able to enumerate
1240
- * 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.
1241
1242
  *
1242
1243
  */
1243
1244
  export const listConnectedApps = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<unknown, ThrowOnError>) => {
@@ -1256,6 +1257,9 @@ export const listConnectedApps = <ThrowOnError extends boolean = false>(options?
1256
1257
  * Idempotent while the authorization is still on record: revoking an app that
1257
1258
  * was already revoked returns 200 with `revokedTokens: 0`.
1258
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
+ *
1259
1263
  */
1260
1264
  export const revokeConnectedApp = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<RevokeConnectedAppData, ThrowOnError>) => {
1261
1265
  return (options?.client ?? client).delete<RevokeConnectedAppResponse, RevokeConnectedAppError, ThrowOnError>({
@@ -1269,6 +1273,9 @@ export const revokeConnectedApp = <ThrowOnError extends boolean = false>(options
1269
1273
  * Generate a secure invite link to grant team members access to your profiles.
1270
1274
  * Invites expire after 7 days and are single-use.
1271
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
+ *
1272
1279
  */
1273
1280
  export const createInviteToken = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CreateInviteTokenData, ThrowOnError>) => {
1274
1281
  return (options?.client ?? client).post<CreateInviteTokenResponse, CreateInviteTokenError, ThrowOnError>({
@@ -2809,6 +2816,11 @@ export const getWebhookSettings = <ThrowOnError extends boolean = false>(options
2809
2816
  *
2810
2817
  * Webhooks are automatically disabled after 10 consecutive delivery failures.
2811
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
+ *
2812
2824
  */
2813
2825
  export const createWebhookSettings = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CreateWebhookSettingsData, ThrowOnError>) => {
2814
2826
  return (options?.client ?? client).post<CreateWebhookSettingsResponse, CreateWebhookSettingsError, ThrowOnError>({
@@ -2825,6 +2837,9 @@ export const createWebhookSettings = <ThrowOnError extends boolean = false>(opti
2825
2837
  *
2826
2838
  * Webhooks are automatically disabled after 10 consecutive delivery failures.
2827
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
+ *
2828
2843
  */
2829
2844
  export const updateWebhookSettings = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UpdateWebhookSettingsData, ThrowOnError>) => {
2830
2845
  return (options?.client ?? client).put<UpdateWebhookSettingsResponse, UpdateWebhookSettingsError, ThrowOnError>({
@@ -2850,6 +2865,10 @@ export const deleteWebhookSettings = <ThrowOnError extends boolean = false>(opti
2850
2865
  * Logs are retained for 30 days. Supports filtering by status, event type, webhook ID, and event ID,
2851
2866
  * plus offset-based pagination.
2852
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
+ *
2853
2872
  */
2854
2873
  export const getWebhookLogs = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<GetWebhookLogsData, ThrowOnError>) => {
2855
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
  /**
@@ -3735,6 +3739,10 @@ export type PlatformTarget = {
3735
3739
  * Timestamp when the post was published to this platform
3736
3740
  */
3737
3741
  publishedAt?: string;
3742
+ /**
3743
+ * Set when a post that was successfully published later disappears from the platform (deleted on-platform or taken down by the platform). status stays "published" (it reflects the publish outcome); poll this field to detect post-publish removals. Absent while the post is live, and cleared if the post reappears. Detection runs with the analytics sync, so expect up to a few hours of lag.
3744
+ */
3745
+ removedFromPlatformAt?: (string) | null;
3738
3746
  /**
3739
3747
  * Present and true only when this Instagram reel was launched as a Trial through Zernio (created with platformSpecificData.trialParams). Use it to segment trial reels in analytics. Note: Instagram's Graph API exposes no readable trial field, so this reflects creation-time intent only. It indicates the reel STARTED as a trial, not whether or when it graduated.
3740
3748
  */
@@ -10614,6 +10622,13 @@ export type ListApiKeysResponse = ({
10614
10622
 
10615
10623
  export type ListApiKeysError = ({
10616
10624
  error?: string;
10625
+ } | {
10626
+ error?: string;
10627
+ code?: 'insufficient_permissions' | 'unclassified_resource';
10628
+ /**
10629
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
10630
+ */
10631
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
10617
10632
  });
10618
10633
 
10619
10634
  export type CreateApiKeyData = {
@@ -10635,6 +10650,10 @@ export type CreateApiKeyData = {
10635
10650
  * 'read-write' allows all operations (default), 'read' restricts to GET requests only
10636
10651
  */
10637
10652
  permission?: 'read-write' | 'read';
10653
+ /**
10654
+ * 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.
10655
+ */
10656
+ disabledResourceGroups?: Array<('publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks')>;
10638
10657
  };
10639
10658
  };
10640
10659
 
@@ -10645,6 +10664,13 @@ export type CreateApiKeyResponse = ({
10645
10664
 
10646
10665
  export type CreateApiKeyError = (unknown | {
10647
10666
  error?: string;
10667
+ } | {
10668
+ error?: string;
10669
+ code?: 'insufficient_permissions' | 'unclassified_resource';
10670
+ /**
10671
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
10672
+ */
10673
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
10648
10674
  });
10649
10675
 
10650
10676
  export type DeleteApiKeyData = {
@@ -10659,6 +10685,13 @@ export type DeleteApiKeyResponse = ({
10659
10685
 
10660
10686
  export type DeleteApiKeyError = ({
10661
10687
  error?: string;
10688
+ } | {
10689
+ error?: string;
10690
+ code?: 'insufficient_permissions' | 'unclassified_resource';
10691
+ /**
10692
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
10693
+ */
10694
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
10662
10695
  });
10663
10696
 
10664
10697
  export type ListConnectedAppsResponse = ({
@@ -10667,7 +10700,14 @@ export type ListConnectedAppsResponse = ({
10667
10700
 
10668
10701
  export type ListConnectedAppsError = ({
10669
10702
  error?: string;
10670
- } | ErrorResponse);
10703
+ } | {
10704
+ error?: string;
10705
+ code?: 'insufficient_permissions' | 'unclassified_resource';
10706
+ /**
10707
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
10708
+ */
10709
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
10710
+ });
10671
10711
 
10672
10712
  export type RevokeConnectedAppData = {
10673
10713
  path: {
@@ -10693,6 +10733,13 @@ export type RevokeConnectedAppResponse = ({
10693
10733
 
10694
10734
  export type RevokeConnectedAppError = (ErrorResponse | {
10695
10735
  error?: string;
10736
+ } | {
10737
+ error?: string;
10738
+ code?: 'insufficient_permissions' | 'unclassified_resource';
10739
+ /**
10740
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
10741
+ */
10742
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
10696
10743
  });
10697
10744
 
10698
10745
  export type CreateInviteTokenData = {
@@ -10727,6 +10774,13 @@ export type CreateInviteTokenResponse = ({
10727
10774
 
10728
10775
  export type CreateInviteTokenError = (unknown | {
10729
10776
  error?: string;
10777
+ } | {
10778
+ error?: string;
10779
+ code?: 'insufficient_permissions' | 'unclassified_resource';
10780
+ /**
10781
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
10782
+ */
10783
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
10730
10784
  });
10731
10785
 
10732
10786
  export type GetConnectUrlData = {
@@ -15138,6 +15192,13 @@ export type CreateWebhookSettingsResponse = ({
15138
15192
 
15139
15193
  export type CreateWebhookSettingsError = (unknown | {
15140
15194
  error?: string;
15195
+ } | {
15196
+ error?: string;
15197
+ code?: 'insufficient_permissions' | 'unclassified_resource';
15198
+ /**
15199
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
15200
+ */
15201
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
15141
15202
  });
15142
15203
 
15143
15204
  export type UpdateWebhookSettingsData = {
@@ -15182,6 +15243,13 @@ export type UpdateWebhookSettingsResponse = ({
15182
15243
 
15183
15244
  export type UpdateWebhookSettingsError = (unknown | {
15184
15245
  error?: string;
15246
+ } | {
15247
+ error?: string;
15248
+ code?: 'insufficient_permissions' | 'unclassified_resource';
15249
+ /**
15250
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
15251
+ */
15252
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
15185
15253
  });
15186
15254
 
15187
15255
  export type DeleteWebhookSettingsData = {
@@ -15258,6 +15326,13 @@ export type GetWebhookLogsResponse = ({
15258
15326
 
15259
15327
  export type GetWebhookLogsError = (unknown | {
15260
15328
  error?: string;
15329
+ } | {
15330
+ error?: string;
15331
+ code?: 'insufficient_permissions' | 'unclassified_resource';
15332
+ /**
15333
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
15334
+ */
15335
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks';
15261
15336
  });
15262
15337
 
15263
15338
  export type TestWebhookData = {