Authyo Docs
  1. APIs
Authyo Docs
  • 🐶 Walk through Authyo
  • Error Codes
  • About Pricing
  • APIs
    • Send OTP
      GET
    • Send OTP
      POST
    • Verify OTP
      GET
  • Web SDKs
    • JavaScript
    • PHP
    • AngularJS Examples
    • TypeScript Examples
    • React JS
    • Vue JS Examples
  1. APIs

Send OTP

POST
https://authyo.io/api/v1/authyoapi/sendotp
This is a POST API call for sending otp by authentication type based on settings of your application

Request

Header Params
clientId
string 
required
Write here your application Client Id Code
Example:
{Your clientId code}
clientSecret
string 
required
Write here your application Client Secret Code
Example:
{Your clientSecret code}
Body Params application/json
object {0}
Example
Here to is required and other paremeters are optional.
Where expiry is an option and you can pass an intger value to valid OTP for next given integer as seconds.
{
    "to": "Sender-address",
    "expiry": {optional*: seconds in integer},
    "otplength": 6,
    "authway": ""
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://authyo.io/api/v1/authyoapi/sendotp' \
--header 'clientId: {Your clientId code}' \
--header 'clientSecret: {Your clientSecret code}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "to": "Sender-address",
    "expiry": {optional*: seconds in integer},
    "otplength": 6,
    "authway": ""
}'

Responses

🟢200Success
application/json
Body
success
boolean 
required
message
string 
required
data
object 
required
isTried
integer 
required
isSent
integer 
required
results
array [object {7}] 
required
Example
{
    "success": true,
    "message": "submited successfully",
    "data": {
        "isTried": 1,
        "isSent": 1,
        "results": [
            {
                "success": true,
                "message": "message submitted successfully",
                "to": "919898******",
                "authtype": "WHATSAPP",
                "maskId": "36eeb3a16fAaAab49b48de0d729b9a35",
                "createdTime": 1747312374,
                "expiretime": 1747312434
            }
        ]
    }
}
Modified at 2025-05-15 07:06:57
Previous
Send OTP
Next
Verify OTP
Built with