Vai al contenuto
Ultimo aggiornamento

Send SMS (Admin)

Sends an SMS message with administrative privileges. Allows sending on behalf of a sub-account or specifying an LRA.
Before making requests, ensure you have configured authentication.

For the full technical reference, see the OpenAPI specification.

Endpoint

POST /api/Admin/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)
accountstringNoAccount username to send on behalf of (impersonation)
lraintegerNoLocal Registration Authority (LRA) identifier
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": "Administrative message",
  "reference": {
    "service": "MY_SERVICE",
    "action": "NOTIFICATION",
    "key": "admin-task-123"
  },
  "account": "sub-account-name",
  "lra": 1234,
  "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
50076Account not foundVerify the account field contains a valid username

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.

Authorization errors

If your account does not have the required privileges, the API returns HTTP 403.

{
  "code": 63,
  "message": "User user_test not authorized for webmethod send",
  "details": null
}

See Authentication for more information.