POST
/
api
/
v1
/
submit
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  name: "John Doe",
  email: "name@company.com",
  phone: 1234567890,
  enquiry: true,
  message: "This is a test message",
});

var requestOptions = {
  method: "POST",
  headers: myHeaders,
  body: raw,
  redirect: "follow",
};

fetch("https://api.mailpigeon.app/api/v1/submit", requestOptions)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.log("error", error));
{
  "data": {
    "message": "Submission successful"
  },
  "status": {
    "code": 201,
    "message": "Created"
  }
}

Body

name
string
This can be used in any context you like.
email
string
This can be used in any context you like.
phone
integer
This can be used in any context you like.
enquiry
boolean
This can be used in any context you like.
message
string
This can be used in any context you like.

Response

data
object
Contains the status of the call and the error message if any.
status
object
Contains the status of the call and the HTTP status code.
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  name: "John Doe",
  email: "name@company.com",
  phone: 1234567890,
  enquiry: true,
  message: "This is a test message",
});

var requestOptions = {
  method: "POST",
  headers: myHeaders,
  body: raw,
  redirect: "follow",
};

fetch("https://api.mailpigeon.app/api/v1/submit", requestOptions)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.log("error", error));
{
  "data": {
    "message": "Submission successful"
  },
  "status": {
    "code": 201,
    "message": "Created"
  }
}