OpenAPI Specification
MailShield provides a complete OpenAPI 3.1 specification for the API, enabling easy integration with API tools like Swagger UI, Postman, Insomnia, and more.
Specification URL
The OpenAPI specification is available at:
https://app.mailshield.app/api/v1/openapi.jsonInteractive Documentation
Explore the API interactively using our built-in API documentation:
The API explorer allows you to:
- Browse all available endpoints
- View request/response schemas
- Test API calls directly in your browser
- Generate code snippets for various languages
Importing to Postman
Method 1: Import from URL
- Open Postman
- Click Import in the top left
- Select the Link tab
- Enter:
https://app.mailshield.app/api/v1/openapi.json - Click Continue and then Import
Method 2: Import from File
- Download the spec:
curl -o mailshield-openapi.json https://app.mailshield.app/api/v1/openapi.json - Open Postman
- Click Import > Upload Files
- Select the downloaded
mailshield-openapi.json - Click Import
Setting Up Authentication
After importing:
- Click on the imported collection
- Go to the Authorization tab
- Select Bearer Token as the type
- Enter your API token
- Save the collection
All requests in the collection will now use your token.
Importing to Insomnia
- Open Insomnia
- Click Create > Import from URL
- Enter:
https://app.mailshield.app/api/v1/openapi.json - Click Fetch and Import
Configure Environment
- Click No Environment > Manage Environments
- Create a new environment with:json
{ "baseUrl": "https://app.mailshield.app/api/v1", "token": "your-api-token-here" } - Update requests to use
and
Importing to Bruno
Bruno is a fast, Git-friendly API client.
- Create a new collection
- Right-click the collection > Import
- Select OpenAPI V3 Spec
- Enter the URL or upload the JSON file
- Configure authentication in collection settings
Using with Swagger UI
You can run Swagger UI locally with the MailShield spec:
docker run -p 8080:8080 \
-e SWAGGER_JSON_URL=https://app.mailshield.app/api/v1/openapi.json \
swaggerapi/swagger-uiThen open http://localhost:8080 in your browser.
Generating Client SDKs
Use the OpenAPI spec to generate client libraries in your preferred language:
Using OpenAPI Generator
# Install OpenAPI Generator
npm install @openapitools/openapi-generator-cli -g
# Generate Python client
openapi-generator-cli generate \
-i https://app.mailshield.app/api/v1/openapi.json \
-g python \
-o ./mailshield-python-client
# Generate TypeScript client
openapi-generator-cli generate \
-i https://app.mailshield.app/api/v1/openapi.json \
-g typescript-fetch \
-o ./mailshield-ts-client
# Generate Go client
openapi-generator-cli generate \
-i https://app.mailshield.app/api/v1/openapi.json \
-g go \
-o ./mailshield-go-clientAvailable Generators
OpenAPI Generator supports 50+ languages including:
- Python, Ruby, PHP, Java, C#
- TypeScript, JavaScript
- Go, Rust, Swift, Kotlin
- And many more
See the full list of generators.
Specification Details
Version
The API follows Semantic Versioning. The current version is 1.0.
Format
- Specification Version: OpenAPI 3.1.0
- Format: JSON
- Authentication: Bearer token (documented in spec)
Schema Validation
You can validate your API requests against the schema:
# Using spectral for linting
npm install -g @stoplight/spectral-cli
spectral lint https://app.mailshield.app/api/v1/openapi.jsonChangelog
v1.0 (Current)
- Initial API release
- Domain management (CRUD)
- DNS security checks
- Security scoring
- DMARC and TLS-RPT reports
- Alert retrieval