# Login

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

***

## Provide Login Information for Sending OTP

<img src="/files/1tl8KAsYlsDxvW0YsEZU" 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="/files/1tl8KAsYlsDxvW0YsEZU" 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"
}
```

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gramhal.gitbook.io/matar/developer-reference/api/user-login/login.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
