diff --git a/functions-framework-api/pom.xml b/functions-framework-api/pom.xml
index 97c77911..0a02bfa5 100644
--- a/functions-framework-api/pom.xml
+++ b/functions-framework-api/pom.xml
@@ -168,4 +168,12 @@
+
Here is an example of an implementation that operates on the JSON payload of the event + * directly: + * + *
+ * public class Example implements BackgroundFunction {
+ * private static final Logger logger = Logger.getLogger(Example.class.getName());
+ *
+ * {@code @Override}
+ * public void accept(JsonElement json, Context context) {
+ * JsonElement messageId = json.getAsJsonObject().get("messageId");
+ * String messageIdString = messageId.getAsJsonString();
+ * logger.info("Got messageId " + messageIdString);
+ * }
+ * }
+ *
+ *
+ * Here is an example of an implementation that deserializes the JSON payload into a Java + * object for simpler access: + * + *
+ * public class Example implements BackgroundFunction {
+ * private static final Logger logger = Logger.getLogger(Example.class.getName());
+ *
+ * {@code @Override}
+ * public void accept(JsonElement json, Context context) {
+ * PubSubMessage message = Gson.fromJson(json, PubSubMessage.class);
+ * logger.info("Got messageId " + message.messageId);
+ * }
+ * }
+ *
+ * // Where PubSubMessage is a user-defined class like this:
+ * public class PubSubMessage {
+ * String data;
+ * {@code Map} attributes;
+ * String messageId;
+ * String publishTime;
+ * }
+ *
+ */
+@FunctionalInterface
+public interface BackgroundFunction {
+ /**
+ * Called to service an incoming event. This interface is implemented by user code to
+ * provide the action for a given background function.
+ * (including any {@link Error}) then the HTTP response will have a 500 status code.
+ *
+ * @param json the payload of the event, as a parsed JSON object.
+ * @param context the context of the event. This is a set of values that every event has,
+ * separately from the payload, such as timestamp and event type.
+ */
+ public void accept(JsonElement json, Context context);
+}