Skip to content

Chat Clear ​

The /chat/clear endpoint clears all messages from a private chat.

Changed in 6.0.0

This endpoint moved from DELETE to POST, and its identifier left the URL: token is now sent in the JSON body. PATCH and DELETE no longer exist anywhere in the API.

Parameters ​

ParameterRequiredDescription
tokenYesThe private chat token
usernameYesThe username
sessionYesThe user's session identifier

Good to know

All parameters are sent as a JSON body with Content-Type: application/json.

Response Fields ​

FieldTypeDescription
messagestringConfirmation message

Code Examples ​

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

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