Please how can I do it that when a person tries to play a game. My game can extract the game URL and the client id from a URL that has the game URL / client id and turn passes this information to an API endpoint that verifies if the person has access or not
It lets the person play if it's successful but if the person doesn't have access, an error message is displayed
What you're asking for is a user management system. And it's a bit more complicated than just passing a client ID. Anything that can be stored on the client, like a user ID, can be accessed and changed.
There are a few ways to handle this. One is with Firebase and Google logins. I have no experience with either of those but lots of C3 creators use them.
I opted for what you're describing with is an API to my own server and I wrote the code in PHP using MySQL. This took a good bit of work because you're going to need to handle user names, passwords, hashing, nonces, salting, email verification, forgotten passwords, account creation, etc.