API reference
Every operation, generated from the spec This page is generated from the same OpenAPI document CommuniQueue tests its API against, so what you read here is what the API actually does.
Prefer the machine-readable document? Import https://api.communiqueue.com/openapi/v1.json directly into Postman or Insomnia.
Operations GET /api/v1/api-keys/validate Check whether an API key is valid and see its status.
Looks up the key passed in the X-Api-Key header and reports whether it is currently valid, along with its name, workspace id, and status - active, revoked, or expired. A key that does not resolve at all still returns 200 with isValid set to false rather than an error; only a request with no X-Api-Key header at all is rejected with 401. Useful for confirming a newly created key works, or for diagnosing why a key you expected to work is being rejected elsewhere.
Requires ApiKey authentication.
Response 200 Field Type Notes apiKeyId string (uuid) | null required createdAt string (date-time) | null required expiresAt string (date-time) | null required isValid boolean required lastUsedAt string (date-time) | null required name string | null required revokedAt string (date-time) | null required status string | null required tenantId string (uuid) | null required
Responses Status Meaning errorCode 200 OK - 401 Unauthorized api_keys.missing 500 Internal Server Error -
curl curl https://api.communiqueue.com/api/v1/api-keys/validate \
-H "X-Api-Key: cq_live_..."Node const response = await fetch(
'https://api.communiqueue.com/api/v1/api-keys/validate',
{
headers: {
'X-Api-Key': process.env.COMMUNIQUEUE_API_KEY
}
}
)
const result = await response.json()
// result.isValid, result.status ('active' | 'revoked' | 'expired')POST /api/v1/notifications/preview Render a template against sample tags without sending anything.
Renders the live (or a pinned) version of the template with the supplied tags and returns the rendered output. Nothing is delivered and no delivery job is created. Only email templates are supported - previewing any other template type returns notifications.unsupported_notification_type. Useful in CI, or in an internal tool that needs to show what a send would look like before it goes out. Omit versionNumber to preview whatever version is currently live.
Requires ApiKey authentication.
Request body Field Type Notes emailOptions EmailOptionsDto | null Field Type Notes attachments array | null Field Type Notes cid string | null content string required contentType string required name string required
bcc array | null cc array | null customHeaders object | null fromAddress string | null overrideRecipients array | null priority EmailPriority | null Permitted values: Normal, High, Low (nullable) .
replyTo string | null requestDeliveryReceipt boolean requestReadReceipt boolean sensitivity EmailSensitivity | null Permitted values: Normal, Personal, Private, Confidential (nullable) .
to array | null trackClicks boolean | null trackOpens boolean | null
smsOptions SmsOptionsDto | null Field Type Notes fromNumber string | null overrideRecipients array | null to array | null
tags TagDto[] required Field Type Notes key string required value string required
templateId string (uuid) required tenantId string (uuid) required versionNumber integer (int32) | null webhookOptions WebhookOptionsDto | null Field Type Notes headers object | null urlOverride string | null
Response 200 Field Type Notes email EmailPreviewResultDto | null required Field Type Notes attachments AttachmentMetadataDto[] required Field Type Notes contentId string | null required contentType string required name string required sizeBytes integer (int64) required
batchingInfo BatchingInfoDto | null required Field Type Notes batchingStrategy string required emailType string required messageCount integer (int32) required
customHeaders object required errorMessage string | null required finalBodies FinalBodiesDto | null required Field Type Notes htmlBody string required textBody string | null required
recipients ResolvedRecipientsDto required Field Type Notes bcc array required cc array required to array required wasOverridden boolean required
renderedContent RenderedContentDto required Field Type Notes body string | null required htmlHead string | null required subject string | null required
renderingErrors RenderingErrorDto[] required Field Type Notes message string required templatePart string required
sender EmailSenderDto required Field Type Notes fromAddress string required fromName string | null required replyTo string | null required
success boolean required templateMetadata TemplateMetadataDto required Field Type Notes emailType string required notificationType string required templateId string (uuid) required versionNumber integer (int32) required
trackingSettings TrackingSettingsDto required Field Type Notes trackClicks boolean required trackOpens boolean required
variableMetadata VariableMetadataDto required Field Type Notes missingVariables array required providedVariables array required unusedVariables array required
validationErrors ValidationErrorDto[] required Field Type Notes field string required message string required
Responses Status Meaning errorCode 200 OK - 400 Bad Request notifications.request_missing notifications.unsupported_notification_type notifications.no_live_version 401 Unauthorized api_keys.missing api_keys.invalid 403 Forbidden api_keys.tenant_mismatch 404 Not Found notifications.template_not_found 500 Internal Server Error -
curl curl -X POST https://api.communiqueue.com/api/v1/notifications/preview \
-H "X-Api-Key: cq_live_..." \
-H "Content-Type: application/json" \
-d '{
"tenantId": "<your workspace id>",
"templateId": "<your template id>",
"tags": [{ "key": "firstName", "value": "Ada" }]
}'Node const response = await fetch(
'https://api.communiqueue.com/api/v1/notifications/preview',
{
method: 'POST',
headers: {
'X-Api-Key': process.env.COMMUNIQUEUE_API_KEY,
'Content-Type': 'application/json'
},
body: JSON.stringify({
tenantId: process.env.COMMUNIQUEUE_WORKSPACE_ID,
templateId: 'welcome-email',
tags: [{ key: 'firstName', value: 'Ada' }]
})
}
)
const preview = await response.json()
// preview.email.renderedContent.subject / .body - what the send would renderPOST /api/v1/notifications/send Queue a templated notification for delivery.
Renders the template named by templateId with the supplied tags and queues it for delivery over whichever channel the template is configured for. The response is 202 Accepted, which means the notification has been queued, not that it has been delivered - track the actual delivery outcome in your workspace's delivery reports. Omit versionNumber to always send whatever version is currently live; pin it only when a specific published version must go out regardless of what gets published afterward. A webhook template additionally requires webhookOptions.urlOverride and a plan that includes webhook delivery.
Requires ApiKey authentication.
Request body Field Type Notes emailOptions EmailOptionsDto | null Field Type Notes attachments array | null Field Type Notes cid string | null content string required contentType string required name string required
bcc array | null cc array | null customHeaders object | null fromAddress string | null overrideRecipients array | null priority EmailPriority | null Permitted values: Normal, High, Low (nullable) .
replyTo string | null requestDeliveryReceipt boolean requestReadReceipt boolean sensitivity EmailSensitivity | null Permitted values: Normal, Personal, Private, Confidential (nullable) .
to array | null trackClicks boolean | null trackOpens boolean | null
smsOptions SmsOptionsDto | null Field Type Notes fromNumber string | null overrideRecipients array | null to array | null
tags TagDto[] required Field Type Notes key string required value string required
templateId string (uuid) required tenantId string (uuid) required versionNumber integer (int32) | null webhookOptions WebhookOptionsDto | null Field Type Notes headers object | null urlOverride string | null
Response 202 Field Type Notes accepted boolean required correlationId string required message string required
Responses Status Meaning errorCode 202 Accepted - 400 Bad Request notifications.request_missing notifications.webhook_destination_required notifications.no_live_version 401 Unauthorized api_keys.missing api_keys.invalid 403 Forbidden api_keys.tenant_mismatch notifications.webhook_delivery_not_available notifications.monthly_limit_not_configured 404 Not Found notifications.template_not_found 429 Too Many Requests notifications.monthly_limit_exceeded 500 Internal Server Error -
curl curl -X POST https://api.communiqueue.com/api/v1/notifications/send \
-H "X-Api-Key: cq_live_..." \
-H "Content-Type: application/json" \
-d '{
"tenantId": "<your workspace id>",
"templateId": "<your template id>",
"tags": [{ "key": "firstName", "value": "Ada" }]
}'Node const response = await fetch(
'https://api.communiqueue.com/api/v1/notifications/send',
{
method: 'POST',
headers: {
'X-Api-Key': process.env.COMMUNIQUEUE_API_KEY,
'Content-Type': 'application/json'
},
body: JSON.stringify({
tenantId: process.env.COMMUNIQUEUE_WORKSPACE_ID,
templateId: 'welcome-email',
tags: [{ key: 'firstName', value: 'Ada' }]
})
}
)
// 202 Accepted - the send is queued, not delivered; check your workspace's
// delivery reports for the outcome.All error codes Every machine-readable errorCode the API can return, across every operation.
api_keys.invalid api_keys.missing api_keys.tenant_mismatch notifications.attachment.content_invalid_base64 notifications.attachment.content_required notifications.attachment.content_too_large notifications.attachment.content_type_required notifications.attachment.content_type_too_long notifications.attachment.name_required notifications.attachment.name_too_long notifications.email.bcc_empty notifications.email.bcc_invalid notifications.email.cc_empty notifications.email.cc_invalid notifications.email.from_address_invalid notifications.email.override_recipient_empty notifications.email.override_recipient_invalid notifications.email.reply_to_invalid notifications.email.to_empty notifications.email.to_invalid notifications.monthly_limit_exceeded notifications.monthly_limit_not_configured notifications.no_live_version notifications.request_missing notifications.tag_key_required notifications.tag_key_too_long notifications.tags_required notifications.template_id_required notifications.template_not_found notifications.template_version_is_draft notifications.template_version_not_found notifications.tenant_id_required notifications.unsupported_notification_type notifications.validation_failed notifications.version_number_invalid notifications.webhook_delivery_not_available notifications.webhook_destination_invalid notifications.webhook_destination_required