Skip to content

Updating Applications

Modify existing applications using PUT (full replacement) or PATCH (partial update) operations.


PUT /api/apps/:id

Replace the entire application with new configuration. All fields must be provided.

Endpoint

PUT /api/apps/:id

Authentication

Requires API Key with Policy Definition permission.

Request Body

Same as creating an application - all fields required.

Response

Returns the updated application object with the new configuration.


PATCH /api/apps/:id

Partially update an application. Only specified fields are modified.

Endpoint

PATCH /api/apps/:id

Authentication

Requires API Key with Policy Definition permission.

Request Body

Provide only the fields you want to update:

{
  "description": "Updated description"
}

Response

Returns the updated application object:

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Payment APIs",
  "description": "Updated description",
  "urlFilters": [...],
  "updatedAt": 1704240000
}

Examples

Update Application Description

Change only the description field using PATCH.

APP_ID="550e8400-e29b-41d4-a716-446655440000"

curl -X PATCH "https://your-shield-host:8080/api/apps/$APP_ID" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"description": "Updated payment processing endpoints"}'
import requests

BASE_URL = "https://your-shield-host:8080"
HEADERS = {"Authorization": "Bearer YOUR_API_KEY"}

app_id = "550e8400-e29b-41d4-a716-446655440000"

response = requests.patch(
    f"{BASE_URL}/api/apps/{app_id}",
    headers=HEADERS,
    json={"description": "Updated payment processing endpoints"}
)

print(f"Updated: {response.json()['description']}")
const axios = require('axios');

const BASE_URL = 'https://your-shield-host:8080';
const HEADERS = { 'Authorization': 'Bearer YOUR_API_KEY' };

const appId = '550e8400-e29b-41d4-a716-446655440000';

const response = await axios.patch(
  `${BASE_URL}/api/apps/${appId}`,
  { description: 'Updated payment processing endpoints' },
  { headers: HEADERS }
);

console.log(`Updated: ${response.data.description}`);
Replace Entire Application

Use PUT to completely replace an application's configuration.

APP_ID="550e8400-e29b-41d4-a716-446655440000"

curl -X PUT "https://your-shield-host:8080/api/apps/$APP_ID" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Payment APIs v2",
    "description": "Updated payment processing",
    "urlFilters": [
      {
        "filterType": 1,
        "isWhitelist": false,
        "contentType": ["application/json"],
        "methods": ["POST", "PUT", "PATCH"],
        "filter": "payment.api.company.com",
        "runContentTypeDetection": true
      }
    ]
  }'
import requests

BASE_URL = "https://your-shield-host:8080"
HEADERS = {"Authorization": "Bearer YOUR_API_KEY"}

app_id = "550e8400-e29b-41d4-a716-446655440000"

app = {
    "name": "Payment APIs v2",
    "description": "Updated payment processing",
    "urlFilters": [
        {
            "filterType": 1,
            "isWhitelist": False,
            "contentType": ["application/json"],
            "methods": ["POST", "PUT", "PATCH"],
            "filter": "payment.api.company.com",
            "runContentTypeDetection": True
        }
    ]
}

response = requests.put(f"{BASE_URL}/api/apps/{app_id}", headers=HEADERS, json=app)
print(f"Updated app: {response.json()['name']}")
const axios = require('axios');

const BASE_URL = 'https://your-shield-host:8080';
const HEADERS = { 'Authorization': 'Bearer YOUR_API_KEY' };

const appId = '550e8400-e29b-41d4-a716-446655440000';

const app = {
  name: 'Payment APIs v2',
  description: 'Updated payment processing',
  urlFilters: [
    {
      filterType: 1,
      isWhitelist: false,
      contentType: ['application/json'],
      methods: ['POST', 'PUT', 'PATCH'],
      filter: 'payment\\.api\\.company\\.com',
      runContentTypeDetection: true
    }
  ]
};

const response = await axios.put(`${BASE_URL}/api/apps/${appId}`, app, { headers: HEADERS });
console.log(`Updated app: ${response.data.name}`);

Error Responses

Status Code Description
400 Invalid request body or validation error
401 Invalid or expired API key
403 Insufficient permissions (requires Policy Definition)
404 Application not found
409 Application name already exists (when changing name)