REST API

The tawk.to REST API lets you save time by automating tasks on behalf of your agents.


Every Admin of a tawk.to property can use our webhooks to send data from tawk.to to a third party system. For example, you can use webhooks to add a new entry to a spreadsheet or project management board whenever a ticket is created.


Webhooks can be created for three types of events:

  • Chat start
  • Chat End
  • Ticket Created


Our REST API allows you to request additional data from tawk.to.


Note: To use the REST API, you will need a developer or be able to write code.

Getting started with the REST API

To use the REST API, you’ll first need to request access: https://www.tawk.to/rest-api-beta-access-request/


When your request is approved, you will receive a link to the documentation with a username and password.

What can you do with the REST API?

You can use the REST API to retrieve, create, update, and delete resources. Here are just a few of the ways you can use the REST API at tawk.to:


  • Automatically create properties for your customers
  • Automatically invite a customer to a property
  • Read a conversation history.
  • Manage webhooks
  • Automatically create a new tab
  • Manage your Knowledge Base
  • Create a new Knowledge Base article
  • List Knowledge Base articles and categories for a property
  • Create or delete a new chat widget for your property.
  • Add, remove, or update a widget card
  • Retrieve a filtered list of tickets, chats, or property members
  • Retrieve specific chat statistics
  • Filter chat statistics for a property by agent, tag, department, date, and more.

Making requests

The API consists of HTTP RPC-style methods, all of the form https://api.tawk.to/v1/METHOD.

All methods must be called using HTTPS. Arguments can be passed in the body of a POST request. The response will contain a JSON object, which will always contain a top-level boolean property ok, indicating whether the response was successful or failed. For failure results, the error property will contain a short machine-readable error code.


You must authenticate for all requests and all requests must be made over HTTPS.

Authentication

API key

If you are using an API key, requests will be authenticated via HTTP Basic Authentication.


Contact support to request beta access to the REST API. Once it has been enabled, please follow the steps below to acquire a REST API key:


1. Log in to your tawk.to Dashboard


2. Select your Profile Image in the upper-right corner


3. Select Edit Profile in the drop-down menu


4. Select REST API Keys


5. Click Create Key to get a new key

OAuth2

If you are using OAuth2, you will need to acquire an access token by following the OAuth2 flow.


Currently, we support two authorization flows: an authorization code and Implicit Grant flow.


When using an authorization code, you will first need to retrieve the code. Then, you will exchange it for an access token and a refresh token. The exchange requires you to enter your client secret key and should be done server-side. The client secret should be kept confidential. Do not distribute your client secret via email, distributed native applications, client-side JavaScript, or public code repositories. You can use a refresh token to extend the validity of the access token.


When using Implicit Grant flow, you can acquire access tokens that are short-lived and can not be extended. Implicit grant flow should be used if a client is incapable of maintaining the confidentiality of their credentials (e.g., when working with distributed native applications, client-side JavaScript, etc.). 

Request beta access

Request access to the REST API here: Get beta access to the REST API


View our JavaScript API Documentation in the tawk.to Developer Platform.


If you have other questions, don’t hesitate to reach out to our support team or schedule a call.

Was this article helpful?

58 out of 81 liked this article

Still need help? Message Us