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
https://api.magier.aiOne 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.
Content-Type: application/json
X-Api-Key: YOUR_API_KEYDetection 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.
{
"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.
/api/dlp/transform/redactBody Parameters
contentstringrequiredThe text to analyze. Send Unicode text in its original language. See the multilingual examples.
detectorstringrequiredThe detection model to use.
magier-swiftmagier-forgelabelsarray of stringsrequiredThe categories to detect. For Swift, provide exact predefined identifiers. For Forge, provide descriptive, organization-specific labels.
transformobjectrequiredHow detected values should be replaced.
Child parameter
modestring · requiredUse MASK to preserve the value’s length, or REDACTED to replace it with a fixed word. See transform modes.
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.
Before layan@example.com
After *****************Before layan@example.com
After REDACTEDThese 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_NAMEIBAN_CODECREDIT_CARD_NUMBERFINANCIAL_ACCOUNT_NUMBERSWIFT_CODE
Using Forge? Define labels for your own concepts. You do not need to select them from this catalogue.
AGENames, identity & demographicsDATE_OF_BIRTHNames, identity & demographicsDEMOGRAPHIC_DATANames, identity & demographicsFEMALE_NAMENames, identity & demographicsFIRST_NAMENames, identity & demographicsGENDERNames, identity & demographicsLAST_NAMENames, identity & demographicsMALE_NAMENames, identity & demographicsPERSON_NAMENames, identity & demographicsCOUNTRY_DEMOGRAPHICContact & locationDOMAIN_NAMEContact & locationEMAIL_ADDRESSContact & locationGEOGRAPHIC_DATAContact & locationLOCATIONContact & locationLOCATION_COORDINATESContact & locationPHONE_NUMBERContact & locationSTREET_ADDRESSContact & locationURLContact & locationUS_STATEContact & locationUS_TOLLFREE_PHONE_NUMBERContact & locationAMERICAN_BANKERS_CUSIP_IDFinancial & payment dataAUSTRALIA_TAX_FILE_NUMBERFinancial & payment dataCANADA_BANK_ACCOUNTFinancial & payment dataCREDIT_CARD_DATAFinancial & payment dataCREDIT_CARD_EXPIRATION_DATEFinancial & payment dataCREDIT_CARD_NUMBERFinancial & payment dataCREDIT_CARD_TRACK_NUMBERFinancial & payment dataFINANCIAL_ACCOUNT_NUMBERFinancial & payment dataFINANCIAL_IDFinancial & payment dataFRANCE_TAX_IDENTIFICATION_NUMBERFinancial & payment dataGERMANY_SCHUFA_IDFinancial & payment dataGERMANY_TAXPAYER_IDENTIFICATION_NUMBERFinancial & payment dataIBAN_CODEFinancial & payment dataINDIA_GST_INDIVIDUALFinancial & payment dataJAPAN_BANK_ACCOUNTFinancial & payment dataPARAGUAY_TAX_NUMBERFinancial & payment dataPORTUGAL_NIB_NUMBERFinancial & payment dataSWIFT_CODEFinancial & payment dataUK_TAXPAYER_REFERENCEFinancial & payment dataUS_ADOPTION_TAXPAYER_IDENTIFICATION_NUMBERFinancial & payment dataUS_BANK_ROUTING_MICRFinancial & payment dataUS_INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBERFinancial & payment dataUS_PREPARER_TAXPAYER_IDENTIFICATION_NUMBERFinancial & payment dataVAT_NUMBERFinancial & payment dataARGENTINA_DNI_NUMBERGovernment IDs & travel documentsARMENIA_PASSPORTGovernment IDs & travel documentsAUSTRALIA_DRIVERS_LICENSE_NUMBERGovernment IDs & travel documentsAUSTRALIA_PASSPORTGovernment IDs & travel documentsAUSTRIA_SOCIAL_SECURITY_NUMBERGovernment IDs & travel documentsAZERBAIJAN_PASSPORTGovernment IDs & travel documentsBELARUS_PASSPORTGovernment IDs & travel documentsBELGIUM_NATIONAL_ID_CARD_NUMBERGovernment IDs & travel documentsBRAZIL_CPF_NUMBERGovernment IDs & travel documentsCANADA_DRIVERS_LICENSE_NUMBERGovernment IDs & travel documentsCANADA_PASSPORTGovernment IDs & travel documentsCANADA_SOCIAL_INSURANCE_NUMBERGovernment IDs & travel documentsCHILE_CDI_NUMBERGovernment IDs & travel documentsCHINA_PASSPORTGovernment IDs & travel documentsCHINA_RESIDENT_ID_NUMBERGovernment IDs & travel documentsCOLOMBIA_CDC_NUMBERGovernment IDs & travel documentsCROATIA_PERSONAL_ID_NUMBERGovernment IDs & travel documentsCZECHIA_PASSPORTGovernment IDs & travel documentsCZECHIA_PERSONAL_ID_NUMBERGovernment IDs & travel documentsDENMARK_CPR_NUMBERGovernment IDs & travel documentsDOD_ID_NUMBERGovernment IDs & travel documentsDRIVERS_LICENSE_NUMBERGovernment IDs & travel documentsFINLAND_BUSINESS_IDGovernment IDs & travel documentsFINLAND_NATIONAL_ID_NUMBERGovernment IDs & travel documentsFRANCE_CNIGovernment IDs & travel documentsFRANCE_DRIVERS_LICENSE_NUMBERGovernment IDs & travel documentsFRANCE_NIRGovernment IDs & travel documentsFRANCE_PASSPORTGovernment IDs & travel documentsGERMANY_DRIVERS_LICENSE_NUMBERGovernment IDs & travel documentsGERMANY_IDENTITY_CARD_NUMBERGovernment IDs & travel documentsGERMANY_PASSPORTGovernment IDs & travel documentsGOVERNMENT_IDGovernment IDs & travel documentsHONG_KONG_ID_NUMBERGovernment IDs & travel documentsIMMIGRATION_STATUSGovernment IDs & travel documentsINDIA_AADHAAR_INDIVIDUALGovernment IDs & travel documentsINDIA_PAN_INDIVIDUALGovernment IDs & travel documentsINDIA_PASSPORTGovernment IDs & travel documentsINDONESIA_NIK_NUMBERGovernment IDs & travel documentsINDONESIA_PASSPORTGovernment IDs & travel documentsIRELAND_DRIVING_LICENSE_NUMBERGovernment IDs & travel documentsIRELAND_EIRCODEGovernment IDs & travel documentsIRELAND_PASSPORTGovernment IDs & travel documentsIRELAND_PPSNGovernment IDs & travel documentsISRAEL_IDENTITY_CARD_NUMBERGovernment IDs & travel documentsITALY_FISCAL_CODEGovernment IDs & travel documentsITALY_PASSPORTGovernment IDs & travel documentsJAPAN_CORPORATE_NUMBERGovernment IDs & travel documentsJAPAN_DRIVERS_LICENSE_NUMBERGovernment IDs & travel documentsJAPAN_INDIVIDUAL_NUMBERGovernment IDs & travel documentsJAPAN_PASSPORTGovernment IDs & travel documentsKAZAKHSTAN_PASSPORTGovernment IDs & travel documentsKOREA_DRIVERS_LICENSE_NUMBERGovernment IDs & travel documentsKOREA_PASSPORTGovernment IDs & travel documentsKOREA_RRNGovernment IDs & travel documentsMEXICO_CURP_NUMBERGovernment IDs & travel documentsMEXICO_PASSPORTGovernment IDs & travel documentsNETHERLANDS_BSN_NUMBERGovernment IDs & travel documentsNETHERLANDS_PASSPORTGovernment IDs & travel documentsNEW_ZEALAND_DRIVERS_LICENSE_NUMBERGovernment IDs & travel documentsNEW_ZEALAND_IRD_NUMBERGovernment IDs & travel documentsPARAGUAY_CIC_NUMBERGovernment IDs & travel documentsPASSPORTGovernment IDs & travel documentsPERU_DNI_NUMBERGovernment IDs & travel documentsPOLAND_NATIONAL_ID_NUMBERGovernment IDs & travel documentsPOLAND_PASSPORTGovernment IDs & travel documentsPOLAND_PESEL_NUMBERGovernment IDs & travel documentsPORTUGAL_CDC_NUMBERGovernment IDs & travel documentsPORTUGAL_SOCIAL_SECURITY_NUMBERGovernment IDs & travel documentsRUSSIA_PASSPORTGovernment IDs & travel documentsSINGAPORE_NATIONAL_REGISTRATION_ID_NUMBERGovernment IDs & travel documentsSINGAPORE_PASSPORTGovernment IDs & travel documentsSOUTH_AFRICA_ID_NUMBERGovernment IDs & travel documentsSPAIN_CIF_NUMBERGovernment IDs & travel documentsSPAIN_DNI_NUMBERGovernment IDs & travel documentsSPAIN_DRIVERS_LICENSE_NUMBERGovernment IDs & travel documentsSPAIN_NIE_NUMBERGovernment IDs & travel documentsSPAIN_NIF_NUMBERGovernment IDs & travel documentsSPAIN_PASSPORTGovernment IDs & travel documentsSPAIN_SOCIAL_SECURITY_NUMBERGovernment IDs & travel documentsSWEDEN_NATIONAL_ID_NUMBERGovernment IDs & travel documentsSWEDEN_PASSPORTGovernment IDs & travel documentsSWITZERLAND_SOCIAL_SECURITY_NUMBERGovernment IDs & travel documentsTAIWAN_ID_NUMBERGovernment IDs & travel documentsTAIWAN_PASSPORTGovernment IDs & travel documentsTHAILAND_NATIONAL_ID_NUMBERGovernment IDs & travel documentsTURKEY_ID_NUMBERGovernment IDs & travel documentsUK_DRIVERS_LICENSE_NUMBERGovernment IDs & travel documentsUK_ELECTORAL_ROLL_NUMBERGovernment IDs & travel documentsUK_NATIONAL_INSURANCE_NUMBERGovernment IDs & travel documentsUK_PASSPORTGovernment IDs & travel documentsUKRAINE_PASSPORTGovernment IDs & travel documentsURUGUAY_CDI_NUMBERGovernment IDs & travel documentsUS_DRIVERS_LICENSE_NUMBERGovernment IDs & travel documentsUS_EMPLOYER_IDENTIFICATION_NUMBERGovernment IDs & travel documentsUS_PASSPORTGovernment IDs & travel documentsUS_SOCIAL_SECURITY_NUMBERGovernment IDs & travel documentsUS_VEHICLE_IDENTIFICATION_NUMBERGovernment IDs & travel documentsUZBEKISTAN_PASSPORTGovernment IDs & travel documentsVEHICLE_IDENTIFICATION_NUMBERGovernment IDs & travel documentsVENEZUELA_CDI_NUMBERGovernment IDs & travel documentsAUSTRALIA_MEDICARE_NUMBERHealth & medical dataBLOOD_TYPEHealth & medical dataCANADA_BC_PHNHealth & medical dataCANADA_OHIPHealth & medical dataCANADA_QUEBEC_HINHealth & medical dataFDA_CODEHealth & medical dataICD10_CODEHealth & medical dataICD9_CODEHealth & medical dataMEDICAL_DATAHealth & medical dataMEDICAL_IDHealth & medical dataMEDICAL_RECORD_NUMBERHealth & medical dataMEDICAL_TERMHealth & medical dataNEW_ZEALAND_NHI_NUMBERHealth & medical dataSCOTLAND_COMMUNITY_HEALTH_INDEX_NUMBERHealth & medical dataUK_NATIONAL_HEALTH_SERVICE_NUMBERHealth & medical dataUS_DEA_NUMBERHealth & medical dataUS_HEALTHCARE_NPIHealth & medical dataUS_MEDICARE_BENEFICIARY_ID_NUMBERHealth & medical dataAUTH_TOKENCredentials, secrets & authenticationAWS_CREDENTIALSCredentials, secrets & authenticationAZURE_AUTH_TOKENCredentials, secrets & authenticationBASIC_AUTH_HEADERCredentials, secrets & authenticationENCRYPTION_KEYCredentials, secrets & authenticationGCP_API_KEYCredentials, secrets & authenticationGCP_CREDENTIALSCredentials, secrets & authenticationJSON_WEB_TOKENCredentials, secrets & authenticationOAUTH_CLIENT_SECRETCredentials, secrets & authenticationPASSWORDCredentials, secrets & authenticationSECURITY_DATACredentials, secrets & authenticationSSL_CERTIFICATECredentials, secrets & authenticationSTORAGE_SIGNED_URLCredentials, secrets & authenticationTINK_KEYSETCredentials, secrets & authenticationWEAK_PASSWORD_HASHCredentials, secrets & authenticationXSRF_TOKENCredentials, secrets & authenticationADVERTISING_IDTechnical & device identifiersHTTP_COOKIETechnical & device identifiersHTTP_USER_AGENTTechnical & device identifiersICCID_NUMBERTechnical & device identifiersIMEI_HARDWARE_IDTechnical & device identifiersIMSI_IDTechnical & device identifiersIP_ADDRESSTechnical & device identifiersMAC_ADDRESSTechnical & device identifiersMAC_ADDRESS_LOCALTechnical & device identifiersMAC_ADDRESS_UNIVERSALTechnical & device identifiersTECHNICAL_IDTechnical & device identifiersDOCUMENT_TYPE/CONTEXT/FINANCEDocuments, files & contentDOCUMENT_TYPE/CONTEXT/HEALTHDocuments, files & contentDOCUMENT_TYPE/CONTEXT/LEGALDocuments, files & contentDOCUMENT_TYPE/CONTEXT/OBSCENEDocuments, files & contentDOCUMENT_TYPE/CONTEXT/OFFENSIVEDocuments, files & contentDOCUMENT_TYPE/CONTEXT/POLITICSDocuments, files & contentDOCUMENT_TYPE/CONTEXT/RELIGIONDocuments, files & contentDOCUMENT_TYPE/CONTEXT/SEXUALDocuments, files & contentDOCUMENT_TYPE/FINANCE/INVOICEDocuments, files & contentDOCUMENT_TYPE/FINANCE/REGULATORYDocuments, files & contentDOCUMENT_TYPE/FINANCE/SEC_FILINGDocuments, files & contentDOCUMENT_TYPE/HR/RESUMEDocuments, files & contentDOCUMENT_TYPE/LEGAL/BLANK_FORMDocuments, files & contentDOCUMENT_TYPE/LEGAL/BRIEFDocuments, files & contentDOCUMENT_TYPE/LEGAL/COURT_ORDERDocuments, files & contentDOCUMENT_TYPE/LEGAL/LAWDocuments, files & contentDOCUMENT_TYPE/LEGAL/PLEADINGDocuments, files & contentDOCUMENT_TYPE/MEDICAL/RECORDDocuments, files & contentDOCUMENT_TYPE/R&D/DATABASE_BACKUPDocuments, files & contentDOCUMENT_TYPE/R&D/PATENTDocuments, files & contentDOCUMENT_TYPE/R&D/SOURCE_CODEDocuments, files & contentDOCUMENT_TYPE/R&D/SOURCE_CODE/CDocuments, files & contentDOCUMENT_TYPE/R&D/SOURCE_CODE/CPPDocuments, files & contentDOCUMENT_TYPE/R&D/SOURCE_CODE/CSDocuments, files & contentDOCUMENT_TYPE/R&D/SOURCE_CODE/GODocuments, files & contentDOCUMENT_TYPE/R&D/SOURCE_CODE/HTMLDocuments, files & contentDOCUMENT_TYPE/R&D/SOURCE_CODE/JAVADocuments, files & contentDOCUMENT_TYPE/R&D/SOURCE_CODE/JAVASCRIPTDocuments, files & contentDOCUMENT_TYPE/R&D/SOURCE_CODE/JSONDocuments, files & contentDOCUMENT_TYPE/R&D/SOURCE_CODE/PHPDocuments, files & contentDOCUMENT_TYPE/R&D/SOURCE_CODE/POWERSHELLDocuments, files & contentDOCUMENT_TYPE/R&D/SOURCE_CODE/PYTHONDocuments, files & contentDOCUMENT_TYPE/R&D/SOURCE_CODE/RUSTDocuments, files & contentDOCUMENT_TYPE/R&D/SOURCE_CODE/SHELLDocuments, files & contentDOCUMENT_TYPE/R&D/SOURCE_CODE/SQLDocuments, files & contentDOCUMENT_TYPE/R&D/SOURCE_CODE/TYPESCRIPTDocuments, files & contentDOCUMENT_TYPE/R&D/SYSTEM_LOGDocuments, files & contentOBJECT_TYPE/BARCODEDocuments, files & contentOBJECT_TYPE/LICENSE_PLATEDocuments, files & contentOBJECT_TYPE/PERSONDocuments, files & contentOBJECT_TYPE/PERSON/PASSPORTDocuments, files & contentOBJECT_TYPE/PERSON/PHOTO_ID_CARDDocuments, files & contentOBJECT_TYPE/WHITEBOARDDocuments, files & contentSTORAGE_SIGNED_POLICY_DOCUMENTDocuments, files & contentCRIME_STATUSLegal, employment & sensitive contextEMPLOYMENT_STATUSLegal, employment & sensitive contextETHNIC_GROUPLegal, employment & sensitive contextMARITAL_STATUSLegal, employment & sensitive contextORGANIZATION_NAMELegal, employment & sensitive contextPOLITICAL_TERMLegal, employment & sensitive contextRELIGIOUS_TERMLegal, employment & sensitive contextSEXUAL_ORIENTATIONLegal, employment & sensitive contextTRADE_UNIONLegal, employment & sensitive contextBRAZIL_RG_NUMBEROther identifiersCVV_NUMBEROther identifiersDATEOther identifiersGENERIC_IDOther identifiersKOREA_ARNOther identifiersNORWAY_NI_NUMBEROther identifiersTIMEOther identifiersMultilingual 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.
{
"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"
}
}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// 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();