---
title: "listAgentSecrets"
---

> Documentation Index
> Fetch the complete documentation index at: https://agenthold.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# listAgentSecrets

Path: agenthold API › secrets

`GET /agents/{agentId}/secrets`

URL: `/api/v1/agents/{agentId}/secrets`

## Authentication

Requires one of the following:

- `session`, apiKey, in cookie
- `token`, http bearer, header `Authorization`

## Path parameters

- `agentId` (`listAgentSecrets.path.agentId`; string, required)

## Code samples

### cURL

```bash
curl --request GET \
  --url '<base-url>/api/v1/agents/<agentId>/secrets' \
  --cookie 'agenthold_session=<agenthold_session>'
```

### TypeScript

```typescript
const url = '<base-url>/api/v1/agents/<agentId>/secrets';
const options = {
  method: 'GET',
  headers: {cookie: 'agenthold_session=<agenthold_session>'}
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "<base-url>/api/v1/agents/<agentId>/secrets"

headers = {"cookie": "agenthold_session=<agenthold_session>"}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

Secrets attached to the agent.

#### Example

```json
[
  {
    "secret": {
      "id": "string",
      "workspaceId": "string",
      "name": "string",
      "rule": {
        "hosts": [
          "string"
        ],
        "header": "string",
        "template": "string"
      },
      "placeholder": "string",
      "owner": {
        "id": "string",
        "email": "string",
        "name": "string",
        "avatarUrl": "string"
      },
      "canManage": true,
      "createdAt": "2019-08-24T14:15:22Z",
      "updatedAt": "2019-08-24T14:15:22Z"
    },
    "envVar": "string"
  }
]
```

- `secret` (`listAgentSecrets.response.200.secret`; object, required)
  - `id` (`listAgentSecrets.response.200.secret.id`; string, required)
  - `workspaceId` (`listAgentSecrets.response.200.secret.workspaceId`; string, required)
  - `name` (`listAgentSecrets.response.200.secret.name`; string, required)
  - `rule` (`listAgentSecrets.response.200.secret.rule`; object, required)
    - `hosts` (`listAgentSecrets.response.200.secret.rule.hosts`; array of string, required) — Exact host names or "*.example.com".
    - `header` (`listAgentSecrets.response.200.secret.rule.header`; string, required)
    - `template` (`listAgentSecrets.response.200.secret.rule.template`; string, required) — Header value; {{.Value}} is the secret. Function: base64.
  - `placeholder` (`listAgentSecrets.response.200.secret.placeholder`; string, required) — What sandboxes see instead of the value.
  - `owner` (`listAgentSecrets.response.200.secret.owner`; object, required)
    - `id` (`listAgentSecrets.response.200.secret.owner.id`; string, required)
    - `email` (`listAgentSecrets.response.200.secret.owner.email`; string, required)
    - `name` (`listAgentSecrets.response.200.secret.owner.name`; string, required)
    - `avatarUrl` (`listAgentSecrets.response.200.secret.owner.avatarUrl`; string, required)
  - `canManage` (`listAgentSecrets.response.200.secret.canManage`; boolean, required)
  - `createdAt` (`listAgentSecrets.response.200.secret.createdAt`; string, required)
    - format: `date-time`
  - `updatedAt` (`listAgentSecrets.response.200.secret.updatedAt`; string, required)
    - format: `date-time`
- `envVar` (`listAgentSecrets.response.200.envVar`; string, required)

### 404

Error.

#### Example

```json
{
  "error": "string"
}
```

- `error` (`listAgentSecrets.response.404.error`; string, required)


Source: https://agenthold.dev/api/list-agent-secrets/index.md
