Admin/Users

User endpoints for admins.

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

Get Users list

GET https://switchapi3.azurewebsites.net/admin/users

Retrieves list of users.

Query Parameters

Name
Type
Description

blacklisted

string

Filter for blacklisted users. true or false

sales_agent_referral_code

string

Referral code of a sales agent.

is_diaspora

boolean

Filter for diasporan/non-diasporan users. true or false

search_query

string

Query string to search through users by email or name

is_verified

boolean

Filter for verified/unverified users. true or false

page

string

Defaults to 1

per_page

string

Defaults to 20

Headers

Name
Type
Description

SWI-CID

string

Client ID

Authorization

string

Format is Bearer token

{
    "message": "Users retrieved successfully",
    "data": [
        {
            "id": 265,
            "switch_id": 100365,
            "first_name": "Kikelomo",
            "last_name": "Ojolowo",
            "email": "kikelomo.ojolowo@yahoo.com",
            "is_verified": false,
            "phone": "+112345678904"
        },
        {
            "id": 264,
            "switch_id": 100364,
            "first_name": "Motolani",
            "last_name": "Fayomi",
            "email": "fayomitolani@gmail.com",
            "is_verified": false,
            "phone": "+112345678907"
        },
        {
            "id": 263,
            "switch_id": 100363,
            "first_name": "Oladimeji",
            "last_name": "Durosaro",
            "email": "durosarodapo@gmail.com",
            "is_verified": false,
            "phone": "+18628734567"
        },
        {
            "id": 262,
            "switch_id": 100362,
            "first_name": "omotolani",
            "last_name": "Deji-Akintola",
            "email": "stilltolani@yahoo.com",
            "is_verified": false,
            "phone": "+443467885577"
        },
        {
            "id": 261,
            "switch_id": 100361,
            "first_name": "Francis",
            "last_name": "Ezinna",
            "email": "eegbuchu@yahoo.com",
            "is_verified": false,
            "phone": "+2348034134689"
        },
        {
            "id": 260,
            "switch_id": 100360,
            "first_name": "Okikioluwa",
            "last_name": "Oyeleke",
            "email": "prosquid1@gmail.com",
            "is_verified": false,
            "phone": "234 701 3944 773"
        },
        {
            "id": 259,
            "switch_id": 100359,
            "first_name": "Mire",
            "last_name": "Wumek",
            "email": "mirewumek@email-wizard.com",
            "is_verified": false,
            "phone": "+2348071417141"
        },
        {
            "id": 258,
            "switch_id": 100358,
            "first_name": "Taga",
            "last_name": "Wila",
            "email": "tajawila@simpleemail.info",
            "is_verified": false,
            "phone": "+2348051128114"
        },
        {
            "id": 257,
            "switch_id": 100357,
            "first_name": "Peter",
            "last_name": "Ruso",
            "email": "ruso@email-server.info",
            "is_verified": false,
            "phone": "+2348051125141"
        },
        {
            "id": 256,
            "switch_id": 100356,
            "first_name": "Esther",
            "last_name": "John-Paul",
            "email": "ecnwowo@gmail.com",
            "is_verified": false,
            "phone": "+15678654213"
        },
        {
            "id": 255,
            "switch_id": 100355,
            "first_name": "Surat",
            "last_name": "Jimoh",
            "email": "jimohsurat9@gmail.com",
            "is_verified": true,
            "phone": "+12162111155"
        },
        {
            "id": 254,
            "switch_id": 100354,
            "first_name": "Esther",
            "last_name": "Nwowo",
            "email": "esther.nwowo@sterling.ng",
            "is_verified": false,
            "phone": "+447556188094"
        },
        {
            "id": 253,
            "switch_id": 100353,
            "first_name": "samsu",
            "last_name": "salsu",
            "email": "samora@cyber-host.net",
            "is_verified": false,
            "phone": "+2348021219191"
        },
        {
            "id": 252,
            "switch_id": 100352,
            "first_name": "FAITH",
            "last_name": "OYEDOKUN",
            "email": "faithoyedokun@yahoo.co.uk",
            "is_verified": false,
            "phone": "+2348087666711"
        },
        {
            "id": 251,
            "switch_id": 100351,
            "first_name": "Yuy",
            "last_name": "Yuh",
            "email": "bigiyowor@email-wizard.com",
            "is_verified": false,
            "phone": "+16045555556"
        },
        {
            "id": 250,
            "switch_id": 100350,
            "first_name": "rfrfrf",
            "last_name": "frfrf",
            "email": "zatu@business-agent.info",
            "is_verified": false,
            "phone": "+16045555555"
        },
        {
            "id": 249,
            "switch_id": 100349,
            "first_name": "Jayx",
            "last_name": "Layx",
            "email": "yohuhirovi@business-agent.info",
            "is_verified": false,
            "phone": "+2348077929193"
        },
        {
            "id": 248,
            "switch_id": 100348,
            "first_name": "Samuel",
            "last_name": "Adebayo",
            "email": "samuel.adebayo@sterling.ng",
            "is_verified": true,
            "phone": "+2347063936467"
        },
        {
            "id": 247,
            "switch_id": 100347,
            "first_name": "Adefemi",
            "last_name": "Olafisoye",
            "email": "defemiwa@yahoo.com",
            "is_verified": false,
            "phone": "+447557376898"
        },
        {
            "id": 246,
            "switch_id": 100346,
            "first_name": "Ropa",
            "last_name": "eef",
            "email": "ropapedot@acemail.info",
            "is_verified": false,
            "phone": "+2348050019001"
        }
    ],
    "meta": {
        "total": 192,
        "per_page": 20,
        "page": 1,
        "page_count": 10
    }
}

