Update Role
Update properties of an existing role. All fields are optional.
Request
PATCH https://api.entryguard.io/api/v1/roles/{id}
Authentication
Requires a valid Bearer JWT token with ORG_ADMIN role.
Authorization: Bearer <access_token>
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | UUID | Yes | The unique identifier of the role to update |
Request Body
{
"name": "string",
"description": "string",
"maxSessionDurationHours": "integer"
}
| Field | Type | Required | Description |
|---|---|---|---|
name | string | No | New role name (must be unique within the organization) |
description | string | No | New role description |
maxSessionDurationHours | integer | No | New maximum session duration in hours |
All fields are optional. Only provided fields will be updated.
Response
Returns the updated role object.
Response Schema
{
"id": "uuid",
"name": "string",
"description": "string",
"maxSessionDurationHours": "integer",
"resourceIds": ["uuid"],
"userIds": ["uuid"],
"createdAt": "timestamp",
"updatedAt": "timestamp"
}
Success Response
Status Code: 200 OK
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Senior DevOps Team",
"description": "Full access to production resources with extended sessions",
"maxSessionDurationHours": 48,
"resourceIds": [
"660e8400-e29b-41d4-a716-446655440001",
"660e8400-e29b-41d4-a716-446655440002"
],
"userIds": [
"770e8400-e29b-41d4-a716-446655440003"
],
"createdAt": "2026-02-18T10:30:00Z",
"updatedAt": "2026-02-18T15:45:00Z"
}
Error Responses
| Status Code | Description |
|---|---|
400 Bad Request | Invalid request body or duplicate role name |
401 Unauthorized | Missing or invalid authentication token |
403 Forbidden | User does not have ORG_ADMIN role |
404 Not Found | Role with the specified ID does not exist in this organization |
429 Too Many Requests | Rate limit exceeded |
500 Internal Server Error | Server error occurred |
Error Response Examples:
{
"timestamp": "2026-02-18T10:30:00Z",
"status": 400,
"error": "Bad Request",
"message": "A role with name 'Senior DevOps Team' already exists",
"path": "/api/v1/roles/550e8400-e29b-41d4-a716-446655440000"
}
{
"timestamp": "2026-02-18T10:30:00Z",
"status": 404,
"error": "Not Found",
"message": "Role not found with id: 550e8400-e29b-41d4-a716-446655440000",
"path": "/api/v1/roles/550e8400-e29b-41d4-a716-446655440000"
}
Example
Request
curl -X PATCH https://api.entryguard.io/api/v1/roles/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
-H "Content-Type: application/json" \
-d '{
"name": "Senior DevOps Team",
"description": "Full access to production resources with extended sessions",
"maxSessionDurationHours": 48
}'
Response
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Senior DevOps Team",
"description": "Full access to production resources with extended sessions",
"maxSessionDurationHours": 48,
"resourceIds": [
"660e8400-e29b-41d4-a716-446655440001",
"660e8400-e29b-41d4-a716-446655440002"
],
"userIds": [
"770e8400-e29b-41d4-a716-446655440003"
],
"createdAt": "2026-02-18T10:30:00Z",
"updatedAt": "2026-02-18T15:45:00Z"
}