Personas API allows a business to introduce a virtual “Persona” or voice into the thread backed by a human agent or a bot who carries a messaging conversation with end users in Messenger. It is still the same bot sending the message via the platform API, but we now have the option to send it under the voice of a Persona.
For more information on using the Personas API, see Using Personas.
A Page access token with pages_messaging
permission is required to interact with this endpoint.
https://graph.facebook.com/me/personas?access_token=<PAGE_ACCESS_TOKEN>
https://graph.facebook.com/<PERSONA_ID>?access_token=<PAGE_ACCESS_TOKEN>
curl -X POST -H "Content-Type: application/json" -d '{
"name": "<persona_display_name>",
"profile_picture_url": "<url>",
}'
"https://graph.facebook.com/me/personas?access_token=<PAGE_ACCESS_TOKEN>"
curl -X GET "https://graph.facebook.com/<PERSONA_ID>?access_token=<PAGE_ACCESS_TOKEN>"
curl -X GET "https://graph.facebook.com/me/personas?access_token=<PAGE_ACCESS_TOKEN>"
curl -X DELETE "https://graph.facebook.com/<PERSONA_ID>?access_token=PAGE_ACCESS_TOKEN"
curl -X POST -H "Content-Type: application/json" -d '{
"recipient":{
"id":"<USER_PSID>"
},
"message":{
"text":"hello, world!",
},
"persona_id": "<PERSONA_ID>"
}' "https://graph.facebook.com/me/messages?access_token=<PAGE_ACCESS_TOKEN>"
Property | Type | Description |
---|---|---|
| String | The display name of the persona. |
| String | The URL of the user icon associated with the persona. |
{
"id": "<PERSONA_ID>"
}
Property | Type | Description |
---|---|---|
| String | The unique ID of the persona. |
{
"data": [
{
"name": "John Mathew",
"profile_picture_url": "https://facebook.com/john_image.jpg",
"id": "<PERSONA_ID>"
},
{
"name": "David Mark",
"profile_picture_url": "https://facebook.com/david_image.jpg",
"id": "<PERSONA_ID>"
},
],
"paging": {
"cursors": {
"before": "QVFIUlMtR2ZATQlRtVUZALUlloV1",
"after": "QVFIUkpnMGx0aTNvUjJNVmJUT0Yw"
}
}
}
Property | Type | Description |
---|---|---|
| Array | An array of personas |
| Object | An object containing the |
{
"name": "John Mathew",
"profile_picture_url": "https://facebook.com/john_image.jpg",
"id": "<PERSONA_ID>"
}
Property | Type | Description |
---|---|---|
| String | The display name of the persona. |
| String | The URL of the user icon associated with the persona. |
| String | The unique ID of the persona. |
{
"success": true
}
Property | Type | Description |
---|---|---|
| bool | Outcome of the delete operation. |