Chat Clear
The /chat/:token endpoint clears all messages from a private chat.
DELETE/v4/chat/:token
Parameters
| Parameter | Required | Description |
|---|---|---|
token | Yes | The private chat token (URL parameter) |
username | Yes | The username |
session | Yes | The 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
| Field | Type | Description |
|---|---|---|
message | string | Confirmation message |
Code Examples
curl -X DELETE \
-H "Content-Type: application/json" \
-d '{
"username": "alice",
"session": "abc123"
}' \
"https://api.sylvain.sh/v4/chat/41a43360-9874-4c7a-9ca8-eec29e765a0e"Try It
Error Handling
If parameters are missing or invalid, the API will return an error:
| Error Message | Description |
|---|---|
Invalid or expired token | The token is invalid or has expired |
Session ID mismatch | Session does not match the user |
Rate limit exceeded | Too many requests in a short period |
Related Endpoints
- POST /v4/chat - Send a message
- GET /v4/chat - Retrieve all recent messages
- POST /v4/chat/private - Create and manage private chat channels