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

# Secrets

> Encrypted values for API keys and credentials

Write-only credential store. Values are encrypted at rest and never returned via the API. Secrets are available in function context as `context['secrets']` — only for shared pool (trusted) functions. Connectors resolve auth from secrets automatically.

**Visibility:**

* `shared` (default) — global, available to all users and connectors
* `private` — per-user, only used when that user triggers a connector or function

Private secrets override shared secrets with the same name. This enables multi-tenant patterns: admin sets a shared `HUBSPOT_API_KEY`, individual users can override with their own private key.

**Endpoints:**

```
POST   /api/v1/secrets                  # Create or update (upsert by name+visibility)
GET    /api/v1/secrets                  # List names and descriptions (no values)
GET    /api/v1/secrets/{name}           # Get metadata (no value)
PUT    /api/v1/secrets/{name}           # Update value or description
DELETE /api/v1/secrets/{name}           # Delete
```

**Access at runtime (shared pool functions only):**

```python theme={null}
def my_function(input, context):
    # Private secrets override shared for the calling user
    token = context['secrets']['SLACK_BOT_TOKEN']
```

**YAML config:**

```yaml theme={null}
secrets:
  - name: SLACK_BOT_TOKEN
    value: xoxb-...          # omit to skip value update on re-apply
    description: Slack bot OAuth token
    # visibility defaults to "shared" in YAML config
```
