---
agentTools:
  projectIndex: https://letsrobot.readme.io/llms.txt
---

# Send Chat Message

[block:callout]
{
  "type": "danger",
  "title": "Authentication",
  "body": "Anonymous chatting is supported for non authenticated users, in order to have a proper username accompany the chat message you should first ensure that user is authenticated via the appropriate endpoint."
}
[/block]

[block:code]
{
  "codes": [
    {
      "code": "let payload = [\n    \"message\": \"[AnyBot] \\(message)\",\n    \"robot_name\": \"AnyBot\",\n    \"robot_id\": \"123456\",\n    \"secret\": \"iknowyourelookingatthisthatsfine\"\n]\n        \nsocket.emit(\"chat_message\", payload)",
      "language": "swift"
    }
  ]
}
[/block]