JSON API Tutorial

We made some non-breaking changes to the v2 API. Most importantly, we increased the throttle rate to 5000 requests per day for each endpoint, while we added burst throttling to avoid receiving too many requests in a very short time. Click here for a changelog of the JSON API.

Introduction

With Unified Messaging, we also upgraded our available JSON APIs - integrating Userlike into your own platforms and workflows has never been easier. Below you find the general documentation as well as a detailed description of each API resource available.

We prepared some cURL-based examples. With the help of the cURL tool you can test drive our API quickly from the command line. This should give you a straightforward understanding how to use our API.

Topic Description
Resource endpoints Available resource endpoints of the JSON API
Authentication Accessing the API
Request headers Additional Request Headers
Rate limits API rate limits
Result pagination Number of results per requests to the list endpoint of a resource
Result filtering Filter list endpoints for specific resource items
Searching resources Search list endpoints for specific resource items
Conversation resource Work with conversation resources
Note resource Work with note resources
Navigation events resource Work with navigation event resources
Contact resource Work with contact resources
Operator resource Work with operator resources
Fetching conversations that were recently created or updated Syncing updates on conversations to your system
Code samples Working (python) code examples

Resource endpoints

Currently, the following resource endpoints are available using the Userlike JSON API:

Resource endpoints Description Allowed methods
https://api.userlike.com/api/um/v2/conversations/
https://api.userlike.com/api/um/v2/conversations/{id}/
https://api.userlike.com/api/um/v2/conversations/{id}/messages/
List of conversations

Single conversation

Single conversation’s messages
GET | DELETE

GET | DELETE

GET
https://api.userlike.com/api/um/v2/notes/
https://api.userlike.com/api/um/v2/notes/{id}/
List of notes

Single note
GET

GET | DELETE
https://api.userlike.com/api/um/v2/navigation/ List of navigation events
GET
https://api.userlike.com/api/um/v2/contact_identities/
https://api.userlike.com/api/um/v2/contact_identities/{id}/
List of contacts

Single contact
GET | DELETE

GET | PATCH | DELETE
https://api.userlike.com/api/um/v2/operators/
https://api.userlike.com/api/um/v2/operators/{id}/
https://api.userlike.com/api/um/v2/operators/{id}/slots/
List of operators

Single operator

Single operator’s slot data
GET

GET | PATCH | DELETE

GET | PATCH | DELETE

The specifics for each resource are described further below, after the introduction of the general features of the JSON API.

API versioning

Our APIs are constantly evolving, but we are striving to implement any new features in a backwards compatible way. If breaking changes are necessary, we will introduce a new API version. Examples for breaking changes are:

  • Removing, renaming, or moving API entities.
  • Changing or removing functionality.
  • Making optional parameters or properties mandatory.

Non-breaking changes, like new endpoints or new optional properties, can happen anytime.
When we deprecate older versions of the API, we will provide at least 90 days of notice.

The current version of our JSON API is /v2/, which was released July 30th, 2021.

The previous version /v1/ is no longer available.
You can find its documentation here if you are still migrating: JSON API V1

Changelog

Notable enhancements we made to our v2 API:

  • Change general rate limit to 5000 requests per day
  • Add burst throttling, which limits the amount of requests you can send in a short time. See API rate limits for details
  • Add id sorting option to conversation list endpoint
  • Add id__lt filter to conversation list endpoint
  • Add id__gt filter to conversation list endpoint
  • Add updated_at_to_date and updated_at_from_date filters to conversation list endpoint

Authentication

All API requests must be authenticated with an API token, i.e. the API token must be passed as an authorization header with each request:

Userlike offers two types of authentication tokens: the "customer authentication token", allowing access to the resources of all organizations, and the "organization authentication token", allowing access to the resources of a single organization.

Organization authentication token

The organization authentication token gives you access to the resources (conversations, contacts, ...) of a single organization. You can find it in your Dashboard under **Chat tools** > **API settings**:

Customer authentication token

The customer authentication token by default gives you access to the resources (conversations, contacts, ...) of your default organization. You can find it in your Dashboard under **Account** > **API settings**:

But when you need to access the resources of a different organization, you can now simply provide the extra header "Userlike-organization-Id" with your request, there indicating the ID of the desired organization:

To find the ID of one of your organizations, go to **Account** > **Organizations** and start editing the respective organization. In the URL bar you can now see the ID of the organization:

