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

# Disable-Request

```
STAGING_URL: https://switchapi3.azurewebsites.net
LIVE_URL: https://switchapi.azurewebsites.net
```

## Create Disable-Request

<mark style="color:green;">`POST`</mark> `https://switchapi3.azurewebsites.net/admin/disable_requests`

Creates a request to disable a user.\
This endpoint can only be used by ***customer\_success*** admins

#### Headers

| Name          | Type   | Description                                    |
| ------------- | ------ | ---------------------------------------------- |
| SWI-CS        | string | Payload checksum                               |
| SWI-CID       | string | Client ID                                      |
| Authorization | string | Format for Authorization is ***Bearer token*** |

#### Request Body

| Name     | Type    | Description                                |
| -------- | ------- | ------------------------------------------ |
| user\_id | integer | The id of the user to be disabled.         |
| reason   | string  | Reason for requesting for user disablement |

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

```
{
  "message": "Disable-request created successfully",
  "data": {
    "status": "pending",
    "id": "52",
    "reason": "Very suspicious user",
    "super_admin_comment": null,
    "user": {
      "first_name": "Demilade",
      "last_name": "Omitiran",
      "email": "omitirand@gmail.com",
      "is_verified": false,
      "switch_id": 100199,
      "image_selfie_url": "+2348184392899_image_selfie_url_Screenshot 2019-05-07 at 4.00.10 PM.png"
    },
    "created_by": {
      "id": "11",
      "email": "cs@switch.ng"
    }
  }
}
```

{% endtab %}

{% tab title="400 " %}

```
{
    "message": "A pending disable-request for this user already exists"
}
```

{% endtab %}
{% endtabs %}

## Get Disable-Request list

<mark style="color:blue;">`GET`</mark> `https://switchapi3.azurewebsites.net/admin/disable_requests`

Retrieves the list of disable-requests.

#### Query Parameters

| Name   | Type   | Description                                                                    |
| ------ | ------ | ------------------------------------------------------------------------------ |
| status | string | Status filter. Could be either ***pending***, ***approved*** or ***declined*** |

#### Headers

| Name          | Type   | Description                                    |
| ------------- | ------ | ---------------------------------------------- |
| SWI-CID       | string | Client ID                                      |
| Authorization | string | Format for Authorization is ***Bearer token*** |

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

