Delete User

Delete User #

Deletes an existing User from the Customer tenant.

If this is a user's non primary tenant, it will remove them only from this tenant. They will still have access to any other Customer they are assigned.

If this is the user's primary tenant, it will remove them from ALL other Customer tenants and delete the User account.

Request #

DELETE /v1.0/accounts/{ACCOUNT_TENANT_ID}/customers/{CUSTOMER_TENANT_ID}/users/{USER_ID}

Example #

This request will delete the specific User within the Customer tenant.

Request #

DELETE <https://api.na.myreports.cloud/api/v1.0/accounts/{ACCOUNT_TENANT_ID}/customers/{CUSTOMER_TENANT_ID}/users/{USER_ID}> HTTP/1.1
Authorisation: Bearer {TOKEN}

Response #

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: xx
{
	"status": "success",
	"timestamp": "2019-01-01T10:00:00.2890319Z"
}

Errors #

Unauthorised #

When the token is not provided, invalid or expired

HTTP/1.1 401 Unauthorised

Bad Request (1) #

When the provided account tenant id or customer tenant id is not in the correct format

HTTP/1.1 400 Bad Request
Date: Thu, 06 Feb 2020 12:45:27 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 149
{
	"error":400,
	"message":"The value '<tenant id>' is not valid.",
	"status":"error",
	"timestamp":"2020-02-06T12:45:27.5903465Z"
}

Bad Request (2) #

When the provided user id is not in the correct format

HTTP/1.1 400 Bad Request
Date: Thu, 06 Feb 2020 12:45:27 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 149
{
	"error":400,
	"message":"The value '<user id>' is not valid.",
	"status":"error",
	"timestamp":"2020-02-06T12:45:27.5903465Z"
}

Not Found #

When there are no Customers or Accounts that have a matching tenant id or Users with the user Id

HTTP/1.1 404 Not Found
Date: Thu, 06 Feb 2020 12:46:58 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 95
{
	"error":404,
	"message":"Not Found",
	"status":"error",
	"timestamp":"2020-02-06T12:46:58.7669535Z"
}

Bad Request #

When the last User with the "user.admin" and "customer.user" role in this Customer tries to have this role removed.

Hand Left warning
There always needs to be a User in a Customer tenant with both the "user.admin" and "customer.user" roles.
HTTP/1.1 400 Bad Request
Date: Thu, 06 Feb 2020 13:12:06 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 132
{
	"error": 400,
	"message": "There must be at least one user administrator.",
	"status": "error",
	"timestamp": "2020-02-06T13:12:06.9741515Z"
}