Forms: delete a form through the Netlify API

An example of how to do this using curl:

  1. create a personal auth token at Netlify App
  2. SAVE THAT TOKEN! There is no way to get it back if you don’t copy it from the creation page. (but, it’s free to make more if you do lose it :)). Please be aware that this token is like your password - gives FULL ACCESS TO ALL YOUR NETLIFY SITES AND TEAMS - so NEVER post it publicly here or anywhere!
  3. find your Site ID through the admin UI - it’s on the “General Settings” page for the site (last navigation entry above the white parts of the page, on the right hand side as of this writing)
  4. find your form’s ID through the admin UI - start on the site in question, select the “Forms” navigation link at the top of the page, click into the form you want to delete, and grab the identifier off the end of the URL. It will look something like 5b69cb61e470854baea3c3e8
  5. confirm that you have exported ANY data you need from submissions, as the next step WILL REMOVE ALL SUBMISSION DATA PERMANENTLY AND IRRETRIEVABLY
  6. now you’re ready!

curl -H "Authorization: Bearer YOUR_API_TOKEN_GOES HERE" -X DELETE https://api.netlify.com/api/v1/sites/YOUR_SITE_ID/forms/YOUR_FORM_ID

If you have trouble with this, let us know in the comments below but again please do NOT post your API token in any debugging output (but your site + form ID, plus the response from curl, WOULD be useful details :))

2 Likes