If you provide a wrong organization ID, the request will again be made against your default organization resources.

Additional request headers

Content-Type: required for PATCH requests

When you want to update existing resources, you have to send a PATCH request with a valid JSON body. Additionally, you must specify the content type of your request being "application/json" - otherwise your body data cannot be processed correctly.

USERLIKE-OPERATOR-ID: switching operator context

By default, API requests run in the context of the account’s operator. If you want to limit the privileges of requests made via the JSON API without affecting the capabilities of the owner, you can make your requests in the context of a less privileged operator.

In these cases we’d recommend the creation of a dedicated API operator, to whom you then assign a (customized) role with the desired set of capabilities. For all API request you can now send this operator’s ID by setting the custom "Userlike-Operator-Id" header:

All requests made this way will check for your API operator’s capabilities before performing any actions. This way you could ensure, for example, that no destructive operations are allowed via the API. Here you learn more about roles and capabilities.

API rate limits

Sustained throttling

You can make up to 5000 API requests per day to a specific resource of an organization. After the resource limit is reached, you’ll receive a response with HTTP status code 429.

Each resource has its own limit, as does each organization. This means that requesting conversations of organization A does not affect the count for requesting contacts from the same organization - nor does it affect the count for requesting conversations of organization B. The following three example calls all add to a different call counter:

In this context, requests for a specific resource of an organization (e.g. conversations) all add to the same count, no matter if they are made to the list or single endpoint, or what HTTP method is used. So a "DELETE" of a single conversation adds a hit to the same counter as does a "GET" to the same organization’s conversation list endpoint. The following three example calls all add to the same call counter:

Resource (per organization) Methods combined requests/day
https://api.userlike.com/api/um/v2/conversations/
https://api.userlike.com/api/um/v2/conversations/{id}/
GET | DELETE

GET | PATCH | DELETE
5000
https://api.userlike.com/api/um/v2/contact_identities/
https://api.userlike.com/api/um/v2/contact_identities/{id}/
GET | DELETE

GET | PATCH | DELETE
5000
https://api.userlike.com/api/um/v2/navigation/ GET 5000
https://api.userlike.com/api/um/v2/operators/
https://api.userlike.com/api/um/v2/operators/{id}/
https://api.userlike.com/api/um/v2/operators/{id}/slots/
GET | DELETE

GET | PATCH | DELETE

GET | PATCH | DELETE
5000
Burst throttling

On top of that, you may experience burst throttling if you send too many requests in a short time period. In this case you will also get a 429 response. You will be able to make another API call after waiting a few seconds.

Filtering

You can filter the results of each resource’s list endpoint. These filters are specific to each resource, so we’ll explain them for each resource further below. Here we’ll only highlight some details that apply to filters in general.

Ordering filter

By default, the list of resources returned by all list endpoints are sorted by their ID, in descending order - meaning that the most recently created resources are coming first.

For some resource list endpoints, you can provide an alternative ordering by providing the field by which the result list should be ordered. Prefixing the ordering field with a "-" (minus) sign will reverse the order from "ascending" to "descending":

For each resource list endpoint we’ll indicate which fields are available for alternative ordering.

Filters and pagination

Applying filters to an API requests means that the pagination is applied to the filtered result set, and the previous and next links provided in a filtered response will already have these filter set. This means that you can easily browse the single pages of a filtered result set by following these links.

Combining filters

You can apply more than one filter to an API request. The single filters are "ANDed" together, i.e. they will return all resource items that match each filter criterion.

The more filters you add, the more specific your request will be and chances are that there are no items matching all criteria.

Exclude IDs

For any requests, to any resource endpoints, you can provide a "blacklist" of resource IDs. Just provide a comma-separated string with all IDs you wish to exclude via the "exclude_ids" filter. Resource(s) thus specified will not be fetched, updated or deleted.

This allows for more effective bulk actions, e.g. fetching all conversations that are not assigned to one specific operator with only two API calls:

First you filter all conversation resources for the operator whose conversations you want to exclude, extracting the single conversation IDs from the result list. Then you make another call to the conversation list resource endpoint, providing this list of IDs to be excluded, as comma-separated value:

Delete IDs

For DELETE requests to list endpoints, you can provide a "whitelist" of resource IDs. Just provide a comma-separated string with all IDs you wish to delete via the "delete_ids" filter. Only the resource(s) thus specified will be deleted.

