Skip to main content

Unblock User By ID

Restore access for a suspended user.

Authentication

This endpoint requires a bearer access token for the System API.

Endpoint

PATCH /api/v1/users/{userId}/unblock
Authorization: Bearer YOUR_ACCESS_TOKEN
Content-Type: application/json

Request

Headers

HeaderRequiredDescription
AuthorizationYesBearer token for a System API client
Content-TypeYesMust be application/json

Path Parameters

ParameterTypeRequiredDescription
userIdintegerYesUser identifier. Must be greater than 0.

Query Parameters

This endpoint does not accept query parameters.

Request Body

{
"triggerWebhook": false,
"notifyUserViaEmail": false,
"unblockedByUserId": 9001
}

Request Fields

FieldTypeRequiredDescription
triggerWebhookbooleanNoAccepted by the API for webhook workflow control. Default: false.
notifyUserViaEmailbooleanNoAccepted by the API for user notification workflow control. Default: false.
unblockedByUserIdintegerNoReserved for future versions.

Response

204 No Content

The user was unblocked successfully.

This endpoint does not return a response body on success.

Errors

StatusWhen it happens
401 UnauthorizedThe bearer token is missing, invalid, or expired
403 ForbiddenThe token is valid but does not have access to this endpoint
404 Not FoundNo user exists with the provided userId

404 Example

User not found

Behavior

  • Suspension state is cleared for the user
  • Current access is revoked again so the new state takes effect immediately
  • triggerWebhook is accepted by the endpoint, but this endpoint does not currently expose a documented webhook result
  • notifyUserViaEmail is accepted by the endpoint, but this endpoint does not currently send a documented notification email

Example

cURL

curl -X PATCH "https://your-tenant.guardhouse.cloud/api/v1/users/101/unblock" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"triggerWebhook": false,
"notifyUserViaEmail": false,
"unblockedByUserId": 9001
}'

.NET SDK

using Guardhouse.SDK.Models.Users;
using Guardhouse.SDK.Services;

// Assumes AddGuardhouseClientWithApiClients(...) is already configured.
app.MapPatch("/example/users/{userId:int}/unblock", async (int userId, IGuardhouseUsersClient usersClient) =>
{
var unblocked = await usersClient.UnblockUserAsync(userId, new UnblockUserRequest
{
TriggerWebhook = false,
NotifyUserViaEmail = false,
UnblockedByUserId = 9001
});

return unblocked ? Results.NoContent() : Results.NotFound();
});

Python SDK

# SDK support is in development.
# Use raw HTTP for now.
#
# Example shape:
# response = requests.patch(
# "https://your-tenant.guardhouse.cloud/api/v1/users/101/unblock",
# headers={
# "Authorization": "Bearer YOUR_ACCESS_TOKEN",
# "Content-Type": "application/json",
# },
# json={
# "triggerWebhook": False,
# "notifyUserViaEmail": False,
# "unblockedByUserId": 9001,
# },
# )

Notes