Skip to main content

Users

Please refer to the Authentication document on how to obtain and use an API key.

Available actions & endpoints​

Fetching all users​

GET /v1/users (Fetch all users)
URL Parameters​
nametypedata typedescription
NoneN/AN/AN/A
Query Parameters​
namerequireddata typedescription
NoneN/AN/AN/A
Responses​
http codecontent-typeresponse
200application/jsonSee example response
401application/json{"code":401,"message": "Authentication is required to continue"}
Example cURL​
 curl -X GET -H "api-key: [YOUR API KEY]" https://api.monitor.insites.com/v1/users
Example Response​
{
"data": [
{
"first_name": "Mike",
"last_name": "Glenn",
"email": "mikeglen@insites.com",
"avatar": null,
"language_preference": "en-GB",
"country_code": "GB",
"suspended_at": null,
"created_at": "2023-06-02T15:54:32+00:00",
"updated_at": null
}
],
"meta": {
"per_page": 20,
"from": 1,
"to": 1,
"current_page": 1,
"last_page": 1,
"total": 1,
"next_page_url": null,
"prev_page_url": null,
"first_page_url": "http://localhost:8000/v1/users?page=1",
"last_page_url": "http://localhost:8000/v1/users?page=1"
}
}

Fetching a specific user​

GET /v1/users/[user_uuid] (Fetch user)
URL Parameters​
namerequireddata typedescription
user_uuidYesstringThe uuid of the user you would like to fetch
Query Parameters​
namerequireddata typedescription
NoneN/AN/AN/A
Responses​
http codecontent-typeresponse
200application/jsonSee example response
404application/json{"code":404,"message": "Record not found in table \"users\""}
401application/json{"code":401,"message": "Authentication is required to continue"}
Example cURL​
 curl -X GET https://api.monitor.insites.com/v1/users/[user_uuid]
-H "api-key: [YOUR API KEY]"
Example Response​
{
"data": {
"first_name": "Mike",
"last_name": "Glenn",
"email": "mikeglen@insites.com",
"avatar": null,
"language_preference": "en-GB",
"country_code": "GB",
"suspended_at": null,
"created_at": "2023-06-02T15:54:32+00:00",
"updated_at": null
}
}

Creating a user​

POST /v1/users (Create user)
URL Parameters​
namerequireddata typedescription
NoneN/AN/AN/A
Query Parameters​
namerequireddata typedescription
NoneN/AN/AN/A
Responses​
http codecontent-typeresponse
200application/jsonSee example response
422application/json{"success":false,"message":"error","errors":{"email":{"unique":"Email address is already taken"}}}
401application/json{"code":401,"message": "Authentication is required to continue"}
Example cURL​
 curl -X POST https://api.monitor.insites.com/v1/users
-H "api-key: [YOUR API KEY]"
-H "Content-Type: application/json"
-d "[SEE EXAMPLE REQUEST BODY]"
Example Request Body​
{
"email": "mikeglenn@insites.com",
"first_name": "Mike",
"last_name": "Glenn",
"language_preference": "en-GB",
"country_code": "GB"
}
Example Response​
{
"message": "success",
"success": true,
"data": {
"email": "mikeglenn@insites.com",
"first_name": "Mike",
"last_name": "Glenn",
"avatar": null,
"language_preference": "en-GB",
"country_code": "GB",
"reseller_uuid": "23cde63d-a219-4566-a975-199c189c3f6f"
}
}

Updating a user​

PATCH /v1/users/[user_uuid] (Update user)
URL Parameters​
namerequireddata typedescription
user_uuidYesstringThe uuid of the user you would like to update
Query Parameters​
namerequireddata typedescription
NoneN/AN/AN/A
Responses​
http codecontent-typeresponse
200application/jsonSee example response
422application/json{"success":false,"message":"error","errors":{"email":{"required":"Email address is required"}}}
401application/json{"code":401,"message": "Authentication is required to continue"}
Example cURL​
 curl -X PATCH https://api.monitor.insites.com/v1/users/[user_uuid]
-H "api-key: [YOUR API KEY]"
-H "Content-Type: application/json"
-d "[SEE EXAMPLE REQUEST BODY]"
Example Request Body​
{
"email": "mikeglenn@insites.com",
"first_name": "Mike",
"last_name": "Glenn",
"language_preference": "en-GB",
"country_code": "GB"
}
Example Response​
{
"message": "success",
"success": true,
"data": {
"email": "mikeglenn@insites.com",
"first_name": "Mike",
"last_name": "Glenn",
"avatar": null,
"language_preference": "en-GB",
"country_code": "GB",
"reseller_uuid": "23cde63d-a219-4566-a975-199c189c3f6f"
}
}

Suspending a user​

GET /v1/users/[user_uuid]/suspend (Suspend user)
URL Parameters​
namerequireddata typedescription
user_uuidYesstringThe uuid of the user you would like to suspend
Query Parameters​
namerequireddata typedescription
NoneN/AN/AN/A
Responses​
http codecontent-typeresponse
200application/json{"success":true,"message":"success"}
401application/json{"code":401,"message": "Authentication is required to continue"}
Example cURL​
 curl -X GET https://api.monitor.insites.com/v1/users/[user_uuid]/suspend
-H "api-key: [YOUR API KEY]"

Un-suspending a user​

GET /v1/users/[user_uuid]/suspend (Un-suspend user)
URL Parameters​
namerequireddata typedescription
user_uuidYesstringThe uuid of the user you would like to suspend
Query Parameters​
namerequireddata typedescription
NoneN/AN/AN/A
Responses​
http codecontent-typeresponse
200application/json{"success":true,"message":"success"}
401application/json{"code":401,"message": "Authentication is required to continue"}
Example cURL​
 curl -X GET https://api.monitor.insites.com/v1/users/[user_uuid]/unsuspend
-H "api-key: [YOUR API KEY]"

Deleting a user​

DELETE /v1/users/[user_uuid] (Delete user)
URL Parameters​
namerequireddata typedescription
user_uuidYesstringThe uuid of the user you would like to delete
Query Parameters​
namerequireddata typedescription
NoneN/AN/AN/A
Responses​
http codecontent-typeresponse
200application/json{"success":true,"message":"success"}
401application/json{"code":401,"message": "Authentication is required to continue"}
Example cURL​
 curl -X DELETE https://api.monitor.insites.com/v1/users/[user_uuid]
-H "api-key: [YOUR API KEY]"