Sender Actions

This guide explains how to display your actions in a conversation to let message recipients know that you have seen and are processing their message.

Display a Sender Action

To display the action for a sender in the conversation, send a POST request to the /PAGE-ID/messages endpoint with the sender_action parameter set to typing_on.

curl -X POST -H "Content-Type: application/json" -d '{
  "recipient":{
    "id":"<PSID>"
  },
  "sender_action":"typing_on"
}' "https://graph.facebook.com/VERSION/PAGE-ID/messages?access_token=PAGE-ACCESS_TOKEN;"

Limitations

  • Requests to display sender action should only include the sender_action parameter and the recipient object. All other Send API properties, such as text and templates, should be sent in a separate request.
  • The recipient must be signed in for sender actions to be displayed.
  • Typing indicators are automatically turned off after 20 seconds, or when the bot sends a message.

Visit the Page Messages reference for a complete list of sender actions.

Best Practices

  • Send the mark_seen indicator when your bot receives a message so that the user does not feel ignored.

  • Send the typing_on indicator when your bot receives a message it will respond to. This helps create a conversational experience.

  • Send typing_on and typing_off actions in the separate batch requests. Batched requests are executed in order very quickly. This quick execution may result in the typing_on indicator being displayed for a fraction of a second if both actions are sent in the same batch.

  • Do not allow an unnatural amount of time (too long or too short) to pass between typing_on and typing_off sender actions. Ideally, the user should feel that a real person was typing the message in the elapsed time.

See Also

Developer Support