Skip to content

Get Data Type

Retrieve a specific data type by type identifier.


Endpoint

GET /api/datatypes/:type

Retrieves a single data type with its complete configuration including regex patterns or group members.


Authentication

Requires any valid API Key. All keys have read access.


Path Parameters

Parameter Type Description
type string Data type identifier

Response

Returns the complete data type object:

Response Format
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "type": "EMPLOYEE_ID",
  "name": "Employee ID",
  "description": "Company employee identifier format",
  "disabled": false,
  "isGroupDataType": false,
  "isBuiltIn": false,
  "regexes": [
    {
      "regex": "EMP-[0-9]{6}",
      "json": "",
      "html": "",
      "valueGroupIndex": 0
    }
  ],
  "createdAt": 1704067200,
  "updatedAt": 1704153600
}

Response Fields

Field Type Description
type string Type identifier (unique identifier for this data type)
name string Display name
description string Description
disabled boolean Whether type is disabled
isGroupDataType boolean Whether this is a group type
internal integer Internal type indicator (non-zero for built-in types)
regexes array Regex patterns (only for regex types)
dataTypes array Member type identifiers (only for group types)
obfuscations array Associated obfuscation configurations
createdAt integer Unix timestamp when created
updatedAt integer Unix timestamp of last update

Examples

Get Data Type by Type

Retrieve a specific data type to view its configuration.

DATATYPE_TYPE="EMPLOYEE_ID"

curl -X GET "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.get(f"{BASE_URL}/api/datatypes/{datatype_type}", headers=HEADERS)
dt = response.json()

print(f"Data Type: {dt['name']}")
print(f"Type: {dt['type']}")
print(f"Is Group: {dt['isGroupDataType']}")
print(f"Built-in: {dt['isBuiltIn']}")
print(f"Disabled: {dt['disabled']}")
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.get(`${BASE_URL}/api/datatypes/${datatypeType}`, { headers: HEADERS });
const dt = response.data;

console.log(`Data Type: ${dt.name}`);
console.log(`Type: ${dt.type}`);
console.log(`Is Group: ${dt.isGroupDataType}`);
console.log(`Built-in: ${dt.isBuiltIn}`);
console.log(`Disabled: ${dt.disabled}`);

Error Responses

Status Code Description
401 Invalid or expired API key
404 Data type not found