Skip to content
Developers/API Documentation
Open Portal

API Documentation

Detect and redact sensitive information in text.

The Magier AI Shield API uses a single REST endpoint. Send your content, choose a detection model, and specify the labels to identify and the transformation to apply.

Use Magier Swift for predefined labels, or Magier Forge for concepts defined by your organization.

On This Page
BASE URL
API server
https://api.magier.ai

One endpoint. Two detection models.

Authentication

Authenticate every request with your API key in the X-Api-Key header. Send the request body as JSON with Content-Type: application/json.

Keep your key on your server. Store it in an environment variable such as MAGIER_API_KEY, and never expose it in client-side code or commit it to source control.

Manage API keys
Required headers
Content-Type: application/json
X-Api-Key: YOUR_API_KEY

Detection Models

Set detector to select the model. Both models use the same endpoint and transform modes.

Magier Swift magier-swift

Optimized for speed. Detects 249 predefined labels, including names, contact details, financial identifiers, and credentials. Use the exact identifiers in the label catalogue.

Magier Forge magier-forge

Optimized for flexibility. Detects dynamically defined concepts such as transaction references, compliance actions, risk classifications, and internal customer identifiers. Supply descriptive labels for the concepts you need.

Both models can be tailored to your organization’s terminology, data, and policies. Specialized models are available where required.

Choose a detector
{
  "detector": "magier-swift",
  "labels": [
    "PERSON_NAME",
    "EMAIL_ADDRESS"
  ]
}

Redact Text

Identify the requested categories in your content and replace detected values using the selected transform mode.

POST/api/dlp/transform/redact

Body Parameters

contentstringrequired

The text to analyze. Send Unicode text in its original language. See the multilingual examples.

detectorstringrequired

The detection model to use.

magier-swiftmagier-forge
labelsarray of stringsrequired

The categories to detect. For Swift, provide exact predefined identifiers. For Forge, provide descriptive, organization-specific labels.

transformobjectrequired

How detected values should be replaced.

Child parameter
modestring · required

Use MASK to preserve the value’s length, or REDACTED to replace it with a fixed word. See transform modes.

Request · cURL
curl https://api.magier.ai/api/dlp/transform/redact \
  -H "X-Api-Key: $MAGIER_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "content": "Customer name: Emma Wilson. Email: emma.wilson@example.com.",
  "detector": "magier-swift",
  "labels": [
    "PERSON_NAME",
    "EMAIL_ADDRESS"
  ],
  "transform": {
    "mode": "MASK"
  }
}'

Set MAGIER_API_KEY in your server environment. For bash or another POSIX-compatible shell.

Transform Modes

Set transform.mode explicitly in your request.

MASK

Replaces each detected value with masking characters while preserving its original length.

REDACTED

Replaces each detected value with the word REDACTED, regardless of the original length.

MASK · illustrative text
Before  layan@example.com
After   *****************
REDACTED · illustrative text
Before  layan@example.com
After   REDACTED

These text examples illustrate replacement behavior, not the API response schema.

Swift Label Catalogue

Magier Swift supports 249 predefined labels across 10 categories. Search by identifier or category, then copy a label into your labels array.

Use identifiers exactly as listed, including capitalization, underscores, and other characters.

Common Banking Labels

  • PERSON_NAME
  • IBAN_CODE
  • CREDIT_CARD_NUMBER
  • FINANCIAL_ACCOUNT_NUMBER
  • SWIFT_CODE
Download the complete catalogue PDF

Using Forge? Define labels for your own concepts. You do not need to select them from this catalogue.

249 of 249 labels
AGENames, identity & demographics
DATE_OF_BIRTHNames, identity & demographics
DEMOGRAPHIC_DATANames, identity & demographics
FEMALE_NAMENames, identity & demographics
FIRST_NAMENames, identity & demographics
GENDERNames, identity & demographics
LAST_NAMENames, identity & demographics
MALE_NAMENames, identity & demographics
PERSON_NAMENames, identity & demographics
COUNTRY_DEMOGRAPHICContact & location
DOMAIN_NAMEContact & location
EMAIL_ADDRESSContact & location
GEOGRAPHIC_DATAContact & location
LOCATIONContact & location
LOCATION_COORDINATESContact & location
PHONE_NUMBERContact & location
STREET_ADDRESSContact & location
URLContact & location
US_STATEContact & location
US_TOLLFREE_PHONE_NUMBERContact & location
AMERICAN_BANKERS_CUSIP_IDFinancial & payment data
AUSTRALIA_TAX_FILE_NUMBERFinancial & payment data
CANADA_BANK_ACCOUNTFinancial & payment data
CREDIT_CARD_DATAFinancial & payment data
CREDIT_CARD_EXPIRATION_DATEFinancial & payment data
CREDIT_CARD_NUMBERFinancial & payment data
CREDIT_CARD_TRACK_NUMBERFinancial & payment data
FINANCIAL_ACCOUNT_NUMBERFinancial & payment data
FINANCIAL_IDFinancial & payment data
FRANCE_TAX_IDENTIFICATION_NUMBERFinancial & payment data
GERMANY_SCHUFA_IDFinancial & payment data
GERMANY_TAXPAYER_IDENTIFICATION_NUMBERFinancial & payment data
IBAN_CODEFinancial & payment data
INDIA_GST_INDIVIDUALFinancial & payment data
JAPAN_BANK_ACCOUNTFinancial & payment data
PARAGUAY_TAX_NUMBERFinancial & payment data
PORTUGAL_NIB_NUMBERFinancial & payment data
SWIFT_CODEFinancial & payment data
UK_TAXPAYER_REFERENCEFinancial & payment data
US_ADOPTION_TAXPAYER_IDENTIFICATION_NUMBERFinancial & payment data
US_BANK_ROUTING_MICRFinancial & payment data
US_INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBERFinancial & payment data
US_PREPARER_TAXPAYER_IDENTIFICATION_NUMBERFinancial & payment data
VAT_NUMBERFinancial & payment data
ARGENTINA_DNI_NUMBERGovernment IDs & travel documents
ARMENIA_PASSPORTGovernment IDs & travel documents
AUSTRALIA_DRIVERS_LICENSE_NUMBERGovernment IDs & travel documents
AUSTRALIA_PASSPORTGovernment IDs & travel documents
AUSTRIA_SOCIAL_SECURITY_NUMBERGovernment IDs & travel documents
AZERBAIJAN_PASSPORTGovernment IDs & travel documents
BELARUS_PASSPORTGovernment IDs & travel documents
BELGIUM_NATIONAL_ID_CARD_NUMBERGovernment IDs & travel documents
BRAZIL_CPF_NUMBERGovernment IDs & travel documents
CANADA_DRIVERS_LICENSE_NUMBERGovernment IDs & travel documents
CANADA_PASSPORTGovernment IDs & travel documents
CANADA_SOCIAL_INSURANCE_NUMBERGovernment IDs & travel documents
CHILE_CDI_NUMBERGovernment IDs & travel documents
CHINA_PASSPORTGovernment IDs & travel documents
CHINA_RESIDENT_ID_NUMBERGovernment IDs & travel documents
COLOMBIA_CDC_NUMBERGovernment IDs & travel documents
CROATIA_PERSONAL_ID_NUMBERGovernment IDs & travel documents
CZECHIA_PASSPORTGovernment IDs & travel documents
CZECHIA_PERSONAL_ID_NUMBERGovernment IDs & travel documents
DENMARK_CPR_NUMBERGovernment IDs & travel documents
DOD_ID_NUMBERGovernment IDs & travel documents
DRIVERS_LICENSE_NUMBERGovernment IDs & travel documents
FINLAND_BUSINESS_IDGovernment IDs & travel documents
FINLAND_NATIONAL_ID_NUMBERGovernment IDs & travel documents
FRANCE_CNIGovernment IDs & travel documents
FRANCE_DRIVERS_LICENSE_NUMBERGovernment IDs & travel documents
FRANCE_NIRGovernment IDs & travel documents
FRANCE_PASSPORTGovernment IDs & travel documents
GERMANY_DRIVERS_LICENSE_NUMBERGovernment IDs & travel documents
GERMANY_IDENTITY_CARD_NUMBERGovernment IDs & travel documents
GERMANY_PASSPORTGovernment IDs & travel documents
GOVERNMENT_IDGovernment IDs & travel documents
HONG_KONG_ID_NUMBERGovernment IDs & travel documents
IMMIGRATION_STATUSGovernment IDs & travel documents
INDIA_AADHAAR_INDIVIDUALGovernment IDs & travel documents
INDIA_PAN_INDIVIDUALGovernment IDs & travel documents
INDIA_PASSPORTGovernment IDs & travel documents
INDONESIA_NIK_NUMBERGovernment IDs & travel documents
INDONESIA_PASSPORTGovernment IDs & travel documents
IRELAND_DRIVING_LICENSE_NUMBERGovernment IDs & travel documents
IRELAND_EIRCODEGovernment IDs & travel documents
IRELAND_PASSPORTGovernment IDs & travel documents
IRELAND_PPSNGovernment IDs & travel documents
ISRAEL_IDENTITY_CARD_NUMBERGovernment IDs & travel documents
ITALY_FISCAL_CODEGovernment IDs & travel documents
ITALY_PASSPORTGovernment IDs & travel documents
JAPAN_CORPORATE_NUMBERGovernment IDs & travel documents
JAPAN_DRIVERS_LICENSE_NUMBERGovernment IDs & travel documents
JAPAN_INDIVIDUAL_NUMBERGovernment IDs & travel documents
JAPAN_PASSPORTGovernment IDs & travel documents
KAZAKHSTAN_PASSPORTGovernment IDs & travel documents
KOREA_DRIVERS_LICENSE_NUMBERGovernment IDs & travel documents
KOREA_PASSPORTGovernment IDs & travel documents
KOREA_RRNGovernment IDs & travel documents
MEXICO_CURP_NUMBERGovernment IDs & travel documents
MEXICO_PASSPORTGovernment IDs & travel documents
NETHERLANDS_BSN_NUMBERGovernment IDs & travel documents
NETHERLANDS_PASSPORTGovernment IDs & travel documents
NEW_ZEALAND_DRIVERS_LICENSE_NUMBERGovernment IDs & travel documents
NEW_ZEALAND_IRD_NUMBERGovernment IDs & travel documents
PARAGUAY_CIC_NUMBERGovernment IDs & travel documents
PASSPORTGovernment IDs & travel documents
PERU_DNI_NUMBERGovernment IDs & travel documents
POLAND_NATIONAL_ID_NUMBERGovernment IDs & travel documents
POLAND_PASSPORTGovernment IDs & travel documents
POLAND_PESEL_NUMBERGovernment IDs & travel documents
PORTUGAL_CDC_NUMBERGovernment IDs & travel documents
PORTUGAL_SOCIAL_SECURITY_NUMBERGovernment IDs & travel documents
RUSSIA_PASSPORTGovernment IDs & travel documents
SINGAPORE_NATIONAL_REGISTRATION_ID_NUMBERGovernment IDs & travel documents
SINGAPORE_PASSPORTGovernment IDs & travel documents
SOUTH_AFRICA_ID_NUMBERGovernment IDs & travel documents
SPAIN_CIF_NUMBERGovernment IDs & travel documents
SPAIN_DNI_NUMBERGovernment IDs & travel documents
SPAIN_DRIVERS_LICENSE_NUMBERGovernment IDs & travel documents
SPAIN_NIE_NUMBERGovernment IDs & travel documents
SPAIN_NIF_NUMBERGovernment IDs & travel documents
SPAIN_PASSPORTGovernment IDs & travel documents
SPAIN_SOCIAL_SECURITY_NUMBERGovernment IDs & travel documents
SWEDEN_NATIONAL_ID_NUMBERGovernment IDs & travel documents
SWEDEN_PASSPORTGovernment IDs & travel documents
SWITZERLAND_SOCIAL_SECURITY_NUMBERGovernment IDs & travel documents
TAIWAN_ID_NUMBERGovernment IDs & travel documents
TAIWAN_PASSPORTGovernment IDs & travel documents
THAILAND_NATIONAL_ID_NUMBERGovernment IDs & travel documents
TURKEY_ID_NUMBERGovernment IDs & travel documents
UK_DRIVERS_LICENSE_NUMBERGovernment IDs & travel documents
UK_ELECTORAL_ROLL_NUMBERGovernment IDs & travel documents
UK_NATIONAL_INSURANCE_NUMBERGovernment IDs & travel documents
UK_PASSPORTGovernment IDs & travel documents
UKRAINE_PASSPORTGovernment IDs & travel documents
URUGUAY_CDI_NUMBERGovernment IDs & travel documents
US_DRIVERS_LICENSE_NUMBERGovernment IDs & travel documents
US_EMPLOYER_IDENTIFICATION_NUMBERGovernment IDs & travel documents
US_PASSPORTGovernment IDs & travel documents
US_SOCIAL_SECURITY_NUMBERGovernment IDs & travel documents
US_VEHICLE_IDENTIFICATION_NUMBERGovernment IDs & travel documents
UZBEKISTAN_PASSPORTGovernment IDs & travel documents
VEHICLE_IDENTIFICATION_NUMBERGovernment IDs & travel documents
VENEZUELA_CDI_NUMBERGovernment IDs & travel documents
AUSTRALIA_MEDICARE_NUMBERHealth & medical data
BLOOD_TYPEHealth & medical data
CANADA_BC_PHNHealth & medical data
CANADA_OHIPHealth & medical data
CANADA_QUEBEC_HINHealth & medical data
FDA_CODEHealth & medical data
ICD10_CODEHealth & medical data
ICD9_CODEHealth & medical data
MEDICAL_DATAHealth & medical data
MEDICAL_IDHealth & medical data
MEDICAL_RECORD_NUMBERHealth & medical data
MEDICAL_TERMHealth & medical data
NEW_ZEALAND_NHI_NUMBERHealth & medical data
SCOTLAND_COMMUNITY_HEALTH_INDEX_NUMBERHealth & medical data
UK_NATIONAL_HEALTH_SERVICE_NUMBERHealth & medical data
US_DEA_NUMBERHealth & medical data
US_HEALTHCARE_NPIHealth & medical data
US_MEDICARE_BENEFICIARY_ID_NUMBERHealth & medical data
AUTH_TOKENCredentials, secrets & authentication
AWS_CREDENTIALSCredentials, secrets & authentication
AZURE_AUTH_TOKENCredentials, secrets & authentication
BASIC_AUTH_HEADERCredentials, secrets & authentication
ENCRYPTION_KEYCredentials, secrets & authentication
GCP_API_KEYCredentials, secrets & authentication
GCP_CREDENTIALSCredentials, secrets & authentication
JSON_WEB_TOKENCredentials, secrets & authentication
OAUTH_CLIENT_SECRETCredentials, secrets & authentication
PASSWORDCredentials, secrets & authentication
SECURITY_DATACredentials, secrets & authentication
SSL_CERTIFICATECredentials, secrets & authentication
STORAGE_SIGNED_URLCredentials, secrets & authentication
TINK_KEYSETCredentials, secrets & authentication
WEAK_PASSWORD_HASHCredentials, secrets & authentication
XSRF_TOKENCredentials, secrets & authentication
ADVERTISING_IDTechnical & device identifiers
HTTP_COOKIETechnical & device identifiers
HTTP_USER_AGENTTechnical & device identifiers
ICCID_NUMBERTechnical & device identifiers
IMEI_HARDWARE_IDTechnical & device identifiers
IMSI_IDTechnical & device identifiers
IP_ADDRESSTechnical & device identifiers
MAC_ADDRESSTechnical & device identifiers
MAC_ADDRESS_LOCALTechnical & device identifiers
MAC_ADDRESS_UNIVERSALTechnical & device identifiers
TECHNICAL_IDTechnical & device identifiers
DOCUMENT_TYPE/CONTEXT/FINANCEDocuments, files & content
DOCUMENT_TYPE/CONTEXT/HEALTHDocuments, files & content
DOCUMENT_TYPE/CONTEXT/LEGALDocuments, files & content
DOCUMENT_TYPE/CONTEXT/OBSCENEDocuments, files & content
DOCUMENT_TYPE/CONTEXT/OFFENSIVEDocuments, files & content
DOCUMENT_TYPE/CONTEXT/POLITICSDocuments, files & content
DOCUMENT_TYPE/CONTEXT/RELIGIONDocuments, files & content
DOCUMENT_TYPE/CONTEXT/SEXUALDocuments, files & content
DOCUMENT_TYPE/FINANCE/INVOICEDocuments, files & content
DOCUMENT_TYPE/FINANCE/REGULATORYDocuments, files & content
DOCUMENT_TYPE/FINANCE/SEC_FILINGDocuments, files & content
DOCUMENT_TYPE/HR/RESUMEDocuments, files & content
DOCUMENT_TYPE/LEGAL/BLANK_FORMDocuments, files & content
DOCUMENT_TYPE/LEGAL/BRIEFDocuments, files & content
DOCUMENT_TYPE/LEGAL/COURT_ORDERDocuments, files & content
DOCUMENT_TYPE/LEGAL/LAWDocuments, files & content
DOCUMENT_TYPE/LEGAL/PLEADINGDocuments, files & content
DOCUMENT_TYPE/MEDICAL/RECORDDocuments, files & content
DOCUMENT_TYPE/R&D/DATABASE_BACKUPDocuments, files & content
DOCUMENT_TYPE/R&D/PATENTDocuments, files & content
DOCUMENT_TYPE/R&D/SOURCE_CODEDocuments, files & content
DOCUMENT_TYPE/R&D/SOURCE_CODE/CDocuments, files & content
DOCUMENT_TYPE/R&D/SOURCE_CODE/CPPDocuments, files & content
DOCUMENT_TYPE/R&D/SOURCE_CODE/CSDocuments, files & content
DOCUMENT_TYPE/R&D/SOURCE_CODE/GODocuments, files & content
DOCUMENT_TYPE/R&D/SOURCE_CODE/HTMLDocuments, files & content
DOCUMENT_TYPE/R&D/SOURCE_CODE/JAVADocuments, files & content
DOCUMENT_TYPE/R&D/SOURCE_CODE/JAVASCRIPTDocuments, files & content
DOCUMENT_TYPE/R&D/SOURCE_CODE/JSONDocuments, files & content
DOCUMENT_TYPE/R&D/SOURCE_CODE/PHPDocuments, files & content
DOCUMENT_TYPE/R&D/SOURCE_CODE/POWERSHELLDocuments, files & content
DOCUMENT_TYPE/R&D/SOURCE_CODE/PYTHONDocuments, files & content
DOCUMENT_TYPE/R&D/SOURCE_CODE/RUSTDocuments, files & content
DOCUMENT_TYPE/R&D/SOURCE_CODE/SHELLDocuments, files & content
DOCUMENT_TYPE/R&D/SOURCE_CODE/SQLDocuments, files & content
DOCUMENT_TYPE/R&D/SOURCE_CODE/TYPESCRIPTDocuments, files & content
DOCUMENT_TYPE/R&D/SYSTEM_LOGDocuments, files & content
OBJECT_TYPE/BARCODEDocuments, files & content
OBJECT_TYPE/LICENSE_PLATEDocuments, files & content
OBJECT_TYPE/PERSONDocuments, files & content
OBJECT_TYPE/PERSON/PASSPORTDocuments, files & content
OBJECT_TYPE/PERSON/PHOTO_ID_CARDDocuments, files & content
OBJECT_TYPE/WHITEBOARDDocuments, files & content
STORAGE_SIGNED_POLICY_DOCUMENTDocuments, files & content
CRIME_STATUSLegal, employment & sensitive context
EMPLOYMENT_STATUSLegal, employment & sensitive context
ETHNIC_GROUPLegal, employment & sensitive context
MARITAL_STATUSLegal, employment & sensitive context
ORGANIZATION_NAMELegal, employment & sensitive context
POLITICAL_TERMLegal, employment & sensitive context
RELIGIOUS_TERMLegal, employment & sensitive context
SEXUAL_ORIENTATIONLegal, employment & sensitive context
TRADE_UNIONLegal, employment & sensitive context
BRAZIL_RG_NUMBEROther identifiers
CVV_NUMBEROther identifiers
DATEOther identifiers
GENERIC_IDOther identifiers
KOREA_ARNOther identifiers
NORWAY_NI_NUMBEROther identifiers
TIMEOther identifiers

