Email API
Use the Email API to queue a single email for asynchronous delivery through a configured QSC email service. Create and manage email configurations in Email Configuration.
View this endpoint's schema in the Open API Explorer.
Call this API from your application's backend. Do not expose API keys or other credentials in browser code.
Delivery
The API validates the request and adds the email to the delivery queue. QSC sends the email asynchronously. A successful response confirms that the request was accepted, not that the email was delivered.
Authentication
Authentication is defined by the security configuration assigned to the email configuration. Use the authentication mechanism configured there. This guide illustrates the recommended API-key approach: send the configured key in the header defined for that security configuration. The default header is X-QSC-Token.
POST /api/v1/email/send/acme/order-confirmation
Content-Type: application/json
X-QSC-Token: <api-key>
Send email
POST /api/v1/email/send/{tenantCode}/{emailConfigCode}
| Path parameter | Description |
|---|---|
tenantCode | Code of the tenant that owns the email configuration, for example playground. |
emailConfigCode | Code of the email configuration, for example order-confirmation. |
Request
{
"target": "recipient@example.com",
"variables": {
"customerName": {
"value": "Max Mustermann"
},
"resetToken": {
"value": "<sensitive-value>",
"type": "masked"
}
}
}
| Property | Type | Required | Description |
|---|---|---|---|
target | string | Yes | Recipient email address. It must use a valid email format. |
variables | object | No | Map of template variable names to values. Omit it or set it to null to use only the default variables from the email configuration. |
variables.<name>.value | string | Yes, per variable | Value passed to the email template. |
variables.<name>.type | string | No | standard (default) or masked. A masked value is stored as [masked] in applicable delivery logs. |
Use the values in your configured templates according to the selected template engine; for example, a Mustache template can use {{customerName}}.
cURL example
curl -X POST 'https://qsc.quasiris.de/api/v1/email/send/acme/order-confirmation' \
-H 'Content-Type: application/json' \
-H 'X-QSC-Token: <api-key>' \
-d '{
"target": "recipient@example.com",
"variables": {
"customerName": { "value": "Max Mustermann" },
"resetToken": { "value": "<sensitive-value>", "type": "masked" }
}
}'
Response and status codes
Successful request
When the request is accepted and queued, the API returns plain text:
HTTP/1.1 200 OK
Content-Type: text/plain
OK
| Code | Description |
|---|---|
200 | The delivery job was accepted and queued. |
400 | The request is invalid, for example because target is not a valid email address. |
401 | Authentication failed. |
Other 4xx | The request could not be accepted. Verify the request, the email configuration, and the assigned API-key security configuration. |
Prerequisites
Before calling the API, ensure that:
- An email configuration exists at
{tenantCode}/{emailConfigCode}. - The configuration is complete and ready to send emails.
- An API-key security configuration is assigned to the email configuration.
- The request uses the corresponding API key.