Skip to main content

Get Role

Retrieve details of a specific role by its ID.

Request

GET 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

ParameterTypeRequiredDescription
idUUIDYesThe unique identifier of the role

Response

Returns the role object.

Response Schema

{
"id": "uuid",
"name": "string",
"description": "string",
"maxSessionDurationHours": "integer",
"resourceIds": ["uuid"],
"userIds": ["uuid"],
"createdAt": "timestamp",
"updatedAt": "timestamp"
}
FieldTypeDescription
idUUIDUnique identifier for the role
namestringRole name
descriptionstringOptional role description
maxSessionDurationHoursintegerMaximum session duration in hours for users with this role
resourceIdsUUID[]Array of cloud resource IDs assigned to this role
userIdsUUID[]Array of user IDs assigned to this role
createdAttimestampISO 8601 timestamp when the role was created
updatedAttimestampISO 8601 timestamp when the role was last updated

Success Response

Status Code: 200 OK

{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "DevOps Team",
"description": "Full access to production resources",
"maxSessionDurationHours": 24,
"resourceIds": [
"660e8400-e29b-41d4-a716-446655440001",
"660e8400-e29b-41d4-a716-446655440002"
],
"userIds": [
"770e8400-e29b-41d4-a716-446655440003",
"770e8400-e29b-41d4-a716-446655440004"
],
"createdAt": "2026-02-18T10:30:00Z",
"updatedAt": "2026-02-18T10:30:00Z"
}

Error Responses

Status CodeDescription
401 UnauthorizedMissing or invalid authentication token
403 ForbiddenUser does not have ORG_ADMIN role
404 Not FoundRole with the specified ID does not exist in this organization
429 Too Many RequestsRate limit exceeded
500 Internal Server ErrorServer error occurred

Error Response Examples:

{
"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 GET https://api.entryguard.io/api/v1/roles/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

Response

{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "DevOps Team",
"description": "Full access to production resources",
"maxSessionDurationHours": 24,
"resourceIds": [
"660e8400-e29b-41d4-a716-446655440001",
"660e8400-e29b-41d4-a716-446655440002"
],
"userIds": [
"770e8400-e29b-41d4-a716-446655440003",
"770e8400-e29b-41d4-a716-446655440004"
],
"createdAt": "2026-02-18T10:30:00Z",
"updatedAt": "2026-02-18T10:30:00Z"
}