AntflyAntfly

Table Privacy#

Table policies, bounded previews, durable inspection scans and source-bound findings. Privacy inspection and configuration require table administration permission.

Read table privacy policy and coverage#

GET/tables/{tableName}/privacy

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer YOUR_API_KEY

Code Examples#

curl -X GET "/db/v1/tables/{tableName}/privacy" \
    -H "Authorization: Bearer YOUR_API_KEY"

Responses#

{
  "configured": true,
  "policy": {
    "mode": "monitor",
    "fields": [
      "string"
    ],
    "category_groups": [
      "contact_details"
    ],
    "categories": [
      {
        "name": "string",
        "description": "string",
        "threshold": 0
      }
    ],
    "sensitivity": "conservative",
    "replacement": "category",
    "producer": {
      "type": "extractor",
      "revision": "string",
      "config": {
        "provider": "antfly",
        "model": "string",
        "schema_version": 1,
        "url": "string",
        "api_url": "string",
        "project_id": "string",
        "location": "string",
        "region": "string",
        "credentials_path": "string",
        "account_id": "string",
        "gateway_id": "string",
        "api_key": "string",
        "bearer_token": "string",
        "schema": {
          "entities": [
            "string"
          ],
          "relations": [
            {
              "type": "string",
              "source": "string",
              "target": "string",
              "description": "string",
              "threshold": 0
            }
          ],
          "classifications": [
            {
              "name": "string",
              "labels": [
                "string"
              ],
              "multi_label": true,
              "hypothesis_template": "string",
              "top_k": 1,
              "mode": "single",
              "label_definitions": {},
              "min_labels": 0,
              "max_labels": 0,
              "ordered": true,
              "threshold": 0,
              "candidate_threshold": 0,
              "activation": "auto",
              "temperature": 0,
              "default": "string",
              "prompt": "string",
              "instruction": "string",
              "examples": [
                {
                  "input": "string",
                  "label": "string"
                }
              ]
            }
          ],
          "structures": {},
          "entity_definitions": {},
          "entity_attributes": {},
          "classification_constraints": [
            {
              "type": "LabelRef",
              "task": "string",
              "label": "string"
            }
          ],
          "joint_ie": {
            "entities": {},
            "relations": {},
            "constraints": [
              {
                "type": "TypedEndpoints",
                "relation": "string",
                "head_types": [
                  "string"
                ],
                "tail_types": [
                  "string"
                ]
              }
            ]
          }
        },
        "options": {
          "threshold": 0,
          "flat_ner": true,
          "include_confidence": true,
          "include_spans": true,
          "word_splitter": "whitespace",
          "overlap": "allow",
          "offset_unit": "utf8_bytes",
          "long_document": {
            "mode": "reject",
            "window_words": 1,
            "overlap_words": 0,
            "max_windows": 1,
            "record_identity": "occurrence"
          },
          "decoder": {
            "algorithm": "auto",
            "beam_width": 1,
            "max_search_nodes": 0,
            "max_local_assignments": 1,
            "best_effort": true
          },
          "joint_ie": {
            "candidate_threshold": 0,
            "entity_threshold": 0,
            "relation_role_threshold": 0,
            "top_k_entities": 1,
            "top_k_roles": 1,
            "relation_pair_cap": 1,
            "max_edges_per_type": 1,
            "entity_weight": 0,
            "relation_weight": 0
          },
          "reader": {
            "provider": "string",
            "model": "string",
            "url": "string",
            "api_url": "string"
          },
          "resolver": {
            "similarity_threshold": 0,
            "type_must_match": true,
            "min_entity_confidence": 0,
            "min_relation_confidence": 0,
            "deduplicate_relations": true,
            "track_provenance": true
          }
        }
      }
    },
    "execution": {
      "batch_items": 1,
      "max_attempts": 1
    }
  },
  "policy_version": "string",
  "resource_version": 0,
  "generation": 0,
  "scan_id": "string",
  "etag": "string",
  "resolved_producer": {
    "type": "extractor",
    "revision": "string",
    "config": {
      "provider": "antfly",
      "model": "string",
      "schema_version": 1,
      "url": "string",
      "api_url": "string",
      "project_id": "string",
      "location": "string",
      "region": "string",
      "credentials_path": "string",
      "account_id": "string",
      "gateway_id": "string",
      "api_key": "string",
      "bearer_token": "string",
      "schema": {
        "entities": [
          "string"
        ],
        "relations": [
          {
            "type": "string",
            "source": "string",
            "target": "string",
            "description": "string",
            "threshold": 0
          }
        ],
        "classifications": [
          {
            "name": "string",
            "labels": [
              "string"
            ],
            "multi_label": true,
            "hypothesis_template": "string",
            "top_k": 1,
            "mode": "single",
            "label_definitions": {},
            "min_labels": 0,
            "max_labels": 0,
            "ordered": true,
            "threshold": 0,
            "candidate_threshold": 0,
            "activation": "auto",
            "temperature": 0,
            "default": "string",
            "prompt": "string",
            "instruction": "string",
            "examples": [
              {
                "input": "string",
                "label": "string"
              }
            ]
          }
        ],
        "structures": {},
        "entity_definitions": {},
        "entity_attributes": {},
        "classification_constraints": [
          {
            "type": "LabelRef",
            "task": "string",
            "label": "string"
          }
        ],
        "joint_ie": {
          "entities": {},
          "relations": {},
          "constraints": [
            {
              "type": "TypedEndpoints",
              "relation": "string",
              "head_types": [
                "string"
              ],
              "tail_types": [
                "string"
              ]
            }
          ]
        }
      },
      "options": {
        "threshold": 0,
        "flat_ner": true,
        "include_confidence": true,
        "include_spans": true,
        "word_splitter": "whitespace",
        "overlap": "allow",
        "offset_unit": "utf8_bytes",
        "long_document": {
          "mode": "reject",
          "window_words": 1,
          "overlap_words": 0,
          "max_windows": 1,
          "record_identity": "occurrence"
        },
        "decoder": {
          "algorithm": "auto",
          "beam_width": 1,
          "max_search_nodes": 0,
          "max_local_assignments": 1,
          "best_effort": true
        },
        "joint_ie": {
          "candidate_threshold": 0,
          "entity_threshold": 0,
          "relation_role_threshold": 0,
          "top_k_entities": 1,
          "top_k_roles": 1,
          "relation_pair_cap": 1,
          "max_edges_per_type": 1,
          "entity_weight": 0,
          "relation_weight": 0
        },
        "reader": {
          "provider": "string",
          "model": "string",
          "url": "string",
          "api_url": "string"
        },
        "resolver": {
          "similarity_threshold": 0,
          "type_must_match": true,
          "min_entity_confidence": 0,
          "min_relation_confidence": 0,
          "deduplicate_relations": true,
          "track_provenance": true
        }
      }
    }
  },
  "external_processing": true,
  "coverage": {
    "available": true,
    "refreshing": true,
    "started_at_millis": 0,
    "completed_at_millis": 0,
    "total": 0,
    "current": 0,
    "pending": 0,
    "failed": 0,
    "with_findings": 0,
    "protected_ready": 0,
    "protected_blocked": 0,
    "categories": {},
    "fields": {},
    "failed_known": 0,
    "failures": [
      {}
    ],
    "next_key": "string"
  }
}

Apply table privacy policy#

PUT/tables/{tableName}/privacy

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer YOUR_API_KEY

Parameters#

NameTypeLocationRequiredDescription
If-MatchstringheaderNoRequired exact ETag when replacing an existing policy.

Request Body#

Example:

