Skip to main content

Data Exchange

The mail2many API uses JSON for data exchange. All requests and responses are handled in JSON format.

Request​

The request body must be sent as JSON. Which fields are required and which are optional is documented for each endpoint.

Important: Documentation examples usually contain all available fields. Check the schema and send only the fields you actually need. If a field is nullable, you can omit it.

Example request:

{
"email": "user@example.com",
"firstname": "John",
"lastname": "Doe",
"genderId": 1,
"sendOptIn": true
}

Response​

The API responds with an HTTP status code and usually a JSON body. The response typically contains more fields than your request, because mail2many returns all resource fields plus metadata such as ID or creation date.

Example response:

HTTP/1.1 200 OK

{
"id": 1,
"email": "user@example.com",
"status": 2,
"statusAddition": 1,
"genderId": 1,
"languageIso": "de",
"firstname": "John",
"lastname": "Doe",
"company": null,
"street": null,
"postcode": null,
"city": null,
"phoneNumber": null,
"birthday": null,
"optInComment": null,
"optInSent": true,
"createdAt": "2021-01-22 10:28:00",
"updatedAt": null
}

Content-Type headers​

Make sure your requests include the correct headers:

Content-Type: application/json
Accept: application/json

This ensures the API can correctly interpret your data and return the expected response headers.