Multilingual Examples

Explore tested requests in English, German, French, and Spanish. Each example uses synthetic banking data. Choose a language, model, and transform to see the request and its captured output.

Business Account Onboarding

Swift identifies a customer’s full name, email address, and IBAN using PERSON_NAME, EMAIL_ADDRESS, and IBAN_CODE. The label identifiers stay the same across content languages.

Transaction and Compliance Review

Forge identifies transaction references, compliance actions, and risk classifications. These examples use the same descriptive English labels with text in each of the four languages.

All eight requests were tested with both MASK and REDACTED. Detection results depend on the content and model configuration; test your own data before integrating.

English · request body
{
  "content": "Business account application. Customer name: Emma Wilson. Email: emma.wilson@example.com. IBAN: DE89 3704 0044 0532 0130 00.",
  "detector": "magier-swift",
  "labels": [
    "PERSON_NAME",
    "EMAIL_ADDRESS",
    "IBAN_CODE"
  ],
  "transform": {
    "mode": "MASK"
  }
}
HTTP 200 · 3 of 3 requested labels detected
Actual response · redacted_content
Business account application. Customer name: ***********. Email: ***********************. IBAN: ***************************.

Captured from the live API on September 18, 2026. The output above is the response’s redacted_content field, not the full JSON response.

Handle Responses

Check the HTTP status before consuming the response. Treat a non-success status as a failed request and inspect the response body for details.

For authentication failures, check that you supplied the correct key in X-Api-Key. For request errors, check the detector, label identifiers, and transform mode.

Use to inspect the actual response for your request. Avoid logging API keys, original sensitive content, or unredacted responses.

Get integration help
Check the response · Node.js
// After sending your request
if (!response.ok) {
  const details = await response.text();
  throw new Error(
    `Magier Shield: ${response.status} ${details}`
  );
}

const result = await response.json();