{
    "mode": "monitor",
    "fields": [
        "string"
    ],
    "category_groups": [
        "contact_details"
    ],
    "categories": [
        {
            "name": "string",
            "description": "string",
            "threshold": 0
        }
    ],
    "sensitivity": "conservative",
    "replacement": "category",
    "producer": {
        "type": "extractor",
        "revision": "string",
        "config": {
            "provider": "antfly",
            "model": "string",
            "schema_version": 1,
            "url": "string",
            "api_url": "string",
            "project_id": "string",
            "location": "string",
            "region": "string",
            "credentials_path": "string",
            "account_id": "string",
            "gateway_id": "string",
            "api_key": "string",
            "bearer_token": "string",
            "schema": {
                "entities": [
                    "string"
                ],
                "relations": [
                    {
                        "type": "string",
                        "source": "string",
                        "target": "string",
                        "description": "string",
                        "threshold": 0
                    }
                ],
                "classifications": [
                    {
                        "name": "string",
                        "labels": [
                            "string"
                        ],
                        "multi_label": true,
                        "hypothesis_template": "string",
                        "top_k": 1,
                        "mode": "single",
                        "label_definitions": {},
                        "min_labels": 0,
                        "max_labels": 0,
                        "ordered": true,
                        "threshold": 0,
                        "candidate_threshold": 0,
                        "activation": "auto",
                        "temperature": 0,
                        "default": "string",
                        "prompt": "string",
                        "instruction": "string",
                        "examples": [
                            {
                                "input": "string",
                                "label": "string"
                            }
                        ]
                    }
                ],
                "structures": {},
                "entity_definitions": {},
                "entity_attributes": {},
                "classification_constraints": [
                    {
                        "type": "LabelRef",
                        "task": "string",
                        "label": "string"
                    }
                ],
                "joint_ie": {
                    "entities": {},
                    "relations": {},
                    "constraints": [
                        {
                            "type": "TypedEndpoints",
                            "relation": "string",
                            "head_types": [
                                "string"
                            ],
                            "tail_types": [
                                "string"
                            ]
                        }
                    ]
                }
            },
            "options": {
                "threshold": 0,
                "flat_ner": true,
                "include_confidence": true,
                "include_spans": true,
                "word_splitter": "whitespace",
                "overlap": "allow",
                "offset_unit": "utf8_bytes",
                "long_document": {
                    "mode": "reject",
                    "window_words": 1,
                    "overlap_words": 0,
                    "max_windows": 1,
                    "record_identity": "occurrence"
                },
                "decoder": {
                    "algorithm": "auto",
                    "beam_width": 1,
                    "max_search_nodes": 0,
                    "max_local_assignments": 1,
                    "best_effort": true
                },
                "joint_ie": {
                    "candidate_threshold": 0,
                    "entity_threshold": 0,
                    "relation_role_threshold": 0,
                    "top_k_entities": 1,
                    "top_k_roles": 1,
                    "relation_pair_cap": 1,
                    "max_edges_per_type": 1,
                    "entity_weight": 0,
                    "relation_weight": 0
                },
                "reader": {
                    "provider": "string",
                    "model": "string",
                    "url": "string",
                    "api_url": "string"
                },
                "resolver": {
                    "similarity_threshold": 0,
                    "type_must_match": true,
                    "min_entity_confidence": 0,
                    "min_relation_confidence": 0,
                    "deduplicate_relations": true,
                    "track_provenance": true
                }
            }
        }
    },
    "execution": {
        "batch_items": 1,
        "max_attempts": 1
    }
}

Code Examples#

curl -X PUT "/db/v1/tables/{tableName}/privacy" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
    "mode": "monitor",
    "fields": [
        "string"
    ],
    "category_groups": [
        "contact_details"
    ],
    "categories": [
        {
            "name": "string",
            "description": "string",
            "threshold": 0
        }
    ],
    "sensitivity": "conservative",
    "replacement": "category",
    "producer": {
        "type": "extractor",
        "revision": "string",
        "config": {
            "provider": "antfly",
            "model": "string",
            "schema_version": 1,
            "url": "string",
            "api_url": "string",
            "project_id": "string",
            "location": "string",
            "region": "string",
            "credentials_path": "string",
            "account_id": "string",
            "gateway_id": "string",
            "api_key": "string",
            "bearer_token": "string",
            "schema": {
                "entities": [
                    "string"
                ],
                "relations": [
                    {
                        "type": "string",
                        "source": "string",
                        "target": "string",
                        "description": "string",
                        "threshold": 0
                    }
                ],
                "classifications": [
                    {
                        "name": "string",
                        "labels": [
                            "string"
                        ],
                        "multi_label": true,
                        "hypothesis_template": "string",
                        "top_k": 1,
                        "mode": "single",
                        "label_definitions": {},
                        "min_labels": 0,
                        "max_labels": 0,
                        "ordered": true,
                        "threshold": 0,
                        "candidate_threshold": 0,
                        "activation": "auto",
                        "temperature": 0,
                        "default": "string",
                        "prompt": "string",
                        "instruction": "string",
                        "examples": [
                            {
                                "input": "string",
                                "label": "string"
                            }
                        ]
                    }
                ],
                "structures": {},
                "entity_definitions": {},
                "entity_attributes": {},
                "classification_constraints": [
                    {
                        "type": "LabelRef",
                        "task": "string",
                        "label": "string"
                    }
                ],
                "joint_ie": {
                    "entities": {},
                    "relations": {},
                    "constraints": [
                        {
                            "type": "TypedEndpoints",
                            "relation": "string",
                            "head_types": [
                                "string"
                            ],
                            "tail_types": [
                                "string"
                            ]
                        }
                    ]
                }
            },
            "options": {
                "threshold": 0,
                "flat_ner": true,
                "include_confidence": true,
                "include_spans": true,
                "word_splitter": "whitespace",
                "overlap": "allow",
                "offset_unit": "utf8_bytes",
                "long_document": {
                    "mode": "reject",
                    "window_words": 1,
                    "overlap_words": 0,
                    "max_windows": 1,
                    "record_identity": "occurrence"
                },
                "decoder": {
                    "algorithm": "auto",
                    "beam_width": 1,
                    "max_search_nodes": 0,
                    "max_local_assignments": 1,
                    "best_effort": true
                },
                "joint_ie": {
                    "candidate_threshold": 0,
                    "entity_threshold": 0,
                    "relation_role_threshold": 0,
                    "top_k_entities": 1,
                    "top_k_roles": 1,
                    "relation_pair_cap": 1,
                    "max_edges_per_type": 1,
                    "entity_weight": 0,
                    "relation_weight": 0
                },
                "reader": {
                    "provider": "string",
                    "model": "string",
                    "url": "string",
                    "api_url": "string"
                },
                "resolver": {
                    "similarity_threshold": 0,
                    "type_must_match": true,
                    "min_entity_confidence": 0,
                    "min_relation_confidence": 0,
                    "deduplicate_relations": true,
                    "track_provenance": true
                }
            }
        }
    },
    "execution": {
        "batch_items": 1,
        "max_attempts": 1
    }
}'

Responses#

