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.

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

FieldTypeNotes
apiKeyIdstring (uuid) | nullrequired
createdAtstring (date-time) | nullrequired
expiresAtstring (date-time) | nullrequired
isValidbooleanrequired
lastUsedAtstring (date-time) | nullrequired
namestring | nullrequired
revokedAtstring (date-time) | nullrequired
statusstring | nullrequired
tenantIdstring (uuid) | nullrequired

Responses

StatusMeaningerrorCode
200OK-
401Unauthorizedapi_keys.missing
500Internal 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

FieldTypeNotes
emailOptionsEmailOptionsDto | null
FieldTypeNotes
attachmentsarray | null
FieldTypeNotes
cidstring | null
contentstringrequired
contentTypestringrequired
namestringrequired
bccarray | null
ccarray | null
customHeadersobject | null
fromAddressstring | null
overrideRecipientsarray | null
priorityEmailPriority | null

Permitted values: Normal, High, Low (nullable).

replyTostring | null
requestDeliveryReceiptboolean
requestReadReceiptboolean
sensitivityEmailSensitivity | null

Permitted values: Normal, Personal, Private, Confidential (nullable).

toarray | null
trackClicksboolean | null
trackOpensboolean | null
smsOptionsSmsOptionsDto | null
FieldTypeNotes
fromNumberstring | null
overrideRecipientsarray | null
toarray | null
tagsTagDto[]required
FieldTypeNotes
keystringrequired
valuestringrequired
templateIdstring (uuid)required
tenantIdstring (uuid)required
versionNumberinteger (int32) | null
webhookOptionsWebhookOptionsDto | null
FieldTypeNotes
headersobject | null
urlOverridestring | null

Response 200

FieldTypeNotes
emailEmailPreviewResultDto | nullrequired
FieldTypeNotes
attachmentsAttachmentMetadataDto[]required
FieldTypeNotes
contentIdstring | nullrequired
contentTypestringrequired
namestringrequired
sizeBytesinteger (int64)required
batchingInfoBatchingInfoDto | nullrequired
FieldTypeNotes
batchingStrategystringrequired
emailTypestringrequired
messageCountinteger (int32)required
customHeadersobjectrequired
errorMessagestring | nullrequired
finalBodiesFinalBodiesDto | nullrequired
FieldTypeNotes
htmlBodystringrequired
textBodystring | nullrequired
recipientsResolvedRecipientsDtorequired
FieldTypeNotes
bccarrayrequired
ccarrayrequired
toarrayrequired
wasOverriddenbooleanrequired
renderedContentRenderedContentDtorequired
FieldTypeNotes
bodystring | nullrequired
htmlHeadstring | nullrequired
subjectstring | nullrequired
renderingErrorsRenderingErrorDto[]required
FieldTypeNotes
messagestringrequired
templatePartstringrequired
senderEmailSenderDtorequired
FieldTypeNotes
fromAddressstringrequired
fromNamestring | nullrequired
replyTostring | nullrequired
successbooleanrequired
templateMetadataTemplateMetadataDtorequired
FieldTypeNotes
emailTypestringrequired
notificationTypestringrequired
templateIdstring (uuid)required
versionNumberinteger (int32)required
trackingSettingsTrackingSettingsDtorequired
FieldTypeNotes
trackClicksbooleanrequired
trackOpensbooleanrequired
variableMetadataVariableMetadataDtorequired
FieldTypeNotes
missingVariablesarrayrequired
providedVariablesarrayrequired
unusedVariablesarrayrequired
validationErrorsValidationErrorDto[]required
FieldTypeNotes
fieldstringrequired
messagestringrequired

Responses

StatusMeaningerrorCode
200OK-
400Bad Requestnotifications.request_missingnotifications.unsupported_notification_typenotifications.no_live_version
401Unauthorizedapi_keys.missingapi_keys.invalid
403Forbiddenapi_keys.tenant_mismatch
404Not Foundnotifications.template_not_found
500Internal 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 render

POST/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

FieldTypeNotes
emailOptionsEmailOptionsDto | null
FieldTypeNotes
attachmentsarray | null
FieldTypeNotes
cidstring | null
contentstringrequired
contentTypestringrequired
namestringrequired
bccarray | null
ccarray | null
customHeadersobject | null
fromAddressstring | null
overrideRecipientsarray | null
priorityEmailPriority | null

Permitted values: Normal, High, Low (nullable).

replyTostring | null
requestDeliveryReceiptboolean
requestReadReceiptboolean
sensitivityEmailSensitivity | null

Permitted values: Normal, Personal, Private, Confidential (nullable).

toarray | null
trackClicksboolean | null
trackOpensboolean | null
smsOptionsSmsOptionsDto | null
FieldTypeNotes
fromNumberstring | null
overrideRecipientsarray | null
toarray | null
tagsTagDto[]required
FieldTypeNotes
keystringrequired
valuestringrequired
templateIdstring (uuid)required
tenantIdstring (uuid)required
versionNumberinteger (int32) | null
webhookOptionsWebhookOptionsDto | null
FieldTypeNotes
headersobject | null
urlOverridestring | null

Response 202

FieldTypeNotes
acceptedbooleanrequired
correlationIdstringrequired
messagestringrequired

Responses

StatusMeaningerrorCode
202Accepted-
400Bad Requestnotifications.request_missingnotifications.webhook_destination_requirednotifications.no_live_version
401Unauthorizedapi_keys.missingapi_keys.invalid
403Forbiddenapi_keys.tenant_mismatchnotifications.webhook_delivery_not_availablenotifications.monthly_limit_not_configured
404Not Foundnotifications.template_not_found
429Too Many Requestsnotifications.monthly_limit_exceeded
500Internal 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