---
updatedAt: 2025-02-20T00:12:36.000Z
agentTools:
  projectIndex: https://developers.credrails.com/llms.txt
---

# Login / Reset Password

> 👍 Let's Check In!!

This endpoint will return a "JWT token" which is like a permit that you need to have with you throughout your safari adventure. This token will allow you to successfully use all other API endpoints.

> 🚧
>
> Make sure to use the JSON Web Token (JWT) as a bearer token in the authorization header of all your subsequent requests. This will ensure that your requests are properly authenticated.

### Reset Password

A temporary password has been sent to the email address you provided during registration. Please use this temporary password to set a new password of your choice.

Here's what we need from you:

```json
{
  "email": "jon.doe@testapi.com",
  "password": "0ldv3rys3cur3passw0rd",
  "newPassword": "newv3rys3cur3passw0rd"
}
```

> 📘 Reset Password
>
> * Password is as received in the email
> * newPassword is the password of your choice. The password must contain a combination of uppercase and lowercase letters, numbers, and special characters, and must be at least 12 characters but not more than 99 characters in length

### Login

Here's what we need from you:

```json
{
  "email": "jon.doe@testapi.com",
  "password": "0ldv3rys3cur3passw0rd"

}
```

> 📘 Login
>
> * password - The password that you set.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "Credrails OpenBanking API",
    "description": "APIs that allows customers to share their financial data with authorized third parties, such as other banks and fintech companies, to access new financial services and products.",
    "license": {
      "name": "Credrails Website",
      "url": "http://www.credrails.com"
    },
    "version": "v2,3,0"
  },
  "externalDocs": {
    "description": "API Documentation",
    "url": "https://credrails.readme.io/docs/open-banking"
  },
  "servers": [
    {
      "url": "https://dev-openbanking.pub.credrails.com",
      "description": "Dev Testing Environment"
    }
  ],
  "tags": [
    {
      "name": "Auth",
      "description": "Before embarking on this game drive,we need to obtain the necessary permits through the authorization tokens"
    }
  ],
  "paths": {
    "/api/v2/auth/login": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Login / Reset Password",
        "operationId": "login_1",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserLogin"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Welcome to our safari adventure! You have successfully logged in ",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticatedResponse"
                }
              }
            }
          },
          "400": {
            "description": "The server is unable to process the request because it perceives it as a client error, such as a syntax mistake in the request, an invalid structure of the request message, or an improper routing of the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleRequestResponse"
                }
              }
            }
          },
          "401": {
            "description": "Whoops, it looks like we're running into some trouble with your request. The server understands your request but it can't complete it because the request lacks valid authentication credentials for the target resource.",
            "content": {
              "*/*": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Oops, it looks like the server is having trouble finding the resource you requested",
            "content": {
              "*/*": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "SimpleRequestResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Code representing request status",
            "enum": [
              "SUCCESS",
              "SECURITY_ANSWER_REQUESTED",
              "INVALID_USERNAME_OR_PASSWORD",
              "INVALID_INSTITUTION_PROVIDED",
              "INVALID_SECURITY_QUESTION_FOR_SESSION",
              "AUTH_NOT_PERFORMED_OR_TIMEDOUT",
              "INVALID_SESSION_ID",
              "UNKNOWN_ERROR",
              "OTP_REQUIRED",
              "INVALID_PAYMENT_TYPE_PROVIDED",
              "DUPLICATE_SESSION_ID",
              "UNSUPPORTED_FEATURE",
              "MISSING_KEY_VALUES",
              "FAILURE",
              "ERROR_RETRIEVING_BALANCE",
              "ERROR_LOGIN_IN",
              "INVALID_SECURITY_ANSWER",
              "INVALID_OTP",
              "ERROR_FETCHING_STATEMENTS",
              "BROWSER_CLOSED",
              "ERROR_RETRIEVING_CREDENTIALS",
              "ERROR_STARTING_BROWSER_SESSION",
              "INSTITUTION_NOT_REACHABLE",
              "BANK_NOT_FOUND",
              "ACCOUNT_PROVIDED_NOT_FOUND",
              "ERROR_MAKING_PAYMENT",
              "INSUFFICIENT_BALANCE",
              "INVALID_AMOUNT",
              "EMPTY_STATEMENT",
              "SESSION_INITIATION_ERROR",
              "OTP_OR_SECURITY_ANSWER_NOT_PROVIDED",
              "INCOMPLETE_OTP",
              "INVALID_CREDENTIALS",
              "ERROR",
              "NO_DATA",
              "RECEIVED",
              "CONSENT_ERROR",
              "USER_DISABLED",
              "REQUEST_CHANGE_PASSWORD",
              "ACCOUNT_BLOCKED",
              "CONFIG_EXISTS",
              "CONFIG_NOT_FOUND",
              "USERNAME_EXISTS",
              "INVALID_REFRESH_TOKEN",
              "LOGOUT_FAILURE",
              "BALANCE_CHECK_REQUEST_EXISTS",
              "PAYMENT_REQUEST_EXISTS",
              "CONSENT_NOT_OBTAINED",
              "INVALID_CONSENT",
              "INVALID_CONSENT_CREDENTIALS",
              "CONSENT_BEING_VALIDATED",
              "VALIDATION_FAILED",
              "PAYMENT_FAILED",
              "BALANCE_CHECK_FAILED",
              "BALANCE_CHECK_REQUEST_NOT_FOUND",
              "TRANSACTIONS_REQUEST_NOT_FOUND",
              "PAYMENT_REQUEST_NOT_FOUND",
              "INVALID_DATES",
              "CHARGES_NOT_SET",
              "INVALID_REQUEST_ID",
              "INVALID_FREQUENCY",
              "STATEMENT_FETCH_FAILED",
              "TRANSACTIONS_CALLBACK_FAILURE",
              "INVALID_USER",
              "TRANSACTIONS_QUEUING_FAILURE",
              "CHARGES_CREATION_FAILURE",
              "CHARGES_UPDATE_FAILURE",
              "GET_CHARGES_FAILURE",
              "PASSWORD_DECRYPTION_FAILED",
              "UNSUPPORTED_BANK_FOR_TRANSACTIONS",
              "INTEGRATION_TYPE_NOT_SUPPORTED",
              "SERVICE_UNAVAILABLE",
              "ERROR_RESETTING_PASSWORD",
              "SCOPE_NOT_SUPPORTED"
            ]
          },
          "message": {
            "type": "string",
            "description": "A message related with the response"
          },
          "requestId": {
            "type": "string",
            "description": "A uuid representing the request from the user"
          }
        }
      },
      "UserLogin": {
        "required": [
          "email",
          "password"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "User's email to be used as username",
            "format": "email",
            "example": "johndoe@example.com"
          },
          "password": {
            "type": "string",
            "description": "Password for the user. Required in order to be obtain JWT token for authorization.Password sent to your email on user registration"
          },
          "newPassword": {
            "maxLength": 99,
            "minLength": 12,
            "pattern": "^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[\\^$*.\\[\\]{}\\(\\)?\\-“!@#%&/,><\\’:;|_~`])\\S{8,99}$",
            "type": "string",
            "description": "Required only when login the first time. This is used to set a new password"
          }
        }
      },
      "AuthenticatedResponse": {
        "required": [
          "email",
          "jwt",
          "refreshToken",
          "userId"
        ],
        "type": "object",
        "properties": {
          "userId": {
            "type": "string",
            "description": "User's user id"
          },
          "email": {
            "type": "string",
            "description": "User's email"
          },
          "jwt": {
            "type": "string",
            "description": "JWT token for authorization. Check the token on its expiry"
          },
          "refreshToken": {
            "type": "string",
            "description": "A token to be used for refreshing the jwt token"
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```