Vai al contenuto
Ultimo aggiornamento

Send SMS

Sends an SMS message to a destination number.
Before making requests, ensure you have configured authentication.

For the full technical reference, see the OpenAPI specification.

Endpoint

POST /api/Services/send

Headers

NameRequiredDescription
AuthorizationYesBasic Auth credentials. See Authentication.
Content-TypeYesMust be application/json.

Body parameters

ParameterTypeRequiredDescription
destinationstringYesDestination phone number in E.164 format (e.g. +390000000000)
textstringYesMessage text to send
referenceobjectNoTracking reference. See Reference Attribute
   servicestringNoService identifier (e.g. MY_SERVICE)
   actionstringNoAction within the service (e.g. 2FA, PASSWORD_RESET)
   keystringNoCustom tracking key (e.g. user ID, order ID)
detailedbooleanNoReturn detailed response including provider info (default: false)
businessRelationIdstringNoOne Platform Business Relation ID. Overrides default business relation settings
webhookobjectNoInline webhook configuration. See Webhook configuration
attemptCountintegerNoDeprecated — no longer required and has no effect

Request example

{
  "destination": "+390000000000",
  "text": "Your verification code is: 123456",
  "reference": {
    "service": "MY_SERVICE",
    "action": "2FA",
    "key": "user-12345"
  },
  "detailed": true
}

Response examples

200 — Message accepted

{
  "message": "0: Accepted for delivery",
  "provider": "PROVIDER1",
  "id": "7b8ef313-f1f2-4c4f-bffa-438c287ba9d8"
}

500 — Send error

{
  "code": 8,
  "message": "Wrong number",
  "details": null
}

Error codes

HTTP StatusError codeError typeSolution
5008Wrong destination numberVerify number format and country code
50056Invalid numberCheck number validity with carrier
50059Invalid reference serviceUse a valid service identifier
50060Message blocked by anti-floodingReduce sending rate
50061Message in watchlistThe destination number is blocked. Contact Namirial support if you believe this is an error
50064SMS provider not availableRetry or contact support
50066Invalid message textEnsure the text field is not empty and does not exceed 1600 characters
50074Message containing URL is deniedContact support to configure URL sending for your account

Authentication errors

Authentication failures return HTTP 401 with error code 63.

CodeDescriptionSolution
63Missing basic authentication headerInclude Authorization: Basic base64(username:password) header
63Username or password not validVerify credentials are correct and account is active
{
  "code": 63,
  "message": "Username or password not valid",
  "details": null
}

See Authentication for setup instructions.