{
  "configured": true,
  "policy": {
    "mode": "monitor",
    "fields": [
      "string"
    ],
    "category_groups": [
      "contact_details"
    ],
    "categories": [
      {
        "name": "string",
        "description": "string",
        "threshold": 0
      }
    ],
    "sensitivity": "conservative",
    "replacement": "category",
    "producer": {
      "type": "extractor",
      "revision": "string",
      "config": {
        "provider": "antfly",
        "model": "string",
        "schema_version": 1,
        "url": "string",
        "api_url": "string",
        "project_id": "string",
        "location": "string",
        "region": "string",
        "credentials_path": "string",
        "account_id": "string",
        "gateway_id": "string",
        "api_key": "string",
        "bearer_token": "string",
        "schema": {
          "entities": [
            "string"
          ],
          "relations": [
            {
              "type": "string",
              "source": "string",
              "target": "string",
              "description": "string",
              "threshold": 0
            }
          ],
          "classifications": [
            {
              "name": "string",
              "labels": [
                "string"
              ],
              "multi_label": true,
              "hypothesis_template": "string",
              "top_k": 1,
              "mode": "single",
              "label_definitions": {},
              "min_labels": 0,
              "max_labels": 0,
              "ordered": true,
              "threshold": 0,
              "candidate_threshold": 0,
              "activation": "auto",
              "temperature": 0,
              "default": "string",
              "prompt": "string",
              "instruction": "string",
              "examples": [
                {
                  "input": "string",
                  "label": "string"
                }
              ]
            }
          ],
          "structures": {},
          "entity_definitions": {},
          "entity_attributes": {},
          "classification_constraints": [
            {
              "type": "LabelRef",
              "task": "string",
              "label": "string"
            }
          ],
          "joint_ie": {
            "entities": {},
            "relations": {},
            "constraints": [
              {
                "type": "TypedEndpoints",
                "relation": "string",
                "head_types": [
                  "string"
                ],
                "tail_types": [
                  "string"
                ]
              }
            ]
          }
        },
        "options": {
          "threshold": 0,
          "flat_ner": true,
          "include_confidence": true,
          "include_spans": true,
          "word_splitter": "whitespace",
          "overlap": "allow",
          "offset_unit": "utf8_bytes",
          "long_document": {
            "mode": "reject",
            "window_words": 1,
            "overlap_words": 0,
            "max_windows": 1,
            "record_identity": "occurrence"
          },
          "decoder": {
            "algorithm": "auto",
            "beam_width": 1,
            "max_search_nodes": 0,
            "max_local_assignments": 1,
            "best_effort": true
          },
          "joint_ie": {
            "candidate_threshold": 0,
            "entity_threshold": 0,
            "relation_role_threshold": 0,
            "top_k_entities": 1,
            "top_k_roles": 1,
            "relation_pair_cap": 1,
            "max_edges_per_type": 1,
            "entity_weight": 0,
            "relation_weight": 0
          },
          "reader": {
            "provider": "string",
            "model": "string",
            "url": "string",
            "api_url": "string"
          },
          "resolver": {
            "similarity_threshold": 0,
            "type_must_match": true,
            "min_entity_confidence": 0,
            "min_relation_confidence": 0,
            "deduplicate_relations": true,
            "track_provenance": true
          }
        }
      }
    },
    "execution": {
      "batch_items": 1,
      "max_attempts": 1
    }
  },
  "policy_version": "string",
  "resource_version": 0,
  "generation": 0,
  "scan_id": "string",
  "etag": "string",
  "resolved_producer": {
    "type": "extractor",
    "revision": "string",
    "config": {
      "provider": "antfly",
      "model": "string",
      "schema_version": 1,
      "url": "string",
      "api_url": "string",
      "project_id": "string",
      "location": "string",
      "region": "string",
      "credentials_path": "string",
      "account_id": "string",
      "gateway_id": "string",
      "api_key": "string",
      "bearer_token": "string",
      "schema": {
        "entities": [
          "string"
        ],
        "relations": [
          {
            "type": "string",
            "source": "string",
            "target": "string",
            "description": "string",
            "threshold": 0
          }
        ],
        "classifications": [
          {
            "name": "string",
            "labels": [
              "string"
            ],
            "multi_label": true,
            "hypothesis_template": "string",
            "top_k": 1,
            "mode": "single",
            "label_definitions": {},
            "min_labels": 0,
            "max_labels": 0,
            "ordered": true,
            "threshold": 0,
            "candidate_threshold": 0,
            "activation": "auto",
            "temperature": 0,
            "default": "string",
            "prompt": "string",
            "instruction": "string",
            "examples": [
              {
                "input": "string",
                "label": "string"
              }
            ]
          }
        ],
        "structures": {},
        "entity_definitions": {},
        "entity_attributes": {},
        "classification_constraints": [
          {
            "type": "LabelRef",
            "task": "string",
            "label": "string"
          }
        ],
        "joint_ie": {
          "entities": {},
          "relations": {},
          "constraints": [
            {
              "type": "TypedEndpoints",
              "relation": "string",
              "head_types": [
                "string"
              ],
              "tail_types": [
                "string"
              ]
            }
          ]
        }
      },
      "options": {
        "threshold": 0,
        "flat_ner": true,
        "include_confidence": true,
        "include_spans": true,
        "word_splitter": "whitespace",
        "overlap": "allow",
        "offset_unit": "utf8_bytes",
        "long_document": {
          "mode": "reject",
          "window_words": 1,
          "overlap_words": 0,
          "max_windows": 1,
          "record_identity": "occurrence"
        },
        "decoder": {
          "algorithm": "auto",
          "beam_width": 1,
          "max_search_nodes": 0,
          "max_local_assignments": 1,
          "best_effort": true
        },
        "joint_ie": {
          "candidate_threshold": 0,
          "entity_threshold": 0,
          "relation_role_threshold": 0,
          "top_k_entities": 1,
          "top_k_roles": 1,
          "relation_pair_cap": 1,
          "max_edges_per_type": 1,
          "entity_weight": 0,
          "relation_weight": 0
        },
        "reader": {
          "provider": "string",
          "model": "string",
          "url": "string",
          "api_url": "string"
        },
        "resolver": {
          "similarity_threshold": 0,
          "type_must_match": true,
          "min_entity_confidence": 0,
          "min_relation_confidence": 0,
          "deduplicate_relations": true,
          "track_provenance": true
        }
      }
    }
  },
  "external_processing": true,
  "coverage": {
    "available": true,
    "refreshing": true,
    "started_at_millis": 0,
    "completed_at_millis": 0,
    "total": 0,
    "current": 0,
    "pending": 0,
    "failed": 0,
    "with_findings": 0,
    "protected_ready": 0,
    "protected_blocked": 0,
    "categories": {},
    "fields": {},
    "failed_known": 0,
    "failures": [
      {}
    ],
    "next_key": "string"
  }
}

Inspect a bounded sample without saving the policy#

POST/tables/{tableName}/privacy/preview

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer YOUR_API_KEY

Request Body#

Example:

{
    "policy": {
        "mode": "monitor",
        "fields": [
            "string"
        ],
        "category_groups": [
            "contact_details"
        ],
        "categories": [
            {
                "name": "string",
                "description": "string",
                "threshold": 0
            }
        ],
        "sensitivity": "conservative",
        "replacement": "category",
        "producer": {
            "type": "extractor",
            "revision": "string",
            "config": {
                "provider": "antfly",
                "model": "string",
                "schema_version": 1,
                "url": "string",
                "api_url": "string",
                "project_id": "string",
                "location": "string",
                "region": "string",
                "credentials_path": "string",
                "account_id": "string",
                "gateway_id": "string",
                "api_key": "string",
                "bearer_token": "string",
                "schema": {
                    "entities": [
                        "string"
                    ],
                    "relations": [
                        {
                            "type": "string",
                            "source": "string",
                            "target": "string",
                            "description": "string",
                            "threshold": 0
                        }
                    ],
                    "classifications": [
                        {
                            "name": "string",
                            "labels": [
                                "string"
                            ],
                            "multi_label": true,
                            "hypothesis_template": "string",
                            "top_k": 1,
                            "mode": "single",
                            "label_definitions": {},
                            "min_labels": 0,
                            "max_labels": 0,
                            "ordered": true,
                            "threshold": 0,
                            "candidate_threshold": 0,
                            "activation": "auto",
                            "temperature": 0,
                            "default": "string",
                            "prompt": "string",
                            "instruction": "string",
                            "examples": [
                                {
                                    "input": "string",
                                    "label": "string"
                                }
                            ]
                        }
                    ],
                    "structures": {},
                    "entity_definitions": {},
                    "entity_attributes": {},
                    "classification_constraints": [
                        {
                            "type": "LabelRef",
                            "task": "string",
                            "label": "string"
                        }
                    ],
                    "joint_ie": {
                        "entities": {},
                        "relations": {},
                        "constraints": [
                            {
                                "type": "TypedEndpoints",
                                "relation": "string",
                                "head_types": [
                                    "string"
                                ],
                                "tail_types": [
                                    "string"
                                ]
                            }
                        ]
                    }
                },
                "options": {
                    "threshold": 0,
                    "flat_ner": true,
                    "include_confidence": true,
                    "include_spans": true,
                    "word_splitter": "whitespace",
                    "overlap": "allow",
                    "offset_unit": "utf8_bytes",
                    "long_document": {
                        "mode": "reject",
                        "window_words": 1,
                        "overlap_words": 0,
                        "max_windows": 1,
                        "record_identity": "occurrence"
                    },
                    "decoder": {
                        "algorithm": "auto",
                        "beam_width": 1,
                        "max_search_nodes": 0,
                        "max_local_assignments": 1,
                        "best_effort": true
                    },
                    "joint_ie": {
                        "candidate_threshold": 0,
                        "entity_threshold": 0,
                        "relation_role_threshold": 0,
                        "top_k_entities": 1,
                        "top_k_roles": 1,
                        "relation_pair_cap": 1,
                        "max_edges_per_type": 1,
                        "entity_weight": 0,
                        "relation_weight": 0
                    },
                    "reader": {
                        "provider": "string",
                        "model": "string",
                        "url": "string",
                        "api_url": "string"
                    },
                    "resolver": {
                        "similarity_threshold": 0,
                        "type_must_match": true,
                        "min_entity_confidence": 0,
                        "min_relation_confidence": 0,
                        "deduplicate_relations": true,
                        "track_provenance": true
                    }
                }
            }
        },
        "execution": {
            "batch_items": 1,
            "max_attempts": 1
        }
    },
    "sample": {
        "keys": [
            "string"
        ],
        "limit": 1
    }
}