Get User info

GET https://switchapi3.azurewebsites.net/admin/users/:user_id

Retrieve user info by id.

Path Parameters

Name
Type
Description

user_id

string

The user id

Headers

Name
Type
Description

SWI-CID

string

Client ID

Authorization

string

Format is Bearer token

{
    "message": "User retrieved",
    "data": {
        "id": 265,
        "email": "kikelomo.ojolowo@yahoo.com",
        "first_name": "Kikelomo",
        "last_name": "Ojolowo",
        "phone": "+112345678904",
        "date_of_birth": "1989-11-02",
        "gender": "female",
        "country": "canada",
        "is_verified": false,
        "blacklisted": false,
        "pin_set": true,
        "phone_verified": true,
        "two_factor_authentication_enabled": true,
        "bvn": "22xxxxxx144",
        "address": "Irvington ",
        "photo_id_url": null,
        "image_selfie_url": "+112345678904_image_selfie_url_chart.png",
        "signature_url": "+112345678904_signature_chart.png",
        "switch_id": 100365,
        "payment_link_slug": null,
        "google_auth_set_up": false,
        "city": "New Jersey",
        "state": "New Jersey",
        "full_address": "Irvington  New Jersey New Jersey 1234",
        "zipcode": "1234",
        "last_sign_in": null,
        "photo_id_expiry": null,
        "photo_id_issuer": null,
        "photo_id_number": null,
        "switch_bank_account_name": null,
        "switch_bank_account_number": null,
        "switch_bank_customer_id": null,
        "full_name": "Kikelomo Ojolowo",
        "disabled": false,
        "has_pending_disable_request": true,
        "has_pending_enable_request": false,
        "nigerian_contact_address": "20 marina ",
        "nigerian_contact_name": "omotolani",
        "nigerian_contact_phone": "2348028315074",
        "nigerian_contact_relationship": "sister",
        "verification_requested": false,
        "wallet": {
            "wallet_balance": "0.0",
            "soft_balance": "0.0"
        },
        "authenticator_uri": "otpauth://totp/SWITCH:kikelomo.ojolowo@yahoo.com?secret=ylrclkgp34wxk2il&issuer=SWITCH",
        "two_factor_authentication_type": "pin",
        "security_question_set": true,
        "is_diaspora": true
    }
}

Disable User

POST https://switchapi3.azurewebsites.net/admin/users/disable/:user_id

