Pre-Configured Proxies
For an overview of Pre-Configured Proxies and when to use them, see Pre-Configured Proxy.
Runtime Options
Code transforms in Pre-Configured Proxies run in Basis Theory's Runtime environment and support the next images:
| Runtime | Description | Provisioning |
|---|---|---|
| node-bt | Default runtime with curated dependencies. No runtime object needed. | Synchronous |
| node22 | Modern Node.js 22 that offers dependency customization. | Asynchronous |
Create a Proxy
Creates a new Proxy for the Tenant.
node22 provisioning is asynchronous. Check valid states for execution.
Permissions
proxy:create
Request
- node-bt
- node22
- cURL
- Node
- JavaScript (legacy)
- C#
- Java
- Python
- Go
transform='module.exports = async function (req) {
// Do something with req.configuration.SERVICE_API_KEY
return {
headers: req.args.headers,
body: req.args.body
};
};'
curl "https://api.basistheory.com/proxies" \
-H "BT-API-KEY: <MANAGEMENT_API_KEY>" \
-H "Content-Type: application/json" \
-X "POST" \
-d '{
"name": "My Proxy",
"destination_url": "https://example.com/api",
"request_transforms": [
{
"code": '"$(echo $transform | jq -Rsa .)"'
}
],
"response_transforms": [
{
"code": '"$(echo $transform | jq -Rsa .)"'
}
],
"configuration": {
"SERVICE_API_KEY": "key_abcd1234"
},
"application": {
"id": "45c124e7-6ab2-4899-b4d9-1388b0ba9d04"
},
"require_auth": true
}'
const proxy = await client.proxies.create({
name: 'My Proxy',
destinationUrl: 'https://example.com/api',
requestTransforms: [
{
code: `
module.exports = async function (req) {
// Do something with req.configuration.SERVICE_API_KEY
return {
headers: req.args.headers,
body: req.args.body
};
};
`
}
],
responseTransforms: [
{
code: `
module.exports = async function (req) {
// Do something with req.configuration.SERVICE_API_KEY
return {
headers: req.args.headers,
body: req.args.body
};
};
`
}
],
configuration: {
SERVICE_API_KEY: 'key_abcd1234',
},
application: {
id: applicationId
},
requireAuth: true
});
import { BasisTheory } from '@basis-theory/basis-theory-js';
const bt = await new BasisTheory().init('<MANAGEMENT_API_KEY>');
const proxy = await bt.proxies.create({
name: 'My Proxy',
destinationUrl: 'https://example.com/api',
requestTransforms: [
{
code: `
module.exports = async function (req) {
// Do something with req.configuration.SERVICE_API_KEY
return {
headers: req.args.headers,
body: req.args.body
};
};
`
}
],
responseTransforms: [
{
code: `
module.exports = async function (req) {
// Do something with req.configuration.SERVICE_API_KEY
return {
headers: req.args.headers,
body: req.args.body
};
};
`
}
],
configuration: {
SERVICE_API_KEY: 'key_abcd1234',
},
application: {
id: '45c124e7-6ab2-4899-b4d9-1388b0ba9d04'
},
requireAuth: true
});
await client.Proxies.CreateAsync(new CreateProxyRequest
{
Name = "My Proxy",
DestinationUrl = "https://example.com/api",
RequestTransforms = new List<ProxyTransform>
{
new ProxyTransform
{
Code = @"
module.exports = async function (req) {
// Do something with req.configuration.SERVICE_API_KEY
return {
headers: req.args.headers,
body: req.args.body
};
};
"
}
},
ResponseTransforms = new List<ProxyTransform>
{
new ProxyTransform
{
Code = @"
module.exports = async function (req) {
// Do something with req.configuration.SERVICE_API_KEY
return {
headers: req.args.headers,
body: req.args.body
};
};
"
}
},
Configuration = new Dictionary<string, string?>
{
{ "SERVICE_API_KEY", "key_abcd1234" }
},
Application = new Application
{
Id = applicationId
},
RequireAuth = true
});
Proxy proxy = new ProxiesClient(ClientOptions.builder().build())
.create(CreateProxyRequest.builder()
.name("My Proxy")
.destinationUrl("https://example.com/api")
.requestTransforms(List.of(
ProxyTransform.builder().code("module.exports = async function (req) { return { headers: req.args.headers, body: req.args.body }; };").build()
))
.responseTransforms(List.of(
ProxyTransform.builder().code("module.exports = async function (req) { return { headers: req.args.headers, body: req.args.body }; };").build()
))
.configuration(new HashMap<>())
.applicationId(applicationId)
.build());
client.proxies.create(
name="My Proxy",
destination_url="https://example.com/api",
request_transforms=[
{
"code": """
module.exports = async function (req) {
// Do something with req.configuration.SERVICE_API_KEY
return {
headers: req.args.headers,
body: req.args.body
};
};
"""
}
],
response_transforms=[
{
"code": """
module.exports = async function (req) {
// Do something with req.configuration.SERVICE_API_KEY
return {
headers: req.args.headers,
body: req.args.body
};
};
"""
}
],
configuration={
"SERVICE_API_KEY": "key_abcd1234"
},
application={
"id": application_id
},
require_auth=True
)
transform := `module.exports = async function (req) {
// Do something with req.configuration.SERVICE_API_KEY
return {
headers: req.args.headers,
body: req.args.body
};
};`
proxy, err := client.Proxies.Create(ctx, &basistheory.CreateProxyRequest{
Name: "My Proxy",
DestinationURL: "https://example.com/api",
RequestTransforms: []*basistheory.ProxyTransform{
{ Code: &transform },
},
ResponseTransforms: []*basistheory.ProxyTransform{
{ Code: &transform },
},
Configuration: map[string]*string{
"SERVICE_API_KEY": func(s string) *string { return &s }("key_abcd1234"),
},
Application: &basistheory.Application{
ID: applicationID,
},
RequireAuth: true,
})
- cURL
- Node
- JavaScript (legacy)
- C#
- Java
- Python
- Go
request_transform='module.exports = async function (event) {
const MaskData = require("maskdata");
const { body, headers } = event.req;
const { SERVICE_API_KEY } = event.configuration;
const { logger } = event;
logger.info("Processing request transform");
const masked_card = MaskData.maskCard(body.card_number, {
maskWith: "*",
unmaskedStartDigits: 0,
unmaskedEndDigits: 4
});
return {
req: {
headers: headers,
body: {
...body,
card_number: masked_card
}
}
};
};'
response_transform='module.exports = async function (event) {
const { body, headers } = event.res;
const { logger } = event;
logger.info("Processing response transform");
return {
res: {
headers: headers,
body: {
...body,
processed_at: new Date().toISOString()
}
}
};
};'
curl "https://api.basistheory.com/proxies" \
-H "BT-API-KEY: <MANAGEMENT_API_KEY>" \
-H "Content-Type: application/json" \
-X "POST" \
-d '{
"name": "My Proxy",
"destination_url": "https://example.com/api",
"request_transforms": [
{
"type": "code",
"code": '"$(echo $request_transform | jq -Rsa .)"',
"runtime": {
"image": "node22",
"dependencies": {
"maskdata": "^1.3.2"
},
"timeout": 10
}
}
],
"response_transforms": [
{
"type": "code",
"code": '"$(echo $response_transform | jq -Rsa .)"',
"runtime": {
"image": "node22",
"timeout": 10
}
}
],
"configuration": {
"SERVICE_API_KEY": "key_abcd1234"
},
"require_auth": true
}'
const proxy = await client.proxies.create({
name: "My Proxy",
destinationUrl: "https://example.com/api",
requestTransforms: [
{
type: "code",
code: `
module.exports = async function (event) {
const MaskData = require("maskdata");
const { body, headers } = event.req;
const { SERVICE_API_KEY } = event.configuration;
const { logger } = event;
logger.info("Processing request transform");
const masked_card = MaskData.maskCard(body.card_number, {
maskWith: "*",
unmaskedStartDigits: 0,
unmaskedEndDigits: 4
});
return {
req: {
headers: headers,
body: {
...body,
card_number: masked_card
}
}
};
};
`,
runtime: {
image: "node22",
dependencies: {
maskdata: "^1.3.2",
},
timeout: 10,
}
}
],
responseTransforms: [
{
type: "code",
code: `
module.exports = async function (event) {
const { body, headers } = event.res;
const { logger } = event;
logger.info("Processing response transform");
return {
res: {
headers: headers,
body: {
...body,
processed_at: new Date().toISOString()
}
}
};
};
`,
runtime: {
image: "node22",
timeout: 10,
}
}
],
configuration: {
SERVICE_API_KEY: "key_abcd1234",
},
requireAuth: true,
});
import { BasisTheory } from "@basis-theory/basis-theory-js";
const bt = await new BasisTheory().init("<MANAGEMENT_API_KEY>");
const proxy = await bt.proxies.create({
name: "My Proxy",
destinationUrl: "https://example.com/api",
requestTransforms: [
{
type: "code",
code: `
module.exports = async function (event) {
const MaskData = require("maskdata");
const { body, headers } = event.req;
const { logger } = event;
const masked_card = MaskData.maskCard(body.card_number, {
maskWith: "*",
unmaskedStartDigits: 0,
unmaskedEndDigits: 4
});
return {
req: {
headers: headers,
body: {
...body,
card_number: masked_card
}
}
};
};
`,
runtime: {
image: "node22",
dependencies: {
maskdata: "^1.3.2",
},
timeout: 10,
}
}
],
responseTransforms: [
{
type: "code",
code: `
module.exports = async function (event) {
const { body, headers } = event.res;
const { logger } = event;
return {
res: {
headers: headers,
body: {
...body,
processed_at: new Date().toISOString()
}
}
};
};
`,
runtime: {
image: "node22",
timeout: 10,
}
}
],
configuration: {
SERVICE_API_KEY: "key_abcd1234",
},
requireAuth: true,
});
await client.Proxies.CreateAsync(new CreateProxyRequest
{
Name = "My Proxy",
DestinationUrl = "https://example.com/api",
RequestTransforms = new List<ProxyTransform>
{
new ProxyTransform
{
Type = "code",
Code = @"
module.exports = async function (event) {
const MaskData = require('maskdata');
const { body, headers } = event.req;
const { logger } = event;
const masked_card = MaskData.maskCard(body.card_number, {
maskWith: '*',
unmaskedStartDigits: 0,
unmaskedEndDigits: 4
});
return {
req: {
headers: headers,
body: {
...body,
card_number: masked_card
}
}
};
};",
Runtime = new Runtime
{
Image = "node22",
Dependencies = new Dictionary<string, string?>
{
{ "maskdata", "^1.3.2" }
},
Timeout = 10
}
}
},
ResponseTransforms = new List<ProxyTransform>
{
new ProxyTransform
{
Type = "code",
Code = @"
module.exports = async function (event) {
const { body, headers } = event.res;
const { logger } = event;
return {
res: {
headers: headers,
body: {
...body,
processed_at: new Date().toISOString()
}
}
};
};",
Runtime = new Runtime
{
Image = "node22",
Timeout = 10
}
}
},
Configuration = new Dictionary<string, string?>
{
{ "SERVICE_API_KEY", "key_abcd1234" }
},
RequireAuth = true
});
new ProxiesClient(ClientOptions.builder().build()).create(CreateProxyRequest.builder()
.name("My Proxy")
.destinationUrl("https://example.com/api")
.requestTransforms(List.of(ProxyTransform.builder()
.type("code")
.code("...")
.runtime(Runtime.builder()
.image("node22")
.dependencies(Map.of("maskdata", "^1.3.2"))
.timeout(10)
.build())
.build()))
.responseTransforms(List.of(ProxyTransform.builder()
.type("code")
.code("...")
.runtime(Runtime.builder()
.image("node22")
.timeout(10)
.build())
.build()))
.configuration(Map.of("SERVICE_API_KEY", "key_abcd1234"))
.requireAuth(true)
.build());
client.proxies.create(
name="My Proxy",
destination_url="https://example.com/api",
request_transforms=[
{
"type": "code",
"code": """module.exports = async function (event) {
const MaskData = require("maskdata");
const { body, headers } = event.req;
const { logger } = event;
const masked_card = MaskData.maskCard(body.card_number, {
maskWith: "*",
unmaskedStartDigits: 0,
unmaskedEndDigits: 4
});
return {
req: {
headers: headers,
body: {
...body,
card_number: masked_card
}
}
};
};""",
"runtime": {
"image": "node22",
"dependencies": {
"maskdata": "^1.3.2"
},
"timeout": 10
}
}
],
response_transforms=[
{
"type": "code",
"code": """module.exports = async function (event) {
const { body, headers } = event.res;
const { logger } = event;
return {
res: {
headers: headers,
body: {
...body,
processed_at: new Date().toISOString()
}
}
};
};""",
"runtime": {
"image": "node22",
"timeout": 10
}
}
],
configuration={
"SERVICE_API_KEY": "key_abcd1234"
},
require_auth=True
)
requestTransformCode := `module.exports = async function (event) {
const MaskData = require("maskdata");
const { body, headers } = event.req;
const { logger } = event;
const masked_card = MaskData.maskCard(body.card_number, {
maskWith: "*",
unmaskedStartDigits: 0,
unmaskedEndDigits: 4
});
return {
req: {
headers: headers,
body: {
...body,
card_number: masked_card
}
}
};
};`
responseTransformCode := `module.exports = async function (event) {
const { body, headers } = event.res;
const { logger } = event;
return {
res: {
headers: headers,
body: {
...body,
processed_at: new Date().toISOString()
}
}
};
};`
proxy, err := client.Proxies.Create(ctx, &basistheory.CreateProxyRequest{
Name: "My Proxy",
DestinationUrl: "https://example.com/api",
RequestTransforms: []*basistheory.ProxyTransform{
{
Type: basistheory.String("code"),
Code: basistheory.String(requestTransformCode),
Runtime: &basistheory.Runtime{
Image: basistheory.String("node22"),
Dependencies: map[string]*string{
"maskdata": basistheory.String("^1.3.2"),
},
Timeout: basistheory.Int(10),
},
},
},
ResponseTransforms: []*basistheory.ProxyTransform{
{
Type: basistheory.String("code"),
Code: basistheory.String(responseTransformCode),
Runtime: &basistheory.Runtime{
Image: basistheory.String("node22"),
Timeout: basistheory.Int(10),
},
},
},
Configuration: map[string]*string{
"SERVICE_API_KEY": basistheory.String("key_abcd1234"),
},
RequireAuth: basistheory.Bool(true),
})
Request Parameters
| Attribute | Required | Type | Default | Runtime | Description |
|---|---|---|---|---|---|
name | true | string | null | All | The name of the Proxy. Has a maximum length of 200 |
destination_url | true | string | null | All | The URL to which requests will be proxied |
request_transforms | false | array | null | All | One or more request transforms executed in order before sending to the destination. |
response_transforms | false | array | null | All | One or more response transforms executed in order before returning the proxy response. |
application | false | Application | null | node-bt | This Application's API key is injected into a pre-configured BasisTheory JS SDK instance passed into the transform. Must be a public or private Application Type. |
configuration | false | map<string, string> | null | All | A string key and string value map of all configuration name and values for a Proxy Transform |
require_auth | false | boolean | true | All | Require a BT-API-KEY request header for authentication and authorization |
Response
Returns a Proxy if the Proxy was created. Returns an error if there were validation errors, or the Proxy failed to create.
- node-bt
- node22
{
"id": "433013a6-a614-4e1e-b2aa-5fba67aa85e6",
"tenant_id": "77cb0024-123e-41a8-8ff8-a3d5a0fa8a08",
"name": "My Proxy",
"key": "e29a50980ca5",
"destination_url": "https://example.com/api",
"request_transforms": [
{
"code": "module.exports = async function (req) { ... }"
}
],
"response_transforms": [
{
"code": "module.exports = async function (req) { ... }"
}
],
"configuration": {
"SERVICE_API_KEY": "key_abcd1234"
},
"application_id": "45c124e7-6ab2-4899-b4d9-1388b0ba9d04",
"require_auth": true,
"created_by": "3ce0dceb-fd0b-4471-8006-c51243c9ef7a",
"created_at": "2020-09-15T15:53:00+00:00"
}
{
"id": "433013a6-a614-4e1e-b2aa-5fba67aa85e6",
"tenant_id": "77cb0024-123e-41a8-8ff8-a3d5a0fa8a08",
"name": "My Proxy",
"key": "e29a50980ca5",
"destination_url": "https://example.com/api",
"state": "creating",
"request_transforms": [
{
"type": "code",
"requested": {
"code": "module.exports = async function (event) { ... }",
"runtime": {
"image": "node22",
"dependencies": {
"maskdata": "^1.3.2"
},
"timeout": 10
}
}
}
],
"response_transforms": [
{
"type": "code",
"requested": {
"code": "module.exports = async function (event) { ... }",
"runtime": {
"image": "node22",
"timeout": 10
}
}
}
],
"configuration": {
"SERVICE_API_KEY": "key_abcd1234"
},
"require_auth": true,
"created_by": "3ce0dceb-fd0b-4471-8006-c51243c9ef7a",
"created_at": "2020-09-15T15:53:00+00:00"
}
List Proxies
Get a list of proxies for the Tenant.
Permissions
proxy:read
Request
- cURL
- Node
- JavaScript (legacy)
- C#
- Java
- Python
- Go
curl "https://api.basistheory.com/proxies" \
-H "BT-API-KEY: <MANAGEMENT_API_KEY>"
const response = await client.proxies.list();
for await (const item of response) {
console.log(item);
}
// Or you can manually iterate page-by-page
const page = await client.proxies.list();
while (page.hasNextPage()) {
page = page.getNextPage();
}
import { BasisTheory } from "@basis-theory/basis-theory-js";
const bt = await new BasisTheory().init("<MANAGEMENT_API_KEY>");
const proxies = await bt.proxies.list();
await client.Proxies.ListAsync(new ProxiesListRequest());
new ProxiesClient(ClientOptions.builder().build()).list();
response = client.proxies.list()
for item in response:
yield item
# alternatively, you can paginate page-by-page
for page in response.iter_pages():
yield page
// List all proxies
proxies, err := client.Proxies.List(ctx, &basistheory.ProxiesListRequest{})
// List proxies with filters
proxies, err := client.Proxies.List(ctx, &basistheory.ProxiesListRequest{
ID: []*string{
func(s string) *string { return &s }("id1"),
func(s string) *string { return &s }("id2"),
},
Name: "My Proxy",
})
Query Parameters
| Parameter | Required | Type | Default | Description |
|---|---|---|---|---|
id | false | array | [] | An optional list of Proxy ID's to filter the list of proxies by |
name | false | string | null | Wildcard search of proxies by name |
Response
Returns a paginated object with the data property containing an array of proxies. Providing any query parameters will filter the results. Returns an error if proxies could not be retrieved.
{
"pagination": {...}
"data": [
{
"id": "433013a6-a614-4e1e-b2aa-5fba67aa85e6",
"tenant_id": "77cb0024-123e-41a8-8ff8-a3d5a0fa8a08",
"name": "My Proxy",
"key": "e29a50980ca5",
"destination_url": "https://example.com/api",
"request_transforms": [
{
"code": "
module.exports = async function (req) {
// Do something with req.configuration.SERVICE_API_KEY
return {
headers: req.args.headers,
body: req.args.body
};
};
"
}
],
"response_transforms": [
{
"code": "
module.exports = async function (req) {
// Do something with req.configuration.SERVICE_API_KEY
return {
headers: req.args.headers,
body: req.args.body
};
};
"
}
],
"configuration": {
"SERVICE_API_KEY": "key_abcd1234"
},
"application_id": "45c124e7-6ab2-4899-b4d9-1388b0ba9d04",
"require_auth": true,
"created_by": "fb124bba-f90d-45f0-9a59-5edca27b3b4a",
"created_at": "2020-09-15T15:53:00+00:00",
"modified_by": "fb124bba-f90d-45f0-9a59-5edca27b3b4a",
"modified_at": "2021-03-01T08:23:14+00:00"
},
{...},
{...}
]
}
Get a Proxy
Get a Proxy by ID in the Tenant.
Permissions
proxy:read
Request
- cURL
- Node
- JavaScript (legacy)
- C#
- Java
- Python
- Go
curl "https://api.basistheory.com/proxies/5b493235-6917-4307-906a-2cd6f1a90b13" \
-H "BT-API-KEY: <MANAGEMENT_API_KEY>"
await client.proxies.get("id");
import { BasisTheory } from "@basis-theory/basis-theory-js";
const bt = await new BasisTheory().init("<MANAGEMENT_API_KEY>");
const proxy = await bt.proxies.retrieve("5b493235-6917-4307-906a-2cd6f1a90b13");
new ProxiesClient(ClientOptions.builder().build()).get("id");
client.proxies.get(
id="id",
)
proxy, err := client.Proxies.Get(ctx, "id")
URI Parameters
| Parameter | Required | Type | Default | Description |
|---|---|---|---|---|
id | true | uuid | null | The ID of the proxy |
Response
Returns a Proxy with the id provided. Returns an error if the Proxy could not be retrieved.
- node-bt
- node22
{
"id": "433013a6-a614-4e1e-b2aa-5fba67aa85e6",
"tenant_id": "77cb0024-123e-41a8-8ff8-a3d5a0fa8a08",
"name": "My Proxy",
"key": "e29a50980ca5",
"destination_url": "https://example.com/api",
"request_transforms": [
{
"code": "module.exports = async function (req) { ... }"
}
],
"response_transforms": [
{
"code": "module.exports = async function (req) { ... }"
}
],
"configuration": {
"SERVICE_API_KEY": "key_abcd1234"
},
"application_id": "45c124e7-6ab2-4899-b4d9-1388b0ba9d04",
"require_auth": true,
"created_by": "fb124bba-f90d-45f0-9a59-5edca27b3b4a",
"created_at": "2020-09-15T15:53:00+00:00",
"modified_by": "fb124bba-f90d-45f0-9a59-5edca27b3b4a",
"modified_at": "2021-03-01T08:23:14+00:00"
}
{
"id": "433013a6-a614-4e1e-b2aa-5fba67aa85e6",
"tenant_id": "77cb0024-123e-41a8-8ff8-a3d5a0fa8a08",
"name": "My Proxy",
"key": "e29a50980ca5",
"destination_url": "https://example.com/api",
"state": "active",
"request_transforms": [
{
"type": "code",
"code": "module.exports = async function (event) { ... }",
"runtime": {
"image": "node22",
"dependencies": { "maskdata": "^1.3.2" },
"timeout": 10
}
}
],
"response_transforms": [
{
"type": "code",
"code": "module.exports = async function (event) { ... }",
"runtime": {
"image": "node22",
"timeout": 10
}
}
],
"configuration": {
"SERVICE_API_KEY": "key_abcd1234"
},
"require_auth": true,
"created_by": "fb124bba-f90d-45f0-9a59-5edca27b3b4a",
"created_at": "2020-09-15T15:53:00+00:00",
"modified_by": "fb124bba-f90d-45f0-9a59-5edca27b3b4a",
"modified_at": "2021-03-01T08:23:14+00:00"
}
Update Proxy
Update a Proxy by ID in the Tenant.
node22 updates are asynchronous. Check valid states where node22 can be updated.
Permissions
proxy:update
Request
- node-bt
- node22
- cURL
- Node
- JavaScript (legacy)
- C#
- Java
- Python
- Go
transform='module.exports = async function (req) {
// Do something with req.configuration.SERVICE_API_KEY
return {
headers: req.args.headers,
body: req.args.body
};
};'
curl "https://api.basistheory.com/proxies/433013a6-a614-4e1e-b2aa-5fba67aa85e6" \
-H "BT-API-KEY: <MANAGEMENT_API_KEY>" \
-H "Content-Type: application/json" \
-X "PUT" \
-d '{
"name": "My Proxy",
"destination_url": "https://example.com/api",
"request_transforms": [
{
"code": '"$(echo $transform | jq -Rsa .)"'
}
],
"response_transforms": [
{
"code": '"$(echo $transform | jq -Rsa .)"'
}
],
"configuration": {
"SERVICE_API_KEY": "key_abcd1234"
},
"application": {
"id": "45c124e7-6ab2-4899-b4d9-1388b0ba9d04"
},
"require_auth": true
}'
await client.proxies.update(
proxyId,
{
name: 'My Proxy',
destinationUrl: 'https://example.com/api',
requestTransforms: [
{
code: `
module.exports = async function (req) {
// Do something with req.configuration.SERVICE_API_KEY
return {
headers: req.args.headers,
body: req.args.body
};
};
`
}
],
responseTransforms: [
{
code: `
module.exports = async function (req) {
// Do something with req.configuration.SERVICE_API_KEY
return {
headers: req.args.headers,
body: req.args.body
};
};
`
}
],
configuration: {
SERVICE_API_KEY: 'key_abcd1234',
},
application: {
id: applicationId
},
requireAuth: true
}
);
import { BasisTheory } from '@basis-theory/basis-theory-js';
const bt = await new BasisTheory().init('<MANAGEMENT_API_KEY>');
const proxy = await bt.proxies.update('433013a6-a614-4e1e-b2aa-5fba67aa85e6', {
name: 'My Proxy',
destinationUrl: 'https://example.com/api',
requestTransforms: [
{
code: `
module.exports = async function (req) {
// Do something with req.configuration.SERVICE_API_KEY
return {
headers: req.args.headers,
body: req.args.body
};
};
`
}
],
responseTransforms: [
{
code: `
module.exports = async function (req) {
// Do something with req.configuration.SERVICE_API_KEY
return {
headers: req.args.headers,
body: req.args.body
};
};
`
}
],
configuration: {
SERVICE_API_KEY: 'key_abcd1234',
},
application: {
id: '45c124e7-6ab2-4899-b4d9-1388b0ba9d04'
},
requireAuth: true
});
await client.Proxies.UpdateAsync(
proxyId,
new UpdateProxyRequest
{
Name = "My Proxy",
DestinationUrl = "https://example.com/api",
RequestTransforms = new List<ProxyTransform>
{
new ProxyTransform
{
Code = @"
module.exports = async function (req) {
// Do something with req.configuration.SERVICE_API_KEY
return {
headers: req.args.headers,
body: req.args.body
};
};
"
}
},
ResponseTransforms = new List<ProxyTransform>
{
new ProxyTransform
{
Code = @"
module.exports = async function (req) {
// Do something with req.configuration.SERVICE_API_KEY
return {
headers: req.args.headers,
body: req.args.body
};
};
"
}
},
Configuration = new Dictionary<string, string?>
{
{ "SERVICE_API_KEY", "key_abcd1234" }
},
Application = new Application
{
Id = applicationId
},
RequireAuth = true
}
);
Proxy updatedProxy = new ProxiesClient(ClientOptions.builder().build())
.update("433013a6-a614-4e1e-b2aa-5fba67aa85e6", UpdateProxyRequest.builder()
.name("My Proxy")
.destinationUrl("https://example.com/api")
.requestTransforms(List.of(
ProxyTransform.builder().code("module.exports = async function (req) { return { headers: req.args.headers, body: req.args.body }; };").build()
))
.responseTransforms(List.of(
ProxyTransform.builder().code("module.exports = async function (req) { return { headers: req.args.headers, body: req.args.body }; };").build()
))
.configuration(new HashMap<>())
.applicationId(applicationId)
.build());
client.proxies.update(
id=proxy_id,
name="My Proxy",
destination_url="https://example.com/api",
request_transforms=[
{
"code": """
module.exports = async function (req) {
// Do something with req.configuration.SERVICE_API_KEY
return {
headers: req.args.headers,
body: req.args.body
};
};
"""
}
],
response_transforms=[
{
"code": """
module.exports = async function (req) {
// Do something with req.configuration.SERVICE_API_KEY
return {
headers: req.args.headers,
body: req.args.body
};
};
"""
}
],
configuration={
"SERVICE_API_KEY": "key_abcd1234"
},
application={
"id": application_id
},
require_auth=True
)
transform := `module.exports = async function (req) {
// Do something with req.configuration.SERVICE_API_KEY
return {
headers: req.args.headers,
body: req.args.body
};
};`
proxy, err := client.Proxies.Update(ctx, "433013a6-a614-4e1e-b2aa-5fba67aa85e6", &basistheory.UpdateProxyRequest{
Name: "My Proxy",
DestinationURL: "https://example.com/api",
RequestTransforms: []*basistheory.ProxyTransform{
{ Code: &transform },
},
ResponseTransforms: []*basistheory.ProxyTransform{
{ Code: &transform },
},
Configuration: map[string]*string{
"SERVICE_API_KEY": func(s string) *string { return &s }("key_abcd1234"),
},
Application: &basistheory.Application{
ID: applicationID,
},
RequireAuth: true,
})
- cURL
- Node
- JavaScript (legacy)
- C#
- Java
- Python
- Go
request_transform='module.exports = async function (event) {
const { body, headers } = event.req;
const { SERVICE_API_KEY } = event.configuration;
const { logger } = event;
logger.info("Processing request transform");
return {
req: {
headers: headers,
body: body
}
};
};'
response_transform='module.exports = async function (event) {
const { body, headers } = event.res;
const { logger } = event;
logger.info("Processing response transform");
return {
res: {
headers: headers,
body: {
...body,
processed_at: new Date().toISOString()
}
}
};
};'
curl "https://api.basistheory.com/proxies/433013a6-a614-4e1e-b2aa-5fba67aa85e6" \
-H "BT-API-KEY: <MANAGEMENT_API_KEY>" \
-H "Content-Type: application/json" \
-X "PUT" \
-d '{
"name": "My Proxy",
"destination_url": "https://example.com/api",
"request_transforms": [
{
"type": "code",
"code": '"$(echo $request_transform | jq -Rsa .)"',
"runtime": {
"image": "node22",
"timeout": 10
}
}
],
"response_transforms": [
{
"type": "code",
"code": '"$(echo $response_transform | jq -Rsa .)"',
"runtime": {
"image": "node22",
"timeout": 10
}
}
],
"configuration": {
"SERVICE_API_KEY": "key_abcd1234"
},
"require_auth": true
}'
await client.proxies.update(
proxyId,
{
name: "My Proxy",
destinationUrl: "https://example.com/api",
requestTransforms: [
{
type: "code",
code: `
module.exports = async function (event) {
const { body, headers } = event.req;
const { SERVICE_API_KEY } = event.configuration;
const { logger } = event;
logger.info("Processing request transform");
return {
req: {
headers: headers,
body: body
}
};
};
`,
runtime: {
image: "node22",
timeout: 10,
}
}
],
responseTransforms: [
{
type: "code",
code: `
module.exports = async function (event) {
const { body, headers } = event.res;
const { logger } = event;
logger.info("Processing response transform");
return {
res: {
headers: headers,
body: {
...body,
processed_at: new Date().toISOString()
}
}
};
};
`,
runtime: {
image: "node22",
timeout: 10,
}
}
],
configuration: {
SERVICE_API_KEY: "key_abcd1234",
},
requireAuth: true,
}
);
import { BasisTheory } from "@basis-theory/basis-theory-js";
const bt = await new BasisTheory().init("<MANAGEMENT_API_KEY>");
const proxy = await bt.proxies.update("433013a6-a614-4e1e-b2aa-5fba67aa85e6", {
name: "My Proxy",
destinationUrl: "https://example.com/api",
requestTransforms: [
{
type: "code",
code: `
module.exports = async function (event) {
const { body, headers } = event.req;
const { logger } = event;
return {
req: {
headers: headers,
body: body
}
};
};
`,
runtime: {
image: "node22",
timeout: 10,
}
}
],
responseTransforms: [
{
type: "code",
code: `
module.exports = async function (event) {
const { body, headers } = event.res;
const { logger } = event;
return {
res: {
headers: headers,
body: {
...body,
processed_at: new Date().toISOString()
}
}
};
};
`,
runtime: {
image: "node22",
timeout: 10,
}
}
],
configuration: {
SERVICE_API_KEY: "key_abcd1234",
},
requireAuth: true,
});
await client.Proxies.UpdateAsync(
proxyId,
new UpdateProxyRequest
{
Name = "My Proxy",
DestinationUrl = "https://example.com/api",
RequestTransforms = new List<ProxyTransform>
{
new ProxyTransform
{
Type = "code",
Code = @"
module.exports = async function (event) {
const { body, headers } = event.req;
const { logger } = event;
return {
req: {
headers: headers,
body: body
}
};
};",
Runtime = new Runtime
{
Image = "node22",
Timeout = 10
}
}
},
ResponseTransforms = new List<ProxyTransform>
{
new ProxyTransform
{
Type = "code",
Code = @"
module.exports = async function (event) {
const { body, headers } = event.res;
const { logger } = event;
return {
res: {
headers: headers,
body: {
...body,
processed_at: new Date().toISOString()
}
}
};
};",
Runtime = new Runtime
{
Image = "node22",
Timeout = 10
}
}
},
Configuration = new Dictionary<string, string?>
{
{ "SERVICE_API_KEY", "key_abcd1234" }
},
RequireAuth = true
}
);
new ProxiesClient(ClientOptions.builder().build()).update("433013a6-a614-4e1e-b2aa-5fba67aa85e6", UpdateProxyRequest.builder()
.name("My Proxy")
.destinationUrl("https://example.com/api")
.requestTransforms(List.of(ProxyTransform.builder()
.type("code")
.code("...")
.runtime(Runtime.builder()
.image("node22")
.timeout(10)
.build())
.build()))
.responseTransforms(List.of(ProxyTransform.builder()
.type("code")
.code("...")
.runtime(Runtime.builder()
.image("node22")
.timeout(10)
.build())
.build()))
.configuration(Map.of("SERVICE_API_KEY", "key_abcd1234"))
.requireAuth(true)
.build());
client.proxies.update(
id=proxy_id,
name="My Proxy",
destination_url="https://example.com/api",
request_transforms=[
{
"type": "code",
"code": """module.exports = async function (event) {
const { body, headers } = event.req;
const { logger } = event;
return {
req: {
headers: headers,
body: body
}
};
};""",
"runtime": {
"image": "node22",
"timeout": 10
}
}
],
response_transforms=[
{
"type": "code",
"code": """module.exports = async function (event) {
const { body, headers } = event.res;
const { logger } = event;
return {
res: {
headers: headers,
body: {
...body,
processed_at: new Date().toISOString()
}
}
};
};""",
"runtime": {
"image": "node22",
"timeout": 10
}
}
],
configuration={
"SERVICE_API_KEY": "key_abcd1234"
},
require_auth=True
)
requestTransformCode := `module.exports = async function (event) {
const { body, headers } = event.req;
const { logger } = event;
return {
req: {
headers: headers,
body: body
}
};
};`
responseTransformCode := `module.exports = async function (event) {
const { body, headers } = event.res;
const { logger } = event;
return {
res: {
headers: headers,
body: {
...body,
processed_at: new Date().toISOString()
}
}
};
};`
proxy, err := client.Proxies.Update(ctx, "433013a6-a614-4e1e-b2aa-5fba67aa85e6", &basistheory.UpdateProxyRequest{
Name: "My Proxy",
DestinationUrl: "https://example.com/api",
RequestTransforms: []*basistheory.ProxyTransform{
{
Type: basistheory.String("code"),
Code: basistheory.String(requestTransformCode),
Runtime: &basistheory.Runtime{
Image: basistheory.String("node22"),
Timeout: basistheory.Int(10),
},
},
},
ResponseTransforms: []*basistheory.ProxyTransform{
{
Type: basistheory.String("code"),
Code: basistheory.String(responseTransformCode),
Runtime: &basistheory.Runtime{
Image: basistheory.String("node22"),
Timeout: basistheory.Int(10),
},
},
},
Configuration: map[string]*string{
"SERVICE_API_KEY": basistheory.String("key_abcd1234"),
},
RequireAuth: basistheory.Bool(true),
})
URI Parameters
| Parameter | Required | Type | Default | Description |
|---|---|---|---|---|
id | true | uuid | null | The ID of the proxy |
Request Parameters
| Attribute | Required | Type | Default | Runtime | Description |
|---|---|---|---|---|---|
name | true | string | null | All | The name of the Proxy. Has a maximum length of 200 |
destination_url | true | string | null | All | The URL to which requests will be proxied |
request_transforms | false | array | null | All | One or more request transforms executed in order before sending to the destination. |
response_transforms | false | array | null | All | One or more response transforms executed in order before returning the proxy response. |
application | false | Application | null | node-bt | This Application's API key is injected into a pre-configured BasisTheory JS SDK instance passed into the transform. Must be a public or private Application Type. |
configuration | false | map<string, string> | null | All | A string key and string value map of all configuration name and values for a Proxy Transform |
require_auth | false | boolean | true | All | Require a BT-API-KEY request header for authentication and authorization |
disable_detokenization | false | boolean | false | When true, disables all detokenization processing and passes {{...}} syntax through as literal text. Use this when your payload contains literal {{...}} strings that should not be interpreted as detokenization expressions. |
Response
Returns a Proxy if the Proxy was updated. Returns an error if there were validation errors, or the Proxy failed to update.
- node-bt
- node22
{
"id": "433013a6-a614-4e1e-b2aa-5fba67aa85e6",
"tenant_id": "77cb0024-123e-41a8-8ff8-a3d5a0fa8a08",
"name": "My Proxy",
"key": "e29a50980ca5",
"destination_url": "https://example.com/api",
"request_transforms": [
{
"code": "module.exports = async function (req) { ... }"
}
],
"response_transforms": [
{
"code": "module.exports = async function (req) { ... }"
}
],
"configuration": {
"SERVICE_API_KEY": "key_abcd1234"
},
"application_id": "45c124e7-6ab2-4899-b4d9-1388b0ba9d04",
"require_auth": true,
"created_by": "3ce0dceb-fd0b-4471-8006-c51243c9ef7a",
"created_at": "2020-09-15T15:53:00+00:00",
"modified_by": "34053374-d721-43d8-921c-5ee1d337ef21",
"modified_at": "2021-03-01T08:23:14+00:00"
}
{
"id": "433013a6-a614-4e1e-b2aa-5fba67aa85e6",
"tenant_id": "77cb0024-123e-41a8-8ff8-a3d5a0fa8a08",
"name": "My Proxy",
"key": "e29a50980ca5",
"destination_url": "https://example.com/api",
"state": "updating",
"request_transforms": [
{
"type": "code",
"requested": {
"code": "module.exports = async function (event) { ... }",
"runtime": {
"image": "node22",
"dependencies": {
"maskdata": "^1.3.2"
},
"timeout": 10
}
}
}
],
"response_transforms": [
{
"type": "code",
"requested": {
"code": "module.exports = async function (event) { ... }",
"runtime": {
"image": "node22",
"timeout": 10
}
}
}
],
"configuration": {
"SERVICE_API_KEY": "key_abcd1234"
},
"require_auth": true,
"created_by": "3ce0dceb-fd0b-4471-8006-c51243c9ef7a",
"created_at": "2020-09-15T15:53:00+00:00",
"modified_by": "34053374-d721-43d8-921c-5ee1d337ef21",
"modified_at": "2021-03-01T08:23:14+00:00"
}
Patch Proxy
Patch a Proxy by ID in the Tenant.
node22 updates are asynchronous. Check valid states where node22 can be updated.
Permissions
proxy:update
Content-Type header to be set to application/merge-patch+json. Requests made with a different Content-Type header value will receive a 415 Unsupported Media Type response code. For more information on merge-patch, see RFC 7386.Request
- cURL
- Node
- JavaScript (legacy)
- C#
- Java
- Python
- Go
transform='module.exports = async function (req) {
// Do something with req.configuration.SERVICE_API_KEY
return {
headers: req.args.headers,
body: req.args.body
};
};'
curl "https://api.basistheory.com/proxies/433013a6-a614-4e1e-b2aa-5fba67aa85e6" \
-H "BT-API-KEY: <MANAGEMENT_API_KEY>" \
-H "Content-Type: application/merge-patch+json" \
-X "PATCH" \
-d '{
"name": "My Proxy",
"destination_url": "https://example.com/api",
"configuration": {
"SERVICE_API_KEY": "key_abcd1234"
}
}'
await client.proxies.update(proxyId, {
name: 'My Proxy',
destinationUrl: "https://example.com/api",
configuration: {
SERVICE_API_KEY: "key_abcd1234",
}
});
import { BasisTheory } from "@basis-theory/basis-theory-js";
const bt = await new BasisTheory().init("<MANAGEMENT_API_KEY>");
const proxy = await bt.proxies.patch("433013a6-a614-4e1e-b2aa-5fba67aa85e6", {
name: "My Proxy",
destinationUrl: "https://example.com/api",
configuration: {
SERVICE_API_KEY: "key_abcd1234",
},
});
await client.Proxies.PatchAsync(
proxyId,
new PatchProxyRequest
{
Name = "My Proxy",
DestinationUrl = "https://example.com/api",
Configuration = new Dictionary<string, string?> {
{ "SERVICE_API_KEY", "key_abcd1234" }
},
}
);
Proxy patchedProxy = new ProxiesClient(ClientOptions.builder().build())
.update("id", UpdateProxyRequest.builder()
.name("My Proxy")
.destinationUrl("https://example.com/api")
.requestTransforms(List.of(
ProxyTransform.builder().code("module.exports = async function (req) { return { headers: req.args.headers, body: req.args.body }; };").build()
))
.responseTransforms(List.of(
ProxyTransform.builder().code("module.exports = async function (req) { return { headers: req.args.headers, body: req.args.body }; };").build()
))
.configuration(new HashMap<>())
.build());
client.proxies.patch(
id=proxy_id,
name="(Deletable) python-SDK-" + str(uuid.uuid4()),
destination_url="https://example.com/api",
configuration={
"SERVICE_API_KEY": "key_abcd134"
}
)
err := client.Proxies.Patch(ctx, "id", &basistheory.PatchProxyRequest{
Name: "My Proxy",
DestinationURL: "https://example.com/api",
Configuration: map[string]*string{
"SERVICE_API_KEY": func(s string) *string { return &s }("key_abcd1234"),
},
})
URI Parameters
| Parameter | Required | Type | Default | Description |
|---|---|---|---|---|
id | true | uuid | null | The ID of the proxy |
Request Parameters
| Attribute | Required | Type | Default | Runtime | Description |
|---|---|---|---|---|---|
name | false | string | null | All | The name of the Proxy. Has a maximum length of 200 |
destination_url | false | string | null | All | The URL to which requests will be proxied |
request_transforms | false | array | null | All | One or more request transforms executed in order before sending to the destination. |
response_transforms | false | array | null | All | One or more response transforms executed in order before returning the proxy response. |
application | false | Application | null | node-bt | This Application's API key is injected into a pre-configured BasisTheory JS SDK instance passed into the transform. Must be a public or private Application Type. |
configuration | false | map<string, string> | null | All | A string key and string value map of all configuration name and values for a Proxy Transform |
require_auth | false | boolean | true | All | Require a BT-API-KEY request header for authentication and authorization |
disable_detokenization | false | boolean | false | When true, disables all detokenization processing and passes {{...}} syntax through as literal text. Use this when your payload contains literal {{...}} strings that should not be interpreted as detokenization expressions. |
Response
Returns 204 if successful. Returns an error if there were validation errors, or the operation failed.
Delete Proxy
Delete a Proxy by ID in the Tenant.
Check valid states where node22 can be deleted.
Permissions
proxy:delete
Request
- cURL
- Node
- JavaScript (legacy)
- C#
- Java
- Python
- Go
curl "https://api.basistheory.com/proxies/433013a6-a614-4e1e-b2aa-5fba67aa85e6" \
-H "BT-API-KEY: <MANAGEMENT_API_KEY>" \
-X "DELETE"
await client.proxies.delete("id");
import { BasisTheory } from "@basis-theory/basis-theory-js";
const bt = await new BasisTheory().init("<MANAGEMENT_API_KEY>");
await bt.proxies.delete("433013a6-a614-4e1e-b2aa-5fba67aa85e6");
await client.Proxies.DeleteAsync("id");
new ProxiesClient(ClientOptions.builder().build()).delete("id");
client.proxies.delete(
id="id",
)
err := client.Proxies.Delete(ctx, "id")
URI Parameters
| Parameter | Required | Type | Default | Description |
|---|---|---|---|---|
id | true | uuid | null | The ID of the proxy |
Response
Returns an error if the Proxy failed to delete.
Proxy Object
| Attribute | Type | Description |
|---|---|---|
id | uuid | Unique identifier of the Proxy which can be used to get a Proxy |
key | string | Auto-generated key used to invoke this Proxy |
name | string | The name of the Proxy |
destination_url | string | The URL to which requests will be proxied |
tenant_id | uuid | The Tenant ID which owns the Proxy |
require_auth | boolean | Require a BT-API-KEY request header for authentication and authorization |
disable_detokenization | boolean | When true, disables all detokenization processing and passes {{...}} syntax through as literal text |
request_transforms | array | (Optional) One or more request transforms executed in order before sending to the destination. |
response_transforms | array | (Optional) One or more response transforms executed in order before returning the proxy response. |
application_id | string | (Optional) This Application's API key is injected into a pre-configured BasisTheory JS SDK instance passed into the transform. Must be a public or private Application Type. |
configuration | map<string, string> | (Optional) A string key and string value map of all configuration name and values for a Proxy Transform |
created_by | uuid | (Optional) The ID of the user or Application that created the Proxy |
created_at | string | (Optional) Created date of the Proxy in ISO 8601 format |
modified_by | uuid | (Optional) The ID of the user or Application that last modified the Proxy |
modified_at | date | (Optional) Last modified date of the Proxy in ISO 8601 format |
Proxy Request Transform Object
| Attribute | Type | Description |
|---|---|---|
type | string | The type of request transform. One of code or tokenize. Default: code. |
code | string | Transform code which will be executed when the Proxy transform is processed. Required when type is code. See Request Transforms for details. |
runtime | Runtime Object | Runtime configuration for transforms. |
options | object | Configuration options for the transform. Required when type is tokenize. See Transform Options for details. |
Proxy Response Transform Object
See Response Transforms for details regarding the various types of response transforms.
| Attribute | Type | Description |
|---|---|---|
type | string | The type of response transform. One of code, mask, tokenize, append_json, append_text, or append_header. Default: code. |
code | string | Transform code which will be executed when the Proxy transform is processed. Required when type is code |
runtime | Runtime Object | Runtime configuration for transforms. |
options | object | Configuration options for the transform. Required when type is tokenize, append_json, append_text, or append_header. See Transform Options for details. |
matcher | string | The type of matching. One of regex or chase_stratus_pan. Required when type is mask |
replacement | string | The replacement character for masking. Must be only one character in length. Required when type is mask |
expression | string | The regular expression to use when determining masking values. Must contain at least one capture group using parenthesis. Required when type is mask and matcher is regex. |
Transform Options
The options field structure varies by transform type:
Tokenize Transform Options (Request and Response)
| Attribute | Type | Description |
|---|---|---|
token | object | Token creation configuration matching the Create Token Request schema |
identifier | string | Optional identifier for referencing the created token in subsequent transforms |
For request and response transforms, token.data can contain:
- Static plaintext values
- Encrypted JWE expressions
- Request expressions like
"{{ req.card_number }}"or"{{ res.card_number }}"to extract data from the request or response payload
Append JSON Transform Options (Response only)
| Attribute | Type | Description |
|---|---|---|
value | any | The data to append to the response. Can contain Liquid expressions or token references |
location | string | JSONPath expression specifying where to place the value in the response (e.g., "$.created_token_id") |
location field (e.g., "$.metadata.token_id"), the system will automatically create any missing parent objects in the response structure.Append Text Transform Options (Response only)
| Attribute | Type | Description |
|---|---|---|
value | string | The text to append to the end of the response body. Can contain Liquid expressions or token references |
Append Header Transform Options (Response only)
| Attribute | Type | Description |
|---|---|---|
value | string | The header value to add to the response. Can contain Liquid expressions or token references |
location | string | The header name to add to the response |
Token References in Options
For transforms that support token references, you can reference tokens created by previous transforms using:
"{{ transform_identifier: 'identifier' }}"- References the full token data"{{ transform_identifier: 'identifier' | json: '$.path' }}"- Extracts specific data using JSONPath
Runtime Object
The runtime object configures the execution environment.
| Attribute | Required | Type | Default | Runtime | Description |
|---|---|---|---|---|---|
image | true | string | - | All | The runtime image identifier. See available runtimes. |
dependencies | false | map<string, string> | {} | node22 | npm packages to install. Key is package name, value is semver version (e.g., "stripe": "^18.4.0"). |
timeout | false | number | 10 | node22 | Maximum execution time in seconds (1-30). |
resources | false | string | standard | node22 | Compute resources allocation. One of standard, large, xlarge. |
warm_concurrency | false | number | 0 | node22 | Number of warm instances to maintain. |
permissions | false | array<string> | [] | node22 | Basis Theory permissions to grant (e.g., token:reveal, token:create). |
See Runtime Options for detailed descriptions of each property.
Requested Object
The requested object contains the pending configuration during asynchronous provisioning (when state is creating or updating).
| Attribute | Type | Description |
|---|---|---|
code | string | The pending code. |
runtime | Runtime Object | The pending runtime configuration. |
- node22
{
"request_transforms": [
{
"type": "code",
"code": "module.exports = async function (event) { const MaskData = require('maskdata'); ... }",
"runtime": {
"image": "node22",
"dependencies": {
"maskdata": "^1.3.2"
},
"permissions": ["token:reveal"],
"timeout": 10,
"resources": "standard"
}
}
]
}
Transforms
For details on writing transform code, including input/output contracts, available transform types, and examples, see Proxy Transforms.
Request Transforms
See Request Transforms for code contracts and available transform types.
Response Transforms
See Response Transforms for code contracts and available transform types.