Skip to content
Greg Svoboda edited this page Mar 4, 2026 · 1 revision

Server

View and update the settings of the current server using ServerClient.

Note: These calls operate on the server associated with the token you initialized ServerClient with. To manage other servers across your account, use AccountClient — see Servers.

import postmark

client = postmark.ServerClient("your-server-token")

Get Server Info

import asyncio

async def main():
    server = await client.server.get()

    print(f"ID:               {server.id}")
    print(f"Name:             {server.name}")
    print(f"Color:            {server.color.value}")
    print(f"Delivery type:    {server.delivery_type.value}")
    print(f"SMTP enabled:     {server.smtp_api_activated}")
    print(f"Track opens:      {server.track_opens}")
    print(f"Track links:      {server.track_links.value}")
    print(f"Inbound address:  {server.inbound_address}")
    print(f"Spam threshold:   {server.inbound_spam_threshold}")

asyncio.run(main())

Edit Server Settings

import asyncio
from postmark.models.servers import ServerColor, TrackLinks

async def main():
    server = await client.server.edit(
        name="My Updated Server",
        color=ServerColor.GREEN,
        track_opens=True,
        track_links=TrackLinks.HTML_AND_TEXT,
        inbound_spam_threshold=5,
    )

    print(f"Updated: {server.name}  color={server.color.value}")

asyncio.run(main())

ServerColor values: PURPLE, BLUE, TURQUOISE, GREEN, RED, YELLOW, GREY

TrackLinks values: NONE, HTML_AND_TEXT, HTML_ONLY, TEXT_ONLY

Further Reading

Clone this wiki locally