This endpoint is for the super-admin to directly disable a user.

Path Parameters

Name
Type
Description

user_id

string

The user's id.

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

reason

string

The reason for disabling the user.

{
    "message": "User disabled successfully",
    "data": {
        "id": 265,
        "email": "kikelomo.ojolowo@yahoo.com",
        "first_name": "Kikelomo",
        "last_name": "Ojolowo",
        "phone": "+112345678904",
        "date_of_birth": "1989-11-02",
        "gender": "female",
        "country": "canada",
        "is_verified": false,
        "blacklisted": false,
        "pin_set": true,
        "phone_verified": true,
        "two_factor_authentication_enabled": true,
        "bvn": "22xxxxxx144",
        "address": "Irvington ",
        "photo_id_url": null,
        "image_selfie_url": "+112345678904_image_selfie_url_chart.png",
        "signature_url": "+112345678904_signature_chart.png",
        "switch_id": 100365,
        "payment_link_slug": null,
        "google_auth_set_up": false,
        "city": "New Jersey",
        "state": "New Jersey",
        "full_address": "Irvington  New Jersey New Jersey 1234",
        "zipcode": "1234",
        "last_sign_in": null,
        "photo_id_expiry": null,
        "photo_id_issuer": null,
        "photo_id_number": null,
        "switch_bank_account_name": null,
        "switch_bank_account_number": null,
        "switch_bank_customer_id": null,
        "full_name": "Kikelomo Ojolowo",
        "disabled": true,
        "has_pending_disable_request": true,
        "has_pending_enable_request": false,
        "nigerian_contact_address": "20 marina ",
        "nigerian_contact_name": "omotolani",
        "nigerian_contact_phone": "2348028315074",
        "nigerian_contact_relationship": "sister",
        "verification_requested": false,
        "wallet": {
            "wallet_balance": "0.0",
            "soft_balance": "0.0"
        },
        "authenticator_uri": "otpauth://totp/SWITCH:kikelomo.ojolowo@yahoo.com?secret=ylrclkgp34wxk2il&issuer=SWITCH",
        "two_factor_authentication_type": "pin",
        "security_question_set": true,
        "is_diaspora": true
    }
}

Enable disabled user

POST https://switchapi3.azurewebsites.net/admin/users/enable/:user_id

This endpoint is for the super-admin to directly enable a disabled user.

Path Parameters

Name
Type
Description

user_id

string

The user id

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

reason

string

The reason for enabling the user.

{
    "message": "User enabled successfully",
    "data": {
        "id": 265,
        "email": "kikelomo.ojolowo@yahoo.com",
        "first_name": "Kikelomo",
        "last_name": "Ojolowo",
        "phone": "+112345678904",
        "date_of_birth": "1989-11-02",
        "gender": "female",
        "country": "canada",
        "is_verified": false,
        "blacklisted": false,
        "pin_set": true,
        "phone_verified": true,
        "two_factor_authentication_enabled": true,
        "bvn": "22xxxxxx144",
        "address": "Irvington ",
        "photo_id_url": null,
        "image_selfie_url": "+112345678904_image_selfie_url_chart.png",
        "signature_url": "+112345678904_signature_chart.png",
        "switch_id": 100365,
        "payment_link_slug": null,
        "google_auth_set_up": false,
        "city": "New Jersey",
        "state": "New Jersey",
        "full_address": "Irvington  New Jersey New Jersey 1234",
        "zipcode": "1234",
        "last_sign_in": null,
        "photo_id_expiry": null,
        "photo_id_issuer": null,
        "photo_id_number": null,
        "switch_bank_account_name": null,
        "switch_bank_account_number": null,
        "switch_bank_customer_id": null,
        "full_name": "Kikelomo Ojolowo",
        "disabled": false,
        "has_pending_disable_request": true,
        "has_pending_enable_request": false,
        "nigerian_contact_address": "20 marina ",
        "nigerian_contact_name": "omotolani",
        "nigerian_contact_phone": "2348028315074",
        "nigerian_contact_relationship": "sister",
        "verification_requested": false,
        "wallet": {
            "wallet_balance": "0.0",
            "soft_balance": "0.0"
        },
        "authenticator_uri": "otpauth://totp/SWITCH:kikelomo.ojolowo@yahoo.com?secret=ylrclkgp34wxk2il&issuer=SWITCH",
        "two_factor_authentication_type": "pin",
        "security_question_set": true,
        "is_diaspora": true
    }
}

