> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://one.miles-api.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://one.miles-api.com/_mcp/server.

# Login With Phone Otp

POST https://api.milescaira.com/v7/login-with-phone-otp
Content-Type: application/json

Send a phone-login OTP via SSO and upsert the local ``User`` on success.

Reference: https://one.miles-api.com/api-reference/account-users/account/login-with-phone-otp-v-7-login-with-phone-otp-post

## Servers

- `https://api.milescaira.com` (Production, default)
- `https://miles-usp-backend-uat-2-154625965269.asia-south1.run.app` (UAT)
- `http://localhost:8080` (Local)

## Request

### Body (application/json)

This endpoint expects a SendOtpIn.

- `phone` (string, optional, nullable)
- `country_code` (string, optional, nullable)
- `communication_method` (integer, optional, nullable)

## Response

### 200

Successful Response

- `any`

## Errors

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)
- `input` (any, optional)
- `ctx` (ValidationErrorCtx, optional)

### ValidationErrorLocItems

### ValidationErrorCtx

## Examples

**Request**

```json
{}
```

**SDK Code**

```python
import requests

url = "https://api.milescaira.com/v7/login-with-phone-otp"

payload = {}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.milescaira.com/v7/login-with-phone-otp"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.milescaira.com/v7/login-with-phone-otp")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```