This allows for safer bulk delete actions, since only the specified IDs will be deleted, no matter what other filters or limits are provided:

Searching

Searching is really a special kind of filtering, available for the conversation and contact list endpoints. For each resource, certain fields will be searched and all matching results will be returned, ordered by a specific ranking. We will explain the individual fields and ranking for each resource below.

To search an endpoint for specific resources, simply add the "search_query" parameter to your request, followed by the search keyword:

Multiple keywords

You can search for multiple keywords in one request by providing the "search_query" parameter with a white-space separated value. Since you cannot use literal whitespaces in your request URLs, use one of the following encodings:

Encoding Value Example
"Percent" encoding %20 ?search_query=userlike%20gregor
"Plus" encoding + ?search_query=userlike+gregor

Multiple keywords are "ORed", meaning that a search for "userlike+gregor" will return results that match either the first or the second keyword:

Ranking

The ranking of all results matching your keyword(s) is determined by two factors: where the matching content was found and how often it was found. A match in a contact’s name ranks higher than a match in a contact’s notes, and three matches in one conversation rank higher than only one match in another.

Ranking factor Example Description
Weight A The ranking prominence follows the natural order of the letters, i.e. "A" ranks higher than "B" ranks higher than "C"
Occurrence 3 The more occurences, the higher the ranking

The ranking of each resource’s search fields are described below.

Stemming and Prefix Search

When you provide a keyword, it is first reduced to its stem. After that we do a prefix search with the result. E.g. if you enter "users", we first reduce it to the word stem "user" and then do a prefix search with that. So it would return results for e.g. "userlike". Multiple keywords are all treated as prefixes as well:

Provided search keyword(s) Actual search
?search_query=user user* Matches "user", but also e.g. "userlike"
?search_query=user+greg user* || greg* Matches e.g. "user", "userlike", "greg" or "gregor"

Keep this in mind if your search returns too many (undesired) results, and provide more specific search keyword(s).

Conversation resource

Resource endpoints Description Allowed methods
https://api.userlike.com/api/um/v2/conversations/
https://api.userlike.com/api/um/v2/conversations/{id}/
https://api.userlike.com/api/um/v2/conversations/{id}/messages/
List of conversations

Single conversation

Single conversation’s messages
GET | DELETE

GET | DELETE

GET
Conversation list endpoint - GET

Fetch a list of conversations you had with your contacts. The response will return a JSON object with a results array, by default containing the last 10 conversations that were created. The response JSON further contains pagination details.

The conversation resource items returned by the list endpoint only contain the last message of the conversation. If you want to get all messages of a conversation, you must make a request to the conversation messages endpoint. We’ll show you how to do that further below.

Conversation list endpoint - DELETE

Delete a list of conversations you had with your contacts. The response contains no data and has the HTTP status 204.

Making a DELETE request to the conversation list endpoint will irrevocably delete a number of conversations at once: 10 by default and 100 at most. As a precaution, you cannot delete ongoing conversations.
Conversation list endpoint filters

The conversation list endpoint lets you filter its resources for the following fields:

Field Sample value Description
contact_uuid MGEwYWJmZmEtN2M1OS01NGI2LWE2OWYtZWYxNDY4OWM0YWQ3 Get all conversations you had with a specific contact
operator_id 23 Get all conversations of a specific operator by their ID
status pending Get all conversations you assigned a certain status
topics Support Get all conversations you assigned a certain topic label to
um_widget_id 42 Get all conversations that were conducted (at least partially) via a specific Widget.
contact_first_message_to_date 2018-09-22T14:01:54.9571247Z Get all conversations where the first contact message was sent before a specific time
contact_first_message_from_date 2018-09-22T14:01:54.9571247Z Get all conversations where the first contact message was sent after a specific time
contact_last_message_to_date 2018-09-22T14:01:54.9571247Z Get all conversations where the last contact message was sent before a specific time
contact_last_message_from_date 2018-07-22T14:01:54.9571247Z Get all conversations where the last contact message was sent after a specific time
updated_at_to_date 2018-09-22T14:01:54.9571247Z Get all conversations in which the last update happened before a specified time. New messages count as updates.
updated_at_from_date 2018-07-22T14:01:54.9571247Z Get all conversations in which the last update happened after a specified time. New messages count as updates.
id__gt 935673 Get all conversations with an ID greater than the one specified.
id__lt 935673 Get all conversations with an ID smaller than the one specified.
contact_identity_id 20 Get all conversations that belong to a specific contact