Update user's fraud status

POST https://switchapi3.azurewebsites.net/admin/users/update_fraud_status/:user_id

This endpoint updates the user's fraud status. Only for customer success and admin.

Path Parameters

Name
Type
Description

user_id

string

The id of the user

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

The admin's comments.

fraud_status

string

The user's fraud status. Can be one of the following: - whitelisted - suspicious - fraudulent

{
    "message": "User Fraud-status updated successfully",
    "data": {
        "id": 11,
        "email": "beyonceknowles@gmail.com",
        "first_name": "Beyonce",
        "last_name": "Knowles",
        "phone": "+2348154634619",
        "date_of_birth": "1981-09-04",
        "gender": "female",
        "country": "nigeria",
        "is_verified": false,
        "blacklisted": false,
        "pin_set": true,
        "phone_verified": true,
        "two_factor_authentication_enabled": true,
        "bvn": null,
        "address": "19, Okotie Eboh",
        "photo_id_url": "+2348154634619_id_card_beyonce.jpg",
        "image_selfie_url": "+2348154634619_image_selfie_url_beyonce.jpg",
        "signature_url": null,
        "switch_id": 100111,
        "payment_link_slug": "100111",
        "google_auth_set_up": false,
        "city": "Ikoyi",
        "state": "Lagos",
        "full_address": "19, Okotie Eboh Lagos Ikoyi 101233",
        "zipcode": "101233",
        "last_sign_in": "2019-02-11T14:21:59.409Z",
        "photo_id_expiry": null,
        "photo_id_issuer": null,
        "photo_id_number": null,
        "disabled": true,
        "switch_bank_account_name": null,
        "switch_bank_account_number": null,
        "switch_bank_customer_id": null,
        "full_name": "Beyonce Knowles",
        "has_pending_disable_request": false,
        "has_pending_enable_request": false,
        "fraud_status": "fraudulent",
        "verification_requested": false,
        "wallet": {
            "wallet_balance": "2978497.0",
            "soft_balance": "3993500.0"
        },
        "authenticator_uri": "otpauth://totp/SWITCH:beyonceknowles@gmail.com?secret=h5fzp422w4mwyq6b&issuer=SWITCH",
        "two_factor_authentication_type": "pin",
        "security_question_set": false,
        "is_diaspora": false
    }
}

Get Users with pending verification requests

GET https://switchapi3.azurewebsites.net/admin/users/pending_verification_requests

This endpoint returns the users that have pending verification requests.

Headers

Name
Type
Description

SWI-CID

string

Client ID

Authorization

string

Format is Bearer token

{
    "message": "Verification Requests retrieved successfully",
    "data": [
        {
            "id": 263,
            "switch_id": 100363,
            "first_name": "Oladimeji",
            "last_name": "Durosaro",
            "email": "durosarodapo@gmail.com",
            "phone": "+18628734567",
            "is_verified": false,
            "verification_requested": true
        },
        {
            "id": 237,
            "switch_id": 100337,
            "first_name": "ayobami",
            "last_name": "agboola",
            "email": "aaywai@gmail.com",
            "phone": "+447556188093",
            "is_verified": false,
            "verification_requested": true
        },
        {
            "id": 23,
            "switch_id": 100123,
            "first_name": "Opemipo",
            "last_name": "Bolaji",
            "email": "bolajipemipo@gmail.com",
            "phone": "+23408124951038",
            "is_verified": false,
            "verification_requested": true
        },
        {
            "id": 4,
            "switch_id": 100104,
            "first_name": "Temitope",
            "last_name": "Alarape",
            "email": "talarapet@gmail.com",
            "phone": "+2348146816230",
            "is_verified": false,
            "verification_requested": true
        }
    ],
    "meta": {
        "total": 4,
        "per_page": 20,
        "page": 1,
        "page_count": 1
    }
}

