Facebook

Set Messenger Profile

Replaces the ice breakers and persistent menu of a Facebook Page's Messenger. A field you leave out keeps its current value.

PUT
/v1/accounts/{id}/messenger-profile

Authorization

Bearer
headerAuthorizationBearer <op_>

Workspace API key, sent as Authorization: Bearer op_... Keys are created in the dashboard.

Path Parameters

id*string
Length1 <= length

Request Body

application/json
  1. body
iceBreakers?array<>

Up to 4 questions shown when a conversation starts.

Itemsitems <= 4
persistentMenu?array<>

Up to 3 menu items. web_url items need url, postback items need payload.

Itemsitems <= 3

Response Body

Updated Messenger profile

application/json
  1. response
accountId*string
iceBreakers*array<>

Questions shown when a conversation starts.

persistentMenu*array<>

Menu items shown in every conversation.

Example Request
import { Configuration, AccountsApi } from "@onepostly/sdk";const accountsApi = new AccountsApi(  new Configuration({ accessToken: process.env.ONEPOSTLY_API_KEY }));const response = await accountsApi.setMessengerProfile({  id: "acc_YOUR_FACEBOOK_ACCOUNT_ID",  setMessengerProfileBody: {    "iceBreakers": [      {        "question": "What are your opening hours?",        "payload": "HOURS"      },      {        "question": "Do you deliver?",        "payload": "DELIVERY"      }    ],    "persistentMenu": [      {        "type": "web_url",        "title": "Order online",        "url": "https://example.com/order"      }    ]  },});console.log(response);
Example Response
{  "accountId": "acc_YOUR_FACEBOOK_ACCOUNT_ID",  "iceBreakers": [    {      "question": "What are your opening hours?",      "payload": "HOURS"    },    {      "question": "Do you deliver?",      "payload": "DELIVERY"    }  ],  "persistentMenu": [    {      "type": "web_url",      "title": "Order online",      "url": "https://example.com/order",      "payload": null    }  ]}