Skip to main content

Users

Base URL#

All following endpoints operates over the URL of your store: https://your-store.com

example: https://alephdigital.publica.la

Endpoints
Create
Retrieve
Update
Delete
Force Logout

Headers#

{
'Content-Type': 'application/json',
'Accept: 'application/json',
'X-User-Token': api_token,
}
info

Make sure you generated the api_token on your store. More info HERE

Create#

POST /integration-api/v1/dashboard/users/

Body Parameters#

ParameterTypeDescription
external_idstringRequired
emailstringRequired
new_passwordstringRecommended
sessions_limitinteger
assign_new_planinteger
new_plan_custom_valid_tostring
adminboolean
plan_adminboolean
only_sees_readableboolean
user_plan_name
{
"email":"jhondoe@mail.com",
"new_password":"Abcd1234",
"sessions_limit":"",
"assign_new_plan": 0,
"new_plan_custom_valid_to":"",
"admin":false,
"plan_admin":false,
"only_sees_readable":true,
"user_plan_name":"",
}

Response#

CodeDescription
200Object Created
422Validation error, the reason of the error will be described in the response body
401Unauthenticated

Response example#

{
"CODE": "success",
"data": {
"id": 923242,
"email": "jhondoe@mail.com",
"uuid": "af5af4f9-9b8d-4d79-b162-0cec4279cae5",
"picture": "https://www.gravatar.com/avatar/5c472faa5105266a3d41aee277eb9d0c?s=160&d=mm&r=g",
"admin": false,
"plan_admin": false,
"only_sees_readable": false,
"sessions_limit": null,
"created_at": {
"timestamp": 1620931649,
"date": "2021-05-13 18:47:29",
"timezone": "UTC"
},
"updated_at": {
"timestamp": 1621256387,
"date": "2021-05-17 12:59:47",
"timezone": "UTC"
},
"deleted_at": null
}
}

Retrieve#

GET /integration-api/v1/dashboard/users GET /integration-api/api/v1/dashboard/users/?query='user@publica.la'

tip

Using query parameter you can filter by email, deactivated and admin users

Response#

CodeDescription
200Success
404Object not found
401Unauthenticated

Response Example#

Example
{
"CODE": "success",
"data": {
"paginator": {
"current_page": 1,
"data": [
{
"id": 923242,
"uuid": "af5af4f9-9b8d-4d79-b162-0cec4279cae5",
"admin": false,
"plan_admin": false,
"email": "jhondoe@mail.com",
"sessions_limit": 1,
"only_sees_readable": 1,
"picture": "https://www.gravatar.com/avatar/98789c9d5825d6f6c6615313ffcaf1ac?s=160&d=mm&r=g",
"created_at": "2021-05-18T13:28:53.000000Z",
"updated_at": "2021-05-18T13:28:53.000000Z",
"deleted_at": null,
"purchased_issues_with_cancelled_count": 0,
"user_plans_count": 0,
"can_be_edited": true,
"created_at_date_string": "2021-05-18",
"impersonate": "https://unlimitedtestautomation.publicala.me/impersonate/take/53114",
"sessions": null,
"ip_ranges": [],
"referrers": [],
"purchased_issues_with_cancelled": [],
"user_plans": []
},
{
...
}]
}
}
}

Update#

PUT /api/v1/dashboard/users/{user_id}

Parameters#

ParameterTypeDescription
external_idstringRequired
emailstringRequired
new_passwordstringRecommended
sessions_limitinteger
assign_new_planinteger
new_plan_custom_valid_tostring
adminboolean
plan_adminboolean
only_sees_readableboolean
user_plan_name

Response#

CodeDescription
204Object Updated
422Validation error, the reason of the error will be described in the response body
401Unauthenticated

Deactivate#

IMPORTANT NOTE

This endpoint enables you to deactivate an user. A deactivated user can not log in through any means.

DELETE /integration-api/v1/dashboard/users/{id}

Response#

CodeDescription
200Object deleted
404Object not found
401Unauthenticated

Response example#

{
"CODE": "success",
"data": []
}

Reactivate#

PUT /integration-api/v1/dashboard/users/{id}/re-activate

Response#

CodeDescription
200Object deleted
404Object not found
401Unauthenticated

Response Example#

{
"CODE": "success",
"data": 1
}

Forced Logout#

POST /integration-api/v1/users/{user_id}/force-logout/

After logging out, the user will be redirected to the initial URL on its next interaction with the system.

The endpoint receives as user identifier the ID or the external_id. Keep in mind that in the case the external-auth-token is used then the external_id is the UUID contained in the token.