# Save a key for a site

> Save or replace a service key for tools that call a particular website.

Source: https://docs.fous.com/api-reference/saveVariable

`PUT /v1/variables`

Saves the value under the site and name, replacing what was saved there. A tool that calls the site uses it, as the variable the name gives (API_KEY, the default, becomes the site’s own, such as ACME_API_KEY). Needs variables:write.

Authentication: `Authorization: Bearer $FOUS_API_KEY`.

## Request body

Required. JSON.

- `site` (string, required)
- `name` (string): Default "API_KEY".
- `label` (string)
- `value` (string, required)

## Response 200

Success

- `success` (true, required)
- `data` (object, required)
  - `key` (Variable, required)

## Errors

Every error uses the Error schema: branch on `error.code`. Codes are listed at https://docs.fous.com/guides/errors.

- 400
- 401 (headers: WWW-Authenticate)
- 402
- 403
- 404
- 408
- 409
- 410
- 413
- 422
- 429 (headers: Retry-After)
- 500
- 502
- 503 (headers: Retry-After)
- 504

## Example request

```bash
curl 'https://api.fous.com/v1/variables' \
  -X PUT \
  -H "Authorization: Bearer $FOUS_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"site":"myshop.com","name":"ACCESS_TOKEN","value":"your-service-key"}'
```
