> 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/user-update-request.md).

# User Update-Request

```
STAGING_URL: https://switch-api-staging.herokuapp.com
LIVE_URL: https://switchapi.azurewebsites.net
```

## Create Update-Request

<mark style="color:green;">`POST`</mark> `https://switch-api-staging.herokuapp.com/user/update_requests/:user_attribute`

This endpoint allows the user to request for an update on his/her profile or BVN.

#### Path Parameters

| Name            | Type   | Description                                                                                                                                                              |
| --------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| user\_attribute | string | <p>The attribute being updated.<br>Could be any of the following: <em><strong>name, email, address, phone</strong></em> or <em><strong>date\_of\_birth</strong></em></p> |

#### Headers

| Name        | Type   | Description                                                |
| ----------- | ------ | ---------------------------------------------------------- |
| auth\_token | string | Format for ***auth\_token*** is ***Bearer token\_string*** |

#### Request Body

| Name                        | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| --------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| zipcode                     | string  | <p>The user's zipcode.<br>Required when <em><strong>user\_attribute</strong></em> is <em><strong>address</strong></em></p>                                                                                                                                                                                                                                                                                                                                                                             |
| bvn\_change                 | boolean | Determines whether the changes should be made on the user's BVN. Defaults to ***true***                                                                                                                                                                                                                                                                                                                                                                                                                |
| city                        | string  | <p>The user's city of residence.<br>Required when <em><strong>user\_attribute</strong></em> is <em><strong>address</strong></em></p>                                                                                                                                                                                                                                                                                                                                                                   |
| state                       | string  | <p>The user's state of residence.<br>Required when <em><strong>user\_attribute</strong></em> is <em><strong>address</strong></em></p>                                                                                                                                                                                                                                                                                                                                                                  |
| reason                      | string  | Only required when ***user\_attribute*** is ***name***. Could be either ***marriage, spelling\_error*** or ***total\_name\_change***.                                                                                                                                                                                                                                                                                                                                                                  |
| first\_name                 | string  | <p>The new first name.<br>Required when <em><strong>user\_attribute</strong></em> is <em><strong>name</strong></em></p>                                                                                                                                                                                                                                                                                                                                                                                |
| last\_name                  | string  | <p>The new last name.<br>Required when <em><strong>user\_attribute</strong></em> is <em><strong>name</strong></em></p>                                                                                                                                                                                                                                                                                                                                                                                 |
| email                       | string  | <p>The new email.<br>Required when <em><strong>user\_attribute</strong></em> is <em><strong>email</strong></em></p>                                                                                                                                                                                                                                                                                                                                                                                    |
| address                     | string  | <p>The new street address.<br>Required when <em><strong>user\_attribute</strong></em> is <em><strong>address</strong></em></p>                                                                                                                                                                                                                                                                                                                                                                         |
| phone                       | string  | <p>The new phone number.<br>Required when <em><strong>user\_attribute</strong></em> is <em><strong>phone</strong></em></p>                                                                                                                                                                                                                                                                                                                                                                             |
| date\_of\_birth             | string  | <p>The correct date of birth.<br>Required when <em><strong>user\_attribute</strong></em> is <em><strong>date\_of\_birth</strong></em></p>                                                                                                                                                                                                                                                                                                                                                              |
| switch\_change              | boolean | Determines whether the changes should be made on the Switch app. Defaults to ***false***                                                                                                                                                                                                                                                                                                                                                                                                               |
| marriage\_certificate\_url  | string  | <p>The url of the image containing the marriage certificate.<br>Required when <em><strong>user\_attribute</strong></em> is <em><strong>name</strong></em> and <em><strong>reason</strong></em> is <em><strong>marriage</strong></em></p>                                                                                                                                                                                                                                                               |
| affidavit\_url              | string  | <p>The url of the image containing the affidavit.<br>Required when <br>- <em><strong>user\_attribute</strong></em> is <em><strong>name</strong></em> and <em><strong>reason</strong></em> is <em><strong>marriage</strong></em><br>- <em><strong>user\_attribute</strong></em> is <em><strong>name</strong></em> and <em><strong>reason</strong></em> is <em><strong>total\_name\_change</strong></em><br>- <em><strong>user\_attribute</strong></em> is <em><strong>date\_of\_birth</strong></em></p> |
| newspaper\_publication\_url | string  | <p>The url of the image containing the newspaper publication.<br>Required when <em><strong>user\_attribute</strong></em> is <em><strong>name</strong></em> and <em><strong>reason</strong></em> is<br>- <em><strong>marriage</strong></em><br>- <em><strong>total\_name\_change</strong></em></p>                                                                                                                                                                                                      |
| photo\_id\_url              | string  | <p>The url of the image containing the photo id.<br>Required when <br>- <em><strong>user\_attribute</strong></em> is <em><strong>name</strong></em><br>- <em><strong>user\_attribute</strong></em> is <em><strong>date\_of\_birth</strong></em></p>                                                                                                                                                                                                                                                    |
| photo\_id\_issuer           | string  | The photo id issuer (valid values: ***drivers\_license***, ***voters\_card***, ***international\_passport*** and ***national\_id\_card***)                                                                                                                                                                                                                                                                                                                                                             |
| photo\_id\_number           | string  | The number of the photo id                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| photo\_id\_expiry           | string  | The expiry date of the photo id                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| utility\_bill\_url          | string  | <p>The url of the image containing the utility bill.<br>Required when <em><strong>user\_attribute</strong></em> is <em><strong>address</strong></em></p>                                                                                                                                                                                                                                                                                                                                               |
| birth\_certificate\_url     | string  | <p>The url of the image containing the birth certificate.<br>Required when <em><strong>user\_attribute</strong></em> is <em><strong>date\_of\_birth</strong></em></p>                                                                                                                                                                                                                                                                                                                                  |

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

