---
title: "PUT /v1/mcp-servers/{uid}/environments"
method: PUT
path: "/v1/mcp-servers/{uid}/environments"
tags: ["mcp-servers"]
---

# PUT /v1/mcp-servers/{uid}/environments

`PUT /v1/mcp-servers/{uid}/environments`

## Request

- Base URL: `https://api.scalar.com/core`
- URL: `https://api.scalar.com/core/v1/mcp-servers/{uid}/environments`
- Auth: HTTP bearer

Save an MCP server's environments: the agent's environment rows first, then the record

## Path parameters

- `uid` string, required

## Request body

- object
  - `environments` object, required

## Response `200`

Default Response

- object
  - `environments` object, required
  - `rows` object[], required
    - `slug` string, required
    - `id` string, required

## Other responses

- `400`: Bad request
- `401`: No auth
- `403`: Forbidden
- `404`: Not found
- `422`: Invalid payload
- `500`: Uncaught error

## Changes

- **2026-10-26** `b3aa8493faa8`: 4 info
  - added the new optional request property `environments/additionalProperties/instructions`
  - added the new optional request property `environments/additionalProperties/templatePrompts`
  - added the optional property `environments/additionalProperties/instructions` to the response with the `200` status
  - added the optional property `environments/additionalProperties/templatePrompts` to the response with the `200` status
- **2026-10-20** `56717d377656`: 2 info
  - added the new optional request property `environments/additionalProperties/customization`
  - added the optional property `environments/additionalProperties/customization` to the response with the `200` status
- **2026-10-15** `d27d57f9d6b9`: 2 info
  - added the new optional request property `environments/additionalProperties/groupSecrets`
  - added the optional property `environments/additionalProperties/groupSecrets` to the response with the `200` status
- **2026-10-13** `31d9832a717b`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/scalar/apis/core/changes/v1/mcp-servers/:uid/environments/put.md)

---

[API](https://skmtc.dev/scalar/apis/core.md) - [All operations](https://skmtc.dev/scalar/apis/core/llms.txt) - [OpenAPI document](https://skmtc.dev/scalar/apis/core/revisions/b3aa8493faa8?raw)
