Sanbox API requests goes to Production

So I created a Person with /api/v1/persons and and then a Lead with /api/v1/leads and used xxxxx-sandbox.pipedrive.com url when doing it but Lead registered to Production side. Why is this? Isn’t Sanbox made for preventing this from happening.

As far as I understood the endpoint you want to use is: https://api.pipedrive.com/v1/ and what determines what env you are hitting is the API key you provide.

Not clear in the docs, I fully agree…