> For the complete documentation index, see [llms.txt](https://akshaypilankar.gitbook.io/mycontract/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://akshaypilankar.gitbook.io/mycontract/admin-api/admin-apis.md).

# Account related apis

All account related apis.

## Sign Up

<mark style="color:green;">`POST`</mark> `https://api.mycontract.co:3001/v1/admin/signup`

This endpoint allows you to signup for admin.

#### Request Body

| Name      | Type   | Description        |
| --------- | ------ | ------------------ |
| email     | string | User email         |
| password  | string | User password      |
| firstName | string | First name of user |
| lastName  | string | Last name of user  |

{% tabs %}
{% tab title="200 " %}

```
{
    "status": true,
    "info": "Please verify your email address by clicking the link that we have mailed you!"
}
```

{% endtab %}

{% tab title="409 " %}

```
{
    "status": false,
    "info": "That email was already taken."
}
```

{% endtab %}

{% tab title="502 " %}

```
{
  'status': "failure",
  'message': "error"
}
```

{% endtab %}
{% endtabs %}

## Login

<mark style="color:green;">`POST`</mark> `https://api.mycontract.co:3001/v1/admin/login`

This endpoint allows you to login as admin.

#### Query Parameters

| Name     | Type   | Description                            |
| -------- | ------ | -------------------------------------- |
| email    | string | User email.                            |
| password | string | Password for respective email address. |

{% tabs %}
{% tab title="200 " %}

```
{
    "status": true,
    "token": // JWT token
}
```

{% endtab %}

{% tab title="302 " %}

```
{
    "token": false,
    "message": "Hello! Active your Account! Check Your email for Activation Link."
}
```

{% endtab %}
{% endtabs %}

## Profile details

<mark style="color:blue;">`GET`</mark> `https://api.mycontract.co:3001/v1/admin/details`

This endpoint is used to get admin profile details

#### Headers

| Name          | Type   | Description |
| ------------- | ------ | ----------- |
| Authorization | string | JWT token   |

{% tabs %}
{% tab title="200 " %}

```
{
    "status": true,
    "data": {
        "id": "a02a3ee0-2862-11e9-8149-97f236a2a701",
        "name": "bob parker",
        "email": "bob@demomail.org",
        "contactNumber":"null"
        "kyc_verified": "notInitiated",
        "adminPackage": false,
        "accountAddress": "0x0750D458d445f6A8d4CdA5DBF1E870BAaC2e67Ee",
        "ETHBalance": "0",
        "tokenBalance": 0
    }
}
```

{% endtab %}

{% tab title="302 " %}

```
{
    status: false, 
    message: "error occured while fetching data"
}
```

{% endtab %}
{% endtabs %}

## upload KYC data

<mark style="color:green;">`POST`</mark> `https://api.mycontract.co:3001/v1/admin/uploadKYC`

This endpoint is used to upload KYC data.

#### Path Parameters

| Name          | Type   | Description |
| ------------- | ------ | ----------- |
| Authorization | string | JWT token   |

#### Request Body

| Name          | Type   | Description                    |
| ------------- | ------ | ------------------------------ |
| companyName   | string | Company name                   |
| companyLogo   | string | Compnay logo in .png format    |
| fullName      | string | User's full name               |
| ISDCode       | string | User's ISD code                |
| contactNumber | number | User's phone number            |
| kycDocName1   | string | Document name                  |
| kycDoc1       | object | Document photo in .jpeg format |
| kycDocName2   | string | Document name                  |
| kycDoc2       | string | Document photo in .jpeg format |
| kycDocName3   | string | Document name                  |
| kycDoc3       | string | Document photo in .jpeg format |

{% tabs %}
{% tab title="200 " %}

```
{
    "status": true,
    "message": "KYC submitted successfully"
}
```

{% endtab %}

{% tab title="409 " %}

```
{
    "status": false,
    "message": "Error occured while uploading! Please check image extension! only png and jpeg , jpg allowed for site Logo"
}
```

{% endtab %}
{% endtabs %}

## Client list

<mark style="color:blue;">`GET`</mark> `https://api.mycontract.co:3001/v1/admin/client/list`

This endpoint is used to retrieve client list.&#x20;

#### Headers

| Name          | Type   | Description |
| ------------- | ------ | ----------- |
| Authorization | string | JWT token   |

{% tabs %}
{% tab title="200 " %}

```
{ 
  status: true,
  clientData: []
 }
```

{% endtab %}

{% tab title="302 " %}

```
{ 
    status: false, 
    message: "error" 
}
```

{% endtab %}
{% endtabs %}

## Individual client detail

<mark style="color:blue;">`GET`</mark> `https://api.mycontract.co:3001/v1/admin/client/:clientId`

#### Headers

| Name          | Type   | Description |
| ------------- | ------ | ----------- |
| Authorization | string | JWT token   |

{% tabs %}
{% tab title="200 " %}

```
{ 
  status: true,
  clientData: []
 }
```

{% endtab %}

{% tab title="302 " %}

```
{ 
    status: false, 
    message: "error" 
}
```

{% endtab %}
{% endtabs %}

## Update client KYC status

<mark style="color:green;">`POST`</mark> `https://api.mycontract.co:3001/v1/admin/client/updateKYC/:clientId`

This endpoint is used to update KYC status.

#### Headers

| Name          | Type   | Description |
| ------------- | ------ | ----------- |
| Authorization | string | JWT token   |

#### Request Body

| Name          | Type    | Description                                                            |
| ------------- | ------- | ---------------------------------------------------------------------- |
| kycStatus     | string  | KYC status parameters ('notInitiated','active', 'pending', 'rejected') |
| accountStatus | boolean | client account status in terms of true and false.                      |

{% tabs %}
{% tab title="200 " %}

```
{ 
    status: true, 
    message: "data updated" 
}
```

{% endtab %}

{% tab title="302 " %}

```
{ 
    status: false, 
    message: "error occured" 
}
```

{% endtab %}
{% endtabs %}

## Logout

<mark style="color:blue;">`GET`</mark> `https://api.mycontract.co:3001/v1/admin/logout`

This endpoint is used to end user session.

#### Path Parameters

| Name          | Type   | Description |
| ------------- | ------ | ----------- |
| Authorization | string | JWT token   |

{% tabs %}
{% tab title="200 " %}

```
{
    "status": true,
    "message": "successfully signout"
}
```

{% endtab %}
{% endtabs %}
