Skip to main content

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.

API reference

View this endpoint's schema in the Open API Explorer.

Server-side integration only

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 parameterDescription
tenantCodeCode of the tenant that owns the email configuration, for example playground.
emailConfigCodeCode of the email configuration, for example order-confirmation.

Request

{
"target": "recipient@example.com",
"variables": {
"customerName": {
"value": "Max Mustermann"
},
"resetToken": {
"value": "<sensitive-value>",
"type": "masked"
}
}
}
PropertyTypeRequiredDescription
targetstringYesRecipient email address. It must use a valid email format.
variablesobjectNoMap 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>.valuestringYes, per variableValue passed to the email template.
variables.<name>.typestringNostandard (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
CodeDescription
200The delivery job was accepted and queued.
400The request is invalid, for example because target is not a valid email address.
401Authentication failed.
Other 4xxThe 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.