The Supreme Court has never weighed in directly on these questions. Here's a primer on the current legal landscape.
Supreme Court looks likely to back Trump administration on adding citizenship question to 2020 census