REST API Overview

API Documentation

Request format, response conventions, pagination, and HTTP methods.

The Cloud Server for Email REST API follows standard REST conventions. Endpoints use predictable, resource-oriented URLs. HTTP methods define actions. JSON is used for request and response bodies. HTTP status codes indicate success or failure.

Request Format

POST /v1/messages HTTP/1.1 Host: api.cloudserverforemail.com Authorization: Bearer YOUR_API_KEY Content-Type: application/json Accept: application/json { "from": "sender@yourdomain.com", "to": ["recipient@example.com"], "subject": "Your subject", "html": "<p>Message body</p>" }

Response Format

All responses return JSON. Successful responses include a status field. Error responses include error and message fields.

Success

{"id":"msg_01J...","status":"queued","queued_at":"2026-04-08T12:00:00Z"}

Error

{"error":"invalid_request","message":"The 'to' field must contain at least one valid email address."}

HTTP Methods

MethodUse
GETRetrieve a resource or list of resources
POSTCreate a resource or trigger an action
PUTReplace a resource entirely
PATCHUpdate specific fields of a resource
DELETERemove a resource

Pagination

List endpoints return paginated results. Use limit and offset query parameters to paginate.

GET /v1/messages?limit=50&offset=100&start_date=2026-04-01
ParameterTypeDescription
limitintegerResults per page (max 250, default 50)
offsetintegerNumber of results to skip (default 0)