Skip to main content

CRM write back event

Webhook 

CRM write back

You can be notified whenever a conversation has taken place in Inbox 2.0 (CONVERSATION_RESOLVED) or an agent has set a current conversation to Pending (CONVERSATION_SET_TO_PENDING). This allows you to save conversation details to your existing CRM system. Other use cases include triggering CSAT surveys, case creation, and expanded customer insights from social media profiles.

Configure write back URL​

To push data from Inbox 2.0 into your CRM, you need to implement a POST endpoint that accepts a JSON request and returns a JSON response. The request contains write back payload, and the response's status code represents your ability to parse the payload and the CRM's ability to ingest the data.

Configure the endpoint as the Write Back URL:

  1. Go to Admin settings.
  2. Expand Integration and APIs.
  3. Select CRM.

Handle the request​

When the endpoint in your system is ready and configured in Inbox 2.0, and relevant events occur within Inbox 2.0, requests are sent to the configured endpoint. All decoded write back payloads have the following fields:

  • type: A string that defines what kind of write back request is being processed. Used to suggest the structure of the data field.
  • version: A number designating the version of the type of request. Used to mark changes to the data field structure.
  • idempotencyKey: A string that uniquely identifies each event to write back. Used to help ensure that each request is processed only once.
  • data: An object that contains structured data for the specific type of write back. For example, a CONVERSATION_RESOLVED type event has fields such as medium, channel, messages*, notes, topics, contactProfile*, attributes*, and agent, among others.

* Applies to all mediums except Twitter. Twitter handle, tweets, and direct message transcripts, and Twitter medium contact attributes (Twitter name, number of followers, etc.), are not sent in the payload, to conform to Twitter's data use policies.

CONVERSATION_RESOLVED and CONVERSATION_SET_TO_PENDING events​

Events with a type of either CONVERSATION_RESOLVED or CONVERSATION_SET_TO_PENDING have the structure defined.

Write back retry​

If the write back request times out or the endpoint returns a non-success (2XX) status code, Inbox 2.0 retries with exponential backoffs. The requests are sent again with a delay of 1, 2, 4, 8, 16, and 32 hours after each retry (a total of 6 requests), as long as the request does not succeed. If the request still has not succeeded after 6 requests, we store the failed request details for future reference. We recommend that you inspect the endpoint logs regularly to ensure that write back requests are properly processed the first time. To distinguish between unique events, each request is given an Idempotency key.

Idempotency key​

The write back requests from Inbox 2.0 make use of an Idempotency key, which allows the write back endpoint to ensure it processes each request once. This key helps when requests are sent multiple times during the retry schedule, so the endpoint can handle requests in an idempotent way. The key is unique per request.

Request​

Responses​

The response status code represents your ability to parse the payload and the CRM's ability to ingest the data.