Skip to main content

Overview

Chat threads represent conversations between tourists and guides related to specific trip bookings. Each thread tracks participants, associated trips, and conversation status.

Create Chat Thread

curl -X POST http://localhost:8080/api/chat_threads \
  -H "Content-Type: application/json" \
  -d '{
    "tripId": 1,
    "touristId": 10,
    "guideId": 5,
    "status": "ACTIVE",
    "lastMessageAt": "2026-03-11T14:30:00",
    "createdAt": "2026-03-11T14:30:00"
  }'
Create a new chat thread for communication between a tourist and guide.

Request Body

tripId
integer
The ID of the trip booking associated with this thread
touristId
integer
required
The user ID of the tourist participant
guideId
integer
required
The user ID of the guide participant
status
string
Thread status. Valid values: ACTIVE, ARCHIVED, BLOCKED
lastMessageAt
string
Timestamp of the last message in ISO 8601 format (e.g., 2026-03-11T14:30:00)
createdAt
string
Thread creation timestamp in ISO 8601 format (e.g., 2026-03-11T14:30:00)

Response

threadId
integer
Unique identifier for the chat thread
tripId
integer
The associated trip booking ID
touristId
integer
The tourist participant’s user ID
guideId
integer
The guide participant’s user ID
status
string
Current thread status (ACTIVE, ARCHIVED, or BLOCKED)
lastMessageAt
string
Timestamp of the last message
createdAt
string
Thread creation timestamp
{
  "threadId": 42,
  "tripId": 1,
  "touristId": 10,
  "guideId": 5,
  "status": "ACTIVE",
  "lastMessageAt": "2026-03-11T14:30:00",
  "createdAt": "2026-03-11T14:30:00"
}

Get All Chat Threads

curl -X GET http://localhost:8080/api/chat_threads \
  -H "Content-Type: application/json"
Retrieve a list of all chat threads in the system.

Response

Returns an array of chat thread objects.
[
  {
    "threadId": 42,
    "tripId": 1,
    "touristId": 10,
    "guideId": 5,
    "status": "ACTIVE",
    "lastMessageAt": "2026-03-11T14:30:00",
    "createdAt": "2026-03-11T14:00:00"
  },
  {
    "threadId": 43,
    "tripId": 2,
    "touristId": 11,
    "guideId": 5,
    "status": "ARCHIVED",
    "lastMessageAt": "2026-03-10T16:20:00",
    "createdAt": "2026-03-10T10:00:00"
  }
]

Get Chat Thread by ID

curl -X GET http://localhost:8080/api/chat_threads/42 \
  -H "Content-Type: application/json"
Retrieve a specific chat thread by its ID.

Path Parameters

id
integer
required
The unique identifier of the chat thread

Response

{
  "threadId": 42,
  "tripId": 1,
  "touristId": 10,
  "guideId": 5,
  "status": "ACTIVE",
  "lastMessageAt": "2026-03-11T14:30:00",
  "createdAt": "2026-03-11T14:00:00"
}

Update Chat Thread

curl -X PUT http://localhost:8080/api/chat_threads/42 \
  -H "Content-Type: application/json" \
  -d '{
    "tripId": 1,
    "touristId": 10,
    "guideId": 5,
    "status": "ARCHIVED",
    "lastMessageAt": "2026-03-11T16:00:00",
    "createdAt": "2026-03-11T14:00:00"
  }'
Update an existing chat thread. Common use cases include changing the thread status or updating the last message timestamp.

Path Parameters

id
integer
required
The unique identifier of the chat thread to update

Request Body

tripId
integer
The ID of the trip booking associated with this thread
touristId
integer
The user ID of the tourist participant
guideId
integer
The user ID of the guide participant
status
string
Thread status. Valid values: ACTIVE, ARCHIVED, BLOCKED
lastMessageAt
string
Timestamp of the last message in ISO 8601 format
createdAt
string
Thread creation timestamp in ISO 8601 format

Response

{
  "threadId": 42,
  "tripId": 1,
  "touristId": 10,
  "guideId": 5,
  "status": "ARCHIVED",
  "lastMessageAt": "2026-03-11T16:00:00",
  "createdAt": "2026-03-11T14:00:00"
}

Delete Chat Thread

curl -X DELETE http://localhost:8080/api/chat_threads/42 \
  -H "Content-Type: application/json"
Permanently delete a chat thread. This will remove the thread and may affect associated messages.

Path Parameters

id
integer
required
The unique identifier of the chat thread to delete

Response

Returns a success status code (typically 204 No Content) if the deletion was successful.

Thread Status Values

Chat threads can have one of the following status values:
  • ACTIVE: Thread is currently active and can receive messages
  • ARCHIVED: Thread has been archived, typically after trip completion
  • BLOCKED: Thread has been blocked, preventing further messages

Build docs developers (and LLMs) love