Send a message
Accepts a message; dispatches are created as pending for the publisher.
Required permission: messages.send. See the guide for details.
Error codes:
- 400
validation.failed - 404
project.not_found,message.channel_not_found,message.template_not_found,attachment.not_found - 422
message.company_inactive,message.project_inactive,message.push_requires_device_tokens,message.no_active_provider,message.otp_not_supported,message.missing_variables,message.attachments_not_supported,message.attachments_too_large
Every endpoint can also answer 401 (missing or invalid key), 403 (route outside the key's project or permission) and 429 rate_limit.exceeded.
ApiKeyX-Api-Key<token>Project API key: nb_<prefix>_<secret>.
companyId*stringId of the company that owns the project (shown with the API key in the dashboard).
uuidprojectId*stringId of the project the API key belongs to.
uuidapplication/json- body
channel*stringChannel code: email, sms or push.
recipients*array<>1 to 10,000 recipients, counted before duplicates are removed. Duplicates (after normalization) are sent once.
1 <= items <= 10000templateId?|Template to render. It must belong to the project and to the same channel.
uuidcontent?|Message body. Required without templateId; overrides the template body when both are given. Up to 1,000,000 characters.
length <= 1000000variables?|Values for {{ key }} placeholders of the template, at most 100. Recipient variables override these.
priority?unknownDelivery priority. Default Normal.
"Critical""Normal""Bulk"idempotencyKey?|Up to 128 characters. Sending the same key again in this project returns the original message instead of creating a new one.
length <= 128scheduledAt?|Send later: a future time, at most 90 days ahead (ISO 8601).
date-timesubject?|Subject line (email). Overrides the template subject. Up to 998 characters.
length <= 998attachmentIds?|array<>Ids of uploaded attachments (email only). At most 10 files and 20 MB in total, template attachments included.
items <= 10isOtp?booleanOne-time password message. Only on the sms channel and only when the project has an OTP-capable SMS provider.
falsedata?|Provider-specific JSON object (for example push payload data), up to 16 KB. String values may contain placeholders when a template is used.
Accepted
application/json- response
message*content*stringMessage-level content (template body or the request content).
subject*null|stringvariables*idempotencyKey*null|stringapiKeyId*|The API key that sent the message, if any.
uuiddispatches*Number of dispatches per status; statuses with no dispatch are left out.
attachments*array<>data*|Provider-specific JSON object, or null.
curl -X POST 'https://api.gbnotification.dokploy.geobilgi.net/api/v1/companies/497f6eca-6276-4993-bfeb-53cbbbba6f08/projects/497f6eca-6276-4993-bfeb-53cbbbba6f08/messages' \ -H 'Content-Type: application/json' \ -d '{ "channel": "email", "recipients": [ { "type": "Email", "value": "jane@example.com" } ], "subject": "Your order has shipped", "content": "<p>Hi Jane, your order is on its way.</p>", "priority": "Normal", "idempotencyKey": "order-1042-shipped"}'{ "message": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "channel": "string", "priority": "Critical", "status": "Pending", "messageTemplateId": null, "recipientCount": 0, "scheduledAt": null, "isOtp": true, "createdAt": "2019-08-24T14:15:22Z", "templateName": null, "subject": null, "firstRecipient": null }, "content": "string", "subject": null, "variables": { "property1": "string", "property2": "string" }, "idempotencyKey": null, "apiKeyId": null, "dispatches": { "property1": 0, "property2": 0 }, "attachments": [ { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "fileName": "string", "contentType": "string", "sizeBytes": 0, "source": "Template" } ], "data": null}