Call Audio CTA

Call audio CTA for generic and button template

You can use the Call-To-Action (CTA) button type audio_call in the Messenger API. This button type provides a new entry point for users to initiate calls with businesses by clicking the audio_call button directly from a button in the generic and button templates. This audio_call CTA button offers enhanced customization compared to the existing call prompt template.

Generic template

You can send this audio_call button using a generic template.

PropertyDescription

Page-ID

string

This is the Page ID connected to the app

recipient

string

The Page-scoped ID of the consumer to whom the message template is requested

message

JSON

The body of the message

attachment

JSON

The XMA attachment as part of the message

type

string

The type of the attachment; in this case template

payload

JSON

The payload of the attachment

template_type

string

The type of the template, in this case generic

elements

JSON

The elements that will be used in the template

buttons

JSON

The buttons CTA that will be used in the template.

type: the type of the button CTA, in this case “audio_call”

title (required): the title of the button CTA

expires_in_days (default 7): how long the button is clickable. The default value is 7 and cannot exceed 7 days.

POST /<PAGE_ID>/messages
{
  "recipient": {
    "id": "<PSID>"
  },
  "message": {
    "attachment": {
      "type": "template",
      "payload": {
        "template_type": "generic",
        "elements": [
          {
            "title": "Contact Support!",
            "buttons": [
              {
                "type": "audio_call",
                "title": "Call Now",
                "expires_in_days": 5
              }
            ]
          }
        ]
      }
    }
  }
}

Example response

PropertyDescription

id

string

The Page-scoped ID of the user to whom the opt-in is requested

message_id

string

The external-facing message ID (mid) of the message sent

{
  "recipient": {
    "id": <PSID>,
    "message_id": <mid>,
  }
}

Error response

The following errors can happen:

  • Invalid page-id or psid
  • The business Page hasn’t enabled the audio calling
  • Permissions/Authorization errors
  • The expires_in_days is set above 7
  • Message is sent outside of allowed window

For more details on these errors, see the Messenger Platform error codes reference.

Button template

You can send this audio_call button using a button template.

PropertyDescription

Page-ID

string

This is the Page ID connected to the app

recipient

string

The Page-scoped ID of the consumer to whom the message template is requested

message

JSON

The body of the message

attachment

JSON

The XMA attachment as part of the message

type

string

The type of the attachment; in this case template

payload

JSON

The payload of the attachment

template_type

string

The type of the template, in this case button

elements

JSON

The elements that will be used in the template

buttons

JSON

The buttons CTA that will be used in the template.

type: the type of the button CTA, in this case "audio_call"

title (required): the title of the button CTA

expires_in_days (default 7): how long the button is clickable. The default value is 7 and cannot exceed 7 days.

POST /&lt;PAGE_ID&gt;/messages
{
  "recipient": {
    "id": "&lt;PSID&gt;"
  },
  "message": {
    "attachment": {
      "type": "template",
      "payload": {
        "template_type": "button",
        "text": "Contact Support!",
        "buttons": [
          {
            "type": "audio_call",
            "title": "Call Now",
            "expires_in_days": 5
          }
        ]
      }
    }
  }
}

Example response

PropertyDescription

id

string

The Page-scoped ID of the user to whom the opt-in is requested

message_id

string

The external-facing message ID (mid) of the message sent

Error response

The following errors can happen:

  • Invalid page-id or psid
  • The business Page hasn’t enabled the audio calling
  • Permissions/Authorization errors
  • The expires_in_days is set above 7
  • Message is sent outside of allowed window

For more details on these errors, see the Messenger Platform error codes reference.