```
{
  "message": "Disable-requests retrieved successfully",
  "data": [
    {
      "id": "51",
      "reason": "Very suspicious user",
      "status": "pending",
      "super_admin_comment": null,
      "user": {
        "first_name": "Testing",
        "last_name": "Andrew",
        "email": "testingandrew@gmail.com",
        "is_verified": false,
        "switch_id": 100125,
        "image_selfie_url": null
      },
      "created_by": {
        "id": "11",
        "email": "cs@switch.ng"
      }
    },
    {
      "id": "49",
      "reason": "Very suspicious user",
      "status": "declined",
      "super_admin_comment": null,
      "user": {
        "first_name": "Demilade",
        "last_name": "Omitiran",
        "email": "omitirand@gmail.com",
        "is_verified": false,
        "switch_id": 100199,
        "image_selfie_url": "+2348184392899_image_selfie_url_Screenshot 2019-05-07 at 4.00.10 PM.png"
      },
      "created_by": {
        "id": "11",
        "email": "cs@switch.ng"
      }
    },
    {
      "id": "48",
      "reason": "Very suspicious user",
      "status": "declined",
      "super_admin_comment": "Not okay",
      "user": {
        "first_name": "Demilade",
        "last_name": "Omitiran",
        "email": "omitirand@gmail.com",
        "is_verified": false,
        "switch_id": 100199,
        "image_selfie_url": "+2348184392899_image_selfie_url_Screenshot 2019-05-07 at 4.00.10 PM.png"
      },
      "created_by": {
        "id": "11",
        "email": "cs@switch.ng"
      }
    },
    {
      "id": "47",
      "reason": "Very suspicious user",
      "status": "approved",
      "super_admin_comment": null,
      "user": {
        "first_name": "Tee",
        "last_name": "Tee",
        "email": "mcvenom2003@yahoo.co.uk",
        "is_verified": false,
        "switch_id": 100121,
        "image_selfie_url": null
      },
      "created_by": {
        "id": "11",
        "email": "cs@switch.ng"
      }
    },
    {
      "id": "46",
      "reason": "Very suspicious user",
      "status": "approved",
      "super_admin_comment": "Okay",
      "user": {
        "first_name": "Testing",
        "last_name": "Andrew",
        "email": "testingandrew@gmail.com",
        "is_verified": false,
        "switch_id": 100125,
        "image_selfie_url": null
      },
      "created_by": {
        "id": "11",
        "email": "cs@switch.ng"
      }
    },
    {
      "id": "45",
      "reason": "Very suspicious user",
      "status": "approved",
      "super_admin_comment": null,
      "user": {
        "first_name": "Tee",
        "last_name": "Tee",
        "email": "mcvenom2003@yahoo.co.uk",
        "is_verified": false,
        "switch_id": 100121,
        "image_selfie_url": null
      },
      "created_by": {
        "id": "11",
        "email": "cs@switch.ng"
      }
    },
    {
      "id": "41",
      "reason": "Testing the mail",
      "status": "approved",
      "super_admin_comment": null,
      "user": {
        "first_name": "Demilade",
        "last_name": "Omitiran",
        "email": "omitirand@gmail.com",
        "is_verified": false,
        "switch_id": 100199,
        "image_selfie_url": "+2348184392899_image_selfie_url_Screenshot 2019-05-07 at 4.00.10 PM.png"
      },
      "created_by": {
        "id": "11",
        "email": "cs@switch.ng"
      }
    },
    {
      "id": "8",
      "reason": "I am suspecting I need to test his account for this feature.",
      "status": "declined",
      "super_admin_comment": null,
      "user": {
        "first_name": "Demilade",
        "last_name": "Omitiran",
        "email": "omitirand@gmail.com",
        "is_verified": false,
        "switch_id": 100199,
        "image_selfie_url": "+2348184392899_image_selfie_url_Screenshot 2019-05-07 at 4.00.10 PM.png"
      },
      "created_by": {
        "id": "11",
        "email": "cs@switch.ng"
      }
    },
    {
      "id": "7",
      "reason": "Please disable this user.",
      "status": "declined",
      "super_admin_comment": null,
      "user": {
        "first_name": "Peter",
        "last_name": "Ruso",
        "email": "ruso@email-server.info",
        "is_verified": false,
        "switch_id": 100357,
        "image_selfie_url": null
      },
      "created_by": {
        "id": "11",
        "email": "cs@switch.ng"
      }
    },
    {
      "id": "6",
      "reason": "Please disable this user.",
      "status": "approved",
      "super_admin_comment": null,
      "user": {
        "first_name": "Francis",
        "last_name": "Ezinna",
        "email": "eegbuchu@yahoo.com",
        "is_verified": false,
        "switch_id": 100361,
        "image_selfie_url": "+2348034134689_image_selfie_url_ankara-14029402298k4gn.jpg"
      },
      "created_by": {
        "id": "11",
        "email": "cs@switch.ng"
      }
    },
    {
      "id": "5",
      "reason": "Please disable this user.",
      "status": "approved",
      "super_admin_comment": null,
      "user": {
        "first_name": "Esther",
        "last_name": "John-Paul",
        "email": "ecnwowo@gmail.com",
        "is_verified": false,
        "switch_id": 100356,
        "image_selfie_url": "+15678654213_image_selfie_url_Screenshot_20190327-124157.png"
      },
      "created_by": {
        "id": "11",
        "email": "cs@switch.ng"
      }
    },
    {
      "id": "4",
      "reason": "Please disable this user.",
      "status": "declined",
      "super_admin_comment": null,
      "user": {
        "first_name": "Peter",
        "last_name": "Ruso",
        "email": "ruso@email-server.info",
        "is_verified": false,
        "switch_id": 100357,
        "image_selfie_url": null
      },
      "created_by": {
        "id": "11",
        "email": "cs@switch.ng"
      }
    },
    {
      "id": "3",
      "reason": "Please diable him",
      "status": "approved",
      "super_admin_comment": null,
      "user": null,
      "created_by": {
        "id": "11",
        "email": "cs@switch.ng"
      }
    },
    {
      "id": "2",
      "reason": "A lot of transaction seems fraudulent here bro!",
      "status": "approved",
      "super_admin_comment": null,
      "user": null,
      "created_by": {
        "id": "11",
        "email": "cs@switch.ng"
      }
    },
    {
      "id": "1",
      "reason": "okay",
      "status": "approved",
      "super_admin_comment": null,
      "user": {
        "first_name": "Motolani",
        "last_name": "Fayomi",
        "email": "fayomitolani@gmail.com",
        "is_verified": false,
        "switch_id": 100364,
        "image_selfie_url": "+112345678907_image_selfie_url_DownloadQrCode (1).png"
      },
      "created_by": {
        "id": "11",
        "email": "cs@switch.ng"
      }
    }
  ],
  "meta": {
    "total": 15,
    "per_page": 20,
    "page": 1,
    "page_count": 1
  }
}
```

{% endtab %}
{% endtabs %}

