Skip to main content

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​

ParameterTypeRequiredDescription
idUUIDYesResource 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​

FieldTypeRequiredDescription
namestringNoUpdated human-readable resource name
resourceIdentifierstringNoUpdated cloud provider's resource ID
credentialIdUUIDNoSwitch to a different cloud credential
regionstringNoUpdated cloud region
isActivebooleanNoManually enable/disable resource
configobjectNoUpdated 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​

FieldTypeDescription
idUUIDUnique resource identifier (unchanged)
namestringHuman-readable resource name
credentialIdUUIDID of linked cloud credential
credentialNamestringName of linked cloud credential
providerstringCloud provider (unchanged)
resourceTypestringType of resource (unchanged)
resourceIdentifierstringCloud provider's resource ID
regionstringCloud region
configobjectResource-specific configuration
isActivebooleanWhether resource is currently active
lastVerifiedAtstring (ISO 8601)Timestamp of last successful verification
createdAtstring (ISO 8601)Resource creation timestamp (unchanged)
updatedAtstring (ISO 8601)Updated timestamp

Error Responses​

Status CodeErrorDescription
400 Bad RequestVALIDATION_ERRORInvalid request body or field values
401 UnauthorizedUNAUTHORIZEDMissing or invalid authentication token
403 ForbiddenFORBIDDENUser lacks ORG_ADMIN role
404 Not FoundRESOURCE_NOT_FOUNDResource with specified ID does not exist
404 Not FoundCREDENTIAL_NOT_FOUNDSpecified credentialId does not exist (if changing credential)
429 Too Many RequestsRATE_LIMIT_EXCEEDEDRate limit exceeded
500 Internal Server ErrorINTERNAL_ERRORServer 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://app.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://app.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://app.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 provider and resourceType fields cannot be changed after creation
  • When changing credentialId, the new credential must belong to the same organization
  • After updating critical fields like resourceIdentifier or credentialId, verify the resource using the Verify Resource endpoint
  • Setting isActive: false will prevent the resource from being used in new sessions