> ## Documentation Index
> Fetch the complete documentation index at: https://nocode-docs.zeroagent.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Email and Password - Basic Authentication

The Email Password authentication allows your client to authenticate using email and password method. The endpoints are pre-built and are easy to manage your authentication flow and users. To get your `{auth_base_url}`, check it out here - [Get started with base url](/authentication/api/generalinfo#get-started-with-base-url).

<Info>
  Note: **APP-KEY** to be passed in Headers can be obtained from the settings in
  the project dashboard
</Info>

## 1. Signup API

This endpoints allows you to create a new user using the email and password method.

<Accordion title="Endpoint" defaultOpen="true">
  <ParamField path="POST" type="{auth_base_url}/email-password-signup" />
</Accordion>

<Accordion title="Header">
  <ParamField query="APP-KEY" type="string" required>
    App key of the particular project
  </ParamField>
</Accordion>

<Accordion title="Body Data">
  POST the data in the **application/json** format.

  <ParamField body="email" type="string" required>
    Input email address of the user
  </ParamField>

  <ParamField body="password" type="string" required>
    Password of the user
  </ParamField>

  <ParamField body="is_verification" type="bool">
    If True, then a verification mail will be sent to the user's mail-id. Default
    is False.
  </ParamField>

  <Note>
    **Email Verification Process** - An Email verification link will be sent automatically to the user's email address if is\_verification is True. Upon clicking the link, the user's email address will be verified automatically.
  </Note>
</Accordion>

<Accordion title="Response Body Data">
  <ResponseField name="user_id" type="string">
    User Id of the new created user
  </ResponseField>

  <ResponseField name="email" type="string">
    Email address of the user
  </ResponseField>

  <ResponseField name="email_verification" type="string">
    If email verification is required then **"pending"**, else status is **"verified"** if verification not required.
  </ResponseField>
</Accordion>

#### Example

```jsx Request theme={null}
POST https://authn.zeromagic.cloud/auth/353d1499ab5149e194a53cf0f6c837f4/development/email-password-signup
HTTP/1.1
APP-KEY : ldM6yPAAE3PRTZbHXrjqGGzZY2Yjm7GwjAyjbNqWH48

{
   "email" : "user@zeromagic.cloud",
   "password": "user1234",
   "is_verification" : false
}
```

```jsx Response theme={null}
HTTP/1.1
201 CREATED

{
   "user_id": "1",
   "email" : "user@zeromagic.cloud",
   "email_verification" : "verified"
}
```

***

## 2. Login API

This endpoints allows you to login a user using the email and password method.

{" "}

<Accordion title="Endpoint">
  <ParamField path="POST" type="{auth_base_url}/email-password-login" />
</Accordion>

<Accordion title="Header">
  <ParamField query="APP-KEY" type="string" required>
    App key of the particular project
  </ParamField>
</Accordion>

<Accordion title="Body Data">
  POST the data in the **application/json** format.

  <ParamField body="email" type="string" required>
    Email address of the user
  </ParamField>

  <ParamField body="password" type="string" required>
    Password of the user
  </ParamField>
</Accordion>

<Accordion title="Response Body Data">
  <ResponseField name="user_id" type="string">
    User Id of the user
  </ResponseField>

  <ResponseField name="email" type="string">
    Email address of the user
  </ResponseField>

  <ResponseField name="email_verification" type="string">
    If email verification is required then **"pending"**, else status if
    **"verified"** if verification not required.
  </ResponseField>

  <ResponseField name="access_token" type="string">
    JWT access token is returned
  </ResponseField>

  <ResponseField name="token_type" type="string">
    Value is *bearer*
  </ResponseField>

  <ResponseField name="expires_in" type="string">
    Currently no expiry time for token, Returns null
  </ResponseField>
</Accordion>

#### Example

```jsx Request theme={null}
POST https://authn.zeromagic.cloud/auth/353d1499ab5149e194a53cf0f6c837f4/development/email-password-login
HTTP/1.1
APP-KEY : ldM6yPAAE3PRTZbHXrjqGGzZY2Yjm7GwjAyjbNqWH48

{
   "email" : "user@zeromagic.cloud",
   "password": "user1234"
}
```

```jsx Response theme={null}
HTTP/1.1
200 OK

{
   "user_id": "1",
   "email" : "user@zeromagic.cloud",
   "email_verification" : "verified",
   "access_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTIzNDU2Nzg5LCJuYW1lIjoiSm9zZXBoIn0.OpOSSw7e485LOP5PrzScxHb7SR6sAOMRckfFwi4rp7o",
   "token_type" :"bearer",
   "expires_in" : null
}
```

## 3. Password Reset API

This endpoints allows you to reset the password for the user.

{" "}

<Accordion title="Endpoint">
  <ParamField path="POST" type="{auth_base_url}/email-password-reset" />
</Accordion>

{" "}

<Accordion title="Header">
  <ParamField query="APP-KEY" type="string" required>
    App key of the particular project
  </ParamField>
</Accordion>

{" "}

<Accordion title="Body Data">
  <ParamField body="email" type="string" required>
    Email address of the user
  </ParamField>
</Accordion>

<Accordion title="Response Body Data">
  <ResponseField name="user_id" type="string">
    User Id of the new created user
  </ResponseField>

  <ResponseField name="email" type="string">
    Email address of the user
  </ResponseField>

  <Note>
    **Password Reset Process** - An Email password reset link will be sent
    automatically to the user's email address. Upon clicking the link, the user
    will be redirected to password reset page where user can set his new password.
    You don't need to create a webpage for password reset from your client end.
  </Note>
</Accordion>

#### Example

```jsx Request theme={null}
POST https://authn.zeromagic.cloud/auth/353d1499ab5149e194a53cf0f6c837f4/development/email-password-reset
HTTP/1.1
APP-KEY : ldM6yPAAE3PRTZbHXrjqGGzZY2Yjm7GwjAyjbNqWH48

{
   "email" : "user@zeromagic.cloud"
}
```

```jsx Response theme={null}
HTTP/1.1
200 OK

{
   "user_id": "1",
   "email" : "user@zeromagic.cloud"
}
```
