@@ -5234,6 +5234,67 @@ paths:
52345234 x-content-type: application/json
52355235 x-accepts:
52365236 - application/json
5237+ /v1/connect/whatsapp/credentials:
5238+ post:
5239+ description: |
5240+ Connect a WhatsApp Business Account by providing Meta credentials directly.
5241+ This is the headless alternative to the Embedded Signup browser flow.
5242+
5243+ To get the required credentials:
5244+ 1. Go to Meta Business Suite (business.facebook.com)
5245+ 2. Create or select a WhatsApp Business Account
5246+ 3. In Business Settings > System Users, create a System User
5247+ 4. Assign it the `whatsapp_business_management` and `whatsapp_business_messaging` permissions
5248+ 5. Generate a permanent access token
5249+ 6. Get the WABA ID from WhatsApp Manager > Account Tools > Phone Numbers
5250+ 7. Get the Phone Number ID from the same page (click on the number)
5251+ operationId: connectWhatsAppCredentials
5252+ requestBody:
5253+ content:
5254+ application/json:
5255+ example:
5256+ profileId: 6507a1b2c3d4e5f6a7b8c9d0
5257+ accessToken: EAABsbCS...your-system-user-token
5258+ wabaId: "123456789012345"
5259+ phoneNumberId: "987654321098765"
5260+ schema:
5261+ $ref: "#/components/schemas/connectWhatsAppCredentials_request"
5262+ required: true
5263+ responses:
5264+ "200":
5265+ content:
5266+ application/json:
5267+ example:
5268+ message: WhatsApp connected successfully
5269+ account:
5270+ accountId: 6507a1b2c3d4e5f6a7b8c9d0
5271+ platform: whatsapp
5272+ username: +1 555-123-4567
5273+ displayName: Acme Corp
5274+ isActive: true
5275+ phoneNumber: +1 555-123-4567
5276+ verifiedName: Acme Corp
5277+ qualityRating: GREEN
5278+ schema:
5279+ $ref: "#/components/schemas/connectWhatsAppCredentials_200_response"
5280+ description: WhatsApp connected successfully
5281+ "400":
5282+ description: |
5283+ Invalid request. Either missing fields or the phoneNumberId was not found
5284+ in the specified WABA. If the phone was not found, the response includes
5285+ `availablePhoneNumbers` to help identify the correct ID.
5286+ "401":
5287+ description: Invalid or expired access token
5288+ "403":
5289+ description: Profile limit exceeded for this plan
5290+ security:
5291+ - bearerAuth: []
5292+ summary: Connect WhatsApp via credentials
5293+ tags:
5294+ - Connect
5295+ x-content-type: application/json
5296+ x-accepts:
5297+ - application/json
52375298 /v1/connect/telegram:
52385299 get:
52395300 description: "Generate an access code (valid 15 minutes) for connecting a Telegram\
@@ -9281,20 +9342,43 @@ paths:
92819342 - application/json
92829343 post:
92839344 description: |
9284- Create a new message template. Template names must be lowercase, start with a letter,
9285- and contain only letters, numbers, and underscores. Templates are submitted to Meta for review.
9345+ Create a new message template. Supports two modes:
9346+
9347+ **Custom template:** Provide `components` with your own content. Submitted to Meta for review (can take up to 24h).
9348+
9349+ **Library template:** Provide `library_template_name` instead of `components` to use a pre-built template
9350+ from Meta's template library. Library templates are **pre-approved** (no review wait). You can optionally
9351+ customize parameters and buttons via `library_template_body_inputs` and `library_template_button_inputs`.
9352+
9353+ Browse available library templates at: https://business.facebook.com/wa/manage/message-templates/
92869354 operationId: createWhatsAppTemplate
92879355 requestBody:
92889356 content:
92899357 application/json:
9290- example:
9291- accountId: 507f1f77bcf86cd799439011
9292- name: order_confirmation
9293- category: UTILITY
9294- language: en_US
9295- components:
9296- - type: body
9297- text: "Your order {{1}} has been confirmed. Expected delivery: {{2}}"
9358+ examples:
9359+ custom:
9360+ summary: Custom template (requires review)
9361+ value:
9362+ accountId: 507f1f77bcf86cd799439011
9363+ name: order_confirmation
9364+ category: UTILITY
9365+ language: en_US
9366+ components:
9367+ - type: body
9368+ text: "Your order {{1}} has been confirmed. Expected delivery:\
9369+ \ {{2}}"
9370+ library:
9371+ summary: "Library template (pre-approved, no review)"
9372+ value:
9373+ accountId: 507f1f77bcf86cd799439011
9374+ name: my_appointment_reminder
9375+ category: UTILITY
9376+ language: en_US
9377+ library_template_name: appointment_reminder
9378+ library_template_button_inputs:
9379+ - type: URL
9380+ url:
9381+ base_url: "https://myapp.com/appointments/{{1}}"
92989382 schema:
92999383 $ref: "#/components/schemas/createWhatsAppTemplate_request"
93009384 required: true
@@ -9304,7 +9388,8 @@ paths:
93049388 application/json:
93059389 schema:
93069390 $ref: "#/components/schemas/createWhatsAppTemplate_200_response"
9307- description: Template created and submitted for review
9391+ description: "Template created (pre-approved for library templates, pending\
9392+ \ review for custom)"
93089393 "400":
93099394 description: Validation error (invalid name format
93109395 "401":
@@ -20001,6 +20086,74 @@ components:
2000120086 type: string
2000220087 account:
2000320088 $ref: "#/components/schemas/SocialAccount"
20089+ connectWhatsAppCredentials_request:
20090+ properties:
20091+ profileId:
20092+ description: Your Late profile ID
20093+ type: string
20094+ accessToken:
20095+ description: Permanent System User access token from Meta Business Suite
20096+ type: string
20097+ wabaId:
20098+ description: WhatsApp Business Account ID from Meta
20099+ type: string
20100+ phoneNumberId:
20101+ description: Phone Number ID from Meta WhatsApp Manager
20102+ type: string
20103+ required:
20104+ - accessToken
20105+ - phoneNumberId
20106+ - profileId
20107+ - wabaId
20108+ connectWhatsAppCredentials_200_response_account:
20109+ example:
20110+ accountId: accountId
20111+ phoneNumber: phoneNumber
20112+ displayName: displayName
20113+ verifiedName: verifiedName
20114+ isActive: true
20115+ qualityRating: qualityRating
20116+ platform: whatsapp
20117+ username: username
20118+ properties:
20119+ accountId:
20120+ type: string
20121+ platform:
20122+ enum:
20123+ - whatsapp
20124+ type: string
20125+ username:
20126+ description: Display phone number
20127+ type: string
20128+ displayName:
20129+ description: Meta-verified business name
20130+ type: string
20131+ isActive:
20132+ type: boolean
20133+ phoneNumber:
20134+ type: string
20135+ verifiedName:
20136+ type: string
20137+ qualityRating:
20138+ description: "GREEN, YELLOW, or RED"
20139+ type: string
20140+ connectWhatsAppCredentials_200_response:
20141+ example:
20142+ message: message
20143+ account:
20144+ accountId: accountId
20145+ phoneNumber: phoneNumber
20146+ displayName: displayName
20147+ verifiedName: verifiedName
20148+ isActive: true
20149+ qualityRating: qualityRating
20150+ platform: whatsapp
20151+ username: username
20152+ properties:
20153+ message:
20154+ type: string
20155+ account:
20156+ $ref: "#/components/schemas/connectWhatsAppCredentials_200_response_account"
2000420157 getTelegramConnectStatus_200_response:
2000520158 example:
2000620159 expiresIn: 900
@@ -23896,6 +24049,22 @@ components:
2389624049 items:
2389724050 $ref: "#/components/schemas/getWhatsAppTemplates_200_response_templates_inner"
2389824051 type: array
24052+ createWhatsAppTemplate_request_library_template_button_inputs_inner_url:
24053+ properties:
24054+ base_url:
24055+ type: string
24056+ createWhatsAppTemplate_request_library_template_button_inputs_inner:
24057+ properties:
24058+ type:
24059+ enum:
24060+ - QUICK_REPLY
24061+ - URL
24062+ - PHONE_NUMBER
24063+ type: string
24064+ url:
24065+ $ref: "#/components/schemas/createWhatsAppTemplate_request_library_template_button_inputs_inner_url"
24066+ phone_number:
24067+ type: string
2389924068 createWhatsAppTemplate_request:
2390024069 properties:
2390124070 accountId:
@@ -23917,14 +24086,33 @@ components:
2391724086 description: "Template language code (e.g., en_US)"
2391824087 type: string
2391924088 components:
23920- description: "Template components (header, body, footer, buttons)"
24089+ description: "Template components (header, body, footer, buttons). Required\
24090+ \ for custom templates, omit when using library_template_name."
2392124091 items:
2392224092 type: object
2392324093 type: array
24094+ library_template_name:
24095+ description: |
24096+ Name of a pre-built template from Meta's template library (e.g., "appointment_reminder",
24097+ "auto_pay_reminder_1", "address_update"). When provided, the template is pre-approved
24098+ by Meta with no review wait. Omit `components` when using this field.
24099+ type: string
24100+ library_template_body_inputs:
24101+ description: |
24102+ Optional body customizations for library templates. Available options depend on the
24103+ template (e.g., add_contact_number, add_learn_more_link, add_security_recommendation,
24104+ add_track_package_link, code_expiration_minutes).
24105+ type: object
24106+ library_template_button_inputs:
24107+ description: |
24108+ Optional button customizations for library templates. Each item specifies button type
24109+ and configuration (e.g., URL, phone number, quick reply).
24110+ items:
24111+ $ref: "#/components/schemas/createWhatsAppTemplate_request_library_template_button_inputs_inner"
24112+ type: array
2392424113 required:
2392524114 - accountId
2392624115 - category
23927- - components
2392824116 - language
2392924117 - name
2393024118 createWhatsAppTemplate_200_response_template:
@@ -23940,6 +24128,7 @@ components:
2394024128 name:
2394124129 type: string
2394224130 status:
24131+ description: "APPROVED for library templates, PENDING for custom"
2394324132 type: string
2394424133 category:
2394524134 type: string
0 commit comments