false, 'ERROR' => 'method_not_allowed'], 405); } $body = readJsonBody(); $messageId = (int) ($body['MessageID'] ?? 0); $agentAddress = trim($body['AgentAddress'] ?? ''); if ($messageId <= 0) jsonResponse(['OK' => false, 'ERROR' => 'message_id_required']); if ($agentAddress === '') jsonResponse(['OK' => false, 'ERROR' => 'agent_address_required']); $stmt = queryTimed("DELETE FROM Hub_PinnedPosts WHERE MessageID = ?", [$messageId]); if ($stmt->rowCount() === 0) { jsonResponse(['OK' => false, 'ERROR' => 'not_pinned']); } jsonResponse(['OK' => true]);