Mask Async with Policy
Submit a masked data request with a named policy, receive a tracking ID and status, then poll for the completed result.
{
"policy_name": "customer-support-policy",
"mask": [
{
"value": "https://platform.openai.com/playground/chat?models=gpt-4o",
"format": "URL",
"token_name": "Text Token"
},
{
"value": "(408)- 426 - 9989",
"format": "Phone Number",
"token_name": "Numeric Token"
}
]
}
curl -X PUT "{baseurl}/mask/async" \
-H "Authorization: Bearer YOUR_AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"policy_name": "customer-support-policy",
"mask": [
{
"value": "https://platform.openai.com/playground/chat?models=gpt-4o",
"format": "URL",
"token_name": "Text Token"
},
{
"value": "(408)- 426 - 9989",
"format": "Phone Number",
"token_name": "Numeric Token"
}
]
}'
import requests
response = requests.put(
"{baseurl}/mask/async",
headers={
"Authorization": "Bearer YOUR_AUTH_TOKEN",
"Content-Type": "application/json"
},
json={
"policy_name": "customer-support-policy",
"mask": [
{
"value": "https://platform.openai.com/playground/chat?models=gpt-4o",
"format": "URL",
"token_name": "Text Token"
},
{
"value": "(408)- 426 - 9989",
"format": "Phone Number",
"token_name": "Numeric Token"
}
]
}
)
print(response.json())
{
"data": [
{
"tracking_id": "bab9dad6-bd3b-4b73-93a0-7ba56aaa4d6229102026064556",
"status": "PENDING"
}
],
"success": true,
"error": {
"message": ""
}
}
Endpoint
| Method | Endpoint |
|---|---|
PUT | {baseurl}/mask/async |
The policy must already exist in the namespace before you make this request. Create a policy before continuing.
policy_name selects the policy to apply.
Request body
body
policy_namestring
RequiredName of the policy to apply.
body
maskarray
RequiredValues to mask using the selected policy.
After submission
The response returns a tracking ID and status. Poll the Async Status endpoint with the returned tracking ID to retrieve the completed result.
Was this page helpful?