```
{
    "message": "Your update-request has been received and will be processed within the next 7 working days."
}
```

{% endtab %}

{% tab title="400 " %}

```
{
    "message": "user's signature not yet verified'"
}
```

{% endtab %}
{% endtabs %}

## Get user's update-requests

<mark style="color:blue;">`GET`</mark> `https://switch-api-staging.herokuapp.com/user/update_requests`

Retrieves all the user's update-requests

#### Headers

| Name        | Type   | Description                                                |
| ----------- | ------ | ---------------------------------------------------------- |
| auth\_token | string | Format for ***auth\_token*** is ***Bearer token\_string*** |

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

```
{
    "message": "User update-requests retrieved successfully",
    "data": [
        {
            "id": 32,
            "old_value": {
                "first_name": "Tayo",
                "last_name": "Tade"
            },
            "new_value": {
                "first_name": "Ayo",
                "last_name": "Ade"
            },
            "user_attribute": "name",
            "reason": "total_name_change",
            "switch_change": false,
            "bvn_change": true,
            "status": "pending",
            "created_at": "2019-05-10T11:26:02.500Z"
        },
        {
            "id": 33,
            "old_value": {
                "email": "tayo@gmail.com"
            },
            "new_value": {
                "email": "someone@email.com"
            },
            "user_attribute": "email",
            "reason": "spelling_error",
            "switch_change": false,
            "bvn_change": true,
            "status": "pending",
            "created_at": "2019-05-10T11:26:58.032Z"
        },
        {
            "id": 34,
            "old_value": {
                "phone": "+2348184292899"
            },
            "new_value": {
                "phone": "+2348023193506"
            },
            "user_attribute": "phone",
            "reason": "spelling_error",
            "switch_change": false,
            "bvn_change": true,
            "status": "pending",
            "created_at": "2019-05-10T11:27:37.279Z"
        },
        {
            "id": 35,
            "old_value": {
                "date_of_birth": "1991-11-10"
            },
            "new_value": {
                "date_of_birth": "1990-11-10"
            },
            "user_attribute": "date_of_birth",
            "reason": "spelling_error",
            "switch_change": false,
            "bvn_change": true,
            "status": "pending",
            "created_at": "2019-05-10T11:29:29.290Z"
        },
        {
            "id": 36,
            "old_value": {
                "address": "some street",
                "city": "some city",
                "state": "some state",
                "zipcode": "something"
            },
            "new_value": {
                "address": "street",
                "city": "city",
                "state": "state",
                "zipcode": "zipcode"
            },
            "user_attribute": "address",
            "reason": "spelling_error",
            "switch_change": false,
            "bvn_change": true,
            "status": "pending",
            "created_at": "2019-05-10T11:38:01.146Z"
        }
    ]
}
```

{% endtab %}
{% endtabs %}
