Projekty
APIChat

Create conversation

Creates (or reuses) a conversation between the authenticated user and another ride participant.

POST
/api/chat

Creates (or reuses) a conversation between the authenticated user and another ride participant.

Authorization

sessionAuth
cookiebetter-auth.session_token<token>

Better Auth session cookie (on HTTPS: __Secure-better-auth.session_token), forwarded to the login server's /api/auth/get-session

Request Body

application/json
  1. body
otherUserId*string
Length1 <= length
rideId?string

Response Body

OK

application/json
  1. response
success*boolean
id*string
Example Request
curl -X POST 'https://example.com/api/chat' \  -H 'Content-Type: application/json' \  -d '{  "otherUserId": "string"}'
Example Response
{  "success": true,  "id": "string"}