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
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer token for a System API client |
Content-Type | Yes | Must be application/json |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
userId | integer | Yes | User 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
| Field | Type | Required | Description |
|---|---|---|---|
triggerWebhook | boolean | No | Accepted by the API for webhook workflow control. Default: false. |
notifyUserViaEmail | boolean | No | Accepted by the API for user notification workflow control. Default: false. |
unblockedByUserId | integer | No | Reserved for future versions. |
Response
204 No Content
The user was unblocked successfully.
This endpoint does not return a response body on success.
Errors
| Status | When it happens |
|---|---|
401 Unauthorized | The bearer token is missing, invalid, or expired |
403 Forbidden | The token is valid but does not have access to this endpoint |
404 Not Found | No 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
triggerWebhookis accepted by the endpoint, but this endpoint does not currently expose a documented webhook resultnotifyUserViaEmailis 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
- Use Block User By ID to suspend the same user again if needed.
- Use Get User By ID to verify the current status.