@zernio/node 0.2.745 → 0.2.747

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
@@ -342,7 +342,7 @@ declare class Zernio {
342
342
  getRedditFlairs: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetRedditFlairsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetRedditFlairsResponse, unknown, ThrowOnError>;
343
343
  setRedditPostFlair: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<SetRedditPostFlairData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<SetRedditPostFlairResponse, unknown, ThrowOnError>;
344
344
  facebook: {
345
- listFacebookPages: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<ListFacebookPagesData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<ListFacebookPagesResponse, unknown, ThrowOnError>;
345
+ listFacebookPages: <ThrowOnError extends boolean = false>(options?: _hey_api_client_fetch.OptionsLegacyParser<ListFacebookPagesData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<ListFacebookPagesResponse, unknown, ThrowOnError>;
346
346
  selectFacebookPage: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<SelectFacebookPageData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<SelectFacebookPageResponse, unknown, ThrowOnError>;
347
347
  };
348
348
  googleBusiness: {
@@ -15985,15 +15985,19 @@ type ConfigureTikTokAdsBrandIdentityError = (unknown | {
15985
15985
  error?: string;
15986
15986
  });
15987
15987
  type ListFacebookPagesData = {
15988
- query: {
15988
+ query?: {
15989
15989
  /**
15990
- * Profile ID from your connection flow
15990
+ * Profile ID from your classic connection flow. Required with tempToken.
15991
15991
  */
15992
- profileId: string;
15992
+ profileId?: string;
15993
15993
  /**
15994
- * Temporary Facebook access token from the OAuth callback redirect
15994
+ * Encrypted dashboard business-login grant. Send alone instead of profileId and tempToken. Expires after ten minutes.
15995
15995
  */
15996
- tempToken: string;
15996
+ selectionToken?: string;
15997
+ /**
15998
+ * Temporary Facebook access token from the classic OAuth callback. Required with profileId.
15999
+ */
16000
+ tempToken?: string;
15997
16001
  };
15998
16002
  };
15999
16003
  type ListFacebookPagesResponse = ({
@@ -16028,21 +16032,21 @@ type ListFacebookPagesError = (unknown | {
16028
16032
  error?: string;
16029
16033
  });
16030
16034
  type SelectFacebookPageData = {
16031
- body: {
16035
+ body: ({
16032
16036
  /**
16033
- * Profile ID from your connection flow
16037
+ * Profile ID from your classic connection flow.
16034
16038
  */
16035
16039
  profileId: string;
16036
16040
  /**
16037
- * The Facebook Page ID selected by the user
16041
+ * The Facebook Page ID selected by the user.
16038
16042
  */
16039
16043
  pageId: string;
16040
16044
  /**
16041
- * Temporary Facebook access token from OAuth
16045
+ * Temporary Facebook access token from OAuth.
16042
16046
  */
16043
16047
  tempToken: string;
16044
16048
  /**
16045
- * Decoded user profile object from the OAuth callback
16049
+ * Decoded user profile object from the OAuth callback.
16046
16050
  */
16047
16051
  userProfile: {
16048
16052
  id?: string;
@@ -16050,15 +16054,24 @@ type SelectFacebookPageData = {
16050
16054
  profilePicture?: string;
16051
16055
  };
16052
16056
  /**
16053
- * Optional custom redirect URL to return to after selection
16057
+ * Optional custom redirect URL to return to after selection.
16054
16058
  */
16055
16059
  redirect_url?: string;
16056
- };
16060
+ } | {
16061
+ /**
16062
+ * Encrypted dashboard business-login grant. Expires after ten minutes.
16063
+ */
16064
+ selectionToken: string;
16065
+ /**
16066
+ * A Page ID from the granted Pages returned by listFacebookPages.
16067
+ */
16068
+ pageId: string;
16069
+ });
16057
16070
  };
16058
16071
  type SelectFacebookPageResponse = ({
16059
16072
  message?: string;
16060
16073
  /**
16061
- * Redirect URL if custom redirect_url was provided
16074
+ * Redirect URL when a custom redirect_url was provided or a business Page was selected.
16062
16075
  */
16063
16076
  redirect_url?: string;
16064
16077
  account?: {
@@ -21249,6 +21262,53 @@ type CreateInboxConversationData = {
21249
21262
  */
21250
21263
  value: string;
21251
21264
  }>;
21265
+ /**
21266
+ * WhatsApp only. Per-card overrides for a CAROUSEL template, each addressed by the card's card_index. Carousel card body variables restart at {{1}} per card, so they cannot be expressed in the flat templateParams slot order; use this instead. A cardIndex naming a card the approved template does not have, a duplicate cardIndex, or a params count that does not match the card body's token count is rejected with 400 (INVALID_TEMPLATE_CARD_PARAM).
21267
+ */
21268
+ templateCards?: Array<{
21269
+ /**
21270
+ * The card's card_index in the approved template.
21271
+ */
21272
+ cardIndex: number;
21273
+ /**
21274
+ * Values for this card's own body variables, in the card's own {{1}}, {{2}}, ... order (or named-slot order of appearance).
21275
+ */
21276
+ params?: Array<(string)>;
21277
+ /**
21278
+ * Overrides this card's header asset for THIS send. Without it, the card's approved sample asset is sent.
21279
+ */
21280
+ headerMedia?: {
21281
+ /**
21282
+ * Must match the card header's media type.
21283
+ */
21284
+ type: 'image' | 'video' | 'document';
21285
+ /**
21286
+ * Public URL of the asset to send. Must be reachable without auth.
21287
+ */
21288
+ link?: string;
21289
+ /**
21290
+ * A Meta media id (from the media upload endpoint), as an alternative to link.
21291
+ */
21292
+ id?: string;
21293
+ };
21294
+ /**
21295
+ * Values for this card's own buttons, each addressed by the button's index within the card.
21296
+ */
21297
+ buttons?: Array<{
21298
+ /**
21299
+ * Zero-based position of the button within the card's buttons.
21300
+ */
21301
+ index: number;
21302
+ /**
21303
+ * The button kind, which decides how the value is sent.
21304
+ */
21305
+ subType: 'quick_reply' | 'url';
21306
+ /**
21307
+ * The value to send (quick_reply payload, or the URL dynamic suffix).
21308
+ */
21309
+ value: string;
21310
+ }>;
21311
+ }>;
21252
21312
  /**
21253
21313
  * WhatsApp only. Overrides a media-header template's header asset for THIS send, so a template with an image/video/document header can carry a different asset per message (e.g. each recipient their own invoice PDF). Without it, the template's approved sample asset is sent. Provide exactly one of link or id.
21254
21314
  */
@@ -21320,7 +21380,7 @@ type CreateInboxConversationResponse = ({
21320
21380
  });
21321
21381
  type CreateInboxConversationError = ({
21322
21382
  error?: string;
21323
- code?: 'PLATFORM_NOT_SUPPORTED' | 'PLATFORM_LIMITATION' | 'TEMPLATE_REQUIRED' | 'INVALID_TEMPLATE_PARAMS' | 'INVALID_TEMPLATE_BUTTON_PARAM' | 'DIRECT_SEND_NOT_ELIGIBLE' | 'DIRECT_SEND_LIMITED' | 'DIRECT_SEND_BLOCKED';
21383
+ code?: 'PLATFORM_NOT_SUPPORTED' | 'PLATFORM_LIMITATION' | 'TEMPLATE_REQUIRED' | 'INVALID_TEMPLATE_PARAMS' | 'INVALID_TEMPLATE_BUTTON_PARAM' | 'INVALID_TEMPLATE_CARD_PARAM' | 'DIRECT_SEND_NOT_ELIGIBLE' | 'DIRECT_SEND_LIMITED' | 'DIRECT_SEND_BLOCKED';
21324
21384
  } | {
21325
21385
  error?: string;
21326
21386
  } | unknown | {
package/dist/index.d.ts CHANGED
@@ -342,7 +342,7 @@ declare class Zernio {
342
342
  getRedditFlairs: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetRedditFlairsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetRedditFlairsResponse, unknown, ThrowOnError>;
343
343
  setRedditPostFlair: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<SetRedditPostFlairData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<SetRedditPostFlairResponse, unknown, ThrowOnError>;
344
344
  facebook: {
345
- listFacebookPages: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<ListFacebookPagesData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<ListFacebookPagesResponse, unknown, ThrowOnError>;
345
+ listFacebookPages: <ThrowOnError extends boolean = false>(options?: _hey_api_client_fetch.OptionsLegacyParser<ListFacebookPagesData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<ListFacebookPagesResponse, unknown, ThrowOnError>;
346
346
  selectFacebookPage: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<SelectFacebookPageData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<SelectFacebookPageResponse, unknown, ThrowOnError>;
347
347
  };
348
348
  googleBusiness: {
@@ -15985,15 +15985,19 @@ type ConfigureTikTokAdsBrandIdentityError = (unknown | {
15985
15985
  error?: string;
15986
15986
  });
15987
15987
  type ListFacebookPagesData = {
15988
- query: {
15988
+ query?: {
15989
15989
  /**
15990
- * Profile ID from your connection flow
15990
+ * Profile ID from your classic connection flow. Required with tempToken.
15991
15991
  */
15992
- profileId: string;
15992
+ profileId?: string;
15993
15993
  /**
15994
- * Temporary Facebook access token from the OAuth callback redirect
15994
+ * Encrypted dashboard business-login grant. Send alone instead of profileId and tempToken. Expires after ten minutes.
15995
15995
  */
15996
- tempToken: string;
15996
+ selectionToken?: string;
15997
+ /**
15998
+ * Temporary Facebook access token from the classic OAuth callback. Required with profileId.
15999
+ */
16000
+ tempToken?: string;
15997
16001
  };
15998
16002
  };
15999
16003
  type ListFacebookPagesResponse = ({
@@ -16028,21 +16032,21 @@ type ListFacebookPagesError = (unknown | {
16028
16032
  error?: string;
16029
16033
  });
16030
16034
  type SelectFacebookPageData = {
16031
- body: {
16035
+ body: ({
16032
16036
  /**
16033
- * Profile ID from your connection flow
16037
+ * Profile ID from your classic connection flow.
16034
16038
  */
16035
16039
  profileId: string;
16036
16040
  /**
16037
- * The Facebook Page ID selected by the user
16041
+ * The Facebook Page ID selected by the user.
16038
16042
  */
16039
16043
  pageId: string;
16040
16044
  /**
16041
- * Temporary Facebook access token from OAuth
16045
+ * Temporary Facebook access token from OAuth.
16042
16046
  */
16043
16047
  tempToken: string;
16044
16048
  /**
16045
- * Decoded user profile object from the OAuth callback
16049
+ * Decoded user profile object from the OAuth callback.
16046
16050
  */
16047
16051
  userProfile: {
16048
16052
  id?: string;
@@ -16050,15 +16054,24 @@ type SelectFacebookPageData = {
16050
16054
  profilePicture?: string;
16051
16055
  };
16052
16056
  /**
16053
- * Optional custom redirect URL to return to after selection
16057
+ * Optional custom redirect URL to return to after selection.
16054
16058
  */
16055
16059
  redirect_url?: string;
16056
- };
16060
+ } | {
16061
+ /**
16062
+ * Encrypted dashboard business-login grant. Expires after ten minutes.
16063
+ */
16064
+ selectionToken: string;
16065
+ /**
16066
+ * A Page ID from the granted Pages returned by listFacebookPages.
16067
+ */
16068
+ pageId: string;
16069
+ });
16057
16070
  };
16058
16071
  type SelectFacebookPageResponse = ({
16059
16072
  message?: string;
16060
16073
  /**
16061
- * Redirect URL if custom redirect_url was provided
16074
+ * Redirect URL when a custom redirect_url was provided or a business Page was selected.
16062
16075
  */
16063
16076
  redirect_url?: string;
16064
16077
  account?: {
@@ -21249,6 +21262,53 @@ type CreateInboxConversationData = {
21249
21262
  */
21250
21263
  value: string;
21251
21264
  }>;
21265
+ /**
21266
+ * WhatsApp only. Per-card overrides for a CAROUSEL template, each addressed by the card's card_index. Carousel card body variables restart at {{1}} per card, so they cannot be expressed in the flat templateParams slot order; use this instead. A cardIndex naming a card the approved template does not have, a duplicate cardIndex, or a params count that does not match the card body's token count is rejected with 400 (INVALID_TEMPLATE_CARD_PARAM).
21267
+ */
21268
+ templateCards?: Array<{
21269
+ /**
21270
+ * The card's card_index in the approved template.
21271
+ */
21272
+ cardIndex: number;
21273
+ /**
21274
+ * Values for this card's own body variables, in the card's own {{1}}, {{2}}, ... order (or named-slot order of appearance).
21275
+ */
21276
+ params?: Array<(string)>;
21277
+ /**
21278
+ * Overrides this card's header asset for THIS send. Without it, the card's approved sample asset is sent.
21279
+ */
21280
+ headerMedia?: {
21281
+ /**
21282
+ * Must match the card header's media type.
21283
+ */
21284
+ type: 'image' | 'video' | 'document';
21285
+ /**
21286
+ * Public URL of the asset to send. Must be reachable without auth.
21287
+ */
21288
+ link?: string;
21289
+ /**
21290
+ * A Meta media id (from the media upload endpoint), as an alternative to link.
21291
+ */
21292
+ id?: string;
21293
+ };
21294
+ /**
21295
+ * Values for this card's own buttons, each addressed by the button's index within the card.
21296
+ */
21297
+ buttons?: Array<{
21298
+ /**
21299
+ * Zero-based position of the button within the card's buttons.
21300
+ */
21301
+ index: number;
21302
+ /**
21303
+ * The button kind, which decides how the value is sent.
21304
+ */
21305
+ subType: 'quick_reply' | 'url';
21306
+ /**
21307
+ * The value to send (quick_reply payload, or the URL dynamic suffix).
21308
+ */
21309
+ value: string;
21310
+ }>;
21311
+ }>;
21252
21312
  /**
21253
21313
  * WhatsApp only. Overrides a media-header template's header asset for THIS send, so a template with an image/video/document header can carry a different asset per message (e.g. each recipient their own invoice PDF). Without it, the template's approved sample asset is sent. Provide exactly one of link or id.
21254
21314
  */
@@ -21320,7 +21380,7 @@ type CreateInboxConversationResponse = ({
21320
21380
  });
21321
21381
  type CreateInboxConversationError = ({
21322
21382
  error?: string;
21323
- code?: 'PLATFORM_NOT_SUPPORTED' | 'PLATFORM_LIMITATION' | 'TEMPLATE_REQUIRED' | 'INVALID_TEMPLATE_PARAMS' | 'INVALID_TEMPLATE_BUTTON_PARAM' | 'DIRECT_SEND_NOT_ELIGIBLE' | 'DIRECT_SEND_LIMITED' | 'DIRECT_SEND_BLOCKED';
21383
+ code?: 'PLATFORM_NOT_SUPPORTED' | 'PLATFORM_LIMITATION' | 'TEMPLATE_REQUIRED' | 'INVALID_TEMPLATE_PARAMS' | 'INVALID_TEMPLATE_BUTTON_PARAM' | 'INVALID_TEMPLATE_CARD_PARAM' | 'DIRECT_SEND_NOT_ELIGIBLE' | 'DIRECT_SEND_LIMITED' | 'DIRECT_SEND_BLOCKED';
21324
21384
  } | {
21325
21385
  error?: string;
21326
21386
  } | unknown | {
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.745",
39
+ version: "0.2.747",
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.745",
8
+ version: "0.2.747",
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.745",
3
+ "version": "0.2.747",
4
4
  "description": "The official Node.js library for the Zernio API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -1603,11 +1603,14 @@ export const handleOAuthCallback = <ThrowOnError extends boolean = false>(option
1603
1603
  * every previously scoped ad account (or every previous grant for an unscoped connection).
1604
1604
  * Missing or unverifiable grants return 409 before changing the account.
1605
1605
  *
1606
- * Pass `pageId` to select a granted Page for creatives and lead forms. Otherwise the
1607
- * previous Page or sole granted Page is selected. Multiple Pages without a selection
1608
- * return 400 with available Page IDs; restart with pageId. With no Pages granted the
1609
- * account can manage campaigns and sync insights but cannot create Page-based creatives
1610
- * or list Page forms. Success redirects with connected=metaads, profileId and accountId.
1606
+ * Pass `pageId` to select a granted Page for creatives and lead forms. API integrations
1607
+ * otherwise reuse the previous Page or sole granted Page. Multiple Pages without a selection
1608
+ * return 400 with available Page IDs for API integrations; restart with pageId.
1609
+ * Dashboard session logins use the sole current grant automatically or open the existing
1610
+ * Facebook Page picker for several grants, including reconnects. Selection completes
1611
+ * the Meta Ads connection. With no Pages granted the callback returns
1612
+ * 400 with instructions to connect again and grant a Page.
1613
+ * Success redirects with connected=metaads, profileId and accountId.
1611
1614
  * Business login reports metadata.tokenType=system-user in GET /v1/accounts. An absent
1612
1615
  * Meta expires_in leaves tokenExpiresAt absent; no personal-token re-exchange occurs.
1613
1616
  * Subsequent classic requests can change the ad-account scope using the business token;
@@ -1655,7 +1658,7 @@ export const connectAds = <ThrowOnError extends boolean = false>(options: Option
1655
1658
 
1656
1659
  /**
1657
1660
  * Complete Meta business login
1658
- * Facebook Login for Business redirect target. Meta supplies the single-use authorization code and the authenticated state returned by connectAds. The state expires after 30 minutes and binds the user, profile, Page selection and ad-account scope. No bearer token is sent by the browser. Success reconnects only metaads and redirects to the original redirect_url. Invalid state returns 400; inaccessible profiles or missing ads access cannot connect. No token is returned to the browser.
1661
+ * Facebook Login for Business redirect target. Meta supplies the single-use authorization code and the authenticated state returned by connectAds. The state expires after 30 minutes and binds the user, profile, Page selection and ad-account scope. No bearer token is sent by the browser. Success reconnects only metaads and redirects to the original redirect_url. Invalid state returns 400; inaccessible profiles or missing ads access cannot connect. Dashboard logins with several Pages redirect to the Facebook Page picker with an encrypted selectionToken valid for ten minutes. Listing and selecting require the initiating user and current profile access. No plaintext platform token is returned to the browser.
1659
1662
  */
1660
1663
  export const completeMetaAdsBusinessLogin = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CompleteMetaAdsBusinessLoginData, ThrowOnError>) => {
1661
1664
  return (options?.client ?? client).get<void, unknown, ThrowOnError>({
@@ -1739,9 +1742,9 @@ export const configureTikTokAdsBrandIdentity = <ThrowOnError extends boolean = f
1739
1742
 
1740
1743
  /**
1741
1744
  * List Facebook pages
1742
- * Returns the list of Facebook Pages the user can manage after OAuth. Extract tempToken and userProfile from the OAuth redirect params and pass them here. Use the X-Connect-Token header if connecting via API key.
1745
+ * Returns Facebook Pages after OAuth. Classic connections require profileId and tempToken from the OAuth redirect. Use X-Connect-Token for headless connections. The dashboard business-login picker instead sends only selectionToken, an encrypted grant valid for ten minutes. This requires the initiating user and current profile access and returns only Page IDs and names. X-Connect-Token cannot authorize business selection.
1743
1746
  */
1744
- export const listFacebookPages = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ListFacebookPagesData, ThrowOnError>) => {
1747
+ export const listFacebookPages = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<ListFacebookPagesData, ThrowOnError>) => {
1745
1748
  return (options?.client ?? client).get<ListFacebookPagesResponse, ListFacebookPagesError, ThrowOnError>({
1746
1749
  ...options,
1747
1750
  url: '/v1/connect/facebook/select-page'
@@ -1750,7 +1753,7 @@ export const listFacebookPages = <ThrowOnError extends boolean = false>(options:
1750
1753
 
1751
1754
  /**
1752
1755
  * Select Facebook page
1753
- * Complete the headless flow by saving the user's selected Facebook page. Pass the userProfile from the OAuth redirect and use X-Connect-Token if connecting via API key.
1756
+ * Complete a classic Facebook Page connection with profileId, pageId, tempToken and userProfile. Use X-Connect-Token for headless connections. The dashboard business-login picker instead sends only selectionToken and pageId to complete a Meta Ads connection. The server verifies the initiating user, profile access, current grants and connection eligibility. The profile, platform token, ad-account scope and return URL come only from the encrypted grant. Business selection requires a session or bearer authentication for the initiating user; X-Connect-Token is not accepted. It returns redirect_url with connected=metaads on success or an eligibility error redirect.
1754
1757
  */
1755
1758
  export const selectFacebookPage = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<SelectFacebookPageData, ThrowOnError>) => {
1756
1759
  return (options?.client ?? client).post<SelectFacebookPageResponse, SelectFacebookPageError, ThrowOnError>({
@@ -3588,6 +3591,7 @@ export const listInboxConversations = <ThrowOnError extends boolean = false>(opt
3588
3591
  * - Templates with media headers (image, video, document) are handled automatically: Zernio reads the approved template definition and fills the header at send time with the template's approved sample asset. To send a DIFFERENT asset per message (e.g. a distinct invoice PDF for each recipient), pass the headerMedia field with a public link (or a Meta media id); it overrides the sample for that send.
3589
3592
  * - A template whose approved header format is LOCATION has no header asset to reconstruct at all: Meta only accepts the location at send time, so pass headerLocation (latitude and longitude required) whenever such a template is sent; headerMedia and headerLocation cannot both be supplied.
3590
3593
  * - A button that carries its own value at send time (a copy-code button holding a Pix payment code or a coupon, a flow token) is sent with templateButtonParams, addressed by the button's index; templateParams covers text variables and dynamic URL buttons only.
3594
+ * - CAROUSEL templates take per-card overrides via templateCards, each addressed by the card's card_index, because card body variables restart at {{1}} per card and cannot be expressed in the flat templateParams order.
3591
3595
  * - Template fields are accepted on the JSON body only, not on multipart requests.
3592
3596
  *
3593
3597
  * For a number you already have a thread with, this sends the template into that thread, which also makes it the way to re-engage a contact after the 24-hour customer-service window has closed. Once the recipient replies (opening the 24h window), send freeform messages with the send-message endpoint (POST /v1/inbox/conversations/{conversationId}/messages).
@@ -15103,15 +15103,19 @@ export type ConfigureTikTokAdsBrandIdentityError = (unknown | {
15103
15103
  });
15104
15104
 
15105
15105
  export type ListFacebookPagesData = {
15106
- query: {
15106
+ query?: {
15107
15107
  /**
15108
- * Profile ID from your connection flow
15108
+ * Profile ID from your classic connection flow. Required with tempToken.
15109
15109
  */
15110
- profileId: string;
15110
+ profileId?: string;
15111
15111
  /**
15112
- * Temporary Facebook access token from the OAuth callback redirect
15112
+ * Encrypted dashboard business-login grant. Send alone instead of profileId and tempToken. Expires after ten minutes.
15113
15113
  */
15114
- tempToken: string;
15114
+ selectionToken?: string;
15115
+ /**
15116
+ * Temporary Facebook access token from the classic OAuth callback. Required with profileId.
15117
+ */
15118
+ tempToken?: string;
15115
15119
  };
15116
15120
  };
15117
15121
 
@@ -15149,38 +15153,47 @@ export type ListFacebookPagesError = (unknown | {
15149
15153
  });
15150
15154
 
15151
15155
  export type SelectFacebookPageData = {
15152
- body: {
15153
- /**
15154
- * Profile ID from your connection flow
15155
- */
15156
- profileId: string;
15157
- /**
15158
- * The Facebook Page ID selected by the user
15159
- */
15160
- pageId: string;
15161
- /**
15162
- * Temporary Facebook access token from OAuth
15163
- */
15164
- tempToken: string;
15165
- /**
15166
- * Decoded user profile object from the OAuth callback
15167
- */
15168
- userProfile: {
15169
- id?: string;
15170
- name?: string;
15171
- profilePicture?: string;
15172
- };
15173
- /**
15174
- * Optional custom redirect URL to return to after selection
15175
- */
15176
- redirect_url?: string;
15156
+ body: ({
15157
+ /**
15158
+ * Profile ID from your classic connection flow.
15159
+ */
15160
+ profileId: string;
15161
+ /**
15162
+ * The Facebook Page ID selected by the user.
15163
+ */
15164
+ pageId: string;
15165
+ /**
15166
+ * Temporary Facebook access token from OAuth.
15167
+ */
15168
+ tempToken: string;
15169
+ /**
15170
+ * Decoded user profile object from the OAuth callback.
15171
+ */
15172
+ userProfile: {
15173
+ id?: string;
15174
+ name?: string;
15175
+ profilePicture?: string;
15177
15176
  };
15177
+ /**
15178
+ * Optional custom redirect URL to return to after selection.
15179
+ */
15180
+ redirect_url?: string;
15181
+ } | {
15182
+ /**
15183
+ * Encrypted dashboard business-login grant. Expires after ten minutes.
15184
+ */
15185
+ selectionToken: string;
15186
+ /**
15187
+ * A Page ID from the granted Pages returned by listFacebookPages.
15188
+ */
15189
+ pageId: string;
15190
+ });
15178
15191
  };
15179
15192
 
15180
15193
  export type SelectFacebookPageResponse = ({
15181
15194
  message?: string;
15182
15195
  /**
15183
- * Redirect URL if custom redirect_url was provided
15196
+ * Redirect URL when a custom redirect_url was provided or a business Page was selected.
15184
15197
  */
15185
15198
  redirect_url?: string;
15186
15199
  account?: {
@@ -20738,6 +20751,53 @@ export type CreateInboxConversationData = {
20738
20751
  */
20739
20752
  value: string;
20740
20753
  }>;
20754
+ /**
20755
+ * WhatsApp only. Per-card overrides for a CAROUSEL template, each addressed by the card's card_index. Carousel card body variables restart at {{1}} per card, so they cannot be expressed in the flat templateParams slot order; use this instead. A cardIndex naming a card the approved template does not have, a duplicate cardIndex, or a params count that does not match the card body's token count is rejected with 400 (INVALID_TEMPLATE_CARD_PARAM).
20756
+ */
20757
+ templateCards?: Array<{
20758
+ /**
20759
+ * The card's card_index in the approved template.
20760
+ */
20761
+ cardIndex: number;
20762
+ /**
20763
+ * Values for this card's own body variables, in the card's own {{1}}, {{2}}, ... order (or named-slot order of appearance).
20764
+ */
20765
+ params?: Array<(string)>;
20766
+ /**
20767
+ * Overrides this card's header asset for THIS send. Without it, the card's approved sample asset is sent.
20768
+ */
20769
+ headerMedia?: {
20770
+ /**
20771
+ * Must match the card header's media type.
20772
+ */
20773
+ type: 'image' | 'video' | 'document';
20774
+ /**
20775
+ * Public URL of the asset to send. Must be reachable without auth.
20776
+ */
20777
+ link?: string;
20778
+ /**
20779
+ * A Meta media id (from the media upload endpoint), as an alternative to link.
20780
+ */
20781
+ id?: string;
20782
+ };
20783
+ /**
20784
+ * Values for this card's own buttons, each addressed by the button's index within the card.
20785
+ */
20786
+ buttons?: Array<{
20787
+ /**
20788
+ * Zero-based position of the button within the card's buttons.
20789
+ */
20790
+ index: number;
20791
+ /**
20792
+ * The button kind, which decides how the value is sent.
20793
+ */
20794
+ subType: 'quick_reply' | 'url';
20795
+ /**
20796
+ * The value to send (quick_reply payload, or the URL dynamic suffix).
20797
+ */
20798
+ value: string;
20799
+ }>;
20800
+ }>;
20741
20801
  /**
20742
20802
  * WhatsApp only. Overrides a media-header template's header asset for THIS send, so a template with an image/video/document header can carry a different asset per message (e.g. each recipient their own invoice PDF). Without it, the template's approved sample asset is sent. Provide exactly one of link or id.
20743
20803
  */
@@ -20811,7 +20871,7 @@ export type CreateInboxConversationResponse = ({
20811
20871
 
20812
20872
  export type CreateInboxConversationError = ({
20813
20873
  error?: string;
20814
- code?: 'PLATFORM_NOT_SUPPORTED' | 'PLATFORM_LIMITATION' | 'TEMPLATE_REQUIRED' | 'INVALID_TEMPLATE_PARAMS' | 'INVALID_TEMPLATE_BUTTON_PARAM' | 'DIRECT_SEND_NOT_ELIGIBLE' | 'DIRECT_SEND_LIMITED' | 'DIRECT_SEND_BLOCKED';
20874
+ code?: 'PLATFORM_NOT_SUPPORTED' | 'PLATFORM_LIMITATION' | 'TEMPLATE_REQUIRED' | 'INVALID_TEMPLATE_PARAMS' | 'INVALID_TEMPLATE_BUTTON_PARAM' | 'INVALID_TEMPLATE_CARD_PARAM' | 'DIRECT_SEND_NOT_ELIGIBLE' | 'DIRECT_SEND_LIMITED' | 'DIRECT_SEND_BLOCKED';
20815
20875
  } | {
20816
20876
  error?: string;
20817
20877
  } | unknown | {