Code Examples#

curl -X POST "/db/v1/tables/{tableName}/privacy/preview" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
    "policy": {
        "mode": "monitor",
        "fields": [
            "string"
        ],
        "category_groups": [
            "contact_details"
        ],
        "categories": [
            {
                "name": "string",
                "description": "string",
                "threshold": 0
            }
        ],
        "sensitivity": "conservative",
        "replacement": "category",
        "producer": {
            "type": "extractor",
            "revision": "string",
            "config": {
                "provider": "antfly",
                "model": "string",
                "schema_version": 1,
                "url": "string",
                "api_url": "string",
                "project_id": "string",
                "location": "string",
                "region": "string",
                "credentials_path": "string",
                "account_id": "string",
                "gateway_id": "string",
                "api_key": "string",
                "bearer_token": "string",
                "schema": {
                    "entities": [
                        "string"
                    ],
                    "relations": [
                        {
                            "type": "string",
                            "source": "string",
                            "target": "string",
                            "description": "string",
                            "threshold": 0
                        }
                    ],
                    "classifications": [
                        {
                            "name": "string",
                            "labels": [
                                "string"
                            ],
                            "multi_label": true,
                            "hypothesis_template": "string",
                            "top_k": 1,
                            "mode": "single",
                            "label_definitions": {},
                            "min_labels": 0,
                            "max_labels": 0,
                            "ordered": true,
                            "threshold": 0,
                            "candidate_threshold": 0,
                            "activation": "auto",
                            "temperature": 0,
                            "default": "string",
                            "prompt": "string",
                            "instruction": "string",
                            "examples": [
                                {
                                    "input": "string",
                                    "label": "string"
                                }
                            ]
                        }
                    ],
                    "structures": {},
                    "entity_definitions": {},
                    "entity_attributes": {},
                    "classification_constraints": [
                        {
                            "type": "LabelRef",
                            "task": "string",
                            "label": "string"
                        }
                    ],
                    "joint_ie": {
                        "entities": {},
                        "relations": {},
                        "constraints": [
                            {
                                "type": "TypedEndpoints",
                                "relation": "string",
                                "head_types": [
                                    "string"
                                ],
                                "tail_types": [
                                    "string"
                                ]
                            }
                        ]
                    }
                },
                "options": {
                    "threshold": 0,
                    "flat_ner": true,
                    "include_confidence": true,
                    "include_spans": true,
                    "word_splitter": "whitespace",
                    "overlap": "allow",
                    "offset_unit": "utf8_bytes",
                    "long_document": {
                        "mode": "reject",
                        "window_words": 1,
                        "overlap_words": 0,
                        "max_windows": 1,
                        "record_identity": "occurrence"
                    },
                    "decoder": {
                        "algorithm": "auto",
                        "beam_width": 1,
                        "max_search_nodes": 0,
                        "max_local_assignments": 1,
                        "best_effort": true
                    },
                    "joint_ie": {
                        "candidate_threshold": 0,
                        "entity_threshold": 0,
                        "relation_role_threshold": 0,
                        "top_k_entities": 1,
                        "top_k_roles": 1,
                        "relation_pair_cap": 1,
                        "max_edges_per_type": 1,
                        "entity_weight": 0,
                        "relation_weight": 0
                    },
                    "reader": {
                        "provider": "string",
                        "model": "string",
                        "url": "string",
                        "api_url": "string"
                    },
                    "resolver": {
                        "similarity_threshold": 0,
                        "type_must_match": true,
                        "min_entity_confidence": 0,
                        "min_relation_confidence": 0,
                        "deduplicate_relations": true,
                        "track_provenance": true
                    }
                }
            }
        },
        "execution": {
            "batch_items": 1,
            "max_attempts": 1
        }
    },
    "sample": {
        "keys": [
            "string"
        ],
        "limit": 1
    }
}'

Responses#

{
  "policy_version": "string",
  "sampled": 0,
  "complete_table_scan": true,
  "external_processing": true,
  "documents": [
    {
      "document": "string",
      "fields": [
        {
          "field": "string",
          "original": "string",
          "text": "string",
          "findings": [
            {
              "document": "string",
              "field": "string",
              "category": "string",
              "start": 0,
              "end": 0,
              "confidence": 0,
              "policy_version": "string",
              "source_fingerprint": "string",
              "producer_revision": "string"
            }
          ]
        }
      ]
    }
  ]
}

Start a durable privacy rescan#

POST/tables/{tableName}/privacy/scans

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer YOUR_API_KEY

Request Body#

Example:

{
    "from_key": "string",
    "to_key": "string",
    "limit": 1
}

Code Examples#

curl -X POST "/db/v1/tables/{tableName}/privacy/scans" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
    "from_key": "string",
    "to_key": "string",
    "limit": 1
}'

Responses#

{
  "scan_id": "string",
  "policy_version": "string",
  "phase": "queued",
  "scanned": 0,
  "reprocessed": 0,
  "failed": 0,
  "next_key": "string",
  "skipped": 0,
  "last_error": "string",
  "consecutive_errors": 0,
  "retry_after_millis": 0,
  "updated_at_millis": 0,
  "verification_cursor": "string",
  "verification_current": 0,
  "verification_pending": 0,
  "verification_failed": 0,
  "verification_blocked": 0,
  "failures": [
    {}
  ]
}

Read privacy scan progress#

GET/tables/{tableName}/privacy/scans/{scanId}

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer YOUR_API_KEY

Code Examples#

curl -X GET "/db/v1/tables/{tableName}/privacy/scans/{scanId}" \
    -H "Authorization: Bearer YOUR_API_KEY"

Responses#

{
  "scan_id": "string",
  "policy_version": "string",
  "phase": "queued",
  "scanned": 0,
  "reprocessed": 0,
  "failed": 0,
  "next_key": "string",
  "skipped": 0,
  "last_error": "string",
  "consecutive_errors": 0,
  "retry_after_millis": 0,
  "updated_at_millis": 0,
  "verification_cursor": "string",
  "verification_current": 0,
  "verification_pending": 0,
  "verification_failed": 0,
  "verification_blocked": 0,
  "failures": [
    {}
  ]
}

List current privacy findings#

GET/tables/{tableName}/privacy/findings

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer YOUR_API_KEY

Parameters#

NameTypeLocationRequiredDescription
cursorstringqueryNo
documentstringqueryNo
fieldstringqueryNo
categorystringqueryNo
policy_versionstringqueryNo
limitintegerqueryNo

Code Examples#

curl -X GET "/db/v1/tables/{tableName}/privacy/findings?cursor=value&document=value&field=value&category=value&policy_version=value&limit=value" \
    -H "Authorization: Bearer YOUR_API_KEY"

Responses#

{
  "policy_version": "string",
  "findings": [
    {
      "document": "string",
      "field": "string",
      "category": "string",
      "start": 0,
      "end": 0,
      "confidence": 0,
      "policy_version": "string",
      "source_fingerprint": "string",
      "producer_revision": "string"
    }
  ],
  "next_cursor": "string",
  "examined_documents": 0,
  "pending_documents": 0
}

List current privacy findings with body filters#

POST/tables/{tableName}/privacy/findings

Equivalent to GET findings, with filters and continuation in JSON so large document identifiers do not exceed URL limits.

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer YOUR_API_KEY

Request Body#

Example:

{
    "cursor": "string",
    "document": "string",
    "field": "string",
    "category": "string",
    "policy_version": "string",
    "limit": 1
}

Code Examples#

curl -X POST "/db/v1/tables/{tableName}/privacy/findings" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
    "cursor": "string",
    "document": "string",
    "field": "string",
    "category": "string",
    "policy_version": "string",
    "limit": 1
}'

Responses#

