Import multiple messages into Tiledesk using REST APIs from third party app


This tutorial will help you to understand how to insert multiple messages into Tiledesk using REST API from third party app. Suppose you have an application (ex. a chatbot framework or a customer support system) and you want to connect it with Tiledesk. For example suppose you have a chatbot software that automatically serves the users (via a widget or others channels) but at some point you want to forward the chat to Tiledesk so that the agents ( and no longer the chatbot) serve the request.


  1. Signup a user on Tiledesk

  2. Anonymous end-user authentication through APIs

  3. Creating the conversation (request)

  4. Sending messages to a conversation

Signup on Tiledesk

To use Tiledesk APIs is mandatory to signup a new user on our beta environment available on

After signup please follow the proposed wizard to create your first Tiledesk project.

Get the PROJECT_ID of the created project under Project Settings menu. We will use this later.

Anonymous end-user authentication through APIs

In this tutorial we will authenticate end-users through Anonymous authentication REST API. We will do an anonymous authentication in order to get the id of the user (requester) who will create the conversation (next paragraph).

curl -v -X POST -H 'Content-Type:application/json' \
-d '{"id_project":"5e2c35c8f0dbc10017bb3aac", "firstname":"John"}' \

This will reply with the JWT token that we'll use to send our first message:

   "token":"JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.XYZ....",

Creating the conversation (request)

Now let's use Create a conversation REST API by setting mainly four parameters:

  • YOUR_ADMIN_EMAIL and PASSWORD: use your admin credentials here

  • SENDER: the anonymous user id created with the previous step.

  • FIRST_MESSAGE: this text is used to summarize the conversation subject. Normally this is the first message send by the user requester.

  • PROJECT_ID: your project id

curl -v -X POST -H 'Content-Type:application/json' \
-u YOUR_ADMIN_EMAIL:PASSWORD -d '{"sender":"SENDER", "first_text":"FIRST_MESSAGE"}' \
curl -v -X POST -H 'Content-Type:application/json' \
-u -d '{"sender":"fc43a0e1-ba85-404e-9a44-bf0050330898", "first_text":"How can i restore my password"}' \

You will get a reponse like this:


Now an empty (without message) conversation is created. Pay attention to the request_id field for the next paragraph.

Sending messages to a conversation

Let us Insert multiple messages REST API to import the messages. We need the following parameters :

  • request_id: the unique request identifier generated by the previous endpoint call

  • the admins credentials

  • An array of messages where:

    • text: is the message text

    • sender is the user indentifier of the user who send the message

    • attributes.clienttimestamp: use this property to force the message timestamp in milliseconds.

curl -v -X POST -H 'Content-Type:application/json' \
-d '[{"sender":"bb0d809b-b093-419b-8b48-11a192cc3619","text":"How can i restore my password", "attributes":{"clienttimestamp":1665584701710}},{"sender":"chatbot1", "text":"You can find it here", "attributes":{"clienttimestamp":1665584701711}}]'  \

Looking at the dashboard of your project you will see your conversation in the Requests panel. The requests are updated in real time, so you don't have to manunally update the Requests' page. If you left unchanged all the default settings, the request will be assigned to you (make sure you are "available", looking in the lower right corner of your profile image in the left menu panel).

The agent (you) can now see the same conversation in the agent chat (first option of the menu panel will open the desktop chat).

Do you have feedback on this article? Please send us your feedback writing an email to

Last updated