Airlock User's Guide Help

Airlock API

Securing the API

Airlock's API supports one-way and two-way SSL/TLS authentication. See the SSL/TLS settings for more information.

Policies API

The Policies API provides endpoints for retrieving, uploading, and deleting policies.

Apply a Policy

Method

Endpoint

Description

POST

/api/policies/apply

Applies a policy to text.

Query Parameters

  • d - Optional - A document ID that uniquely identifies the text being submitted. Leave empty and Airlock will generate a document ID derived from a hash of the submitted text.

  • p - Optional - The name of the policy to apply. Defaults to default if not provided.

  • c - Optional - The context. Defaults to none if not provided.

Example request to apply a policy to text.

curl -k -X POST "https://localhost:8080/api/policies/apply" --data "His SSN was 123-45-6789." -H Content-Type "text/plain"

Get Policy Names

Method

Endpoint

Description

GET

/api/policies

Get the names of all policies.

Example request:

curl -k https://localhost:8080/api/policies

Get a Policy

Method

Endpoint

Description

GET

/api/policies/{policyName}

Get the content of a policy, where is the name of the policy to get.

Example request:

curl -k https://localhost:8080/api/policies/my-policy

Example response:

{ "name": "just-phone-numbers", "ignored": [ ], "identifiers": { "dictionaries": [ ], "phoneNumber": { "phoneNumberFilterStrategies": [ { "strategy": "REDACT", "redactionFormat": "{{{REDACTED-%t}}}" } ] } } }

Upload a Policy

Method

Endpoint

Description

PUT

/api/policies/{policyName}

Upload a policy, where is the name of the policy to get. If a policy with this name already exists it will be overwritten.

Example request:

curl -X PUT -H "Content-Type: application/json" -k https://localhost:8080/api/profiles/my-profile -d @policy.json

Delete a Policy

Method

Endpoint

Description

DELETE

/api/policies/{policyName}

Delete a policy, where is the name of the policy to delete.

Example request:

curl -X DELETE -k https://localhost:8080/api/policies/exprofile
Last modified: 17 November 2023