Create a mail address
POST/projects/ {projectId}/ mail-addresses/
v2
POST
mail-create-mail-address
Request
Responses
Usage examples
- cURL
- JavaScript SDK
- PHP SDK
$ curl \
--fail \
--location \
-X POST \
-d '{"address":"email@mittwald.example","forwardAddresses":["email@mittwald.example"]}' \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
-H 'Content-Type: application/json' \
https://api.mittwald.de/v2/projects/string/mail-addresses
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";
const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.mail.createMailAddress({
"projectId": "string",
"data": {
"address": "email@mittwald.example",
"forwardAddresses": [
"email@mittwald.example"
]
}
});
assertStatus(response, 201);
use \Mittwald\ApiClient\Generated\V2\Clients\Mail\CreateMailAddress\CreateMailAddressRequest;
use \Mittwald\ApiClient\Generated\V2\Clients\Mail\CreateMailAddress\CreateMailAddressRequestBody;
$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));
// TODO: Please consult the properties and constructor signature of
// CreateMailAddressRequestBody to learn how to construct a valid instance
$body = new CreateMailAddressRequestBody(/* TODO: ... */);
$request = (new CreateMailAddressRequest(
projectId: "string",
body: $body
));
$response = $client->mail()->createMailAddress($request);
var_dump($response->getBody();