API and integrations
How to Send an OTP Code by SMS via API: Template, Request and Statuses
An OTP is a one-time code for login, registration or payment confirmation. It is sent as a service SMS using an approved template. Below is the path from template to your first code.
1. Create a template with a variable
In the “Templates” tab add a text with a variable instead of the code, for example: “Your verification code: {code}. Do not share it with anyone. Company name”. A service template is approved within 30 minutes during working hours (see How to create a template and pass moderation).
2. Get an integration key
Profile → “Integration access”. The test key is available immediately: sending with it is free and nothing goes to the operator. The live key is issued once your account is approved. Details: API: keys and first request.
3. Send the request
POST https://usms.uz/api/v1/send with the header Authorization: Bearer LOGIN:SECRET and a JSON body:
- phone — recipient number in international format, e.g. 998901234567;
- from — sender name;
- template_id — your template number;
- params — values of the variables, e.g. {"code": "4821"}.
The response contains the message id and its status.
4. Check delivery
Request the status with GET /status/{id}, or receive notifications at your own address via POST /webhook. Status meanings: Message statuses and refunds.
OTP tips
- A code should be short-lived: limit its validity on your side.
- Put nothing in the SMS except the code and the service name.
- For websites there is a ready phone verification widget — see USMS integrations.
- Full documentation in nine languages: api.usms.uz.
Updated: 03.10.2026