## Get Disable-Request info

<mark style="color:blue;">`GET`</mark> `https://switchapi3.azurewebsites.net/admin/disable_requests/:request_id`

Retrieves the info of a disable-request.

#### Path Parameters

| Name        | Type   | Description           |
| ----------- | ------ | --------------------- |
| request\_id | string | The id of the request |

#### Headers

| Name          | Type   | Description                                    |
| ------------- | ------ | ---------------------------------------------- |
| SWI-CID       | string | Client ID                                      |
| Authorization | string | Format for Authorization is ***Bearer token*** |

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

```
{
  "message": "Disable-request retrieved successfully",
  "data": {
    "id": "51",
    "reason": "Very suspicious user",
    "status": "pending",
    "super_admin_comment": null,
    "user": {
      "first_name": "Testing",
      "last_name": "Andrew",
      "email": "testingandrew@gmail.com",
      "is_verified": false,
      "switch_id": 100125,
      "image_selfie_url": null
    },
    "created_by": {
      "id": "11",
      "email": "cs@switch.ng"
    }
  }
}
```

{% endtab %}

{% tab title="404 " %}

```
{
    "message": "disable-request with id 50 does not exist"
}
```

{% endtab %}
{% endtabs %}

## Approve Request

<mark style="color:green;">`POST`</mark> `https://switchapi3.azurewebsites.net/admin/disable_requests/approve/:request_id`

This endpoint allows a super-admin to approve a request.

#### Path Parameters

| Name        | Type   | Description           |
| ----------- | ------ | --------------------- |
| request\_id | string | The id of the request |

#### Headers

| Name          | Type   | Description                                    |
| ------------- | ------ | ---------------------------------------------- |
| SWI-CS        | string | Payload checksum                               |
| SWI-CID       | string | Client ID                                      |
| Authorization | string | Format for Authorization is ***Bearer token*** |

#### Request Body

| Name    | Type   | Description         |
| ------- | ------ | ------------------- |
| comment | string | Super-admin comment |

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

```
{
  "message": "Disable-request approved successfully",
  "data": {
    "id": "51",
    "reason": "Very suspicious user",
    "status": "approved",
    "super_admin_comment": "Okay",
    "user": {
      "first_name": "Testing",
      "last_name": "Andrew",
      "email": "testingandrew@gmail.com",
      "is_verified": false,
      "switch_id": 100125,
      "image_selfie_url": null
    },
    "created_by": {
      "id": "11",
      "email": "cs@switch.ng"
    }
  }
}
```

{% endtab %}

{% tab title="400 " %}

```
{
  "message": "disable-request already approved"
}
```

{% endtab %}

{% tab title="401 " %}

```
{
    "message": "Only an admin with a role of super_admin can perform this action"
}
```

{% endtab %}

{% tab title="404 " %}

```
{
    "message": "disable-request with id 50 does not exist"
}
```

{% endtab %}
{% endtabs %}

## Decline Request

<mark style="color:green;">`POST`</mark> `https://switchapi3.azurewebsites.net/admin/disable_requests/decline/:request_id`

This endpoint allows a super-admin to decline a request.

#### Path Parameters

| Name        | Type   | Description            |
| ----------- | ------ | ---------------------- |
| request\_id | string | The id of the request. |

#### Headers

| Name          | Type   | Description                  |
| ------------- | ------ | ---------------------------- |
| SWI-CS        | string | Payload checksum             |
| SWI-CID       | string | Client ID                    |
| Authorization | string | Format is ***Bearer token*** |

#### Request Body

| Name    | Type   | Description         |
| ------- | ------ | ------------------- |
| comment | string | Super-admin comment |

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

```
{
  "message": "Disable-request declined successfully",
  "data": {
    "id": "52",
    "reason": "Very suspicious user",
    "status": "declined",
    "super_admin_comment": "Not okay",
    "user": {
      "first_name": "Demilade",
      "last_name": "Omitiran",
      "email": "omitirand@gmail.com",
      "is_verified": false,
      "switch_id": 100199,
      "image_selfie_url": "+2348184392899_image_selfie_url_Screenshot 2019-05-07 at 4.00.10 PM.png"
    },
    "created_by": {
      "id": "11",
      "email": "cs@switch.ng"
    }
  }
}
```

{% endtab %}

{% tab title="400 " %}

```
{
  "message": "disable-request already declined"
}
```

{% endtab %}

{% tab title="401 " %}

```
{
    "message": "Only an admin with a role of super_admin can perform this action"
}
```

{% endtab %}

{% tab title="404 " %}

```
{
    "message": "disable-request with id 50 does not exist"
}
```

{% endtab %}
{% endtabs %}