{
  "policy_version": "string",
  "findings": [
    {
      "document": "string",
      "field": "string",
      "category": "string",
      "start": 0,
      "end": 0,
      "confidence": 0,
      "policy_version": "string",
      "source_fingerprint": "string",
      "producer_revision": "string"
    }
  ],
  "next_cursor": "string",
  "examined_documents": 0,
  "pending_documents": 0
}

Read table privacy policy and coverage#

GET/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/privacy

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer YOUR_API_KEY

Code Examples#

curl -X GET "/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/privacy" \
    -H "Authorization: Bearer YOUR_API_KEY"

Responses#

{
  "configured": true,
  "policy": {
    "mode": "monitor",
    "fields": [
      "string"
    ],
    "category_groups": [
      "contact_details"
    ],
    "categories": [
      {
        "name": "string",
        "description": "string",
        "threshold": 0
      }
    ],
    "sensitivity": "conservative",
    "replacement": "category",
    "producer": {
      "type": "extractor",
      "revision": "string",
      "config": {
        "provider": "antfly",
        "model": "string",
        "schema_version": 1,
        "url": "string",
        "api_url": "string",
        "project_id": "string",
        "location": "string",
        "region": "string",
        "credentials_path": "string",
        "account_id": "string",
        "gateway_id": "string",
        "api_key": "string",
        "bearer_token": "string",
        "schema": {
          "entities": [
            "string"
          ],
          "relations": [
            {
              "type": "string",
              "source": "string",
              "target": "string",
              "description": "string",
              "threshold": 0
            }
          ],
          "classifications": [
            {
              "name": "string",
              "labels": [
                "string"
              ],
              "multi_label": true,
              "hypothesis_template": "string",
              "top_k": 1,
              "mode": "single",
              "label_definitions": {},
              "min_labels": 0,
              "max_labels": 0,
              "ordered": true,
              "threshold": 0,
              "candidate_threshold": 0,
              "activation": "auto",
              "temperature": 0,
              "default": "string",
              "prompt": "string",
              "instruction": "string",
              "examples": [
                {
                  "input": "string",
                  "label": "string"
                }
              ]
            }
          ],
          "structures": {},
          "entity_definitions": {},
          "entity_attributes": {},
          "classification_constraints": [
            {
              "type": "LabelRef",
              "task": "string",
              "label": "string"
            }
          ],
          "joint_ie": {
            "entities": {},
            "relations": {},
            "constraints": [
              {
                "type": "TypedEndpoints",
                "relation": "string",
                "head_types": [
                  "string"
                ],
                "tail_types": [
                  "string"
                ]
              }
            ]
          }
        },
        "options": {
          "threshold": 0,
          "flat_ner": true,
          "include_confidence": true,
          "include_spans": true,
          "word_splitter": "whitespace",
          "overlap": "allow",
          "offset_unit": "utf8_bytes",
          "long_document": {
            "mode": "reject",
            "window_words": 1,
            "overlap_words": 0,
            "max_windows": 1,
            "record_identity": "occurrence"
          },
          "decoder": {
            "algorithm": "auto",
            "beam_width": 1,
            "max_search_nodes": 0,
            "max_local_assignments": 1,
            "best_effort": true
          },
          "joint_ie": {
            "candidate_threshold": 0,
            "entity_threshold": 0,
            "relation_role_threshold": 0,
            "top_k_entities": 1,
            "top_k_roles": 1,
            "relation_pair_cap": 1,
            "max_edges_per_type": 1,
            "entity_weight": 0,
            "relation_weight": 0
          },
          "reader": {
            "provider": "string",
            "model": "string",
            "url": "string",
            "api_url": "string"
          },
          "resolver": {
            "similarity_threshold": 0,
            "type_must_match": true,
            "min_entity_confidence": 0,
            "min_relation_confidence": 0,
            "deduplicate_relations": true,
            "track_provenance": true
          }
        }
      }
    },
    "execution": {
      "batch_items": 1,
      "max_attempts": 1
    }
  },
  "policy_version": "string",
  "resource_version": 0,
  "generation": 0,
  "scan_id": "string",
  "etag": "string",
  "resolved_producer": {
    "type": "extractor",
    "revision": "string",
    "config": {
      "provider": "antfly",
      "model": "string",
      "schema_version": 1,
      "url": "string",
      "api_url": "string",
      "project_id": "string",
      "location": "string",
      "region": "string",
      "credentials_path": "string",
      "account_id": "string",
      "gateway_id": "string",
      "api_key": "string",
      "bearer_token": "string",
      "schema": {
        "entities": [
          "string"
        ],
        "relations": [
          {
            "type": "string",
            "source": "string",
            "target": "string",
            "description": "string",
            "threshold": 0
          }
        ],
        "classifications": [
          {
            "name": "string",
            "labels": [
              "string"
            ],
            "multi_label": true,
            "hypothesis_template": "string",
            "top_k": 1,
            "mode": "single",
            "label_definitions": {},
            "min_labels": 0,
            "max_labels": 0,
            "ordered": true,
            "threshold": 0,
            "candidate_threshold": 0,
            "activation": "auto",
            "temperature": 0,
            "default": "string",
            "prompt": "string",
            "instruction": "string",
            "examples": [
              {
                "input": "string",
                "label": "string"
              }
            ]
          }
        ],
        "structures": {},
        "entity_definitions": {},
        "entity_attributes": {},
        "classification_constraints": [
          {
            "type": "LabelRef",
            "task": "string",
            "label": "string"
          }
        ],
        "joint_ie": {
          "entities": {},
          "relations": {},
          "constraints": [
            {
              "type": "TypedEndpoints",
              "relation": "string",
              "head_types": [
                "string"
              ],
              "tail_types": [
                "string"
              ]
            }
          ]
        }
      },
      "options": {
        "threshold": 0,
        "flat_ner": true,
        "include_confidence": true,
        "include_spans": true,
        "word_splitter": "whitespace",
        "overlap": "allow",
        "offset_unit": "utf8_bytes",
        "long_document": {
          "mode": "reject",
          "window_words": 1,
          "overlap_words": 0,
          "max_windows": 1,
          "record_identity": "occurrence"
        },
        "decoder": {
          "algorithm": "auto",
          "beam_width": 1,
          "max_search_nodes": 0,
          "max_local_assignments": 1,
          "best_effort": true
        },
        "joint_ie": {
          "candidate_threshold": 0,
          "entity_threshold": 0,
          "relation_role_threshold": 0,
          "top_k_entities": 1,
          "top_k_roles": 1,
          "relation_pair_cap": 1,
          "max_edges_per_type": 1,
          "entity_weight": 0,
          "relation_weight": 0
        },
        "reader": {
          "provider": "string",
          "model": "string",
          "url": "string",
          "api_url": "string"
        },
        "resolver": {
          "similarity_threshold": 0,
          "type_must_match": true,
          "min_entity_confidence": 0,
          "min_relation_confidence": 0,
          "deduplicate_relations": true,
          "track_provenance": true
        }
      }
    }
  },
  "external_processing": true,
  "coverage": {
    "available": true,
    "refreshing": true,
    "started_at_millis": 0,
    "completed_at_millis": 0,
    "total": 0,
    "current": 0,
    "pending": 0,
    "failed": 0,
    "with_findings": 0,
    "protected_ready": 0,
    "protected_blocked": 0,
    "categories": {},
    "fields": {},
    "failed_known": 0,
    "failures": [
      {}
    ],
    "next_key": "string"
  }
}

Apply table privacy policy#

PUT/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/privacy

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer YOUR_API_KEY

Parameters#

NameTypeLocationRequiredDescription
If-MatchstringheaderNoRequired exact ETag when replacing an existing policy.

Request Body#

Example:

{
    "mode": "monitor",
    "fields": [
        "string"
    ],
    "category_groups": [
        "contact_details"
    ],
    "categories": [
        {
            "name": "string",
            "description": "string",
            "threshold": 0
        }
    ],
    "sensitivity": "conservative",
    "replacement": "category",
    "producer": {
        "type": "extractor",
        "revision": "string",
        "config": {
            "provider": "antfly",
            "model": "string",
            "schema_version": 1,
            "url": "string",
            "api_url": "string",
            "project_id": "string",
            "location": "string",
            "region": "string",
            "credentials_path": "string",
            "account_id": "string",
            "gateway_id": "string",
            "api_key": "string",
            "bearer_token": "string",
            "schema": {
                "entities": [
                    "string"
                ],
                "relations": [
                    {
                        "type": "string",
                        "source": "string",
                        "target": "string",
                        "description": "string",
                        "threshold": 0
                    }
                ],
                "classifications": [
                    {
                        "name": "string",
                        "labels": [
                            "string"
                        ],
                        "multi_label": true,
                        "hypothesis_template": "string",
                        "top_k": 1,
                        "mode": "single",
                        "label_definitions": {},
                        "min_labels": 0,
                        "max_labels": 0,
                        "ordered": true,
                        "threshold": 0,
                        "candidate_threshold": 0,
                        "activation": "auto",
                        "temperature": 0,
                        "default": "string",
                        "prompt": "string",
                        "instruction": "string",
                        "examples": [
                            {
                                "input": "string",
                                "label": "string"
                            }
                        ]
                    }
                ],
                "structures": {},
                "entity_definitions": {},
                "entity_attributes": {},
                "classification_constraints": [
                    {
                        "type": "LabelRef",
                        "task": "string",
                        "label": "string"
                    }
                ],
                "joint_ie": {
                    "entities": {},
                    "relations": {},
                    "constraints": [
                        {
                            "type": "TypedEndpoints",
                            "relation": "string",
                            "head_types": [
                                "string"
                            ],
                            "tail_types": [
                                "string"
                            ]
                        }
                    ]
                }
            },
            "options": {
                "threshold": 0,
                "flat_ner": true,
                "include_confidence": true,
                "include_spans": true,
                "word_splitter": "whitespace",
                "overlap": "allow",
                "offset_unit": "utf8_bytes",
                "long_document": {
                    "mode": "reject",
                    "window_words": 1,
                    "overlap_words": 0,
                    "max_windows": 1,
                    "record_identity": "occurrence"
                },
                "decoder": {
                    "algorithm": "auto",
                    "beam_width": 1,
                    "max_search_nodes": 0,
                    "max_local_assignments": 1,
                    "best_effort": true
                },
                "joint_ie": {
                    "candidate_threshold": 0,
                    "entity_threshold": 0,
                    "relation_role_threshold": 0,
                    "top_k_entities": 1,
                    "top_k_roles": 1,
                    "relation_pair_cap": 1,
                    "max_edges_per_type": 1,
                    "entity_weight": 0,
                    "relation_weight": 0
                },
                "reader": {
                    "provider": "string",
                    "model": "string",
                    "url": "string",
                    "api_url": "string"
                },
                "resolver": {
                    "similarity_threshold": 0,
                    "type_must_match": true,
                    "min_entity_confidence": 0,
                    "min_relation_confidence": 0,
                    "deduplicate_relations": true,
                    "track_provenance": true
                }
            }
        }
    },
    "execution": {
        "batch_items": 1,
        "max_attempts": 1
    }
}

Code Examples#

curl -X PUT "/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/privacy" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
    "mode": "monitor",
    "fields": [
        "string"
    ],
    "category_groups": [
        "contact_details"
    ],
    "categories": [
        {
            "name": "string",
            "description": "string",
            "threshold": 0
        }
    ],
    "sensitivity": "conservative",
    "replacement": "category",
    "producer": {
        "type": "extractor",
        "revision": "string",
        "config": {
            "provider": "antfly",
            "model": "string",
            "schema_version": 1,
            "url": "string",
            "api_url": "string",
            "project_id": "string",
            "location": "string",
            "region": "string",
            "credentials_path": "string",
            "account_id": "string",
            "gateway_id": "string",
            "api_key": "string",
            "bearer_token": "string",
            "schema": {
                "entities": [
                    "string"
                ],
                "relations": [
                    {
                        "type": "string",
                        "source": "string",
                        "target": "string",
                        "description": "string",
                        "threshold": 0
                    }
                ],
                "classifications": [
                    {
                        "name": "string",
                        "labels": [
                            "string"
                        ],
                        "multi_label": true,
                        "hypothesis_template": "string",
                        "top_k": 1,
                        "mode": "single",
                        "label_definitions": {},
                        "min_labels": 0,
                        "max_labels": 0,
                        "ordered": true,
                        "threshold": 0,
                        "candidate_threshold": 0,
                        "activation": "auto",
                        "temperature": 0,
                        "default": "string",
                        "prompt": "string",
                        "instruction": "string",
                        "examples": [
                            {
                                "input": "string",
                                "label": "string"
                            }
                        ]
                    }
                ],
                "structures": {},
                "entity_definitions": {},
                "entity_attributes": {},
                "classification_constraints": [
                    {
                        "type": "LabelRef",
                        "task": "string",
                        "label": "string"
                    }
                ],
                "joint_ie": {
                    "entities": {},
                    "relations": {},
                    "constraints": [
                        {
                            "type": "TypedEndpoints",
                            "relation": "string",
                            "head_types": [
                                "string"
                            ],
                            "tail_types": [
                                "string"
                            ]
                        }
                    ]
                }
            },
            "options": {
                "threshold": 0,
                "flat_ner": true,
                "include_confidence": true,
                "include_spans": true,
                "word_splitter": "whitespace",
                "overlap": "allow",
                "offset_unit": "utf8_bytes",
                "long_document": {
                    "mode": "reject",
                    "window_words": 1,
                    "overlap_words": 0,
                    "max_windows": 1,
                    "record_identity": "occurrence"
                },
                "decoder": {
                    "algorithm": "auto",
                    "beam_width": 1,
                    "max_search_nodes": 0,
                    "max_local_assignments": 1,
                    "best_effort": true
                },
                "joint_ie": {
                    "candidate_threshold": 0,
                    "entity_threshold": 0,
                    "relation_role_threshold": 0,
                    "top_k_entities": 1,
                    "top_k_roles": 1,
                    "relation_pair_cap": 1,
                    "max_edges_per_type": 1,
                    "entity_weight": 0,
                    "relation_weight": 0
                },
                "reader": {
                    "provider": "string",
                    "model": "string",
                    "url": "string",
                    "api_url": "string"
                },
                "resolver": {
                    "similarity_threshold": 0,
                    "type_must_match": true,
                    "min_entity_confidence": 0,
                    "min_relation_confidence": 0,
                    "deduplicate_relations": true,
                    "track_provenance": true
                }
            }
        }
    },
    "execution": {
        "batch_items": 1,
        "max_attempts": 1
    }
}'

Responses#

