Vault

Secrets

Secrets are just like any other objects in your workspace. You can create, update and delete them.

Creating secrets

To create one or more secret, send a POST request to /secrets. You must also provide name for this secret which can be anything you like for descriptive purposes.

You can also optionally provide a deletion_date for your secret, which is the date and time when your secret will be automatically deleted by Modernbanc.

Request:

[
  {
    "name": "Card number",
    "value": "4242 4242 4242 4242",
    "deletion_date": "2023-01-13T18:44:11.263Z"
  }
]

Response:

[
  {
    "name": "Card number",
    "value": "4242 4242 4242 4242",
    "deletion_date": "2023-01-13T18:44:11.263Z"
  }
]

Updating secrets

You can update your secret at any time whether it’s to change the underlying information that was stored or update its name.

Updating name of the secret

{
  "name": "Card number",
  "value": "4242 4242 4242 4242"
}

Updating underlying value of the secret

{
  "value": "4242 4242 4242 4242"
}

Getting secrets

To get or list your secrets just use the GET endpoints like any other objects. Standard include, pagination and filter rules apply.

Because field value is a computed field we don’t include it by default. So if you want to get the original value of your secret you need to explicitly specify ?include={value:true}.

Example without include value.

{
  "id": "ENCRYPTED_JAN23_lsYnrfANN9VsvQq40ex",
  "name": "Card number",
  "deletion_date": "2023-01-13T18:44:11.263Z"
}

Example with include value.

{
  "id": "ENCRYPTED_JAN23_lsYnrfANN9VsvQq40ex",
  "name": "Card number",
  "value": "4242 4242 4242 4242",
  "deletion_date": "2023-01-13T18:44:11.263Z"
}

Also note that since value is a computed field you can’t currently filter on it.