Skip to content

Chat Clear ​

The /chat/:token endpoint clears all messages from a private chat.

Parameters ​

ParameterRequiredDescription
tokenYesThe private chat token (URL parameter)
usernameYesThe username
sessionYesThe user's session identifier

Good to know

The token parameter is part of the URL path. The other parameters are sent as a JSON body with Content-Type: application/json.

Response Fields ​

FieldTypeDescription
messagestringConfirmation message

Code Examples ​

curl -X DELETE \
  -H "Content-Type: application/json" \
  -d '{
    "username": "alice",
    "session": "abc123"
  }' \
  "https://api.sylvain.sh/v5/chat/41a43360-9874-4c7a-9ca8-eec29e765a0e"

Try It ​

Error Handling ​

If parameters are missing or invalid, the API will return an error:

Error MessageDescription
Invalid or expired tokenThe token is invalid or has expired
Session ID mismatchSession does not match the user
Rate limit exceededToo many requests in a short period