Update Resource
Updates an existing cloud resource. This is a partial update endpoint - only the fields you provide will be changed.
Request
PATCH /resources/{id}
Authentication
Requires Bearer JWT Token with ORG_ADMIN role.
Authorization: Bearer <access_token>
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | UUID | Yes | Resource unique identifier |
Request Body
All fields are optional. Only include fields you want to update.
{
"name": "Production API Gateway - Updated",
"resourceIdentifier": "sg-0abc123def456789",
"credentialId": "8d0f7780-8536-51f0-c958-f18ed2g01bf8",
"region": "eu-west-1",
"isActive": true,
"config": {
"port": 8443,
"protocol": "tcp"
}
}
Body Parameters
| Field | Type | Required | Description |
|---|---|---|---|
name | string | No | Updated human-readable resource name |
resourceIdentifier | string | No | Updated cloud provider's resource ID |
credentialId | UUID | No | Switch to a different cloud credential |
region | string | No | Updated cloud region |
isActive | boolean | No | Manually enable/disable resource |
config | object | No | Updated resource-specific configuration |
Response
Success Response
Status Code: 200 OK
Response Body:
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Production API Gateway - Updated",
"credentialId": "8d0f7780-8536-51f0-c958-f18ed2g01bf8",
"credentialName": "AWS Backup Account",
"provider": "AWS",
"resourceType": "SECURITY_GROUP",
"resourceIdentifier": "sg-0abc123def456789",
"region": "eu-west-1",
"config": {
"port": 8443,
"protocol": "tcp"
},
"isActive": true,
"lastVerifiedAt": "2026-02-18T10:30:00Z",
"createdAt": "2026-01-15T08:00:00Z",
"updatedAt": "2026-02-18T11:30:00Z"
}
Response Fields
| Field | Type | Description |
|---|---|---|
id | UUID | Unique resource identifier (unchanged) |
name | string | Human-readable resource name |
credentialId | UUID | ID of linked cloud credential |
credentialName | string | Name of linked cloud credential |
provider | string | Cloud provider (unchanged) |
resourceType | string | Type of resource (unchanged) |
resourceIdentifier | string | Cloud provider's resource ID |
region | string | Cloud region |
config | object | Resource-specific configuration |
isActive | boolean | Whether resource is currently active |
lastVerifiedAt | string (ISO 8601) | Timestamp of last successful verification |
createdAt | string (ISO 8601) | Resource creation timestamp (unchanged) |
updatedAt | string (ISO 8601) | Updated timestamp |
Error Responses
| Status Code | Error | Description |
|---|---|---|
400 Bad Request | VALIDATION_ERROR | Invalid request body or field values |
401 Unauthorized | UNAUTHORIZED | Missing or invalid authentication token |
403 Forbidden | FORBIDDEN | User lacks ORG_ADMIN role |
404 Not Found | RESOURCE_NOT_FOUND | Resource with specified ID does not exist |
404 Not Found | CREDENTIAL_NOT_FOUND | Specified credentialId does not exist (if changing credential) |
429 Too Many Requests | RATE_LIMIT_EXCEEDED | Rate limit exceeded |
500 Internal Server Error | INTERNAL_ERROR | Server error occurred |
Error Response Example
{
"error": "VALIDATION_ERROR",
"message": "Invalid resource identifier format",
"timestamp": "2026-02-18T11:30:00Z"
}
Example
Request - Update Name and Config
curl -X PATCH https://api.entryguard.io/api/v1/resources/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
-H "Content-Type: application/json" \
-d '{
"name": "Production API Gateway - Updated",
"config": {
"port": 8443,
"protocol": "tcp"
}
}'
Request - Change Credential
curl -X PATCH https://api.entryguard.io/api/v1/resources/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
-H "Content-Type: application/json" \
-d '{
"credentialId": "8d0f7780-8536-51f0-c958-f18ed2g01bf8"
}'
Request - Disable Resource
curl -X PATCH https://api.entryguard.io/api/v1/resources/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
-H "Content-Type: application/json" \
-d '{
"isActive": false
}'
Response
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Production API Gateway - Updated",
"credentialId": "8d0f7780-8536-51f0-c958-f18ed2g01bf8",
"credentialName": "AWS Backup Account",
"provider": "AWS",
"resourceType": "SECURITY_GROUP",
"resourceIdentifier": "sg-0abc123def456",
"region": "eu-central-1",
"config": {
"port": 8443,
"protocol": "tcp"
},
"isActive": true,
"lastVerifiedAt": "2026-02-18T10:30:00Z",
"createdAt": "2026-01-15T08:00:00Z",
"updatedAt": "2026-02-18T11:30:00Z"
}
Notes
- This is a partial update - only send the fields you want to change
- The
providerandresourceTypefields cannot be changed after creation - When changing
credentialId, the new credential must belong to the same organization - After updating critical fields like
resourceIdentifierorcredentialId, verify the resource using the Verify Resource endpoint - Setting
isActive: falsewill prevent the resource from being used in new sessions