Update Application
Update an existing application's configuration. This is a partial update endpoint, only the fields you provide will be updated, all other fields will preserve their current values.
Endpoint
PUT /environments/{envId}/app/{id}
Authentication
Required: Yes (Session or Bearer Token with 2FA)
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
envId | string (UUID) | Yes | Environment ID containing the application |
id | string (UUID) | Yes | Application ID to update |
Request Body
{
"name": "my-updated-app",
"source": {
"image": {
"name": "nginx",
"tag": "1.25-alpine"
}
},
"resources": {
"cpu": 2000,
"memory": 1024,
"storage": 20480
},
"port": 8080,
"environmentVariables": {
"NODE_ENV": "production",
"API_URL": "https://api.example.com",
"DEBUG": "false"
},
"volumes": ["volume-id-1", "volume-id-2"],
"variableSets": ["varset-id-1"],
"files": ["file-id-1"]
}
Request Fields
All fields are optional - only provide the fields you want to update. Fields not included will keep their current values.
| Field | Type | Required | Description |
|---|---|---|---|
name | string | No | Application name |
source.image.name | string | No* | Docker image name (*required if updating image) |
source.image.tag | string | No* | Docker image tag (*required if updating image) |
source.containerRegistryConfigIdRef | string (UUID) | No | Container Registry ID (required for private images) |
command | string | No | Override container command |
args | string | No | Override container arguments |
resources.cpu | string | No | CPU allocation (e.g., "1000m", "2") |
resources.memory | string | No | Memory allocation (e.g., "512Mi", "2Gi") |
resources.storage | string | No | Storage allocation (e.g., "10Gi") |
ports | array | No | Array of port configurations |
publicEndpoint | object | No | Public endpoint configuration |
volumeMounts | array | No | Array of volume mount configurations |
variableSetMounts | array | No | Array of variable set mount configurations |
fileMounts | array | No | Array of file mount configurations |
isActive | boolean | No | Whether the application is active |
Important: This endpoint performs a partial update. You can send just the fields you want to change:
- To update only the image: Send
source.image- To update only resources: Send
resources- To update multiple fields: Send only those fields
- Omitted fields will not be changed
Container Registry Support
Public Images: For public images (Docker Hub, GHCR, etc.), simply provide the image name and tag:
{
"source": {
"image": {
"name": "nginx",
"tag": "1.25-alpine"
}
}
}
Private Images:
For private images, include the containerRegistryConfigIdRef to use your configured Container Registry:
{
"source": {
"image": {
"name": "myregistry.azurecr.io/private-app",
"tag": "v1.0.0"
},
"containerRegistryConfigIdRef": "550e8400-e29b-41d4-a716-446655440000"
}
}
Note: Before using private images, create a Container Registry via Settings → Container Registries or use the Container Registry API. The system will validate that the image exists and is accessible using the registry credentials.
Response
Success Response (200 OK)
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "my-updated-app",
"envIdRef": "660e8400-e29b-41d4-a716-446655440001",
"companyIdRef": "770e8400-e29b-41d4-a716-446655440002",
"source": {
"image": {
"name": "nginx",
"tag": "1.25-alpine"
}
},
"resources": {
"cpu": 2000,
"memory": 1024,
"storage": 20480
},
"hostname": "my-updated-app-abc123",
"port": 8080,
"environmentVariables": {
"NODE_ENV": "production",
"API_URL": "https://api.example.com",
"DEBUG": "false"
},
"isDeleted": false,
"createdBy": "user-123",
"modifiedBy": "user-456",
"version": 2
}
Error Responses
| Status Code | Description |
|---|---|
| 400 | Bad Request - Invalid request body, image not found, or resource quota exceeded |
| 401 | Unauthorized - Invalid or missing authentication |
| 403 | Forbidden - User doesn't have access to this application |
| 404 | Not Found - Application or environment doesn't exist |
| 500 | Internal Server Error |
Examples
Example 1: Update Only the Image (Public)
# Only updates the image, all other settings remain unchanged
curl -X PUT "https://api.thevenin.cloud/environments/{envId}/app/{id}" \
-H "Authorization: Bearer tvn_your_api_token_here" \
-H "Content-Type: application/json" \
-d '{
"source": {
"image": {
"name": "nginx",
"tag": "1.25-alpine"
}
}
}'
Example 2: Update Only Resources
# Only updates CPU and memory, image and other settings stay the same
curl -X PUT "https://api.thevenin.cloud/environments/{envId}/app/{id}" \
-H "Authorization: Bearer tvn_your_api_token_here" \
-H "Content-Type: application/json" \
-d '{
"resourceRequests": {
"cpu": "2000m",
"memory": "2Gi"
}
}'
Example 3: Update Multiple Fields
# Updates name, image, and resources together
curl -X PUT "https://api.thevenin.cloud/environments/{envId}/app/{id}" \
-H "Authorization: Bearer tvn_your_api_token_here" \
-H "Content-Type: application/json" \
-d '{
"name": "my-updated-app",
"source": {
"image": {
"name": "nginx",
"tag": "1.25-alpine"
}
},
"resourceRequests": {
"cpu": "2000m",
"memory": "1Gi",
"filesystemStorage": "20Gi"
}
}'
Example 4: Update to Private Image
# Updates only the image to use a private registry
curl -X PUT "https://api.thevenin.cloud/environments/{envId}/app/{id}" \
-H "Authorization: Bearer tvn_your_api_token_here" \
-H "Content-Type: application/json" \
-d '{
"source": {
"image": {
"name": "ghcr.io/myorg/private-backend",
"tag": "v2.0.0"
},
"containerRegistryConfigIdRef": "550e8400-e29b-41d4-a716-446655440000"
}
}'
Example 5: Update Only Name
# Only changes the application name, everything else stays the same
curl -X PUT "https://api.thevenin.cloud/environments/{envId}/app/{id}" \
-H "Authorization: Bearer tvn_your_api_token_here" \
-H "Content-Type: application/json" \
-d '{
"name": "new-app-name"
}'
Important Notes
Partial Update Behavior
This endpoint performs partial updates (PATCH-like behavior):
✅ What happens:
- Only the fields you include in the request are updated
- All other fields keep their current values
- You can update a single field, multiple fields, or all fields
❌ What does NOT happen:
- Fields are not cleared or reset if omitted
- Empty objects/arrays in the request will update those fields to empty
- Existing data is not overwritten unless you explicitly provide new values
Examples of Persistence:
Current Application State:
{
"name": "my-app",
"source": { "image": { "name": "nginx", "tag": "1.24" } },
"resourceRequests": { "cpu": "1000m", "memory": "512Mi" }
}
Update Request (only name):
{
"name": "my-updated-app"
}
Result:
{
"name": "my-updated-app", // ✅ Updated
"source": { "image": { "name": "nginx", "tag": "1.24" } }, // ✅ Preserved
"resourceRequests": { "cpu": "1000m", "memory": "512Mi" } // ✅ Preserved
}
Additional Notes
- Image Validation: When updating the image, it's validated (30s timeout) to ensure it exists and is accessible
- Private Images: Require
containerRegistryConfigIdRefand the registry must be active - Resource Validation: Resource updates are validated against environment quotas
- Version Increment: Application version increments automatically after each update
- History: Previous versions are preserved for rollback capabilities