Skip to main content
POST
/
sendMessage
Send a chat message
curl --request POST \
  --url http://localhost/mogl/mogl-backend/api/sendMessage \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "receiver_user_id": 1,
  "message": "Hello, how are you?",
  "attachment": null,
  "has_fixed_attachment": false,
  "reply_id": 1,
  "athlete_id": 123,
  "job_id": 1,
  "milestone_id": 1,
  "milestone_athlete_rel_id": 1,
  "addChatWithApproval": false,
  "from_mass_messaging": false
}
'

Documentation Index

Fetch the complete documentation index at: https://developer.mogl.online/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

JWT Bearer token authentication. Use the /api/login endpoint to obtain a token.

Body

application/json
receiver_user_id
integer

Receiver user ID (NOT receiver_id)

Example:

1

message
string
Example:

"Hello, how are you?"

attachment
string

Optional file as base64-encoded string or data URI (e.g. data:image/png;base64,...). Send null if no attachment.

Example:

null

has_fixed_attachment
boolean

If true, uses attachment as-is (no upload)

Example:

false

reply_id
integer

Chat reply reference ID

Example:

1

athlete_id
integer

Agent acting on behalf of athlete

Example:

123

job_id
integer

Job ID for deliverable approval flow

Example:

1

milestone_id
integer

Milestone ID for approval flow

Example:

1

milestone_athlete_rel_id
integer

Milestone-athlete relation ID

Example:

1

addChatWithApproval
enum<string>

Trigger approval insert

Available options:
Yes,
No
Example:

false

from_mass_messaging
boolean

Skip file upload and Pusher event

Example:

false

Response

200

Message sent