---
title: "Create a Relay"
method: POST
path: "/relays"
tags: ["Core", "Relays"]
---

# Create a Relay

`POST /relays`

## Request

- Base URL: `https://api.evervault.com`
- URL: `https://api.evervault.com/relays`
- Auth: HTTP basic
- TypeScript: <https://skmtc.dev/evervault/apis/evervault-api/docs/relays/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates a new [Relay](/relay).

## Request body

- object
  - `destinationDomain` string, required: The domain in front of which you would like to configure a Relay
  - `routes` RelayRoute[], required: A collection of route configurations for the Relay.
    - `method` 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'PATCH': The HTTP method that must be matched for the operation to be performed. For any method, use null.
    - `path` string, required: The path that must be matched for the operation to be performed. For wildcards, use '*'. For a catchall of all subsequent paths, use '**'.
    - `request` RelayAction[], required: The actions to be performed on the data on request.
      - `action` 'encrypt' | 'decrypt', required: The operation to perform on the selected data.
      - `selections` RelaySelection[], required: The selections of data on which the operation will be performed.
        - `type` 'header' | 'json' | 'form': The type of the selector used to identify the data on which the action should be performed.
        - `role` string: The role of the encrypted field that must be matched for the operation to be performed.
        - `selector` string, required: The selector that identifies the data on which the action should be performed
    - `response` RelayAction[], required: The actions to be performed on the data on response.
      - `action` 'encrypt' | 'decrypt', required: The operation to perform on the selected data.
      - `selections` RelaySelection[], required: The selections of data on which the operation will be performed.
        - `type` 'header' | 'json' | 'form': The type of the selector used to identify the data on which the action should be performed.
        - `role` string: The role of the encrypted field that must be matched for the operation to be performed.
        - `selector` string, required: The selector that identifies the data on which the action should be performed
  - `encryptEmptyStrings` boolean: Whether or not empty strings should be encrypted. Defaults to true.
  - `authentication` 'api-key' | 'null', nullable: The type of authentication required for the Relay

## Response `201`

The Relay has been created

- Relay
  - `id` string, required: The unique identifier for the Relay.
  - `destinationDomain` string, required: The domain in front of which the Relay should be configured.
  - `evervaultDomain` string, required: The Evervault managed domain to which requests to be relayed to the destination domain should be sent.
  - `routes` RelayRoute[], required: A collection of route configurations for the Relay.
    - `method` 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'PATCH': The HTTP method that must be matched for the operation to be performed. For any method, use null.
    - `path` string, required: The path that must be matched for the operation to be performed. For wildcards, use '*'. For a catchall of all subsequent paths, use '**'.
    - `request` RelayAction[], required: The actions to be performed on the data on request.
      - `action` 'encrypt' | 'decrypt', required: The operation to perform on the selected data.
      - `selections` RelaySelection[], required: The selections of data on which the operation will be performed.
        - `type` 'header' | 'json' | 'form': The type of the selector used to identify the data on which the action should be performed.
        - `role` string: The role of the encrypted field that must be matched for the operation to be performed.
        - `selector` string, required: The selector that identifies the data on which the action should be performed
    - `response` RelayAction[], required: The actions to be performed on the data on response.
      - `action` 'encrypt' | 'decrypt', required: The operation to perform on the selected data.
      - `selections` RelaySelection[], required: The selections of data on which the operation will be performed.
        - `type` 'header' | 'json' | 'form': The type of the selector used to identify the data on which the action should be performed.
        - `role` string: The role of the encrypted field that must be matched for the operation to be performed.
        - `selector` string, required: The selector that identifies the data on which the action should be performed
  - `authentication` 'api-key' | 'null', nullable, required: The type of authentication required for the Relay
  - `encryptEmptyStrings` boolean, required: Whether or not empty strings should be encrypted.
  - `app` string, required: The unique identifier for the app to which the Relay belongs.
  - `createdAt` integer, required: The exact time, in epoch milliseconds, when this Relay was created.
  - `updatedAt` integer, required: The exact time, in epoch milliseconds, when this Relay was updated.

## Changes

- **2026-11-06** `8d0ca833fa04`: 9 info
  - the response property `app` became required for the status `201`
  - the response property `authentication` became required for the status `201`
  - the response property `createdAt` became required for the status `201`
  - the response property `destinationDomain` became required for the status `201`
  - …5 more
- **2025-11-18** `30ea25af4354`: 1 breaking, 2 warning, 3 info
  - the response property `authentication` became nullable for the status `201`
  - added the new `api-key` enum value to the `authentication` response property for the response status `201`
  - added the new `undefined` enum value to the `authentication` response property for the response status `201`
  - api tag `Core` added
  - …2 more

[Operation history](https://skmtc.dev/evervault/apis/evervault-api/changes/relays/post.md)

---

[API](https://skmtc.dev/evervault/apis/evervault-api.md) - [All operations](https://skmtc.dev/evervault/apis/evervault-api/llms.txt) - [OpenAPI document](https://skmtc.dev/evervault/apis/evervault-api/revisions/8d0ca833fa04?raw)