Get User's Devices

GET https://switchapi3.azurewebsites.net/admin/users/:id/devices

This endpoint returns the list of mobile devices linked to a user's account.

Path Parameters

Name
Type
Description

id

string

The user's id.

Headers

Name
Type
Description

SWI-CID

string

Client ID

Authorization

string

Format is Bearer token

{
    "message": "User's devices retrieved succesfully",
    "data": [
        {
            "device_id": "1f5808766b1bb49f",
            "device_model": "Infinix",
            "device_os": "Android 8.1.0",
            "created_at": "2020-03-13T19:27:26.871Z"
        }
    ]
}

Delete User Device

POST https://switchapi3.azurewebsites.net/admin/users/delete/:id/devices/:device_id

This endpoint unlinks a device from a user.

Path Parameters

Name
Type
Description

id

string

The user's id.

device_id

string

The id of the device

Headers

Name
Type
Description

SWI-CS

string

Payload checksum

SWI-CID

string

Client ID

Authorization

string

Format is Bearer token

{
    "message": "Device unlinked from account succesfully"
}

Reset User Password

POST https://switchapi3.azurewebsites.net/admin/users/reset_password/:id

This endpoint resets the user's password.

Path Parameters

Name
Type
Description

id

string

The user's id

Headers

Name
Type
Description

SWI-CID

string

Client ID

Authorization

string

Format is Bearer token

{
    "message": "User password updated successfully",
    "data": {
        "id": "23",
        "email": "bolajipemipo0@gmail.com",
        "phone": "+23408124951039",
        "first_name": "Opemipo",
        "last_name": "Bolaji",
        "date_of_birth": "1995-02-09",
        "photo_id_url": "+23408124951038_id_card_for_change_request_download.html",
        "image_selfie_url": null,
        "signature_url": "+23408124951038_signature_img3.jpg",
        "address": "14 Atunrashe Street, off Ishaga Road, Ojuelegba, Lagos, Nigeria..",
        "nearest_landmark": null,
        "next_of_kin_name": null,
        "next_of_kin_relationship": null,
        "next_of_kin_phone_number": null,
        "next_of_kin_email_address": null,
        "is_verified": false,
        "gender": "male",
        "country": "NG",
        "blacklisted": false,
        "switch_id": 100123,
        "two_factor_authentication_enabled": true,
        "two_factor_authentication_type": "pin",
        "phone_verified": true,
        "pin_set": true,
        "payment_link_slug": "bolajipemipo",
        "city": "Lagos.",
        "state": "LAGOS",
        "zipcode": "23411",
        "last_sign_in": "2019-02-14T09:28:04.055Z",
        "photo_id_issuer": "drivers_license",
        "photo_id_number": "123",
        "photo_id_expiry": "2013-04-08T08:41:00.000Z",
        "switch_bank_account_name": null,
        "switch_bank_account_number": null,
        "google_auth_set_up": false,
        "nigerian_contact_name": null,
        "nigerian_contact_phone": null,
        "nigerian_contact_address": null,
        "nigerian_contact_relationship": null,
        "switch_bank_customer_id": null,
        "disabled": false,
        "has_pending_disable_request": false,
        "has_pending_enable_request": false,
        "fraud_status": "whitelisted",
        "verified_at": null,
        "email_confirmed": true,
        "kaoshi_user_id": null,
        "kaoshi_name": null,
        "verification_requested": true,
        "bvn": "12xxxxxx901",
        "number_of_security_questions_set": 1,
        "security_question_set": true,
        "is_diaspora": false,
        "has_wallet": true,
        "dom_accounts": null,
        "invite_link": "http://localhost:3000/register/100123",
        "payment_link": "http://localhost:3000/pay/100123",
        "created_at": "2019-02-06T16:50:04.592Z"
    }
}

Last updated

Was this helpful?