Mailosaur logo
Mailosaur logo

Servers

The Servers API allows you to list, view, create, and modify the servers that store your email and SMS messages.

GET/api/servers

Returns a list of your virtual SMTP servers. Servers are returned sorted in alphabetical order.

Run in PostmanRun in Insomnia
Example request
curl \
  -u api:YOUR_API_KEY \
  https://mailosaur.com/api/servers
Example response
[
    {
        "id": "abcd1234",
        "name": "Server name",
        "users": [],
        "messages": 16
    }
]
POST/api/servers

Creates a new virtual SMTP server and returns it.

Body parameters

  • Name
    name
    Type
    string
    Description

    The name of the server.

Run in PostmanRun in Insomnia
Example request
curl \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{"name":"Example"}' \
  -u api:YOUR_API_KEY \
  https://mailosaur.com/api/servers
Example response
{
    "id": "abcd1234",
    "name": "Server name",
    "users": [],
    "messages": 0
}
GET/api/servers/:id

Retrieves the detail for a single server. Simply supply the unique identifier for the required server.

Path parameters

  • Name
    id
    Type
    string
    Description

    The identifier of the server to be retrieved.

Run in PostmanRun in Insomnia
Example request
curl \
  -u api:YOUR_API_KEY \
  https://mailosaur.com/api/servers/SERVER_ID
Example response
{
    "id": "abcd1234",
    "name": "Server name",
    "users": [],
    "messages": 0
}
GET/api/servers/:id/password

Retrieves the password, for use with SMTP and POP3, for a single server. Simply supply the unique identifier for the required server.

Path parameters

  • Name
    id
    Type
    string
    Description

    The identifier of the server.

Run in PostmanRun in Insomnia
Example request
curl \
  -u api:YOUR_API_KEY \
  https://mailosaur.com/api/servers/SERVER_ID/password
Example response
{
    "value": "server-password"
}
PUT/api/servers/:id

Updates a single server and returns it.

Path parameters

  • Name
    id
    Type
    string
    Description

    The identifier of the server to be updated.

Body parameters

  • Name
    name
    Type
    string
    Description

    The name of the server.

Run in PostmanRun in Insomnia
Example request
curl \
  -X PUT \
  -H 'Content-Type: application/json' \
  -d '{"name":"Updated server name"}' \
  -u api:YOUR_API_KEY \
  https://mailosaur.com/api/servers/SERVER_ID
Example response
{
    "id": "abcd1234",
    "name": "Server name",
    "users": [],
    "messages": 0
}
DELETE/api/servers/:id

Permanently deletes a server. This operation cannot be undone. Also deletes all messages and associated attachments within the server.

Path parameters

  • Name
    id
    Type
    string
    Description

    The identifier of the server to be deleted.

Run in PostmanRun in Insomnia
Example request
curl \
  -X DELETE \
  -u api:YOUR_API_KEY \
  https://mailosaur.com/api/servers/SERVER_ID
Previous