Test Your First Request
Use this guide to verify that your Custodian Labs API key works.
This page shows a simple text transformation request. For your first test, use fictional information only.
Test from the terminal
Use curl to send a request directly from your terminal.
Store your API key
Set your API key as an environment variable in your terminal:
export CUSTODIAN_API_KEY="your_api_key_here"
Send a text transformation request
Send a POST request to Guardian Layer:
curl -i -X POST "<MASKING_API_BASE_URL>/api/v1/deidentify/text/proprietary/outputs" \
-H "X-API-Key: $CUSTODIAN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Please contact Jane Smith at jane.smith@example.com or call (415) 555-0123.",
"domain": "General",
"masking_type": "transform",
"pii_entities": ["ALL"]
}'
Replace <MASKING_API_BASE_URL> with the Custodian Labs API base URL for your environment.
Expected response
A successful request returns 200 OK and two transformed alternatives:
{
"original_text": "Please contact Jane Smith at jane.smith@example.com or call (415) 555-0123.",
"outputs": [
{
"id": 1,
"text": "Please contact Maria Lopez at maria.lopez@example.com or call (415) 555-0187."
},
{
"id": 2,
"text": "Please contact David Kim at david.kim@example.com or call (415) 555-0194."
}
],
"mode": "PROPRIETARY_OUTPUTS",
"meta": {}
}
The exact transformed values may vary.
Try redaction
To remove detected information instead of replacing it, change:
"masking_type": "redact"
Test from the Dashboard
You can also verify your API key without using the terminal:
- Open API Testing in the Dashboard.
- Select your API key.
- Choose Enter Text.
- Paste a short example containing fictional information.
- Select All PII.
- Choose Transform or Redact.
- Click Mask Now.
The transformed output appears in the Results panel.
Common first-request issues
| Status or symptom | Likely cause | What to check |
|---|---|---|
401 Unauthorized | The API key is missing or invalid | Confirm that the header is X-API-Key and copy the key again from the Dashboard |
403 Forbidden | The API key has expired | Check the renewal date on the API Keys page |
429 Too Many Requests | Your token or request allowance has been reached | Check your usage in the Dashboard and review your plan |
422 Unprocessable Entity | The request body contains an invalid field or value | Compare your JSON body with the example above |
| Request times out | The API service or endpoint is unavailable | Confirm the base URL and contact support if the issue continues |