Send an SMS
Send text messages and one-time passwords to phone numbers.
Request
curl -X POST 'https://api.gbnotification.dokploy.geobilgi.net/api/v1/companies/COMPANY_ID/projects/PROJECT_ID/messages' \ -H 'X-Api-Key: YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "channel": "sms", "recipients": [ { "type": "Phone", "value": "+905321234567" } ], "content": "Your order 1042 has shipped and will arrive tomorrow.", "idempotencyKey": "order-1042-shipped-sms"}'- Recipients are of type
Phone: 6 to 32 characters of digits, spaces,(,),-and an optional leading+. Use the international format (+905321234567); numbers are de-duplicated by their digits. subjectis not used by SMS providers.- Keep
contentshort: long texts are split into several SMS parts by the provider and may cost more.
One-time passwords
For verification codes set isOtp: true. The project needs an OTP-capable SMS provider, otherwise the API answers
422 message.otp_not_supported.
curl -X POST 'https://api.gbnotification.dokploy.geobilgi.net/api/v1/companies/COMPANY_ID/projects/PROJECT_ID/messages' \ -H 'X-Api-Key: YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "channel": "sms", "recipients": [ { "type": "Phone", "value": "+905321234567" } ], "content": "Your verification code is 482913.", "priority": "Critical", "isOtp": true}'See OTP messages for the rules.
Common errors
| Response | Cause |
|---|---|
400 validation.failed | A phone number in the wrong format (Message.Recipients[0].Value), or isOtp on another channel. |
422 message.no_active_provider | The project has no active SMS provider in its chain. |
422 message.otp_not_supported | isOtp is set but no provider of the chain supports OTP. |