Enable Identity via Netlify API

It would be nice to be able to deploy sites, and enable Identity without having to go to the UI of a deployed site and enable Identity. Whether this is some API endpoint or a netlify configuration option. Currently I have many clients and I can automate the build, deployment, but still have to go into the deployed site and enable identity by clicking a button.

@David_Davis, the Netlify web UI is using the same API. One of the best ways to find out how to make the API call in your code, is to view the network tab and examine the API call in the browser developer tools.

The “Copy as CURL” and “Copy all as CURL” options in Chrome can be incredibly helpful to see exactly how the UI is making these API calls. Using this, it should be possible to generalize the API call so you can programmatically make the same API calls using your own code.

If there are other questions about this, please let us know.

Hi @luke, if I’m using netlify-cli, I’d like to authenticate a user to my site without enabling Itentity through the UI which I previously stated. You mentioned being able to do this through the API. I run netlify api --list and I don’t see an api method that would allow me to add user to Identity. Does this mean I can’t use the cli to accomplish this or correct me if I’m wrong. Thanks Luke.

Indeed, our api definition that you can find that way or at https://open-api.netlify.com does not include all possible and existing calls, including that one.

What Luke was trying to describe is that you would use the UI to do the operation one time, and watch in the browser dev tools, and take the call we made and you can reproduce it on other sites to programatically enable.

This article has a more thorough description of how to do this: [Common Issue] Understanding and using Netlify's API