Skip to main content

Operations

Spam reporting, trust contact token management, auto-reconnect, and history sync configuration.

Spam Report

Report a message as spam.

POST /api/v1/sessions/{session_id}/spam/report

Request Body

{
"message_id": "3EB0ABC123...",
"message_timestamp": 1700000000,
"from_jid": "628123456789@s.whatsapp.net",
"spam_flow": "message_menu"
}
FieldTypeRequiredDescription
message_idstringYesMessage ID being reported
message_timestampnumberYesTimestamp of the message
from_jidstringNoJID of the message sender
participant_jidstringNoParticipant JID (group messages)
group_jidstringNoGroup JID (group reports)
group_subjectstringNoGroup name (group reports)
spam_flowstringNoReport flow type (default: message_menu)
media_typestringNoMedia type of the message

Spam Flow Types

FlowDescription
message_menuReport from message context menu
group_spam_banner_reportReport from group spam banner
group_info_reportReport from group info page
contact_infoReport from contact info page
status_reportReport from status viewer

Response

{
"success": true,
"report_id": "report-uuid"
}

Example

curl -X POST http://localhost:3451/api/v1/sessions/my-session/spam/report \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"message_id": "3EB0ABC123...",
"message_timestamp": 1700000000,
"from_jid": "628123456789@s.whatsapp.net",
"spam_flow": "message_menu"
}'

TCToken - Issue Tokens

Issue trust contact tokens for one or more JIDs.

POST /api/v1/sessions/{session_id}/tctoken/issue

Request Body

{
"jids": [
"628123456789@s.whatsapp.net",
"628987654321@s.whatsapp.net"
]
}

Response

{
"tokens": [
{
"jid": "628123456789@s.whatsapp.net",
"timestamp": 1700000000
}
]
}

Example

curl -X POST http://localhost:3451/api/v1/sessions/my-session/tctoken/issue \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"jids": ["628123456789@s.whatsapp.net"]
}'

TCToken - Get Token

Get the trust contact token for a specific JID.

GET /api/v1/sessions/{session_id}/tctoken/{jid}

Response

{
"jid": "628123456789@s.whatsapp.net",
"token_timestamp": 1700000000,
"sender_timestamp": 1700000100,
"found": true
}

If no token exists:

{
"jid": "628123456789@s.whatsapp.net",
"token_timestamp": null,
"sender_timestamp": null,
"found": false
}

Example

curl http://localhost:3451/api/v1/sessions/my-session/tctoken/628123456789@s.whatsapp.net \
-H "Authorization: Bearer YOUR_TOKEN"

TCToken - List All

List all JIDs that have trust contact tokens.

GET /api/v1/sessions/{session_id}/tctoken/list

Response

{
"jids": [
"628123456789@s.whatsapp.net",
"628987654321@s.whatsapp.net"
]
}

Example

curl http://localhost:3451/api/v1/sessions/my-session/tctoken/list \
-H "Authorization: Bearer YOUR_TOKEN"

TCToken - Prune Expired

Remove all expired trust contact tokens.

DELETE /api/v1/sessions/{session_id}/tctoken/expired

Response

{
"pruned_count": 5
}

Example

curl -X DELETE http://localhost:3451/api/v1/sessions/my-session/tctoken/expired \
-H "Authorization: Bearer YOUR_TOKEN"

Auto-Reconnect - Get Status

Get the current auto-reconnect configuration.

GET /api/v1/sessions/{session_id}/reconnect

Response

{
"enabled": true,
"error_count": 0
}

Example

curl http://localhost:3451/api/v1/sessions/my-session/reconnect \
-H "Authorization: Bearer YOUR_TOKEN"

Auto-Reconnect - Set

Enable or disable automatic reconnection on disconnect.

PUT /api/v1/sessions/{session_id}/reconnect

Request Body

{
"enabled": true
}

Response

{
"enabled": true,
"error_count": 0
}

Example

curl -X PUT http://localhost:3451/api/v1/sessions/my-session/reconnect \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"enabled": true}'

History Sync - Get

Get the current history sync configuration.

GET /api/v1/sessions/{session_id}/history-sync

Response

{
"skip_history_sync": false
}

Example

curl http://localhost:3451/api/v1/sessions/my-session/history-sync \
-H "Authorization: Bearer YOUR_TOKEN"

History Sync - Set

Control whether message history is synced when connecting a new device.

PUT /api/v1/sessions/{session_id}/history-sync

Request Body

{
"skip": true
}
FieldTypeRequiredDescription
skipbooleanYesSet to true to skip history sync

Response

{
"skip_history_sync": true
}

Example

curl -X PUT http://localhost:3451/api/v1/sessions/my-session/history-sync \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"skip": true}'