# Send SMS

Sends an SMS message to a destination number.
Before making requests, ensure you have configured [authentication](/products/sms/enterprise-documentation/developer-documentation/authentication).

For the full technical reference, see the [OpenAPI specification](/products/sms/openapi/smsservices/sendsms).

#### Endpoint


```
POST /api/Services/send
```

#### Headers

| Name | Required | Description |
|  --- | --- | --- |
| `Authorization` | Yes | Basic Auth credentials. See [Authentication](/products/sms/enterprise-documentation/developer-documentation/authentication). |
| `Content-Type` | Yes | Must be `application/json`. |


#### Body parameters

| Parameter | Type | Required | Description |
|  --- | --- | --- | --- |
| `destination` | string | Yes | Destination phone number in E.164 format (e.g. `+390000000000`) |
| `text` | string | Yes | Message text to send |
| `reference` | object | No | Tracking reference. See [Reference Attribute](/products/sms/enterprise-documentation/developer-documentation/integration-guide/attribute-reference) |
|    `service` | string | No | Service identifier (e.g. `MY_SERVICE`) |
|    `action` | string | No | Action within the service (e.g. `2FA`, `PASSWORD_RESET`) |
|    `key` | string | No | Custom tracking key (e.g. user ID, order ID) |
| `detailed` | boolean | No | Return detailed response including provider info (default: `false`) |
| `businessRelationId` | string | No | One Platform Business Relation ID. Overrides default business relation settings |
| `webhook` | object | No | Inline webhook configuration. See [Webhook configuration](/products/sms/enterprise-documentation/developer-documentation/wb/wb-configuration) |
| `attemptCount` | integer | No | Deprecated — no longer required and has no effect |


#### Request example


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

#### Response examples

**200 — Message accepted**


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

**500 — Send error**


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

#### Error codes

| HTTP Status | Error code | Error type | Solution |
|  --- | --- | --- | --- |
| `500` | 8 | Wrong destination number | Verify number format and country code |
| `500` | 56 | Invalid number | Check number validity with carrier |
| `500` | 59 | Invalid reference service | Use a valid service identifier |
| `500` | 60 | Message blocked by anti-flooding | Reduce sending rate |
| `500` | 61 | Message in watchlist | The destination number is blocked. Contact Namirial support if you believe this is an error |
| `500` | 64 | SMS provider not available | Retry or contact support |
| `500` | 66 | Invalid message text | Ensure the `text` field is not empty and does not exceed 1600 characters |
| `500` | 74 | Message containing URL is denied | Contact support to configure URL sending for your account |


#### Authentication errors

Authentication failures return HTTP 401 with error code 63.

| Code | Description | Solution |
|  --- | --- | --- |
| 63 | Missing basic authentication header | Include `Authorization: Basic base64(username:password)` header |
| 63 | Username or password not valid | Verify credentials are correct and account is active |



```json
{
  "code": 63,
  "message": "Username or password not valid",
  "details": null
}
```

See [Authentication](/products/sms/enterprise-documentation/developer-documentation/authentication) for setup instructions.