# Vaults

Read more about vaults from [Vaults documentation](https://prompteasy.eu/docs/features/vaults).

## Get a list of vaults

`GET /v1/vaults`

Authentication (security requirement alternatives):

```json
[
  {
    "ApiKeyAuth": [],
    "BearerAuth": []
  }
]
```

- ApiKeyAuth: apiKey, header X-Api-Key
- BearerAuth: http (bearer)

Responses:

- 200: A list of vaults

Content type: application/json

Type: array

Items:
  Reference: [Vault](https://api.prompteasy.eu/docs/api/models/vault/index.md); Type: object

- 401: Unauthorized

## Examples

### cURL

```bash
curl -X GET 'https://api.prompteasy.eu/v1/vaults' \
  -H 'X-Api-Key: YOUR_TOKEN' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://api.prompteasy.eu/v1/vaults', {
  method: 'GET',
  headers: {
    'X-Api-Key': 'YOUR_TOKEN',
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.get(
    'https://api.prompteasy.eu/v1/vaults',
    headers={
        'X-Api-Key': 'YOUR_TOKEN',
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```


## Create a new vault

`POST /v1/vaults`

Authentication (security requirement alternatives):

```json
[
  {
    "ApiKeyAuth": [],
    "BearerAuth": []
  }
]
```

- ApiKeyAuth: apiKey, header X-Api-Key
- BearerAuth: http (bearer)

Request body: application/json (required)

Type: object

Schema: [VaultRequest](https://api.prompteasy.eu/docs/api/models/vaultrequest/index.md)

- `name` (optional)
  Type: string
  
  Example:
  
  ```json
  "My Vault"
  ```

- `description` (optional)
  Type: string
  
  Example:
  
  ```json
  "A vault for my prompts"
  ```

- `team_id` (optional)
  Type: integer; nullable
  
  Example:
  
  ```json
  1
  ```

- `tenant_vault` (optional)
  Type: boolean
  
  Example:
  
  ```json
  true
  ```

- `public_vault` (optional)
  Type: boolean
  
  Example:
  
  ```json
  true
  ```

Responses:

- 201: Vault object

Content type: application/json

Type: object

Schema: [Vault](https://api.prompteasy.eu/docs/api/models/vault/index.md)

- `id` (optional)
  Type: integer
  
  Example:
  
  ```json
  1
  ```

- `tenant_id` (optional)
  Type: integer
  
  Example:
  
  ```json
  1
  ```

- `team_id` (optional)
  Type: integer; nullable
  
  Example:
  
  ```json
  1
  ```

- `tenant_vault` (optional)
  Type: boolean
  
  Example:
  
  ```json
  true
  ```

- `public_vault` (optional)
  Type: boolean
  
  Example:
  
  ```json
  true
  ```

- `default` (optional)
  Type: boolean
  
  Example:
  
  ```json
  false
  ```

- `name` (optional)
  Type: string
  
  Example:
  
  ```json
  "My Vault"
  ```

- `description` (optional)
  Type: string
  
  Example:
  
  ```json
  "A vault for my prompts"
  ```

- `created_at` (optional)
  Type: string, date-time
  
  Example:
  
  ```json
  "2025-11-25T13:12:29+00:00"
  ```

- `updated_at` (optional)
  Type: string, date-time
  
  Example:
  
  ```json
  "2025-11-25T13:12:29+00:00"
  ```

- `team` (optional)
  Reference: [Team](https://api.prompteasy.eu/docs/api/models/team/index.md); Type: object

- 401: Unauthorized

- 403: Forbidden

- 422: Unprocessable Entity

Content type: application/json

Type: object

Schema: [ValidationError](https://api.prompteasy.eu/docs/api/models/validationerror/index.md)

- `message` (optional)
  Type: string
  
  Example:
  
  ```json
  "Validation failed"
  ```

- `errors` (optional)
  Reference: [ValidationErrorErrors](https://api.prompteasy.eu/docs/api/models/validationerrorerrors/index.md); Type: object

## Examples

### cURL

```bash
curl -X POST 'https://api.prompteasy.eu/v1/vaults' \
  -H 'X-Api-Key: YOUR_TOKEN' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "name": "My Vault",
  "description": "A vault for my prompts",
  "team_id": 1,
  "tenant_vault": true,
  "public_vault": true
}'
```

### JavaScript

```javascript
const body = `{
  "name": "My Vault",
  "description": "A vault for my prompts",
  "team_id": 1,
  "tenant_vault": true,
  "public_vault": true
}`;

const response = await fetch('https://api.prompteasy.eu/v1/vaults', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_TOKEN',
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "name": "My Vault",
  "description": "A vault for my prompts",
  "team_id": 1,
  "tenant_vault": true,
  "public_vault": true
}'''

response = requests.post(
    'https://api.prompteasy.eu/v1/vaults',
    data=body.encode('utf-8'),
    headers={
        'X-Api-Key': 'YOUR_TOKEN',
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json',
    },
)
print(response.text)
```


## Detach a vault

`POST /v1/vaults/{vault}/detach`

Authentication (security requirement alternatives):

```json
[
  {
    "ApiKeyAuth": [],
    "BearerAuth": []
  }
]
```

- ApiKeyAuth: apiKey, header X-Api-Key
- BearerAuth: http (bearer)

Parameters:

- `vault` (path, integer, required)
  Type: integer

Responses:

- 204: No Content

- 401: Unauthorized

- 403: Forbidden

## Examples

### cURL

```bash
curl -X POST 'https://api.prompteasy.eu/v1/vaults/0/detach' \
  -H 'X-Api-Key: YOUR_TOKEN' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://api.prompteasy.eu/v1/vaults/0/detach', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_TOKEN',
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.post(
    'https://api.prompteasy.eu/v1/vaults/0/detach',
    headers={
        'X-Api-Key': 'YOUR_TOKEN',
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```


## Attach a vault

`POST /v1/vaults/{vault}/attach`

Authentication (security requirement alternatives):

```json
[
  {
    "ApiKeyAuth": [],
    "BearerAuth": []
  }
]
```

- ApiKeyAuth: apiKey, header X-Api-Key
- BearerAuth: http (bearer)

Parameters:

- `vault` (path, integer, required)
  Type: integer

Request body: application/json (required)

Type: object

Schema: [AttachVaultRequest](https://api.prompteasy.eu/docs/api/models/attachvaultrequest/index.md)

- `team_id` (optional)
  Type: integer; nullable
  
  Example:
  
  ```json
  1
  ```

- `tenant_vault` (optional)
  Type: boolean
  
  Example:
  
  ```json
  true
  ```

Responses:

- 204: No Content

- 401: Unauthorized

- 403: Forbidden

- 422: Unprocessable Entity

Content type: application/json

Type: object

Schema: [ValidationError](https://api.prompteasy.eu/docs/api/models/validationerror/index.md)

- `message` (optional)
  Type: string
  
  Example:
  
  ```json
  "Validation failed"
  ```

- `errors` (optional)
  Reference: [ValidationErrorErrors](https://api.prompteasy.eu/docs/api/models/validationerrorerrors/index.md); Type: object

## Examples

### cURL

```bash
curl -X POST 'https://api.prompteasy.eu/v1/vaults/0/attach' \
  -H 'X-Api-Key: YOUR_TOKEN' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "team_id": 1,
  "tenant_vault": true
}'
```

### JavaScript

```javascript
const body = `{
  "team_id": 1,
  "tenant_vault": true
}`;

const response = await fetch('https://api.prompteasy.eu/v1/vaults/0/attach', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_TOKEN',
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "team_id": 1,
  "tenant_vault": true
}'''

response = requests.post(
    'https://api.prompteasy.eu/v1/vaults/0/attach',
    data=body.encode('utf-8'),
    headers={
        'X-Api-Key': 'YOUR_TOKEN',
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json',
    },
)
print(response.text)
```


## Get a single vault

`GET /v1/vaults/{vault}`

Authentication (security requirement alternatives):

```json
[
  {
    "ApiKeyAuth": [],
    "BearerAuth": []
  }
]
```

- ApiKeyAuth: apiKey, header X-Api-Key
- BearerAuth: http (bearer)

Parameters:

- `vault` (path, integer, required)
  Type: integer

Responses:

- 200: Vault object

Content type: application/json

Type: object

Schema: [Vault](https://api.prompteasy.eu/docs/api/models/vault/index.md)

- `id` (optional)
  Type: integer
  
  Example:
  
  ```json
  1
  ```

- `tenant_id` (optional)
  Type: integer
  
  Example:
  
  ```json
  1
  ```

- `team_id` (optional)
  Type: integer; nullable
  
  Example:
  
  ```json
  1
  ```

- `tenant_vault` (optional)
  Type: boolean
  
  Example:
  
  ```json
  true
  ```

- `public_vault` (optional)
  Type: boolean
  
  Example:
  
  ```json
  true
  ```

- `default` (optional)
  Type: boolean
  
  Example:
  
  ```json
  false
  ```

- `name` (optional)
  Type: string
  
  Example:
  
  ```json
  "My Vault"
  ```

- `description` (optional)
  Type: string
  
  Example:
  
  ```json
  "A vault for my prompts"
  ```

- `created_at` (optional)
  Type: string, date-time
  
  Example:
  
  ```json
  "2025-11-25T13:12:29+00:00"
  ```

- `updated_at` (optional)
  Type: string, date-time
  
  Example:
  
  ```json
  "2025-11-25T13:12:29+00:00"
  ```

- `team` (optional)
  Reference: [Team](https://api.prompteasy.eu/docs/api/models/team/index.md); Type: object

- 401: Unauthorized

- 403: Forbidden

## Examples

### cURL

```bash
curl -X GET 'https://api.prompteasy.eu/v1/vaults/0' \
  -H 'X-Api-Key: YOUR_TOKEN' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://api.prompteasy.eu/v1/vaults/0', {
  method: 'GET',
  headers: {
    'X-Api-Key': 'YOUR_TOKEN',
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.get(
    'https://api.prompteasy.eu/v1/vaults/0',
    headers={
        'X-Api-Key': 'YOUR_TOKEN',
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```


## Update a vault

`PUT /v1/vaults/{vault}`

Authentication (security requirement alternatives):

```json
[
  {
    "ApiKeyAuth": [],
    "BearerAuth": []
  }
]
```

- ApiKeyAuth: apiKey, header X-Api-Key
- BearerAuth: http (bearer)

Parameters:

- `vault` (path, integer, required)
  Type: integer

Request body: application/json (required)

Type: object

Schema: [VaultUpdateRequest](https://api.prompteasy.eu/docs/api/models/vaultupdaterequest/index.md)

- `name` (optional)
  Type: string
  
  Example:
  
  ```json
  "My Vault"
  ```

- `description` (optional)
  Type: string; nullable
  
  Example:
  
  ```json
  "An updated description for my vault"
  ```

- `public_vault` (optional)
  Type: boolean
  
  Example:
  
  ```json
  true
  ```

Responses:

- 200: Vault object

Content type: application/json

Type: object

Schema: [Vault](https://api.prompteasy.eu/docs/api/models/vault/index.md)

- `id` (optional)
  Type: integer
  
  Example:
  
  ```json
  1
  ```

- `tenant_id` (optional)
  Type: integer
  
  Example:
  
  ```json
  1
  ```

- `team_id` (optional)
  Type: integer; nullable
  
  Example:
  
  ```json
  1
  ```

- `tenant_vault` (optional)
  Type: boolean
  
  Example:
  
  ```json
  true
  ```

- `public_vault` (optional)
  Type: boolean
  
  Example:
  
  ```json
  true
  ```

- `default` (optional)
  Type: boolean
  
  Example:
  
  ```json
  false
  ```

- `name` (optional)
  Type: string
  
  Example:
  
  ```json
  "My Vault"
  ```

- `description` (optional)
  Type: string
  
  Example:
  
  ```json
  "A vault for my prompts"
  ```

- `created_at` (optional)
  Type: string, date-time
  
  Example:
  
  ```json
  "2025-11-25T13:12:29+00:00"
  ```

- `updated_at` (optional)
  Type: string, date-time
  
  Example:
  
  ```json
  "2025-11-25T13:12:29+00:00"
  ```

- `team` (optional)
  Reference: [Team](https://api.prompteasy.eu/docs/api/models/team/index.md); Type: object

- 401: Unauthorized

- 403: Forbidden

- 422: Unprocessable Entity

Content type: application/json

Type: object

Schema: [ValidationError](https://api.prompteasy.eu/docs/api/models/validationerror/index.md)

- `message` (optional)
  Type: string
  
  Example:
  
  ```json
  "Validation failed"
  ```

- `errors` (optional)
  Reference: [ValidationErrorErrors](https://api.prompteasy.eu/docs/api/models/validationerrorerrors/index.md); Type: object

## Examples

### cURL

```bash
curl -X PUT 'https://api.prompteasy.eu/v1/vaults/0' \
  -H 'X-Api-Key: YOUR_TOKEN' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "name": "My Vault",
  "description": "An updated description for my vault",
  "public_vault": true
}'
```

### JavaScript

```javascript
const body = `{
  "name": "My Vault",
  "description": "An updated description for my vault",
  "public_vault": true
}`;

const response = await fetch('https://api.prompteasy.eu/v1/vaults/0', {
  method: 'PUT',
  headers: {
    'X-Api-Key': 'YOUR_TOKEN',
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "name": "My Vault",
  "description": "An updated description for my vault",
  "public_vault": true
}'''

response = requests.put(
    'https://api.prompteasy.eu/v1/vaults/0',
    data=body.encode('utf-8'),
    headers={
        'X-Api-Key': 'YOUR_TOKEN',
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json',
    },
)
print(response.text)
```


## Delete a vault

`DELETE /v1/vaults/{vault}`

Authentication (security requirement alternatives):

```json
[
  {
    "ApiKeyAuth": [],
    "BearerAuth": []
  }
]
```

- ApiKeyAuth: apiKey, header X-Api-Key
- BearerAuth: http (bearer)

Parameters:

- `vault` (path, integer, required)
  Type: integer

Responses:

- 204: No Content

- 401: Unauthorized

- 403: Forbidden

## Examples

### cURL

```bash
curl -X DELETE 'https://api.prompteasy.eu/v1/vaults/0' \
  -H 'X-Api-Key: YOUR_TOKEN' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://api.prompteasy.eu/v1/vaults/0', {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_TOKEN',
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.delete(
    'https://api.prompteasy.eu/v1/vaults/0',
    headers={
        'X-Api-Key': 'YOUR_TOKEN',
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```
