Skip to main content
Webhooks use cases
Updated over a week ago

This section describes common use cases for implementing TextUs webhooks with APIs.

Contact opt-out

The contact opt-out use case allows your users to track which customers have requested to opt out of receiving text messages from any TextUs messaging account in your organization.

You can use the following example workflow to create a contact opt-out record in your application:

  1. A contact is opted out of receiving SMS text messages, either manually or by texting an opt-out keyword.

  2. TextUs sends your webhook endpoint the contact.opted-out event.

  3. Your webhook endpoint processes the event.

  4. Your application creates a contact record based on the phone number provided by making a PUT request to the Opt Outs API:

    /{your-account-name}/opt_outs/{contact_phone_number}

If a contact opts back into receiving SMS text messages, your webhook endpoint will receive the contact.opted-in event. For compliance purposes, we do not recommend deleting opt-out records.

Note logging

The note logging use case, also referred to as message logging, allows your integration to copy the contents of a message sent or received in TextUs, then attach key information to an object in a CRM or other system of record.

You can use the following example workflow to log notes from your TextUs account to your application:

  1. A TextUs user sends a message to a contact.

  2. TextUs sends your webhook endpoint the message.delivered event. If the contact replies to the message, TextUs sends your webhook endpoint the message.received event.

  3. Your webhook endpoint processes the event.

  4. After parsing the event payload, your application includes the contact ID and message body in a GET request to the Messages API:

    /messages/{contactId}
  5. Your CRM or system of record receives the data in the API call, then attaches the information to an object in the contact record to log the note.

Contact created

The contact created use case allows your integration to create a new contact record in your application when a contact is created in TextUs.

The create a single contact record use case uses the following workflow:

  1. A contact is created for a single account in TextUs.

  2. TextUs sends your webhook endpoint the contact.created event.

  3. Your webhook integration processes the event.

  4. Your integration creates a new contact record by making a POST request to the Contacts API:

    /{your-account-name}/contacts
Did this answer your question?