Skip to content

Instantly share code, notes, and snippets.

@0x7466
Created January 26, 2026 12:08
Show Gist options
  • Select an option

  • Save 0x7466/6c76d0b656e1832a394f3011ba8ffb8f to your computer and use it in GitHub Desktop.

Select an option

Save 0x7466/6c76d0b656e1832a394f3011ba8ffb8f to your computer and use it in GitHub Desktop.
Postal Server OpenAPI
{
"openapi": "3.0.3",
"info": {
"title": "Postal Server API",
"description": "API for interacting with the Postal mail delivery server.",
"version": "1.0.0"
},
"servers": [
{
"url": "https://your-postal-server.com/api/v1",
"description": "Postal API v1 endpoint"
}
],
"components": {
"securitySchemes": {
"ServerApiKey": {
"type": "apiKey",
"in": "header",
"name": "X-Server-API-Key"
}
},
"schemas": {
"Attachment": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The filename of the attachment."
},
"content_type": {
"type": "string",
"description": "The MIME type of the attachment."
},
"data": {
"type": "string",
"description": "The base64 encoded content of the attachment."
}
},
"required": ["name", "content_type", "data"]
},
"SendMessageRequest": {
"type": "object",
"properties": {
"to": {
"type": "array",
"items": {
"type": "string"
},
"maxItems": 50,
"description": "The e-mail addresses of the recipients (max 50)"
},
"cc": {
"type": "array",
"items": {
"type": "string"
},
"maxItems": 50,
"description": "The e-mail addresses of any CC contacts (max 50)"
},
"bcc": {
"type": "array",
"items": {
"type": "string"
},
"maxItems": 50,
"description": "The e-mail addresses of any BCC contacts (max 50)"
},
"from": {
"type": "string",
"description": "The e-mail address for the From header"
},
"sender": {
"type": "string",
"description": "The e-mail address for the Sender header"
},
"subject": {
"type": "string",
"description": "The subject of the e-mail"
},
"tag": {
"type": "string",
"description": "The tag of the e-mail"
},
"reply_to": {
"type": "string",
"description": "Set the reply-to address for the mail"
},
"plain_body": {
"type": "string",
"description": "The plain text body of the e-mail"
},
"html_body": {
"type": "string",
"description": "The HTML body of the e-mail"
},
"attachments": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Attachment"
},
"description": "An array of attachments for this e-mail"
},
"headers": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "A hash of additional headers"
}
}
},
"SendMessageResponse": {
"type": "object",
"properties": {
"status": {
"type": "string",
"example": "success"
},
"data": {
"type": "object",
"properties": {
"message_id": {
"type": "string"
},
"messages": {
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"id": { "type": "integer" },
"token": { "type": "string" }
}
}
}
}
}
}
}
}
},
"security": [
{
"ServerApiKey": []
}
],
"paths": {
"/send/message": {
"post": {
"summary": "Send a new message",
"operationId": "sendMessage",
"tags": ["Messages"],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SendMessageRequest"
}
}
}
},
"responses": {
"200": {
"description": "Message queued successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SendMessageResponse"
}
}
}
},
"401": {
"description": "Unauthorized - Invalid or missing API Key"
},
"422": {
"description": "Unprocessable Entity - Validation errors"
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment