- API-Referenz
- List mail addresses
List mail addresses
Request
- projectIdstring
ID of the Project to list MailAddresses for.
- searchstring
Search term to filter MailAddresses for. The fields id, address and mailboxName are searchable. An exact match is performed for id, a partial match for address and mailboxName.
- forwardAddressboolean
Whether the MailAddress is a forward address.
- catchAllboolean
Whether the MailAddress is a catch-all address.
- autoResponderboolean
Whether the MailAddress has an active auto responder.
- mailArchiveboolean
Whether the MailAddress has a mail-archive.
- limitinteger (≥ 0)
The max count of resources to return in the list response.
- skipinteger
Number of items to skip. Should be multiple of
limit. - pageinteger (≥ 0)
Page to display.
skipandpageend up doing the same. If bothpageandskipare set, skip is used. - sortArray von string (einer von: address.domain, address.local, updatedAt, projectId, mailbox.quota, mailbox.name, mailbox.storageInBytes.current, mailbox.storageInBytes.limit)
List of fields how the result should be sorted.
- orderArray von string (einer von: asc, desc)
Should the result be sorted ascending or descending? You can specify for each field another sorting: sort[0]=foo, order[0]=asc, sort[1]=bar, order[1]=desc.
Responses
- X-Pagination-Limitinteger
The limit used to select the resources for the response
- X-Pagination-Skipinteger
The number of skipped items
- X-Pagination-Pagenumber
The calculate page of the list response. Refer to parameters to learn more.
- X-Pagination-TotalCountinteger
The total amount of items available in the remote ressource. Use this value in combination with the limit to calculate the available pages.
OK
- Array[
- *object
- addressstring (idn-email)required
- archiveobjectrequired
- activebooleanrequired
Shows if the mail-archive is enabled.
- quotainteger (int64)required
Maximum available mail-archive storage in bytes.
- usedBytesinteger (int64)required
Current mail-archive usage in bytes.
- autoResponderobjectrequired
- activebooleanrequired
- expiresAtstring (date-time)
- messagestring
- startsAtstring (date-time)
- forwardAddressesArray von string (idn-email)required
- Array[
- *string (idn-email)
]
- idstring (uuid)required
- isArchivedbooleanrequired
- isBackupInProgressbooleanrequired
- isCatchAllbooleanrequired
- mailboxobject
- mailsystemSettingsobjectrequired
- rateLimitIdstringrequired
- namestringrequired
- passwordUpdatedAtstring (date-time)required
- sendingEnabledbooleanrequired
- spamProtectionobjectrequired
- activebooleanrequired
- autoDeleteSpambooleanrequired
- folderstring (einer von: spam, inbox)required
- relocationMinSpamScoreintegerrequired
- storageInBytesobjectrequired
- currentobjectrequired
- updatedAtstring (date-time)required
- valueinteger (int64)required
- limitinteger (int64)required
- originalAddressstring (idn-email)
For archived mail addresses, the address the mailbox had right before it was archived.
- projectIdstringrequired
- rateLimitChangeRequestobject
- rateLimitIdstringrequired
ID of the rate limit requested.
- receivingDisabledbooleanrequired
- updatedAtstring (date-time)required
]
Content-Type: application/json
[
{
"address": "email@mittwald.example",
"archive": {
"active": true,
"quota": 123,
"usedBytes": 123
},
"autoResponder": {
"active": true,
"expiresAt": "1985-10-26T01:21:00.000Z",
"message": "string",
"startsAt": "1985-10-26T01:21:00.000Z"
},
"forwardAddresses": [
"email@mittwald.example"
],
"id": "f0f86186-0a5a-45b2-aa33-502777496347",
"isArchived": true,
"isBackupInProgress": true,
"isCatchAll": true,
"mailbox": {
"mailsystemSettings": {
"rateLimitId": "string"
},
"name": "string",
"passwordUpdatedAt": "1985-10-26T01:21:00.000Z",
"sendingEnabled": true,
"spamProtection": {
"active": true,
"autoDeleteSpam": true,
"folder": "spam",
"relocationMinSpamScore": 123
},
"storageInBytes": {
"current": {
"updatedAt": "1985-10-26T01:21:00.000Z",
"value": 123
},
"limit": 123
}
},
"originalAddress": "email@mittwald.example",
"projectId": "string",
"rateLimitChangeRequest": {
"rateLimitId": "string"
},
"receivingDisabled": true,
"updatedAt": "1985-10-26T01:21:00.000Z"
}
]
{
"items": {
"properties": {
"address": {
"format": "idn-email",
"type": "string"
},
"archive": {
"properties": {
"active": {
"description": "Shows if the mail-archive is enabled.",
"type": "boolean"
},
"quota": {
"description": "Maximum available mail-archive storage in bytes.",
"format": "int64",
"type": "integer"
},
"usedBytes": {
"description": "Current mail-archive usage in bytes.",
"format": "int64",
"type": "integer"
}
},
"required": [
"active",
"quota",
"usedBytes"
],
"type": "object"
},
"autoResponder": {
"properties": {
"active": {
"type": "boolean"
},
"expiresAt": {
"format": "date-time",
"type": "string"
},
"message": {
"type": "string"
},
"startsAt": {
"format": "date-time",
"type": "string"
}
},
"required": [
"active"
],
"type": "object"
},
"forwardAddresses": {
"items": {
"format": "idn-email",
"type": "string"
},
"type": "array"
},
"id": {
"format": "uuid",
"type": "string"
},
"isArchived": {
"type": "boolean"
},
"isBackupInProgress": {
"type": "boolean"
},
"isCatchAll": {
"type": "boolean"
},
"mailbox": {
"properties": {
"mailsystemSettings": {
"properties": {
"rateLimitId": {
"type": "string"
}
},
"required": [
"rateLimitId"
],
"type": "object"
},
"name": {
"type": "string"
},
"passwordUpdatedAt": {
"format": "date-time",
"type": "string"
},
"sendingEnabled": {
"type": "boolean"
},
"spamProtection": {
"properties": {
"active": {
"type": "boolean"
},
"autoDeleteSpam": {
"type": "boolean"
},
"folder": {
"enum": [
"spam",
"inbox"
],
"type": "string"
},
"relocationMinSpamScore": {
"maximum": 10,
"type": "integer"
}
},
"required": [
"active",
"folder",
"relocationMinSpamScore",
"autoDeleteSpam"
],
"type": "object"
},
"storageInBytes": {
"properties": {
"current": {
"properties": {
"updatedAt": {
"format": "date-time",
"type": "string"
},
"value": {
"format": "int64",
"type": "integer"
}
},
"required": [
"value",
"updatedAt"
],
"type": "object"
},
"limit": {
"format": "int64",
"type": "integer"
}
},
"required": [
"limit",
"current"
],
"type": "object"
}
},
"required": [
"name",
"sendingEnabled",
"spamProtection",
"storageInBytes",
"passwordUpdatedAt",
"mailsystemSettings"
],
"type": "object"
},
"originalAddress": {
"description": "For archived mail addresses, the address the mailbox had right before it was archived.",
"format": "idn-email",
"type": "string"
},
"projectId": {
"type": "string"
},
"rateLimitChangeRequest": {
"properties": {
"rateLimitId": {
"description": "ID of the rate limit requested.",
"type": "string"
}
},
"required": [
"rateLimitId"
],
"type": "object"
},
"receivingDisabled": {
"type": "boolean"
},
"updatedAt": {
"format": "date-time",
"type": "string"
}
},
"required": [
"id",
"receivingDisabled",
"address",
"isCatchAll",
"projectId",
"forwardAddresses",
"updatedAt",
"autoResponder",
"isArchived",
"isBackupInProgress",
"archive"
],
"type": "object"
},
"type": "array"
}
Validation Error caused by invalid input data in the request
- type"ValidationError"required
- messagestring
- validationErrorsArray von objectrequired
- Array[
- *object
- messagestringrequired
The standard error message
- pathstringrequired
The path to the part of the data that was validated. JavaScript property access notation (e.g., ".prop[1].subProp") is used.
- typestringrequired
ajv validation error type (e.g. "format", "required", "type") or own validation error types
- contextobject
The object with the additional information about the error that can be used to create custom error messages. Keys depend on the type that failed validation (e.g. "missingProperty" for type "required")
- *string
]
Content-Type: application/json
{
"type": "ValidationError",
"message": "Validation failed",
"validationErrors": [
{
"message": "should be string",
"path": ".address.street",
"type": "format",
"context": {
"format": "email"
}
}
]
}
{
"type": "object",
"required": [
"type",
"validationErrors"
],
"properties": {
"type": {
"type": "string",
"enum": [
"ValidationError"
]
},
"message": {
"type": "string",
"example": "Validation failed"
},
"validationErrors": {
"type": "array",
"items": {
"type": "object",
"required": [
"message",
"path",
"type"
],
"properties": {
"message": {
"type": "string",
"description": "The standard error message",
"example": "should be string"
},
"path": {
"type": "string",
"description": "The path to the part of the data that was validated. JavaScript property access notation (e.g., \".prop[1].subProp\") is used.\n",
"example": ".address.street"
},
"type": {
"type": "string",
"description": "ajv validation error type (e.g. \"format\", \"required\", \"type\") or own validation error types",
"example": "format"
},
"context": {
"type": "object",
"example": {
"format": "email"
},
"description": "The object with the additional information about the error that can be used to create custom error messages. Keys depend on the\ntype that failed validation (e.g. \"missingProperty\" for type \"required\")\n",
"additionalProperties": {
"type": "string"
}
}
}
}
}
}
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
The requested resource was not found
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
Your request ran into a rate limit. You have to wait until rate limit expires
- messagestring
- typestring
Content-Type: application/json
{
"message": "too many requests",
"type": "RateLimitError"
}
{
"type": "object",
"properties": {
"message": {
"type": "string",
"example": "too many requests"
},
"type": {
"type": "string",
"example": "RateLimitError"
}
}
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
Nutzungsbeispiele
$ curl \
--fail \
--location \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/mail-addresses/?projectId=string&search=string&forwardAddress=true&catchAll=true&autoResponder=true&mailArchive=true&limit=50&page=1&sort=address.domain&order=asc
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.listMailAddressesForUser({
"queryParameters": {
"projectId": "string",
"search": "string",
"forwardAddress": true,
"catchAll": true,
"autoResponder": true,
"mailArchive": true,
"limit": 50,
"page": 1,
"sort": [
"address.domain"
],
"order": [
"asc"
]
}
});
assertStatus(response, 200);
use \Mittwald\ApiClient\Generated\V2\Clients\Mail\ListMailAddressesForUser\ListMailAddressesForUserRequest;
$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));
$request = (new ListMailAddressesForUserRequest())
->withProjectId("string")
->withSearch("string")
->withForwardAddress(true)
->withCatchAll(true)
->withAutoResponder(true)
->withMailArchive(true)
->withLimit(50)
->withPage(1)
->withSort(["address.domain"])
->withOrder(["asc"]);
$response = $client->mail()->listMailAddressesForUser($request);
var_dump($response->getBody();