---
title: "Set a web link's secrets"
method: PUT
path: "/v1/media/{id}/web-secrets"
tags: ["media"]
---

# Set a web link's secrets

`PUT /v1/media/{id}/web-secrets`

## Request

- Base URL: `https://api.brixsignage.com`
- URL: `https://api.brixsignage.com/v1/media/{id}/web-secrets`
- Auth: HTTP bearer

Store credentials, such as authentication tokens or login passwords, for a web asset. Values are encrypted at rest and write-only: send an object mapping reference names to values, where a null value deletes that reference. Only the reference names, never the values, can be read back later. This merges with any existing secrets rather than replacing them.

## Path parameters

- `id` string, required

## Request body

- object
  - `secrets` object, required: Secret name → value (at most 50, values ≤ 8192 characters). `null` or `""` removes one; names not sent are kept.
  - `expect` object: The link's `url` and `webConfig` as you last read them. Send it: the secrets are stored only if the link still sends them to that address and those sign-in steps, else 409.
    - `url` string, required
    - `webConfig` unknown, required

## Response `200`

Success.

- object
  - `data` object, required
    - `ok` true, required
    - `refs` string[], required: The secret NAMES now stored. Values are never returned.

## Other responses

- `400`: Too many secrets, a name or value too long, or a malformed `expect`.
- `401`: Missing, expired or revoked bearer token.
- `403`: The token lacks the permission this operation needs (see `x-brix-permission`).
- `404`: No media with this id.
- `409`: The link's address or sign-in steps changed (or are not what `expect` says). Nothing was stored.
- `5XX`: Server error. The body carries a `requestId` to quote to support.

---

[API](https://skmtc.dev/brixsignage/apis/brix-api.md) · [All operations](https://skmtc.dev/brixsignage/apis/brix-api/llms.txt) · [OpenAPI document](https://skmtc.dev/brixsignage/apis/brix-api/revisions/02fd3665dc7d?raw)
