-
Notifications
You must be signed in to change notification settings - Fork 0
Servers
Greg Svoboda edited this page Mar 4, 2026
·
1 revision
Manage multiple servers across your account using AccountClient. You will need an account API token.
import postmark
account = postmark.AccountClient("your-account-token")import asyncio
async def main():
result = await account.server.list()
print(f"Total servers: {result.total}")
for server in result.items:
print(f" [{server.id}] {server.name}")
print(f" Color: {server.color.value}")
print(f" Delivery type: {server.delivery_type.value}")
print(f" SMTP enabled: {server.smtp_api_activated}")
asyncio.run(main())async def main():
server = await account.server.get(server_id=1234567)
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}")import asyncio
from postmark.models.servers import DeliveryType, ServerColor
async def main():
server = await account.server.create(
name="My New Server",
color=ServerColor.BLUE,
delivery_type=DeliveryType.SANDBOX,
track_opens=True,
)
print(f"Created: [{server.id}] {server.name}")
print(f"Inbound address: {server.inbound_address}")
asyncio.run(main())DeliveryType values: LIVE, SANDBOX
from postmark.models.servers import ServerColor
async def main():
server = await account.server.edit(
server_id=1234567,
name="Renamed Server",
color=ServerColor.RED,
)
print(f"Updated: {server.name}")async def main():
result = await account.server.delete(server_id=1234567)
print(result.message)- Server — View and update the current server's settings via ServerClient
- Error Handling
- Postmark Servers API