Send a new message (v2)
**Production uyarisi:** Bu endpoint veri degistirir veya operasyon tetikleyebilir. API Playground icinde Production server seciliyse gercek production verisi etkilenir; test icin Development server kullanin. Send a new message (v2). Creates or executes messages through POST /api/v2/messages.
Production uyarisi: Bu endpoint veri degistirir veya operasyon tetikleyebilir. API Playground icinde Production server seciliyse gercek production verisi etkilenir; test icin Development server kullanin.
Send a new message (v2). Creates or executes messages through POST /api/v2/messages.
Authorization
JWT-auth Paste the JWT access token without the Bearer prefix.
In: header
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/v2/messages" \ -H "Content-Type: application/json" \ -d '{ "type": "text", "chatId": "64d15f9e2e6c8f4d5a123456", "targetUserId": "64d15f9e2e6c8f4d5a654321", "content": "Hello there!", "file": "profile-photo.jpg" }'{
"_id": "64d15f9e2e6c8f4d5a123456",
"chatId": "64d15f9e2e6c8f4d5a654321",
"senderId": "64d15f9e2e6c8f4d5a111111",
"type": "text",
"content": "Hello there!",
"media": {
"url": "https://cdn.example.com/message/file.jpg",
"type": "image",
"name": "file.jpg",
"size": 102400,
"duration": 60,
"width": 1920,
"height": 1080,
"thumbnail_url": "https://cdn.example.com/message/file-thumb.jpg"
},
"creditTransfer": {
"amount": 25,
"recipientId": "64d15f9e2e6c8f4d5a654321",
"senderId": "64d15f9e2e6c8f4d5a123456"
},
"readBy": [
"64d15f9e2e6c8f4d5a654321"
],
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z"
}{
"isSuccess": false,
"statusCode": 400,
"data": null,
"errors": [
"Validation failed"
],
"timestamp": "2026-01-15T10:30:00.000Z"
}{
"isSuccess": false,
"statusCode": 401,
"data": null,
"errors": [
"Authentication required"
],
"timestamp": "2026-01-15T10:30:00.000Z"
}{
"isSuccess": false,
"statusCode": 403,
"data": null,
"errors": [
"Insufficient permissions"
],
"timestamp": "2026-01-15T10:30:00.000Z"
}{
"isSuccess": false,
"statusCode": 404,
"data": null,
"errors": [
"Resource not found"
],
"timestamp": "2026-01-15T10:30:00.000Z"
}{
"isSuccess": false,
"statusCode": 409,
"data": null,
"errors": [
"Resource already exists or cannot be changed in its current state"
],
"timestamp": "2026-01-15T10:30:00.000Z"
}Send a new message POST
**Production uyarisi:** Bu endpoint veri degistirir veya operasyon tetikleyebilir. API Playground icinde Production server seciliyse gercek production verisi etkilenir; test icin Development server kullanin. Send a new message. Creates or executes messages through POST /api/v1/messages.
Send a credit transfer message POST
**Production uyarisi:** Bu endpoint veri degistirir veya operasyon tetikleyebilir. API Playground icinde Production server seciliyse gercek production verisi etkilenir; test icin Development server kullanin. Send a credit transfer message. Creates or executes messages credit transfer through POST /api/v1/messages/credit-transfer.