Skip to content

Deleting Data Types

Delete custom data types that are no longer needed.

Note: Built-in data types cannot be deleted.


Endpoint

DELETE /api/datatypes/:type

Permanently deletes a custom data type. Built-in data types cannot be deleted.


Authentication

Requires API Key with Admin permission.


Path Parameters

Parameter Type Description
type string Data type identifier

Response

Returns 204 No Content on successful deletion.


Behavior

When deleting a data type:

  • Built-in types cannot be deleted - Only custom data types can be removed
  • Referenced by obfuscations - Obfuscations using this type will fail
  • Referenced by group types - Groups containing this type will be invalid
  • Permanent deletion - Cannot be undone via API

Examples

Delete a Custom Data Type

Delete a custom data type by its ID.

DATATYPE_TYPE="EMPLOYEE_ID"

curl -X DELETE "https://your-shield-host:8080/api/datatypes/$DATATYPE_TYPE" \
  -H "Authorization: Bearer YOUR_API_KEY"
import requests

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

datatype_type = "EMPLOYEE_ID"

response = requests.delete(f"{BASE_URL}/api/datatypes/{datatype_type}", headers=HEADERS)

if response.status_code == 204:
    print("Data type deleted successfully")
const axios = require('axios');

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

const datatypeType = 'EMPLOYEE_ID';

const response = await axios.delete(`${BASE_URL}/api/datatypes/${datatypeType}`, { headers: HEADERS });

if (response.status === 204) {
  console.log('Data type deleted successfully');
}

Error Responses

Status Code Description
401 Invalid or expired API key
403 Insufficient permissions or attempting to delete built-in type
404 Data type not found

Important Notes

  • Check dependencies first - Before deleting, verify no obfuscations or groups reference this type
  • Use disable instead - Consider disabling the type temporarily rather than deleting
  • Cannot be restored - Deleted data types cannot be recovered via API