> For the complete documentation index, see [llms.txt](https://gramhal.gitbook.io/matar/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gramhal.gitbook.io/matar/developer-reference/api/user-login/login.md).

# Login

{% hint style="info" %}
Provide Login Information for sending OTP.
{% endhint %}

***

## Provide Login Information for Sending OTP

<img src="https://203590333-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIHuU6kmTWQfXxOUkN7No%2Fuploads%2F9pfaSmHpcwNtTeoMqnB4%2Ffile.excalidraw.svg?alt=media&amp;token=473260ac-4c32-48b6-a4c8-f9bcd8ac3952" alt="API: - https://matar.in.ngrok.io/api/v1/login" class="gitbook-drawing">

### Params

#### **Body Parameter ⬇️**

<table data-full-width="false"><thead><tr><th width="244.33333333333331">Body Parameter</th><th width="161">Data Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>phone_number </strong><mark style="color:red;"><strong>(required)</strong></mark></td><td>String</td><td>Phone Number for sending OTP. Add 91 before your number.</td></tr><tr><td><strong>name </strong><mark style="color:red;"><strong>(required)</strong></mark></td><td>String</td><td>Name for Account Login.</td></tr><tr><td><strong>action </strong><mark style="color:red;"><strong>(required)</strong></mark></td><td>String</td><td>Provide action name which is <strong>'send_otp'</strong></td></tr></tbody></table>

#### **Sample Request ⬇️ (Body Parameter)**

```
curl --location 'https://matar.app/api/v1/login' \
--header 'Content-Type: application/json' \
--data '{
    "phone_number": "919277140178",
    "name": "skb",
    "action": "send_otp"
}'
```

#### **Responses ⬇️**

**Status Code: 🟢200** (200 denotes **'ok'**)

```200
{
    "message": "sent otp"
}
```

***

## When OTP is Expired

<img src="https://203590333-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIHuU6kmTWQfXxOUkN7No%2Fuploads%2F9pfaSmHpcwNtTeoMqnB4%2Ffile.excalidraw.svg?alt=media&amp;token=473260ac-4c32-48b6-a4c8-f9bcd8ac3952" alt="API: - https://matar.in.ngrok.io/api/v1/login" class="gitbook-drawing">

### **Params**

**Body Parameter ⬇️**

<table data-full-width="false"><thead><tr><th width="244.33333333333331">Body Parameter</th><th width="161">Data Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>phone_number </strong><mark style="color:red;"><strong>(required)</strong></mark></td><td>String</td><td>Phone Number for sending OTP. Add 91 before your number.</td></tr><tr><td><strong>name </strong><mark style="color:red;"><strong>(required)</strong></mark></td><td>String</td><td>Name for Account Login.</td></tr><tr><td><strong>action </strong><mark style="color:red;"><strong>(required)</strong></mark></td><td>String</td><td>Provide action name which is <strong>'send_otp'</strong></td></tr></tbody></table>

***

**Sample Request ⬇️️ (Body Parameter)**

```
curl --location 'https://matar.app/api/v1/login' \
--header 'Content-Type: application/json' \
--data '{
    "phone_number": "919277140178",
    "name": "skb",
    "action": "send_otp"
}'
```

**Responses ⬇️**

Status Code: 🔴**400** (400 denotes **'Bad request'**)

```400
{
    "is_expired_otp": true,
    "message": "expired otp please try again"
}
```

***
