# Workspace secrets

> Store an API key once in Settings › Developers › Secrets and use it in every Webhook step's headers as {{secrets.NAME}}. Values are encrypted, never shown again, and never leave in an export.

Source: https://tryladoo.com/docs/developers/secrets · Updated 2026-11-21

A workspace secret is an API key or token you store once and use by name. When ten Webhook steps call the same API, they all say `Bearer {{secrets.DISPATCH_API_KEY}}`, and rotating the key in one place updates every one of them from the next call.

## Add a secret

Go to **Settings › Developers › Secrets** and choose **New secret**. You need the workspace's admin or owner role.

- **Name:** capital letters, numbers and `_`, starting with a letter, like `DISPATCH_API_KEY`. Each name is unique in its workspace.
- **Value:** the key itself, up to 4,096 characters, with no line breaks.
- **Send only to:** the hostnames it may be sent to, like `api.example.com`, or `*.example.com` for any subdomain of it. Up to 10. A step pointed anywhere else doesn't send.

Once saved, the value is never shown again, in the dashboard or the API. To change it, choose **Change** and enter a new value. Leave the value empty to change only where it can be sent.

## Use it in a Webhook step or a custom tool

Put the reference in a header's value, in a Webhook step or an agent's custom tool:

```
Authorization: Bearer {{secrets.DISPATCH_API_KEY}}
X-Api-Key: {{secrets.DISPATCH_API_KEY}}
```

When the call reaches the step, Ladoo fills in the value just before it sends the request. A header that only holds references (and an optional scheme like `Bearer`) is shown in the editor as written, because it holds no secret itself.

Secrets only work in headers. In the address, the body or the **Say while waiting** line they'd be empty, so the editor flags them there.

## Where a secret goes, and where it never does

A secret is sent only:

- in the headers of a Webhook step's or custom tool's request, or of an [MCP server](https://tryladoo.com/docs/developers/mcp-servers),
- over `https://`,
- to a host its **Send only to** list allows,
- through the same address checks as every Webhook step, which refuse private and local network addresses.

If any of those doesn't hold, the step doesn't send and takes its error path, with `secret_blocked`. A step that names a secret the workspace doesn't have fails with `secret_missing`.

A secret's value never appears in:

- API responses, including the secret routes themselves,
- the workflow editor, drafts or published versions,
- prompts, the agent's speech, Custom Code steps or call transcripts,
- workflow [exports](https://tryladoo.com/docs/developers/workflow-file-format#what-export-leaves-out), which carry `{{secrets.NAME}}` and never the value,
- the workspace audit log, which records who added, rotated, changed or deleted a secret, by name.

Values are encrypted at rest. The dashboard's database role can list secret names but can't read values. Only the part of Ladoo that sends Webhook steps can.

## Exports and other workspaces

Because an export keeps the reference, a workflow file or template moves between workspaces with its headers intact. Its `needs_setup` list names each secret it uses. Add a secret with the same name in the workspace you import into, and the steps work there with that workspace's own key.

## API

The dashboard uses these routes. They aren't in the public API reference yet and may change. An API key needs `webhooks:read` to list secrets and `webhooks:write` to change them.

| Route                       | What it does                                                                                                                                        |
| --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GET /v1/secrets`           | Lists names, allowed hosts and dates. Never values.                                                                                                 |
| `GET /v1/secrets/{name}`    | One secret, without its value.                                                                                                                      |
| `PUT /v1/secrets/{name}`    | Creates (`201`) or changes (`200`). Body: `{"value": "…", "allowed_hosts": ["api.example.com"]}`. `value` is required to create and optional after. |
| `DELETE /v1/secrets/{name}` | Deletes it. Steps that use it fail with `secret_missing` until it's added again.                                                                    |