{
  "configured": true,
  "policy": {
    "mode": "monitor",
    "fields": [
      "string"
    ],
    "category_groups": [
      "contact_details"
    ],
    "categories": [
      {
        "name": "string",
        "description": "string",
        "threshold": 0
      }
    ],
    "sensitivity": "conservative",
    "replacement": "category",
    "producer": {
      "type": "extractor",
      "revision": "string",
      "config": {
        "provider": "antfly",
        "model": "string",
        "schema_version": 1,
        "url": "string",
        "api_url": "string",
        "project_id": "string",
        "location": "string",
        "region": "string",
        "credentials_path": "string",
        "account_id": "string",
        "gateway_id": "string",
        "api_key": "string",
        "bearer_token": "string",
        "schema": {
          "entities": [
            "string"
          ],
          "relations": [
            {
              "type": "string",
              "source": "string",
              "target": "string",
              "description": "string",
              "threshold": 0
            }
          ],
          "classifications": [
            {
              "name": "string",
              "labels": [
                "string"
              ],
              "multi_label": true,
              "hypothesis_template": "string",
              "top_k": 1,
              "mode": "single",
              "label_definitions": {},
              "min_labels": 0,
              "max_labels": 0,
              "ordered": true,
              "threshold": 0,
              "candidate_threshold": 0,
              "activation": "auto",
              "temperature": 0,
              "default": "string",
              "prompt": "string",
              "instruction": "string",
              "examples": [
                {
                  "input": "string",
                  "label": "string"
                }
              ]
            }
          ],
          "structures": {},
          "entity_definitions": {},
          "entity_attributes": {},
          "classification_constraints": [
            {
              "type": "LabelRef",
              "task": "string",
              "label": "string"
            }
          ],
          "joint_ie": {
            "entities": {},
            "relations": {},
            "constraints": [
              {
                "type": "TypedEndpoints",
                "relation": "string",
                "head_types": [
                  "string"
                ],
                "tail_types": [
                  "string"
                ]
              }
            ]
          }
        },
        "options": {
          "threshold": 0,
          "flat_ner": true,
          "include_confidence": true,
          "include_spans": true,
          "word_splitter": "whitespace",
          "overlap": "allow",
          "offset_unit": "utf8_bytes",
          "long_document": {
            "mode": "reject",
            "window_words": 1,
            "overlap_words": 0,
            "max_windows": 1,
            "record_identity": "occurrence"
          },
          "decoder": {
            "algorithm": "auto",
            "beam_width": 1,
            "max_search_nodes": 0,
            "max_local_assignments": 1,
            "best_effort": true
          },
          "joint_ie": {
            "candidate_threshold": 0,
            "entity_threshold": 0,
            "relation_role_threshold": 0,
            "top_k_entities": 1,
            "top_k_roles": 1,
            "relation_pair_cap": 1,
            "max_edges_per_type": 1,
            "entity_weight": 0,
            "relation_weight": 0
          },
          "reader": {
            "provider": "string",
            "model": "string",
            "url": "string",
            "api_url": "string"
          },
          "resolver": {
            "similarity_threshold": 0,
            "type_must_match": true,
            "min_entity_confidence": 0,
            "min_relation_confidence": 0,
            "deduplicate_relations": true,
            "track_provenance": true
          }
        }
      }
    },
    "execution": {
      "batch_items": 1,
      "max_attempts": 1
    }
  },
  "policy_version": "string",
  "resource_version": 0,
  "generation": 0,
  "scan_id": "string",
  "etag": "string",
  "resolved_producer": {
    "type": "extractor",
    "revision": "string",
    "config": {
      "provider": "antfly",
      "model": "string",
      "schema_version": 1,
      "url": "string",
      "api_url": "string",
      "project_id": "string",
      "location": "string",
      "region": "string",
      "credentials_path": "string",
      "account_id": "string",
      "gateway_id": "string",
      "api_key": "string",
      "bearer_token": "string",
      "schema": {
        "entities": [
          "string"
        ],
        "relations": [
          {
            "type": "string",
            "source": "string",
            "target": "string",
            "description": "string",
            "threshold": 0
          }
        ],
        "classifications": [
          {
            "name": "string",
            "labels": [
              "string"
            ],
            "multi_label": true,
            "hypothesis_template": "string",
            "top_k": 1,
            "mode": "single",
            "label_definitions": {},
            "min_labels": 0,
            "max_labels": 0,
            "ordered": true,
            "threshold": 0,
            "candidate_threshold": 0,
            "activation": "auto",
            "temperature": 0,
            "default": "string",
            "prompt": "string",
            "instruction": "string",
            "examples": [
              {
                "input": "string",
                "label": "string"
              }
            ]
          }
        ],
        "structures": {},
        "entity_definitions": {},
        "entity_attributes": {},
        "classification_constraints": [
          {
            "type": "LabelRef",
            "task": "string",
            "label": "string"
          }
        ],
        "joint_ie": {
          "entities": {},
          "relations": {},
          "constraints": [
            {
              "type": "TypedEndpoints",
              "relation": "string",
              "head_types": [
                "string"
              ],
              "tail_types": [
                "string"
              ]
            }
          ]
        }
      },
      "options": {
        "threshold": 0,
        "flat_ner": true,
        "include_confidence": true,
        "include_spans": true,
        "word_splitter": "whitespace",
        "overlap": "allow",
        "offset_unit": "utf8_bytes",
        "long_document": {
          "mode": "reject",
          "window_words": 1,
          "overlap_words": 0,
          "max_windows": 1,
          "record_identity": "occurrence"
        },
        "decoder": {
          "algorithm": "auto",
          "beam_width": 1,
          "max_search_nodes": 0,
          "max_local_assignments": 1,
          "best_effort": true
        },
        "joint_ie": {
          "candidate_threshold": 0,
          "entity_threshold": 0,
          "relation_role_threshold": 0,
          "top_k_entities": 1,
          "top_k_roles": 1,
          "relation_pair_cap": 1,
          "max_edges_per_type": 1,
          "entity_weight": 0,
          "relation_weight": 0
        },
        "reader": {
          "provider": "string",
          "model": "string",
          "url": "string",
          "api_url": "string"
        },
        "resolver": {
          "similarity_threshold": 0,
          "type_must_match": true,
          "min_entity_confidence": 0,
          "min_relation_confidence": 0,
          "deduplicate_relations": true,
          "track_provenance": true
        }
      }
    }
  },
  "external_processing": true,
  "coverage": {
    "available": true,
    "refreshing": true,
    "started_at_millis": 0,
    "completed_at_millis": 0,
    "total": 0,
    "current": 0,
    "pending": 0,
    "failed": 0,
    "with_findings": 0,
    "protected_ready": 0,
    "protected_blocked": 0,
    "categories": {},
    "fields": {},
    "failed_known": 0,
    "failures": [
      {}
    ],
    "next_key": "string"
  }
}

Inspect a bounded sample without saving the policy#

POST/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/privacy/preview

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer YOUR_API_KEY

Request Body#

Example:

{
    "policy": {
        "mode": "monitor",
        "fields": [
            "string"
        ],
        "category_groups": [
            "contact_details"
        ],
        "categories": [
            {
                "name": "string",
                "description": "string",
                "threshold": 0
            }
        ],
        "sensitivity": "conservative",
        "replacement": "category",
        "producer": {
            "type": "extractor",
            "revision": "string",
            "config": {
                "provider": "antfly",
                "model": "string",
                "schema_version": 1,
                "url": "string",
                "api_url": "string",
                "project_id": "string",
                "location": "string",
                "region": "string",
                "credentials_path": "string",
                "account_id": "string",
                "gateway_id": "string",
                "api_key": "string",
                "bearer_token": "string",
                "schema": {
                    "entities": [
                        "string"
                    ],
                    "relations": [
                        {
                            "type": "string",
                            "source": "string",
                            "target": "string",
                            "description": "string",
                            "threshold": 0
                        }
                    ],
                    "classifications": [
                        {
                            "name": "string",
                            "labels": [
                                "string"
                            ],
                            "multi_label": true,
                            "hypothesis_template": "string",
                            "top_k": 1,
                            "mode": "single",
                            "label_definitions": {},
                            "min_labels": 0,
                            "max_labels": 0,
                            "ordered": true,
                            "threshold": 0,
                            "candidate_threshold": 0,
                            "activation": "auto",
                            "temperature": 0,
                            "default": "string",
                            "prompt": "string",
                            "instruction": "string",
                            "examples": [
                                {
                                    "input": "string",
                                    "label": "string"
                                }
                            ]
                        }
                    ],
                    "structures": {},
                    "entity_definitions": {},
                    "entity_attributes": {},
                    "classification_constraints": [
                        {
                            "type": "LabelRef",
                            "task": "string",
                            "label": "string"
                        }
                    ],
                    "joint_ie": {
                        "entities": {},
                        "relations": {},
                        "constraints": [
                            {
                                "type": "TypedEndpoints",
                                "relation": "string",
                                "head_types": [
                                    "string"
                                ],
                                "tail_types": [
                                    "string"
                                ]
                            }
                        ]
                    }
                },
                "options": {
                    "threshold": 0,
                    "flat_ner": true,
                    "include_confidence": true,
                    "include_spans": true,
                    "word_splitter": "whitespace",
                    "overlap": "allow",
                    "offset_unit": "utf8_bytes",
                    "long_document": {
                        "mode": "reject",
                        "window_words": 1,
                        "overlap_words": 0,
                        "max_windows": 1,
                        "record_identity": "occurrence"
                    },
                    "decoder": {
                        "algorithm": "auto",
                        "beam_width": 1,
                        "max_search_nodes": 0,
                        "max_local_assignments": 1,
                        "best_effort": true
                    },
                    "joint_ie": {
                        "candidate_threshold": 0,
                        "entity_threshold": 0,
                        "relation_role_threshold": 0,
                        "top_k_entities": 1,
                        "top_k_roles": 1,
                        "relation_pair_cap": 1,
                        "max_edges_per_type": 1,
                        "entity_weight": 0,
                        "relation_weight": 0
                    },
                    "reader": {
                        "provider": "string",
                        "model": "string",
                        "url": "string",
                        "api_url": "string"
                    },
                    "resolver": {
                        "similarity_threshold": 0,
                        "type_must_match": true,
                        "min_entity_confidence": 0,
                        "min_relation_confidence": 0,
                        "deduplicate_relations": true,
                        "track_provenance": true
                    }
                }
            }
        },
        "execution": {
            "batch_items": 1,
            "max_attempts": 1
        }
    },
    "sample": {
        "keys": [
            "string"
        ],
        "limit": 1
    }
}

Code Examples#

curl -X POST "/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/privacy/preview" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
    "policy": {
        "mode": "monitor",
        "fields": [
            "string"
        ],
        "category_groups": [
            "contact_details"
        ],
        "categories": [
            {
                "name": "string",
                "description": "string",
                "threshold": 0
            }
        ],
        "sensitivity": "conservative",
        "replacement": "category",
        "producer": {
            "type": "extractor",
            "revision": "string",
            "config": {
                "provider": "antfly",
                "model": "string",
                "schema_version": 1,
                "url": "string",
                "api_url": "string",
                "project_id": "string",
                "location": "string",
                "region": "string",
                "credentials_path": "string",
                "account_id": "string",
                "gateway_id": "string",
                "api_key": "string",
                "bearer_token": "string",
                "schema": {
                    "entities": [
                        "string"
                    ],
                    "relations": [
                        {
                            "type": "string",
                            "source": "string",
                            "target": "string",
                            "description": "string",
                            "threshold": 0
                        }
                    ],
                    "classifications": [
                        {
                            "name": "string",
                            "labels": [
                                "string"
                            ],
                            "multi_label": true,
                            "hypothesis_template": "string",
                            "top_k": 1,
                            "mode": "single",
                            "label_definitions": {},
                            "min_labels": 0,
                            "max_labels": 0,
                            "ordered": true,
                            "threshold": 0,
                            "candidate_threshold": 0,
                            "activation": "auto",
                            "temperature": 0,
                            "default": "string",
                            "prompt": "string",
                            "instruction": "string",
                            "examples": [
                                {
                                    "input": "string",
                                    "label": "string"
                                }
                            ]
                        }
                    ],
                    "structures": {},
                    "entity_definitions": {},
                    "entity_attributes": {},
                    "classification_constraints": [
                        {
                            "type": "LabelRef",
                            "task": "string",
                            "label": "string"
                        }
                    ],
                    "joint_ie": {
                        "entities": {},
                        "relations": {},
                        "constraints": [
                            {
                                "type": "TypedEndpoints",
                                "relation": "string",
                                "head_types": [
                                    "string"
                                ],
                                "tail_types": [
                                    "string"
                                ]
                            }
                        ]
                    }
                },
                "options": {
                    "threshold": 0,
                    "flat_ner": true,
                    "include_confidence": true,
                    "include_spans": true,
                    "word_splitter": "whitespace",
                    "overlap": "allow",
                    "offset_unit": "utf8_bytes",
                    "long_document": {
                        "mode": "reject",
                        "window_words": 1,
                        "overlap_words": 0,
                        "max_windows": 1,
                        "record_identity": "occurrence"
                    },
                    "decoder": {
                        "algorithm": "auto",
                        "beam_width": 1,
                        "max_search_nodes": 0,
                        "max_local_assignments": 1,
                        "best_effort": true
                    },
                    "joint_ie": {
                        "candidate_threshold": 0,
                        "entity_threshold": 0,
                        "relation_role_threshold": 0,
                        "top_k_entities": 1,
                        "top_k_roles": 1,
                        "relation_pair_cap": 1,
                        "max_edges_per_type": 1,
                        "entity_weight": 0,
                        "relation_weight": 0
                    },
                    "reader": {
                        "provider": "string",
                        "model": "string",
                        "url": "string",
                        "api_url": "string"
                    },
                    "resolver": {
                        "similarity_threshold": 0,
                        "type_must_match": true,
                        "min_entity_confidence": 0,
                        "min_relation_confidence": 0,
                        "deduplicate_relations": true,
                        "track_provenance": true
                    }
                }
            }
        },
        "execution": {
            "batch_items": 1,
            "max_attempts": 1
        }
    },
    "sample": {
        "keys": [
            "string"
        ],
        "limit": 1
    }
}'

Responses#

{
  "policy_version": "string",
  "sampled": 0,
  "complete_table_scan": true,
  "external_processing": true,
  "documents": [
    {
      "document": "string",
      "fields": [
        {
          "field": "string",
          "original": "string",
          "text": "string",
          "findings": [
            {
              "document": "string",
              "field": "string",
              "category": "string",
              "start": 0,
              "end": 0,
              "confidence": 0,
              "policy_version": "string",
              "source_fingerprint": "string",
              "producer_revision": "string"
            }
          ]
        }
      ]
    }
  ]
}

Start a durable privacy rescan#

POST/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/privacy/scans

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer YOUR_API_KEY

Request Body#

Example:

{
    "from_key": "string",
    "to_key": "string",
    "limit": 1
}

Code Examples#

curl -X POST "/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/privacy/scans" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
    "from_key": "string",
    "to_key": "string",
    "limit": 1
}'

Responses#

{
  "scan_id": "string",
  "policy_version": "string",
  "phase": "queued",
  "scanned": 0,
  "reprocessed": 0,
  "failed": 0,
  "next_key": "string",
  "skipped": 0,
  "last_error": "string",
  "consecutive_errors": 0,
  "retry_after_millis": 0,
  "updated_at_millis": 0,
  "verification_cursor": "string",
  "verification_current": 0,
  "verification_pending": 0,
  "verification_failed": 0,
  "verification_blocked": 0,
  "failures": [
    {}
  ]
}

Read privacy scan progress#

GET/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/privacy/scans/{scanId}

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer YOUR_API_KEY

Code Examples#

curl -X GET "/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/privacy/scans/{scanId}" \
    -H "Authorization: Bearer YOUR_API_KEY"

Responses#

{
  "scan_id": "string",
  "policy_version": "string",
  "phase": "queued",
  "scanned": 0,
  "reprocessed": 0,
  "failed": 0,
  "next_key": "string",
  "skipped": 0,
  "last_error": "string",
  "consecutive_errors": 0,
  "retry_after_millis": 0,
  "updated_at_millis": 0,
  "verification_cursor": "string",
  "verification_current": 0,
  "verification_pending": 0,
  "verification_failed": 0,
  "verification_blocked": 0,
  "failures": [
    {}
  ]
}

List current privacy findings#

GET/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/privacy/findings

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer YOUR_API_KEY

Parameters#

NameTypeLocationRequiredDescription
cursorstringqueryNo
documentstringqueryNo
fieldstringqueryNo
categorystringqueryNo
policy_versionstringqueryNo
limitintegerqueryNo

Code Examples#

curl -X GET "/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/privacy/findings?cursor=value&document=value&field=value&category=value&policy_version=value&limit=value" \
    -H "Authorization: Bearer YOUR_API_KEY"

Responses#

{
  "policy_version": "string",
  "findings": [
    {
      "document": "string",
      "field": "string",
      "category": "string",
      "start": 0,
      "end": 0,
      "confidence": 0,
      "policy_version": "string",
      "source_fingerprint": "string",
      "producer_revision": "string"
    }
  ],
  "next_cursor": "string",
  "examined_documents": 0,
  "pending_documents": 0
}

List current privacy findings with body filters#

POST/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/privacy/findings

Equivalent to GET findings, with filters and continuation in JSON so large document identifiers do not exceed URL limits.

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer YOUR_API_KEY

Request Body#

Example:

{
    "cursor": "string",
    "document": "string",
    "field": "string",
    "category": "string",
    "policy_version": "string",
    "limit": 1
}

Code Examples#

curl -X POST "/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/privacy/findings" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
    "cursor": "string",
    "document": "string",
    "field": "string",
    "category": "string",
    "policy_version": "string",
    "limit": 1
}'

Responses#

{
  "policy_version": "string",
  "findings": [
    {
      "document": "string",
      "field": "string",
      "category": "string",
      "start": 0,
      "end": 0,
      "confidence": 0,
      "policy_version": "string",
      "source_fingerprint": "string",
      "producer_revision": "string"
    }
  ],
  "next_cursor": "string",
  "examined_documents": 0,
  "pending_documents": 0
}