---
title: "Set a secret"
description: "Stores a value workflows of this suite can use by name (`\"secret:NAME\"`) without ever seeing it: a webhook address, an API key."
canonical: "https://grid82.com/docs/builder-api/secrets/set"
updated: "2026-11-13"
---

# Set a secret

`PUT https://studio.grid82.app/v1/suites/{suiteId}/secrets/{name}`

Stores a value workflows of this suite can use by name (`"secret:NAME"`) without ever seeing it: a webhook address, an API key.

`OPENROUTER_API_KEY` makes the suite's AI steps use its own OpenRouter key instead of credits. Names are UPPER\_SNAKE\_CASE.

Requires the `members:write` scope. Operation `secrets.set`. MCP tool `secrets_set`. CLI: `grid82 secrets set` (`npx grid82`).

## Path parameters

| Name      | Type   | Required | Description |
| --------- | ------ | -------- | ----------- |
| `suiteId` | string | yes      |             |
| `name`    | string | yes      |             |

## Headers

| Name              | Type   | Required | Description                                                                                                                                                                                                                                                        |
| ----------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Idempotency-Key` | string | no       | Any unique string. Sending the same key with the same request again returns the first response (marked `Idempotency-Replayed: true`) instead of running it twice. Reusing it for a different request is refused with 409. Kept for 24 hours. Up to 255 characters. |

## Request body

| Field   | Type   | Required | Description            |
| ------- | ------ | -------- | ---------------------- |
| `value` | string | yes      | Up to 4096 characters. |

**Authorizations**

- `Authorization` (bearer, in header, required)

## Response

**200**: Success

- `data` (`object`, required)
- `data.name` (`string`, required)
- `data.updatedAt` (`string`, required)

```json
{
  "data": {
    "name": "<string>",
    "updatedAt": "<string>"
  }
}
```

**4XX**: Refused

- `error` (`object`, required)
- `error.code` (`enum<string>`, required, one of: `not_found, forbidden, unauthenticated, validation_failed, conflict, rate_limited, payment_required, not_implemented, internal`)
- `error.message` (`string`, required)
- `error.details` (`Record<string, unknown>`)

```json
{
  "error": {
    "code": "not_found",
    "message": "<string>",
    "details": {}
  }
}
```

**Example request**

```bash
curl --request PUT \
  --url 'https://studio.grid82.app/v1/suites/<suiteId>/secrets/<name>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "value": "<string>"
}'
```
