DEV Community

Cover image for Handling form submissions via the Netlify API
Phil Hawksworth for Netlify

Posted on • Originally published at netlify.com

Handling form submissions via the Netlify API

Throughout December we'll be highlighting a different Netlify feature each day. It might just be the thing you need to unlock those creative juices, and dust off that domain you registered but never deployed! Keep an eye on the blog and on Twitter for each feature!

When using Netlify Forms, you can access your submissions via the UI under the Forms tab of your site, but if you'd like to
programmatically access them, you can use the Netlify API to do so.

A few endpoints and operations are available.

Note: All URLs start with https://api.netlify.com/api/v1. SSL only.

  • Get verified submissions for all forms of a site with a GET request to /sites/{site_id}/submissions.
  • Get verified submissions for a specific form of a site with a GET request to /forms/{form_id}/submissions.
  • Get spam submissions by adding the query parameter state=spam to the URLs mentioned above. For example /forms/{form_id}/submissions?state=spam.
  • Change submission state with the 2 following operations:
    • PUT request to /submissions/{submission_id}/spam to mark a submission as spam.
    • PUT request to /submissions/{submission_id}/ham to mark a submission as ham.
  • Delete submissions with a DELETE request to /submissions/{submission_id}

That's it! From there you can manage your submissions whichever way you want!

More information

API Trace View

How I Cut 22.3 Seconds Off an API Call with Sentry 👀

Struggling with slow API calls? Dan Mindru walks through how he used Sentry's new Trace View feature to shave off 22.3 seconds from an API call.

Get a practical walkthrough of how to identify bottlenecks, split tasks into multiple parallel tasks, identify slow AI model calls, and more.

Read more →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay