{"id":14208,"date":"2021-01-11T17:58:51","date_gmt":"2021-01-11T22:58:51","guid":{"rendered":"http:\/\/www.iri.com\/blog\/?p=14208"},"modified":"2026-02-23T17:59:10","modified_gmt":"2026-02-23T22:59:10","slug":"darkshield-rpc-api","status":"publish","type":"post","link":"https:\/\/www.iri.com\/blog\/data-protection\/darkshield-rpc-api\/","title":{"rendered":"IRI DarkShield RPC API"},"content":{"rendered":"<p><em><strong>Editors Note<\/strong>: The article below was written prior to the release of V5 of the IRI DarkShield PII data masking tool for structured, semi-structured, and unstructured data. <a href=\"https:\/\/www.iri.com\/news\/press-releases\/new-darkshield-version-finds-and-masks-more-pii-data-at-risk\">Version 5<\/a>, released in Q1, 2024, introduced separate RPC APIs based on the one below &#8212; for files, relational databases and NoSQL databases. All four APIs are now also used to run search and mask jobs configured in the <a href=\"https:\/\/www.iri.com\/products\/workbench\/darkshield-gui\">DarkShield GUI<\/a>. DarkShield Version 6, released in Q3, 2025 now also offers a stateless, <a href=\"https:\/\/www.iri.com\/blog\/data-protection\/iri-darkshield-rest-api\/\">REST API<\/a> option.<\/em><\/p>\n<p><a href=\"https:\/\/www.iri.com\/products\/darkshield\"><i>IRI DarkShield<\/i><\/a> Version 4 features a Remote Procedure Call (RPC) Application Programming Interface (API) for searching and masking unstructured text. The API allows for the use of DarkShield\u2019s search matchers and masking rules outside of the context of files.<\/p>\n<p>This \u201cBase API\u201d is also the underlying technology used by the <a href=\"http:\/\/www.iri.com\/blog\/data-protection\/darkshield-files-rpc-api\/\"><i>DarkShield Files API<\/i><\/a> for performing search and masking operations specifically in free-form text, CSV\/TSV, JSON\/XML, PDF, Parquet, and\/or image files residing on premise, or in cloud storage like Azure, GCP, S3 or OneDrive\/SharePoint.<\/p>\n<p>The DarkShield API is built as a plugin on top of the IRI Web Services Platform (codenamed <i>Plankton<\/i>), allowing the user to pick which services they will require while utilizing the same hosting, configuration, and logging capabilities provided through the platform.<\/p>\n<p><a href=\"\/blog\/wp-content\/uploads\/2021\/01\/iri-web-services-architecture-cropped.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-14216 aligncenter\" src=\"\/blog\/wp-content\/uploads\/2021\/01\/iri-web-services-architecture-cropped.png\" alt=\"\" width=\"438\" height=\"449\" srcset=\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/iri-web-services-architecture-cropped.png 438w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/iri-web-services-architecture-cropped-293x300.png 293w\" sizes=\"(max-width: 438px) 100vw, 438px\" \/><\/a><\/p>\n<p>This article covers the API\u2019s core search and masking capabilities, and provides a few examples.<span id='easy-footnote-1-14208' class='easy-footnote-margin-adjust'><\/span><span class='easy-footnote'><a href='https:\/\/www.iri.com\/blog\/data-protection\/darkshield-rpc-api\/#easy-footnote-bottom-1-14208' title='An online video introduction and demo is also available &lt;a href=&quot;https:\/\/www.youtube.com\/watch?v=0Zh1KcU9URs&amp;amp;ab_channel=IRITheCoSortCo&quot;&gt;here&lt;\/a&gt;.'><sup>1<\/sup><\/a><\/span><\/p>\n<p><a href=\"\/blog\/wp-content\/uploads\/2021\/10\/DarkShield-base-api-diagram.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-15115 aligncenter\" src=\"\/blog\/wp-content\/uploads\/2021\/10\/DarkShield-base-api-diagram.png\" alt=\"\" width=\"650\" height=\"381\" srcset=\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/10\/DarkShield-base-api-diagram.png 855w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/10\/DarkShield-base-api-diagram-300x176.png 300w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/10\/DarkShield-base-api-diagram-768x450.png 768w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><\/a><\/p>\n<p>The DarkShield RPC API is documented through an <i>OpenAPI document<\/i>, a JSON\/YAML based declarative specification of the different endpoints supported by the API, the schemas of the request payloads and the expected responses, as well as examples that can be run against each endpoint.<\/p>\n<p>The screenshots used throughout this article are HTML-rendered views of DarkShield\u2019s <a href=\"https:\/\/www.openapis.org\/\"><i>OpenAPI<\/i><\/a> document. By default, all Plankton services use <a href=\"https:\/\/swagger.io\/tools\/swagger-ui\/\"><i>Swagger-UI<\/i><\/a> to render the OpenAPI documents under the <i>\/docs<\/i> endpoint, which provides a useful interface for executing examples.<\/p>\n<p>In some cases we will also be showing <a href=\"https:\/\/redoc.ly\/\"><i>Redoc<\/i><\/a>-rendered versions for added clarity (certain OpenAPI V3 concepts like <i>discriminators <\/i>are not properly modeled in <i>Swagger-UI<\/i>).<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-16376\" src=\"\/blog\/wp-content\/uploads\/2022\/12\/Capture.png\" alt=\"This image shows base endpoints of the DarkShield API for searching and masking text\" width=\"3000\" height=\"1920\" srcset=\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2022\/12\/Capture.png 3000w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2022\/12\/Capture-300x192.png 300w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2022\/12\/Capture-1024x655.png 1024w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2022\/12\/Capture-768x492.png 768w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2022\/12\/Capture-1536x983.png 1536w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2022\/12\/Capture-2048x1311.png 2048w\" sizes=\"(max-width: 3000px) 100vw, 3000px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>For file-based search and masking, we also provide an additional plugin called the <i>IRI DarkShield Files API<\/i>. The files plugin utilizes the same search and matcher contexts that are defined in the base API discussed in this article, so we recommend that you read this article first before continuing on to the files article.<\/p>\n<p><a href=\"\/blog\/wp-content\/uploads\/2021\/01\/DarkShield-files-api-diagram.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-14221 aligncenter\" src=\"\/blog\/wp-content\/uploads\/2021\/01\/DarkShield-files-api-diagram.png\" alt=\"\" width=\"651\" height=\"440\" srcset=\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/DarkShield-files-api-diagram.png 861w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/DarkShield-files-api-diagram-300x203.png 300w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/DarkShield-files-api-diagram-768x519.png 768w\" sizes=\"(max-width: 651px) 100vw, 651px\" \/><\/a><\/p>\n<h5><b>Running the API<\/b><\/h5>\n<p>To follow along the examples given in this article, we recommend that you look at our Plankton setup guide (packaged with the trial) for how to install and run the API. Once you launch Plankton, navigate to the location where the OpenAPI docs are hosted in your browser, which by default is on <i>http:\/\/localhost:8959\/docs<\/i>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-16377\" src=\"\/blog\/wp-content\/uploads\/2021\/01\/planktonStartup.png\" alt=\"Startup of the DarkShield ('plankton') RPC API at the default port of 8959\" width=\"1702\" height=\"331\" srcset=\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/planktonStartup.png 1702w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/planktonStartup-300x58.png 300w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/planktonStartup-1024x199.png 1024w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/planktonStartup-768x149.png 768w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/planktonStartup-1536x299.png 1536w\" sizes=\"(max-width: 1702px) 100vw, 1702px\" \/><\/p>\n<h5><b>Creating Search Contexts<\/b><\/h5>\n<p>Before we can begin using the API to annotate text, we must first define the search methodology that DarkShield will use. For that, we need to host a Search Context which defines a set of Search Matchers that we will use to match on the data, as well as a unique name so that we can send search requests to it.<\/p>\n<p>If you select the <i>\/api\/darkshield\/searchContext.create <\/i>endpoint, you will be shown a description of the endpoint along with a useful example for how to create one. You can also select other examples from the dropdown:<\/p>\n<p><a href=\"http:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-3.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-14223 aligncenter\" src=\"\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-3-1024x514.png\" alt=\"\" width=\"651\" height=\"327\" srcset=\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-3-1024x514.png 1024w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-3-300x151.png 300w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-3-768x385.png 768w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-3.png 1600w\" sizes=\"(max-width: 651px) 100vw, 651px\" \/><\/a><\/p>\n<p>To execute an example, click on the <i>Try it out <\/i>button, which adds an <i>Execute <\/i>button on the bottom and allows you to modify the currently selected example in case you want to tweak it or create your own:<\/p>\n<p><a href=\"http:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-4.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-14224 aligncenter\" src=\"\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-4-1024x540.png\" alt=\"\" width=\"650\" height=\"343\" srcset=\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-4-1024x540.png 1024w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-4-300x158.png 300w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-4-768x405.png 768w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-4.png 1600w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><\/a><\/p>\n<p>Click <i>Execute <\/i>to create the example Search Context which you have selected. On the bottom, you will see the <i>curl<\/i> command that can be used to execute the same command through the command line, as well as the response (which should return a 200 status code with an empty body for a successful execution):<\/p>\n<p><a href=\"http:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-5.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-14225 aligncenter\" src=\"\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-5-1024x330.png\" alt=\"\" width=\"649\" height=\"209\" srcset=\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-5-1024x330.png 1024w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-5-300x97.png 300w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-5-768x248.png 768w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-5.png 1600w\" sizes=\"(max-width: 649px) 100vw, 649px\" \/><\/a><\/p>\n<p>You will note that the name of the Search Context has to be unique, and duplicate Search Contexts are prohibited. If you try to execute the same exact example again, you will get a 400 Bad Request response with an error message stating that the Search Context you were trying to create already exists:<\/p>\n<p><a href=\"http:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-6.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-14226 aligncenter\" src=\"\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-6-1024x460.png\" alt=\"\" width=\"650\" height=\"292\" srcset=\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-6-1024x460.png 1024w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-6-300x135.png 300w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-6-768x345.png 768w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-6.png 1600w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><\/a><\/p>\n<p>If you wish to change a Search Context, you must first explicitly destroy it by calling the\u00a0<i>\/api\/darkshield\/searchContext.destroy <\/i>endpoint. All Search and Mask Contexts will also be destroyed automatically when the server stops, and have to be re-created when <i>Plankton<\/i> is restarted.<\/p>\n<h5><b>Search Matchers<\/b><\/h5>\n<p>The <i>OpenAPI<\/i> document not only provides examples for the <i>searchContext.create <\/i>endpoint, but also the schema for how a request payload should look like in order for a Search Context to be created. If you are still in example mode, click <i>Cancel <\/i>to return to the original view, and the click on <i>Schema <\/i>next to the <i>Examples <\/i>tab under the <i>Request Body <\/i>to view the schema for the endpoint:<\/p>\n<p><a href=\"http:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-7.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-14227 aligncenter\" src=\"\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-7-1024x520.png\" alt=\"\" width=\"650\" height=\"330\" srcset=\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-7-1024x520.png 1024w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-7-300x152.png 300w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-7-768x390.png 768w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-7.png 1600w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><\/a><\/p>\n<p>From this view, you can see that a Search Context requires a name and a list of Search Matchers (with at least one Search Matcher defined). The name of the Search Matcher will be added to an annotation to indicate which matcher was used to annotate it.<\/p>\n<p>Note that, unlike the Search Context name, the Search Matcher name does not have to be unique. For example, there are multiple ways to match on names, and each matcher can be named \u201cNamesMatcher.\u201d<\/p>\n<p>Looking at the screenshot above, the schema for a Search Matcher does not give a lot of clues regarding what the required fields are, or what the <i>type <\/i>should be. This is a known limitation for <i>Swagger UI<\/i> since it cannot display all subclasses of the Search Matcher schema based on the discriminator value (in this case, the <i>type <\/i>field).<\/p>\n<p>You can scroll down to the bottom of the page to view the <i>Schemas<\/i> tab that contains the various different subtypes of the Search Matcher. Or if you are using <i>Redoc<\/i>, you will be able to see more information:<\/p>\n<p><a href=\"http:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-8.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-14228 aligncenter\" src=\"\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-8-1024x677.png\" alt=\"\" width=\"650\" height=\"430\" srcset=\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-8-1024x677.png 1024w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-8-300x198.png 300w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-8-768x508.png 768w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-8.png 1575w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><\/a><\/p>\n<p>On <i>Redoc<\/i>, you can toggle between the 5 different Search Matcher types, each of which have their own parameters and return their own annotations:<\/p>\n<ol>\n<li aria-level=\"1\">Fuzzy Lookup (fuzzy): Searches for exact and non-exact matches within text using Levenshtein distance. Fuzzy Matchers can specify various matching criteria, like maximum Levenshtein Distance or the number of permitted deletions\/insertions. Returns annotations that contain the Levenshtein distance between the match and the keyword that the matcher thought it matched.<\/li>\n<li aria-level=\"1\">Named Entity Recognition (ner): Searches for a specific category of data that the OpenNLP-compatible model was trained on based on the sentence context in which that data could appear in (e.g., , names, addresses, dates, etc.). Can specify optional sentence detectors and tokenizer models, otherwise standard whitespace detectors will be used to split the text into sentences and tokenize them. Return annotations containing a statistical probability that the named entity was correctly identified.<\/li>\n<li aria-level=\"1\">Pattern (pattern): A regular expression pattern with an optional validation JavaScript file for performing computational validation on matches (for example, calculating the checksum for credit cards). A pattern match can also be split into named groups, which is useful in cases where only a part of the pattern is of interest. Returns standard annotation which can optionally include the group that was matched from the pattern if named groups were specified (both in the pattern and the <i>groups<\/i> matcher parameter).<\/li>\n<li aria-level=\"1\">Set File Lookup (set): direct lookup of entries from a set file. Can choose whether to match whole words and whether to ignore case. Return standard annotations.<\/li>\n<li aria-level=\"1\">Transformers Named Entity Recognition (transformers): Searches for text that an NER model (of either the PyTorch or TensorFlow frameworks) has annotated. Either a name of a model on <a href=\"https:\/\/huggingface.co\/models\">Huggingface Model Hub<\/a> or the folder location of the model can be specified for both the NER model and tokenizer model. What labels to include in annotations can be specified by the <em>entityLabels<\/em> parameter. For example, an NER model may label different types of named entities (location names, peoples&#8217; names,\u00a0 organization names, etc.) differently. By default, all entities labeled by the model are included in annotations.\u00a0 How entities are grouped can be tuned via the <em>aggregationStrategy<\/em> parameter. Returns annotations containing a statistical probability that the named entity was correctly identified.<\/li>\n<\/ol>\n<h5><b>Searching Text<\/b><\/h5>\n<p>Once we have hosted our Search Context, we want to perform an actual search against it. Scroll down to the <i>\/api\/darkshield\/searchContext.search<\/i> endpoint and select the example that matches the Search Context that you have created previously:<\/p>\n<p><a href=\"http:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-9.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-14229 aligncenter\" src=\"\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-9-1024x441.png\" alt=\"\" width=\"650\" height=\"280\" srcset=\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-9-1024x441.png 1024w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-9-300x129.png 300w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-9-768x331.png 768w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-9.png 1600w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><\/a><\/p>\n<p>The request contains the name of the Search Context that we want to use and the text that we want to search. If we click on the <i>Try it out <\/i>button and then click on the <i>Execute<\/i>, we can see the resulting annotations file that is returned from the API:<\/p>\n<p><a href=\"http:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-10.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-14230 aligncenter\" src=\"\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-10-1024x518.png\" alt=\"\" width=\"650\" height=\"329\" srcset=\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-10-1024x518.png 1024w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-10-300x152.png 300w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-10-768x388.png 768w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-10.png 1600w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><\/a><\/p>\n<p>A list of annotations are returned, with each annotation containing the match, the name of the matcher that matched it, the start and end character offsets of the match, and the type of the annotation (which can help determine what additional fields could be defined for the match).<\/p>\n<p>These annotations are in JSON and downloadable to a file. It is therefore possible to export your search results to third-party tools; for example, SIEM portals like <a href=\"https:\/\/www.iri.com\/blog\/business-intelligence\/datadog-security-analytics-darkshield\/\">Datadog<\/a> or <a href=\"https:\/\/www.iri.com\/blog\/data-protection\/darkshield-splunk-es\/\">Splunk<\/a>, or a data catalog like Alation.<\/p>\n<p>If you are using multiple Search Matchers in a Search Context, there is a chance that overlapping annotations are produced (for example, if a set lookup and an NER model matches on the same name). In those cases, DarkShield only keeps one of the overlapping matches, preferring the left-most and longest match.<\/p>\n<p>In the future, there may be additional strategies which can be specified inside of a Search Context for dealing with overlapping annotations.<\/p>\n<p>If you pick an example for a Search Context which has not yet been hosted, you will see the following error, which states that the Context in question does not exist:<\/p>\n<p><a href=\"http:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-11.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-14231 aligncenter\" src=\"\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-11-1024x449.png\" alt=\"\" width=\"650\" height=\"285\" srcset=\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-11-1024x449.png 1024w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-11-300x132.png 300w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-11-768x337.png 768w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-11.png 1600w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><\/a><\/p>\n<p>In a case like this, you can either select the correct example or create the Search Context which you are trying to use from the previous section.<\/p>\n<h5><b>Creating Mask Contexts<\/b><\/h5>\n<p>As a direct analog to a Search Context, we need to create a corresponding Mask Context which can be used to mask annotated text. A Mask Context defines a list of masking rules that should be applied, as well as a list of Rule Matchers which match annotations to their corresponding data masking rule (<a href=\"https:\/\/www.iri.com\/solutions\/data-masking\/static-data-masking\">function<\/a>).<\/p>\n<p>Navigate to the <i>\/api\/darkshield\/maskContext.create<\/i> endpoint:<\/p>\n<p><a href=\"http:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-12.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-14232 aligncenter\" src=\"\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-12-1024x511.png\" alt=\"\" width=\"651\" height=\"325\" srcset=\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-12-1024x511.png 1024w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-12-300x150.png 300w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-12-768x383.png 768w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-12.png 1600w\" sizes=\"(max-width: 651px) 100vw, 651px\" \/><\/a><\/p>\n<p>You will note that the names of the examples correspond to the Search Context examples. However, it would be incorrect to say that there is a one-to-one matching between a Mask Context and a Search Context. That is because a Mask Context can be used to mask annotations produced from any number of Search Contexts, provided that the annotations match the criteria of the Rule Matchers.<\/p>\n<p>To illustrate this point, we will first look at the definition of the Rule Matchers in <i>Redoc<\/i>.<\/p>\n<h5><b>Rule Matchers<\/b><\/h5>\n<p>A Rule Matcher is used to map an annotation to a corresponding Masking Rule. Currently, there is only one type of Rule Matcher, a <i>Name Rule Matcher<\/i>, which matches on the name of the Search Matcher that created the annotation using a regular expression pattern.<\/p>\n<p><a href=\"http:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-rule-matchers.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-14234 aligncenter\" src=\"\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-rule-matchers-908x1024.png\" alt=\"\" width=\"650\" height=\"733\" srcset=\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-rule-matchers-908x1024.png 908w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-rule-matchers-266x300.png 266w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-rule-matchers-768x866.png 768w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-rule-matchers.png 1053w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><\/a><\/p>\n<p>A Name Rule Matcher can therefore match on multiple different Search Matcher names, including all possible Search Matchers if an inclusive pattern is specified (for example, \u201c.+\u201d which matches on all possible sequences of ASCII characters).<\/p>\n<p>Rule Matchers are applied in order, so a common strategy for making sure that all annotations are masked is to define the specific Rule Matchers first, and then more general Rule Matchers which can catch all non-matched annotations.<\/p>\n<p>If no Rule Matcher matches on an annotation, that annotation will not be masked, and will be placed inside of the <i>failedResults<\/i> array along with the reason why it failed (because it could not be matched).<\/p>\n<h5><b>Masking Rules<\/b><\/h5>\n<p>Each Rule Matcher corresponds to exactly one Masking rule, defined in the <i>rules <\/i>array:<\/p>\n<p><a href=\"http:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-masking-rules.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-14233 aligncenter\" src=\"\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-masking-rules-1008x1024.png\" alt=\"\" width=\"649\" height=\"659\" srcset=\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-masking-rules-1008x1024.png 1008w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-masking-rules-295x300.png 295w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-masking-rules-768x780.png 768w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-masking-rules.png 1051w\" sizes=\"(max-width: 649px) 100vw, 649px\" \/><\/a><\/p>\n<p>Currently, there is only one type of masking rule, a <i>CoSort <\/i>rule, which is defined using an IRI Domain-Specific Language (DSL) which is used in FieldShield. The DarkShield API delegates masking tasks to the underlying SortCL engine by generating the associated script.<\/p>\n<p>Some examples of common rule expressions include:<\/p>\n<ul>\n<li aria-level=\"1\"><i>replace_chars(${NAME}, \u2018*\u2019)<\/i>: A character redaction which replaces the input with a sequence of masking characters, in this case an asterisk \u2018*\u2019.<\/li>\n<li aria-level=\"1\"><i>enc_fp_aes256_alphanum(${NAME}, \u2018passphrase\u2019)<\/i>: Generate ciphertext using format-preserving encryption.<\/li>\n<li aria-level=\"1\"><i>hash_sha2(${NAME})<\/i>: Generate a hash from the input.<\/li>\n<\/ul>\n<p>Note that the <i>${NAME} <\/i>represents any arbitrary text, since DarkShield replaces it with an internal field name.<\/p>\n<p>For more information about the different masking rules which can be used and the parameters for their expressions, consult the FieldShield manual.<\/p>\n<p>Pseudonymization can be performed by specifying a path to a set file and leaving the expression field blank. The set file should contain two tab-delimited columns, the first specifying the text to match on and the second specifying the replacement. The set file must be sorted in ASCII order.<\/p>\n<h5><b>Masking Text<\/b><\/h5>\n<p>With the understanding of how Rule Matchers and Masking Rules work, we can now create a Mask Context from the list of examples. After clicking <i>Try it out <\/i>and <i>Execute<\/i>, you should see a results JSON payload in the response containing the masked text along with the results and failed results:<\/p>\n<p><a href=\"http:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-13.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-14235 aligncenter\" src=\"\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-13-1024x524.png\" alt=\"\" width=\"649\" height=\"332\" srcset=\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-13-1024x524.png 1024w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-13-300x154.png 300w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-13-768x393.png 768w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-13.png 1600w\" sizes=\"(max-width: 649px) 100vw, 649px\" \/><\/a><\/p>\n<p>The <i>results <\/i>array contains a list of masked results, each with the original annotation that was masked, the new start and end character offsets relative to the masked text, the generated masked result, and the rule name that was used to generate it.<\/p>\n<p>The <i>failedResults <\/i>array will contain any result which was not masked. There are many reasons for why an annotation could not be masked. For example, trying to apply a blur masking function on non-integer text will fail in the underlying CoSort (SortCL) engine.<\/p>\n<p>Unmatched annotations will also be placed into the failed results. The failed result contains a <i>reason <\/i>key which gives a description of why the annotation failed to mask:<\/p>\n<p><a href=\"http:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-14.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-14236 aligncenter\" src=\"\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-14-1024x433.png\" alt=\"\" width=\"650\" height=\"275\" srcset=\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-14-1024x433.png 1024w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-14-300x127.png 300w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-14-768x324.png 768w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-14.png 1600w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><\/a><\/p>\n<p>Each failed result contains the adjusted character offsets relative to the masked text, so it is easy to fix failed results in the already masked text in a subsequent masking call.<\/p>\n<h5><b>Search and Masking Text<\/b><\/h5>\n<p>After defining the Search and Mask Contexts to use, it is also possible to search and mask in the same pass. Just call the <i>\/api\/darkshield\/searchContext.mask <\/i>endpoint with the names of the Search and Mask Contexts, as well as the text to mask; for example,<\/p>\n<p><a href=\"http:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-15.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-14237 aligncenter\" src=\"\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-15-1024x439.png\" alt=\"\" width=\"651\" height=\"279\" srcset=\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-15-1024x439.png 1024w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-15-300x129.png 300w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-15-768x329.png 768w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-15.png 1600w\" sizes=\"(max-width: 651px) 100vw, 651px\" \/><\/a><\/p>\n<p>The results will be the same as those returned from the <i>maskContext.mask<\/i> call:<\/p>\n<p><a href=\"http:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-16.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-14238 aligncenter\" src=\"\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-16-1024x546.png\" alt=\"\" width=\"651\" height=\"347\" srcset=\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-16-1024x546.png 1024w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-16-300x160.png 300w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-16-768x409.png 768w, https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2021\/01\/darkshield-rpc-api-16.png 1600w\" sizes=\"(max-width: 651px) 100vw, 651px\" \/><\/a><\/p>\n<p>If you would have any questions about the DarkShield API, email <a href=\"mailto:darkshield@iri.com\">darkshield@iri.com<\/a>. For commercial inquiries, email <a href=\"mailto:info@iri.com\">info@iri.com<\/a>.<\/p>\n<p>You can also schedule an interactive discussion and demonstration around your use via <a href=\"https:\/\/www.iri.com\/products\/go\/live-demo\">https:\/\/www.iri.com\/products\/go\/live-demo<\/a>; just specify IRI DarkShield API as the topic.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Editors Note: The article below was written prior to the release of V5 of the IRI DarkShield PII data masking tool for structured, semi-structured, and unstructured data. Version 5, released in Q1, 2024, introduced separate RPC APIs based on the one below &#8212; for files, relational databases and NoSQL databases. All four APIs are now<\/p>\n<div><a class=\"btn-filled btn\" href=\"https:\/\/www.iri.com\/blog\/data-protection\/darkshield-rpc-api\/\" title=\"IRI DarkShield RPC API\">Read More<\/a><\/div>\n","protected":false},"author":112,"featured_media":16376,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[8,363,29,2255],"tags":[1689,1433,1494,1496,2075,1388,2077,2076,2078,1495,1432,1497],"class_list":["post-14208","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data-protection","category-data-quality","category-test-data","category-archived-articles","tag-big-data-masking","tag-dark-data-masking","tag-darkshield-api","tag-darkshield-rpc-api","tag-data-masking-api","tag-iri-darkshield","tag-masking-pii-in-free-text","tag-masking-pii-in-text","tag-raw-text-pii","tag-rpc-api","tag-unstructured-data-masking","tag-web-interface"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v23.4 (Yoast SEO v23.4) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>IRI DarkShield RPC API - IRI<\/title>\n<meta name=\"description\" content=\"Learn about the Remote Procedure Call (RPC) API in the IRI DarkShield data masking tool to search and mask PII in text at rest or in flight.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.iri.com\/blog\/data-protection\/darkshield-rpc-api\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"IRI DarkShield RPC API\" \/>\n<meta property=\"og:description\" content=\"Learn about the Remote Procedure Call (RPC) API in the IRI DarkShield data masking tool to search and mask PII in text at rest or in flight.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.iri.com\/blog\/data-protection\/darkshield-rpc-api\/\" \/>\n<meta property=\"og:site_name\" content=\"IRI\" \/>\n<meta property=\"article:published_time\" content=\"2021-01-11T22:58:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-23T22:59:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2022\/12\/Capture.png\" \/>\n\t<meta property=\"og:image:width\" content=\"3000\" \/>\n\t<meta property=\"og:image:height\" content=\"1920\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Dmitry Kulakov\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dmitry Kulakov\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"16 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.iri.com\/blog\/data-protection\/darkshield-rpc-api\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.iri.com\/blog\/data-protection\/darkshield-rpc-api\/\"},\"author\":{\"name\":\"Dmitry Kulakov\",\"@id\":\"https:\/\/www.iri.com\/blog\/#\/schema\/person\/6434d748d01ce766d6a2ff576d747cfb\"},\"headline\":\"IRI DarkShield RPC API\",\"datePublished\":\"2021-01-11T22:58:51+00:00\",\"dateModified\":\"2026-02-23T22:59:10+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.iri.com\/blog\/data-protection\/darkshield-rpc-api\/\"},\"wordCount\":2496,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.iri.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.iri.com\/blog\/data-protection\/darkshield-rpc-api\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2022\/12\/Capture.png\",\"keywords\":[\"big data masking\",\"dark data masking\",\"Darkshield API\",\"DarkShield RPC API\",\"data masking API\",\"IRI DarkShield\",\"masking PII in free text\",\"masking PII in text\",\"raw text PII\",\"RPC API\",\"unstructured data masking\",\"web interface\"],\"articleSection\":[\"Data Masking\/Protection\",\"Data Quality (DQ&#041;\",\"Test Data\",\"Archived Articles\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.iri.com\/blog\/data-protection\/darkshield-rpc-api\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.iri.com\/blog\/data-protection\/darkshield-rpc-api\/\",\"url\":\"https:\/\/www.iri.com\/blog\/data-protection\/darkshield-rpc-api\/\",\"name\":\"IRI DarkShield RPC API - IRI\",\"isPartOf\":{\"@id\":\"https:\/\/www.iri.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.iri.com\/blog\/data-protection\/darkshield-rpc-api\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.iri.com\/blog\/data-protection\/darkshield-rpc-api\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2022\/12\/Capture.png\",\"datePublished\":\"2021-01-11T22:58:51+00:00\",\"dateModified\":\"2026-02-23T22:59:10+00:00\",\"description\":\"Learn about the Remote Procedure Call (RPC) API in the IRI DarkShield data masking tool to search and mask PII in text at rest or in flight.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.iri.com\/blog\/data-protection\/darkshield-rpc-api\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.iri.com\/blog\/data-protection\/darkshield-rpc-api\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.iri.com\/blog\/data-protection\/darkshield-rpc-api\/#primaryimage\",\"url\":\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2022\/12\/Capture.png\",\"contentUrl\":\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2022\/12\/Capture.png\",\"width\":3000,\"height\":1920,\"caption\":\"This image shows base endpoints of the DarkShield API for searching and masking text\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.iri.com\/blog\/data-protection\/darkshield-rpc-api\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.iri.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"IRI DarkShield RPC API\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.iri.com\/blog\/#website\",\"url\":\"https:\/\/www.iri.com\/blog\/\",\"name\":\"IRI\",\"description\":\"Total Data Management Blog\",\"publisher\":{\"@id\":\"https:\/\/www.iri.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.iri.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.iri.com\/blog\/#organization\",\"name\":\"IRI\",\"url\":\"https:\/\/www.iri.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.iri.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/02\/iri-logo-total-data-management-small-1.png\",\"contentUrl\":\"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/02\/iri-logo-total-data-management-small-1.png\",\"width\":750,\"height\":206,\"caption\":\"IRI\"},\"image\":{\"@id\":\"https:\/\/www.iri.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.iri.com\/blog\/#\/schema\/person\/6434d748d01ce766d6a2ff576d747cfb\",\"name\":\"Dmitry Kulakov\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.iri.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c74394d71a1044376b7336db0b3ab4c7?s=96&d=blank&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c74394d71a1044376b7336db0b3ab4c7?s=96&d=blank&r=g\",\"caption\":\"Dmitry Kulakov\"},\"url\":\"https:\/\/www.iri.com\/blog\/author\/dmitryk\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"IRI DarkShield RPC API - IRI","description":"Learn about the Remote Procedure Call (RPC) API in the IRI DarkShield data masking tool to search and mask PII in text at rest or in flight.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.iri.com\/blog\/data-protection\/darkshield-rpc-api\/","og_locale":"en_US","og_type":"article","og_title":"IRI DarkShield RPC API","og_description":"Learn about the Remote Procedure Call (RPC) API in the IRI DarkShield data masking tool to search and mask PII in text at rest or in flight.","og_url":"https:\/\/www.iri.com\/blog\/data-protection\/darkshield-rpc-api\/","og_site_name":"IRI","article_published_time":"2021-01-11T22:58:51+00:00","article_modified_time":"2026-02-23T22:59:10+00:00","og_image":[{"width":3000,"height":1920,"url":"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2022\/12\/Capture.png","type":"image\/png"}],"author":"Dmitry Kulakov","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Dmitry Kulakov","Est. reading time":"16 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.iri.com\/blog\/data-protection\/darkshield-rpc-api\/#article","isPartOf":{"@id":"https:\/\/www.iri.com\/blog\/data-protection\/darkshield-rpc-api\/"},"author":{"name":"Dmitry Kulakov","@id":"https:\/\/www.iri.com\/blog\/#\/schema\/person\/6434d748d01ce766d6a2ff576d747cfb"},"headline":"IRI DarkShield RPC API","datePublished":"2021-01-11T22:58:51+00:00","dateModified":"2026-02-23T22:59:10+00:00","mainEntityOfPage":{"@id":"https:\/\/www.iri.com\/blog\/data-protection\/darkshield-rpc-api\/"},"wordCount":2496,"commentCount":0,"publisher":{"@id":"https:\/\/www.iri.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.iri.com\/blog\/data-protection\/darkshield-rpc-api\/#primaryimage"},"thumbnailUrl":"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2022\/12\/Capture.png","keywords":["big data masking","dark data masking","Darkshield API","DarkShield RPC API","data masking API","IRI DarkShield","masking PII in free text","masking PII in text","raw text PII","RPC API","unstructured data masking","web interface"],"articleSection":["Data Masking\/Protection","Data Quality (DQ&#041;","Test Data","Archived Articles"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.iri.com\/blog\/data-protection\/darkshield-rpc-api\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.iri.com\/blog\/data-protection\/darkshield-rpc-api\/","url":"https:\/\/www.iri.com\/blog\/data-protection\/darkshield-rpc-api\/","name":"IRI DarkShield RPC API - IRI","isPartOf":{"@id":"https:\/\/www.iri.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.iri.com\/blog\/data-protection\/darkshield-rpc-api\/#primaryimage"},"image":{"@id":"https:\/\/www.iri.com\/blog\/data-protection\/darkshield-rpc-api\/#primaryimage"},"thumbnailUrl":"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2022\/12\/Capture.png","datePublished":"2021-01-11T22:58:51+00:00","dateModified":"2026-02-23T22:59:10+00:00","description":"Learn about the Remote Procedure Call (RPC) API in the IRI DarkShield data masking tool to search and mask PII in text at rest or in flight.","breadcrumb":{"@id":"https:\/\/www.iri.com\/blog\/data-protection\/darkshield-rpc-api\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.iri.com\/blog\/data-protection\/darkshield-rpc-api\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.iri.com\/blog\/data-protection\/darkshield-rpc-api\/#primaryimage","url":"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2022\/12\/Capture.png","contentUrl":"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2022\/12\/Capture.png","width":3000,"height":1920,"caption":"This image shows base endpoints of the DarkShield API for searching and masking text"},{"@type":"BreadcrumbList","@id":"https:\/\/www.iri.com\/blog\/data-protection\/darkshield-rpc-api\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.iri.com\/blog\/"},{"@type":"ListItem","position":2,"name":"IRI DarkShield RPC API"}]},{"@type":"WebSite","@id":"https:\/\/www.iri.com\/blog\/#website","url":"https:\/\/www.iri.com\/blog\/","name":"IRI","description":"Total Data Management Blog","publisher":{"@id":"https:\/\/www.iri.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.iri.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.iri.com\/blog\/#organization","name":"IRI","url":"https:\/\/www.iri.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.iri.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/02\/iri-logo-total-data-management-small-1.png","contentUrl":"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/02\/iri-logo-total-data-management-small-1.png","width":750,"height":206,"caption":"IRI"},"image":{"@id":"https:\/\/www.iri.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.iri.com\/blog\/#\/schema\/person\/6434d748d01ce766d6a2ff576d747cfb","name":"Dmitry Kulakov","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.iri.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c74394d71a1044376b7336db0b3ab4c7?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c74394d71a1044376b7336db0b3ab4c7?s=96&d=blank&r=g","caption":"Dmitry Kulakov"},"url":"https:\/\/www.iri.com\/blog\/author\/dmitryk\/"}]}},"jetpack_featured_media_url":"https:\/\/www.iri.com\/blog\/wp-content\/uploads\/2022\/12\/Capture.png","_links":{"self":[{"href":"https:\/\/www.iri.com\/blog\/wp-json\/wp\/v2\/posts\/14208"}],"collection":[{"href":"https:\/\/www.iri.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.iri.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.iri.com\/blog\/wp-json\/wp\/v2\/users\/112"}],"replies":[{"embeddable":true,"href":"https:\/\/www.iri.com\/blog\/wp-json\/wp\/v2\/comments?post=14208"}],"version-history":[{"count":25,"href":"https:\/\/www.iri.com\/blog\/wp-json\/wp\/v2\/posts\/14208\/revisions"}],"predecessor-version":[{"id":18576,"href":"https:\/\/www.iri.com\/blog\/wp-json\/wp\/v2\/posts\/14208\/revisions\/18576"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.iri.com\/blog\/wp-json\/wp\/v2\/media\/16376"}],"wp:attachment":[{"href":"https:\/\/www.iri.com\/blog\/wp-json\/wp\/v2\/media?parent=14208"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.iri.com\/blog\/wp-json\/wp\/v2\/categories?post=14208"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.iri.com\/blog\/wp-json\/wp\/v2\/tags?post=14208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}