Forms
The forms endpoint emails form submissions — contact forms, lead captures, waitlists — to the project’s admin email, so your app can collect messages without a backend or an email provider.
POST https://cloud.frontend.co/api/v1/contactAuthenticate with the project’s API key. Submissions are sent to the project’s admin email: the email of the member who created the project, or the team owner’s.
Request
Section titled “Request”Send JSON with the form’s fields, a message, or both:
| Field | Type | Description |
|---|---|---|
fields | object | The form’s fields as name–value pairs, such as { "Name": "Ada", "Email": "ada@example.com" }. Up to 50 fields. |
message | string | A free-text message. |
Submissions can be up to 10,000 characters in total.
curl -X POST "https://cloud.frontend.co/api/v1/contact" \ -H "x-api-key: $FRONTEND_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "fields": { "Name": "Ada Lovelace", "Email": "ada@example.com", "Company": "Analytical" }, "message": "I would like a demo." }'From your app
Section titled “From your app”Post the form from server code so the API key stays private:
export async function POST(request: Request) { const form = await request.formData() const res = await fetch('https://cloud.frontend.co/api/v1/contact', { method: 'POST', headers: { 'Content-Type': 'application/json', 'x-api-key': process.env.FRONTEND_API_KEY!, }, body: JSON.stringify({ fields: { Name: form.get('name'), Email: form.get('email') }, message: form.get('message'), }), }) return Response.json(await res.json(), { status: res.status })}Errors
Section titled “Errors”| Status | Meaning |
|---|---|
400 | The submission has no fields or message, or is too long |
401 | Missing or invalid API key |
404 | The project wasn’t found |
409 | The project has no admin email |
500, 502 | The email couldn’t be sent |
A successful submission returns { "success": true }.