You can use these filters alone or in combination to extract exactly the resource items you need.

You can also use these filters to immediately delete the filtered resource items.

Making a filtered DELETE request to the conversation list endpoint will also irrevocably bulk delete a number of conversations: 10 by default, 100 being the maximum allowed limit.

Make sure you also read the general remarks on result filtering.

Conversation list endpoint searching

The conversation list endpoint lets you search its resources by matching your search keyword(s) against certain data fields of or related to your conversations. If your keyword(s) match(es) any of the contents of the following fields, the respective conversation will be part of the result set:

Field Ranking Description
Contact's name A Get all conversations whose contact’s name matches the keyword
Contact's email A Get all conversations whose contact’s email matches the keyword
Contact's street A Get all conversations whose contact’s street name matches the keyword
Contact's city A Get all conversations whose contact’s city matches the keyword
Conversation messages C Get all conversations whose messages matches the keyword

We intentionally rank matches in the associated contacts' data higher than matches in the conversations' own content, since that data is much more structured and qualified.

You can also use the search feature to immediately delete the matching conversations:

Making a search DELETE request to the conversation list endpoint will irrevocably bulk delete the matched conversations: 10 by default, 100 being the maximum allowed limit.

Make sure you also read the general remarks on resource searching.

Conversation list endpoint ordering

The conversation list endpoint results can be alternatively ordered by the following fields:

Field Value Description
ordering id Order the conversations according to their IDs, in ascending order (oldest first).
ordering -id Order the conversations according to their IDs, in descending order (newest first).
ordering last_message_sent_at Order the conversations according to when the last message was sent, in ascending order (oldest first).
ordering -last_message_sent_at Order the conversations according to when the last message was sent, in descending order (latest first).
ordering contact_first_message_sent_at Order the conversations according to when the contact first interacted with them, in ascending order (oldest first).
ordering -contact_first_message_sent_at Order the conversations according to when the contact first interacted with them, in descending order (latest first).
ordering contact_last_update_at Order the conversations according to when its contact was last updated, in ascending order (oldest first).
ordering -contact_last_update_at Order the conversations according to when their contact was last updated, in descending order (latest first).
ordering contact_last_message_sent_at Order the conversations according to when the contact last interacted with them, in ascending order (oldest first).
ordering -contact_last_message_sent_at Order the conversations according to when the contact last interacted with them, in descending order (latest first).

Make sure you also read the general remarks on result filtering.

Conversation single endpoint - GET

Fetch a specific conversation you had with one of your contacts by providing its ID.

If you need the full conversation data for a specific set of conversations, first filter the resource items accordingly using the list endpoint. Then use the conversation IDs you get from the filtered result set to fetch the single resource items, which will contain the full data.

Conversation single endpoint - DELETE

Delete a specific conversation you had with one of your contacts by providing its ID. Response contains no data and has HTTP status 204.

Conversation messages endpoint - GET

Fetch the messages for a specific conversation you had with one of your contacts by providing its ID. The response will return a JSON object with a results array, by default containing the last 100 messages that were created.

Conversation messages endpoint filters

The conversation messages endpoint lets you filter its resources for the following fields:

Field Sample value Description
type notification Get all messages of a specific type
sender_type contact Get all messages from a specific sender type
event welcome_message Get all messages from a specific event

You can use these filters alone or in combination to extract exactly the resource items you need.

The following values can be used to filter by `type`:

Value Description
notification Get all messages of type notification
upload Get all messages of type upload
co Get all messages sent by contact
ct Get all messages sent to contact
link Get all messages of type link (eg. a link was sent in the conversation)
call_event Get all messages relating to audio/video call events (eg. "call finished")
call_offer Get all messages relating to audio/video call offers (a call was offered to the contact by an operator)

Make sure you also read the general remarks on result filtering.

Conversation messages endpoint pagination

The conversation messages endpoint uses cursor based pagination with a maximum page size of 100 messages.

You can provide us with a message reference in the cursor query parameter and we will return messages that either come before or after the cursor, depending on which ordering query parameter you send.

Responses you receive will have a next-link and a previous-link with the correct cursor set, if there are messages in the conversation that come before or after the result list. The next and previous link in the response will always have the same page size as the request.

Conversation messages endpoint ordering

The conversation messages endpoint results can alternatively be ordered by the following fields:

Field Value Description
ordering id Order the conversation messages according to their ID, in ascending order (oldest first).
ordering -id Order the conversation messages according to their ID, in descending order (latest first).

Make sure you also read the general remarks on result filtering.

Note resource

Resource endpoints Description Allowed methods
https://api.userlike.com/api/um/v2/notes/
https://api.userlike.com/api/um/v2/notes/{id}/
List of notes

Single note
GET

GET | DELETE
Note list endpoint - GET

Fetch a list of notes. The response will return a JSON object with a results array, by default containing the last 10 notes that were created. The response JSON further contains pagination details.

There are two types of notes: notes on conversations and notes on contacts. Notes on conversations have a non-null conversation_id, while notes on contacts have a non-null contact_identity_id. To learn how to fetch the notes for a specific conversation or a specific contact, please see the section on filtering the note list endpoint.

Note list endpoint filters

The note list endpoint lets you filter its resources for the following fields:

Field Sample value Description
conversation_id 42 Get all notes you added to a specific conversation
contact_identity_id 23 Get all notes you added to a specific contact

Combining these filter would always result in an empty response, as notes either have a conversation_id or a contact_identity_id.

Make sure you also read the general remarks on result filtering.

Note list endpoint ordering

The note list endpoint results are sorted by their ID, in descending order - meaning that the most recently created notes are coming first.

Note single endpoint - GET

Fetch a specific note by providing its ID.

Note single endpoint - DELETE

Delete a specific note by providing its ID. Response contains no data and has the HTTP status 204.

Contact resource

Resource endpoints Description Allowed methods
https://api.userlike.com/api/um/v2/contact_identities/
https://api.userlike.com/api/um/v2/contact_identities/{id}/
List of contacts

Single contact
GET | DELETE

GET | PATCH | DELETE
Contact list endpoint - GET

Fetch a list of contacts. Returns a JSON object with a results array, by default containing the last 10 contacts that have been created. The response JSON further contains pagination details.

Contact list endpoint - DELETE

Delete a list of contacts. The response contains no data and has HTTP status 204.

Making a DELETE request to the contact list endpoint can potentially bulk delete a number of contacts: 10 by default, 100 being the maximum allowed limit.
Contact list endpoint filters

The contact list endpoint lets you filter its resources for the following fields:

Field Sample value Description
id 23 Get the contact matching the given ID
email david@userlike.com Get the contact with the specified email
name David Voswinkel Get all contacts matching a specific name
to_date_time 2018-09-22T14:01:54.9571247Z Get all contacts that were active before a specific time
from_date_time 2018-07-22T14:01:54.9571247Z Get all contacts that were active after a specific time
verified true Get all contacts that have a verified email or mobile number
locale en_US Get all contacts that match the given locale

You can use these filters to extract exactly the resource items you need.

You can also use these filters to immediately delete the filtered resource items.

Making a filtered DELETE request to the contact list endpoint can potentially bulk delete a number of contacts: 10 by default, 100 being the maximum allowed limit.

Make sure you also read the general remarks on result filtering.

Contact list endpoint searching

The contact list endpoint lets you search its resources by matching your search keyword(s) against certain data fields of your contacts. If your keyword(s) match(es) any of the contents of the following fields, the respective contact will be part of the result set:

Field Ranking Description
Contact's name A Get all conversations whose contact’s name matches the keyword
Contact's email A Get all conversations whose contact’s email matches the keyword
Contact's street A Get all conversations whose contact’s street name matches the keyword
Contact's city A Get all conversations whose contact’s city matches the keyword
Contact's country A Get all conversations whose contact’s country matches the keyword
Contact's notes B Get all conversations where your notes about the contact matches the keyword

An example contact search:

You can also use the search feature to immediately delete the matching contacts:

Making a search DELETE request to the contact list endpoint will irrevocably bulk delete the matched contacts: 10 by default, 100 being the maximum allowed limit.

Make sure you also read the general remarks on resource searching.

Contact list endpoint ordering

The contact list endpoint results can be alternatively ordered by the following fields:

Field Value Description
ordering created_at Order the contacts according to when they were created, in ascending order (oldest first).
ordering -created_at Order the contacts according to when they were created, in descending order (latest first).
ordering name Order the contacts by their names, in ascending order (A-Z).
ordering -name Order the contacts by their names, in descending order (Z-A).
ordering email Order the contacts by their email, in ascending order (A-Z).
ordering -email Order the contacts by their email, in descending order (Z-A).

Make sure you also read the general remarks on result filtering.

Contact single endpoint - GET

Fetch a specific contact by providing its ID. The returned JSON object contains the full contact representation.

Contact single endpoint - PATCH

Update certain data of a specific contact. The returned JSON object contains the full and updated contact.

The following fields can be updated:

Field Sample value Description
email my.contact@customer.com Update the contact’s email address
name "Jane Doe" Update the contact’s name
salutation "mrs" Update how the contact whishes to be saluted
gender "f" Update the contact’s gender
street "Sunset Blvd" Update the contact’s street
city "Cologne" Update the contact’s city
country "DE" Update the contact’s country, providing a valid two-digit iso code.
phone_number "+49521234567" Update the contact’s phone number
mobile_number "+49521234567" Update the contact’s mobile number
contact_by_phone True Update if the contact wants to be contacted via phone
contact_by_email True Update if the contact wants to be contacted via email
contact_by_userlike_messenger True Update if the contact wants to be contacted via the Website Messenger
contact_by_userlike_channels True Update if the contact wants to be contacted via channels
url_facebook "https://facebook.com/xy" Update the contact’s Facebook URL
url_twitter "https://twitter.com/xy" Update the contact’s Twitter URL
url_linkedin "https://linkedin.com/xy" Update the contact’s Linkedin URL
url_profile_picture "https://url_profile_picture.com/xy" Update the contact’s profile picture URL
external_customer_id "123" Update the contact’s external id

You can update one or more of these fields with a single patch request.

In contrast to a single conversation, you can update nearly all fields of a contact via the API. This allows you to enrich your Userlike contacts with data from another CRM system you might have, for example.

Contact single endpoint - DELETE

Delete a specific contact by providing its ID. Response contains no data and has HTTP status 204.

Operator resource

Resource endpoints Description Allowed methods
https://api.userlike.com/api/um/v2/operators/
https://api.userlike.com/api/um/v2/operators/{id}/
https://api.userlike.com/api/um/v2/operators/{id}/slots/
List of operators

Single operator

Single operator’s slot data
GET

GET | PATCH | DELETE

GET | PATCH | DELETE

In contrast to the other resources, the operator resource’s list endpoint does not offer bulk deletion. This is to prevent destructive API calls that could seriously affect the operation of your Userlike account.

Operator list endpoint - GET

Fetch a list of operators. Returns a JSON object with a results array, by default containing the last 10 operators that have been created, including their current chat slot utilization. The response JSON further contains pagination details.

Operator list endpoint filters

The operator list endpoint lets you filter its resources for the following fields:

Field Sample value Description
id 23 Get the operator matching the given ID
email david@userlike.com Get the operator with the specified email
name David Voswinkel Get all operators matching a specific name
operator_group_id 132 Get all operators belongig to a specific operator group

You can use these filters to extract exactly the resource items you need.

Make sure you also read the general remarks on result filtering.

Operator list endpoint ordering

The operator list endpoint results can be alternatively ordered by the following fields:

Field Value Description
ordering created_at Order the operators according to when they were created, in ascending order (oldest first).
ordering -created_at Order the operators according to when they were created, in descending order (latest first).
ordering name Order the operators by their names, in ascending order (A-Z).
ordering -name Order the operators by their names, in descending order (Z-A).
ordering email Order the operators by their email, in ascending order (A-Z).
ordering -email Order the operators by their email, in descending order (Z-A).

Make sure you also read the general remarks on result filtering.

Operator single endpoint - GET

Fetch a specific operator by providing its ID. The returned JSON object contains the full operator representation, including operator group and organization.

Operator single endpoint - PATCH

Make various changes to a specific operator.

You can use the PATCH method to update an operator’s out of office status or notification settings. The response will have the format of the slot view as described below.

The following fields can be updated:

Field Sample value Description
um_notification_message_receive true Turn browser notification for new messages on or off
um_notification_chat_session_forward true Turn browser notification for reassigned conversations on or off
um_notification_conversation_rating true Turn browser notification for conversation ratings on or off
um_notification_conversation_feedback true Turn browser notification for conversation feedback on or off
um_notification_conversation_post_survey true Turn browser notification for post-conversation surveys on or off
um_notification_conversation_goal true Turn browser notification for reached Widget goals on or off
um_notification_conversation_end true Turn browser notification for ended conversations on or off
um_notification_conversation_offline_assigned true Turn browser notification for assigned offline conversations on or off
um_notification_conversation_live true Turn browser notification for incoming live conversations on or off
um_notification_conversation_not_live true Turn browser notification for timeout being reached in a conversation on or off
um_notification_conversation_end_own true Turn browser notification for own conversation ending on or off
um_notification_conversation_feedback_own true Turn browser notification for feedback in own conversations on or off
um_notification_conversation_goal_own true Turn browser notification for Widget goals reached in own conversations on or off
um_notification_conversation_offline_unassigned true Turn browser notification for unassigned conversations on or off
um_notification_conversation_started true Turn browser notification for conversation started or resumed on or off
um_notification_conversation_post_survey_own true Turn browser notification for post-conversation survey answers in own conversations on or off
um_notification_conversation_rating_own true Turn browser notification for ratings on own conversations on or off
um_notification_operator_availability true Turn browser notification for operator status changes on or off
sound_connect true Turn sound notification for operator connecting to UMC on or off
sound_disconnect true Turn sound notification for operator disconnecting from UMC on or off
sound_message_new true Turn sound notification for new message being received in a conversation on or off
sound_operator_off true Turn sound notification for operator going offline on or off
sound_operator_on true Turn sound notification for operator going online on or off
sound_conversation_live true Turn sound notification for received live conversations on or off
sound_conversation_offline true Turn sound notification for received offline conversations on or off
notification_mute true Mute or unmute all notifications
out_of_office true Turn out of office mode on or off

You can update one or more of these fields with a single PATCH request.

Operator single endpoint - change operator status

You can toggle an operator’s availability between **online** and **away** by making a PATCH request. The response contains the operator’s slot data and has the HTTP status code 200.

Operator single endpoint - DELETE

Delete a specific operator by providing its ID. The response contains no data and has HTTP status 204.

Since deleting an operator can affect the operation of your Userlike account, we take some precautions to prevent you from causing serious harm when making a DELETE call.

We make sure that you do not accidentally:

  • Delete the Owner of your Userlike account
  • Delete the operator making the request (which in most cases is the Owner)
  • Delete the last operator of an organization

When you make a call that would cause one of these actions, you’ll instead get a 403 status response, indicating your request was denied. In the JSON body you’ll find the details on why it was denied.

Operator single endpoint - slot view

For single operator resource items, we offer an additional endpoint that only returns the specific operator’s slot data when making a GET request to it. Apart from that, all other requests behave exactly the same as those to the regular operator resource single endpoint.

Use this reduced "view" on a specific operator’s chat slot utilization if all you need is this subset of the operator’s data. For example, when you are using the JSON API to sync your operators' chat availability with an external support system.

The fields of an operator’s slot data are:

Field Description
availability The operator’s presence status, combined from the fields "available" and "connected". Its value can be "available", "unavailable" or "offline".
available Whether the operator is available to chat
connected Whether the operator is currently connected to the Message Center
free Number of free chat slots
used Number of used chat slots
total Number of the operator’s total chat slots

Fetching conversations that were recently created or updated

Since this is a common use case we wrote this section to explain the best ways to keep conversations in your system in sync with changes on our side.

To get all conversations created or updated in a certain timeframe, use the updated_at_from_date and updated_at_to_date filters. Whenever changes are made to the conversation or a message is sent in it, this timestamp is updated.

Python Examples

We prepared a few examples on how to access the Userlike API using Python. It’s pretty straightforward, we use the Python library "requests" for the HTTP requests, always adding the required Authorization headers.

Simple example: fetch last conversations

This basic example shows you how to retrieve the list of the latest 10 conversations you had with your customers with a small Python script.

Slightly more complex example: add phone numbers from your CRM to contacts in Userlike

This larger example shows you how to work with different endpoints and request types to fulfill a task.

Imagine the following use case: you want to automatically add phone numbers from your CRM to the contacts in Userlike.

For this, you first have to get the ID of each customer by filtering the contact resource endpoint with their email address. Then, you have to update the contacts by sending patch requests to each individual contact resource endpoint.