Submit a contact form
curl --request POST \
--url https://api.neuraldraft.io/v1/contact-forms \
--header 'Content-Type: application/json' \
--data '
{
"email": "jsmith@example.com",
"subject": "<string>",
"message": "<string>",
"data": {}
}
'const url = 'https://api.neuraldraft.io/v1/contact-forms';
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'jsmith@example.com',
subject: '<string>',
message: '<string>',
data: {}
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));import requests
url = "https://api.neuraldraft.io/v1/contact-forms"
payload = {
"email": "jsmith@example.com",
"subject": "<string>",
"message": "<string>",
"data": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.neuraldraft.io/v1/contact-forms",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => 'jsmith@example.com',
'subject' => '<string>',
'message' => '<string>',
'data' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"id": 17,
"email": "jane@example.com",
"subject": "Demo request",
"message": "<string>",
"data": {},
"status": "received",
"submitted_at": "2023-11-07T05:31:56Z"
}
}{
"type": "https://api.neuraldraft.io/errors/forbidden",
"title": "Forbidden",
"status": 403,
"detail": "This API key does not have the `commerce:write` scope.",
"code": "forbidden",
"instance": "req_2Nh4PqRsTuVw"
}{
"type": "https://api.neuraldraft.io/errors/validation_failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields failed validation.",
"code": "validation_failed",
"instance": "req_2Nh4PqRsTuVw",
"errors": {
"customer_email": [
"The customer email field must be a valid email address."
],
"starts_at": [
"The starts at field must be a date after now."
]
}
}{
"type": "https://api.neuraldraft.io/errors/rate_limited",
"title": "Too many requests",
"status": 429,
"detail": "Rate limit exceeded. Retry in 12 seconds.",
"code": "rate_limited",
"instance": "req_2Nh4PqRsTuVw"
}Forms
Submit a contact form
Public endpoint — no API key required when called from a browser
embed. The project is resolved via the
X-NeuralDraft-Project-Key header or ?project_id=<id> query param.
data is free-form JSON for whatever your form collects; IP and
user-agent are merged in server-side for spam triage.
Free; no credits charged.
POST
/
contact-forms
Submit a contact form
curl --request POST \
--url https://api.neuraldraft.io/v1/contact-forms \
--header 'Content-Type: application/json' \
--data '
{
"email": "jsmith@example.com",
"subject": "<string>",
"message": "<string>",
"data": {}
}
'const url = 'https://api.neuraldraft.io/v1/contact-forms';
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'jsmith@example.com',
subject: '<string>',
message: '<string>',
data: {}
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));import requests
url = "https://api.neuraldraft.io/v1/contact-forms"
payload = {
"email": "jsmith@example.com",
"subject": "<string>",
"message": "<string>",
"data": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.neuraldraft.io/v1/contact-forms",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => 'jsmith@example.com',
'subject' => '<string>',
'message' => '<string>',
'data' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"id": 17,
"email": "jane@example.com",
"subject": "Demo request",
"message": "<string>",
"data": {},
"status": "received",
"submitted_at": "2023-11-07T05:31:56Z"
}
}{
"type": "https://api.neuraldraft.io/errors/forbidden",
"title": "Forbidden",
"status": 403,
"detail": "This API key does not have the `commerce:write` scope.",
"code": "forbidden",
"instance": "req_2Nh4PqRsTuVw"
}{
"type": "https://api.neuraldraft.io/errors/validation_failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields failed validation.",
"code": "validation_failed",
"instance": "req_2Nh4PqRsTuVw",
"errors": {
"customer_email": [
"The customer email field must be a valid email address."
],
"starts_at": [
"The starts at field must be a date after now."
]
}
}{
"type": "https://api.neuraldraft.io/errors/rate_limited",
"title": "Too many requests",
"status": 429,
"detail": "Rate limit exceeded. Retry in 12 seconds.",
"code": "rate_limited",
"instance": "req_2Nh4PqRsTuVw"
}⌘I