/v1/otp/sendالمعاملات
idempotency-key(header) — string
جسم الطلب
{
"type": "object",
"required": [
"phone"
],
"properties": {
"phone": {
"type": "string",
"pattern": "^\\+[1-9]\\d{6,14}$"
}
},
"additionalProperties": false
}مثال على الطلب
# 1. Send a one-time code over WhatsApp
curl -X POST https://api.authevo.dev/v1/otp/send \
-H "Authorization: Bearer sk_…" \
-H "Content-Type: application/json" \
-d '{ "phone": "+201234567890" }'
# 2. Verify the code your user entered
curl -X POST https://api.authevo.dev/v1/otp/verify \
-H "Authorization: Bearer sk_…" \
-H "Content-Type: application/json" \
-d '{ "phone": "+201234567890", "code": "123456" }'الاستجابات
200
{
"type": "object",
"properties": {
"data": {
"type": "object",
"properties": {
"message_id": {
"type": "string"
},
"status": {
"type": "string"
},
"expires_in": {
"type": "number"
},
"cooldown_seconds": {
"type": "number"
}
}
}
}
}{
"data": {
"message_id": "msg_9k2m4n8x",
"status": "sent",
"expires_in": 600
}
}default — Error response (standard envelope). `code` is a stable machine-readable string — e.g. VALIDATION_ERROR (400), UNAUTHORIZED / INVALID_API_KEY (401), RATE_LIMIT_EXCEEDED (429), INTERNAL_ERROR (500); `message` is human-readable.
{
"type": "object",
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "string",
"description": "Stable, machine-readable error code."
},
"message": {
"type": "string",
"description": "Human-readable description."
},
"reason": {
"type": "string",
"description": "Optional customer-safe category for a rate-limit rejection."
},
"layer": {
"type": "string",
"enum": [
"edge",
"origin"
],
"description": "Optional layer that rejected the request."
},
"dimension": {
"type": "string",
"description": "Optional allowlisted, customer-safe limiting dimension."
},
"retry_after_seconds": {
"type": "integer",
"minimum": 1,
"maximum": 86400,
"description": "Optional authoritative delay before retrying."
},
"reset_at": {
"type": "string",
"format": "date-time",
"description": "Optional UTC time when the active window clears."
},
"window_seconds": {
"type": "integer",
"minimum": 1,
"maximum": 86400,
"description": "Optional duration of the active limiting window."
},
"limit": {
"type": "integer",
"minimum": 1,
"description": "Optional ceiling for the active limiting window."
}
}
}
}
}{
"error": {
"code": "123456",
"message": "string",
"reason": "string"
}
}