Skip to main content
POST
/
api
/
v1
/
chat
/
{chat_type}
Create or get a chat
curl --request POST \
  --url https://api.hevn.finance/api/v1/chat/{chat_type} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "text": "<string>"
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "createdAt": "2023-11-07T05:31:56Z",
  "lastMessageAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "lastReadByUserAt": "2023-11-07T05:31:56Z",
  "lastReadByAdminAt": "2023-11-07T05:31:56Z",
  "unreadCount": 0
}

Authorizations

Authorization
string
header
default:Bearer <token>
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-api-key
string | null

Path Parameters

chat_type
enum<string>
required

Chat types exposed to end users (subset of db.ChatType).

Available options:
support,
compliance

Body

application/json

Create (or get) the user's internal chat.

text
string | null

Response

Successful Response

User-facing chat.

id
string<uuid>
required
createdAt
string<date-time>
required
lastMessageAt
string<date-time> | null
updatedAt
string<date-time> | null
lastReadByUserAt
string<date-time> | null
lastReadByAdminAt
string<date-time> | null
unreadCount
integer
default:0