---
site: steel.dev
collection: docs
canonical_url: https://steel.dev/docs/reference/api/vaults
markdown_url: https://steel.dev/docs/reference/api/vaults.md
content_signal: ai-input=yes, ai-train=yes, search=yes
title: Vaults API
description: Create, list, get, update and delete Vaults with the Steel API.
summary: Create, list, get, update and delete Vaults with the Steel API.
type: reference
prerequisites: []
related:
  - https://steel.dev/docs/reference/api/profiles.md
  - https://steel.dev/docs/reference/api/credentials.md
  - https://steel.dev/docs/reference/api/secret-connections.md
  - https://steel.dev/docs/reference/api/files.md
  - https://steel.dev/docs/reference/api/extensions.md
agent_setup: https://setup.steel.dev/install.md
docs_index: https://steel.dev/docs/sitemap.md
---

# Vaults API

A Vault is a named group of credentials in a project. These endpoints create, list, get, update and delete Vaults. For the base URL and authentication, see [API conventions](https://steel.dev/docs/reference/api). For Vault names, items and bindings, see [Vaults](https://steel.dev/docs/logins/vaults).

The first example is a complete program. The later examples use its `client`, and the ID of a Vault in `VAULT_ID` (cURL), `vaultId` (TypeScript), `vault_id` (Python and Rust) or `vaultID` (Go).

## Endpoints

### List Vaults

```http
GET /v1/vaults
```

Lists the Vaults in a project.

| Name | In | Type | Required | Default | Description |
| - | - | - | - | - | - |
| `projectId` | query | string (uuid) | no | | The project whose Vaults to list. |

| Field | Type | Description |
| - | - | - |
| `vaults` | object\[] | The Vaults, each with the fields in [Create a Vault](https://steel.dev/docs/reference/api/vaults#create-a-vault). |

**TypeScript**

```ts file=list-vaults.mts
import Steel from "steel-sdk";

const client = new Steel();
const result = await client.vaults.list();

for (const vault of result.vaults) {
  console.log(vault.id, vault.name);
}
```

**Python**

```python file=list_vaults.py
from steel import Steel

client = Steel()
result = client.vaults.list()

for vault in result.vaults:
    print(vault.id, vault.name)
```

**Go**

```go file=main.go
package main

import (
	"context"
	"fmt"
	"log"

	"github.com/steel-dev/sdk/go"
)

func main() {
	if err := run(context.Background()); err != nil {
		log.Fatal(err)
	}
}

func run(ctx context.Context) error {
	client := steel.NewClient()
	result, err := client.Vaults.List(ctx, steel.VaultListParams{})
	if err != nil {
		return err
	}

	for _, vault := range result.Vaults {
		fmt.Println(vault.ID, vault.Name)
	}
	return nil
}
```

**Rust**

```rust file=src/main.rs
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = steel_rs::Client::new();
    let result = client
        .vaults()
        .list(steel_rs::VaultListParams::default())
        .await?;

    for vault in result.vaults {
        println!("{} {}", vault.id, vault.name);
    }
    Ok(())
}
```

**cURL**

```sh
curl https://api.steel.dev/v1/vaults \
  -H "steel-api-key: $STEEL_API_KEY"
```

### Create a Vault

```http
POST /v1/vaults
```

Creates a Vault.

| Name | In | Type | Required | Default | Description |
| - | - | - | - | - | - |
| `name` | body | string | yes | | The Vault name. It has 1 to 63 lowercase letters, digits, dots, underscores or hyphens, and starts with a letter or digit. |
| `description` | body | string or null | no | | A description of the Vault. |
| `projectId` | body | string (uuid) | no | | The project to create the Vault in. |

The response is `201` with the Vault:

| Field | Type | Description |
| - | - | - |
| `id` | string (uuid) | The Vault ID. |
| `name` | string | The Vault name. |
| `description` | string or null | The Vault description. |
| `projectId` | string (uuid) | The project that owns the Vault. |
| `createdAt` | string (date-time) | When the Vault was created. |
| `updatedAt` | string (date-time) | When the Vault last changed. |

**TypeScript**

```ts
const vault = await client.vaults.create({
  name: "acme-prod",
  description: "Logins for the Acme account",
});
console.log(vault.id, vault.name);
```

**Python**

```python
vault = client.vaults.create(
    name="acme-prod",
    description="Logins for the Acme account",
)
print(vault.id, vault.name)
```

**Go**

```go
vault, err := client.Vaults.New(ctx, steel.VaultNewParams{
	Name:        steel.F("acme-prod"),
	Description: steel.F("Logins for the Acme account"),
})
if err != nil {
	return err
}
fmt.Println(vault.ID, vault.Name)
```

**Rust**

```rust
let vault = client
    .vaults()
    .create(steel_rs::VaultCreateParams {
        description: Some("Logins for the Acme account".to_owned()),
        ..steel_rs::VaultCreateParams::new("acme-prod".to_owned())
    })
    .await?;
println!("{} {}", vault.id, vault.name);
```

**cURL**

```sh
curl -X POST https://api.steel.dev/v1/vaults \
  -H "steel-api-key: $STEEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "acme-prod", "description": "Logins for the Acme account" }'
```

### Get a Vault

```http
GET /v1/vaults/{id}
```

Returns one Vault.

| Name | In | Type | Required | Default | Description |
| - | - | - | - | - | - |
| `id` | path | string (uuid) | yes | | The Vault ID. |
| `projectId` | query | string (uuid) | no | | The Vault's project. |

The response is the Vault object, with the fields in [Create a Vault](https://steel.dev/docs/reference/api/vaults#create-a-vault).

**TypeScript**

```ts
const vault = await client.vaults.retrieve(vaultId);
console.log(vault.name);
```

**Python**

```python
vault = client.vaults.retrieve(vault_id)
print(vault.name)
```

**Go**

```go
import "os"

vaultID := os.Getenv("VAULT_ID")
vault, err := client.Vaults.Get(ctx, vaultID, steel.VaultGetParams{})
if err != nil {
	return err
}
fmt.Println(vault.Name)
```

**Rust**

```rust
let vault_id = std::env::var("VAULT_ID")?;
let vault = client
    .vaults()
    .retrieve(&vault_id, steel_rs::VaultRetrieveParams::default())
    .await?;
println!("{}", vault.name);
```

**cURL**

```sh
curl https://api.steel.dev/v1/vaults/$VAULT_ID \
  -H "steel-api-key: $STEEL_API_KEY"
```

### Update a Vault

```http
PATCH /v1/vaults/{id}
```

Changes a Vault's name or description.

| Name | In | Type | Required | Default | Description |
| - | - | - | - | - | - |
| `id` | path | string (uuid) | yes | | The Vault ID. |
| `projectId` | query | string (uuid) | no | | The Vault's project. |

The response is the Vault object, with the fields in [Create a Vault](https://steel.dev/docs/reference/api/vaults#create-a-vault).

**TypeScript**

```ts
const vault = await client.vaults.update(vaultId, {
  name: "acme-production",
});
console.log(vault.updatedAt);
```

**Python**

```python
vault = client.vaults.update(vault_id, name="acme-production")
print(vault.updated_at)
```

**Go**

```go
import "os"

vaultID := os.Getenv("VAULT_ID")
vault, err := client.Vaults.Update(ctx, vaultID, steel.VaultUpdateParams{
	Name: steel.F("acme-production"),
})
if err != nil {
	return err
}
fmt.Println(vault.UpdatedAt)
```

**Rust**

```rust
let vault_id = std::env::var("VAULT_ID")?;
let vault = client
    .vaults()
    .update(
        &vault_id,
        steel_rs::VaultUpdateParams {
            name: Some("acme-production".to_owned()),
            ..Default::default()
        },
    )
    .await?;
println!("{}", vault.updated_at);
```

**cURL**

```sh
curl -X PATCH https://api.steel.dev/v1/vaults/$VAULT_ID \
  -H "steel-api-key: $STEEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "acme-production" }'
```

### Delete a Vault

```http
DELETE /v1/vaults/{id}
```

Deletes an empty Vault. Delete or move its items first; a Vault that has items returns `409`.

| Name | In | Type | Required | Default | Description |
| - | - | - | - | - | - |
| `id` | path | string (uuid) | yes | | The Vault ID. |
| `projectId` | query | string (uuid) | no | | The Vault's project. |

The response is `204` with no body.

**TypeScript**

```ts
await client.vaults.delete(vaultId);
```

**Python**

```python
client.vaults.delete(vault_id)
```

**Go**

```go
import "os"

vaultID := os.Getenv("VAULT_ID")
if err := client.Vaults.Delete(ctx, vaultID, steel.VaultDeleteParams{}); err != nil {
	return err
}
```

**Rust**

```rust
let vault_id = std::env::var("VAULT_ID")?;
client
    .vaults()
    .delete(&vault_id, steel_rs::VaultDeleteParams::default())
    .await?;
```

**cURL**

```sh
curl -X DELETE https://api.steel.dev/v1/vaults/$VAULT_ID \
  -H "steel-api-key: $STEEL_API_KEY"
```

See [Vaults](https://steel.dev/docs/logins/vaults).
