---
title: "Set the environment metadata"
method: PUT
path: "/_api/environments/{environment}/metadata"
tags: ["Environments"]
---

# Set the environment metadata

`PUT /_api/environments/{environment}/metadata`

## Request

- The document declares no server URL.
- Auth: one of:
  - API key in header `Authorization`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/macrometa/apis/macrometa-api-reference/docs/_api/environments/:environment/metadata/put.ts> (a function with typed inputs; its response is checked against the schema)

Set the metadata for an environment.

## Path parameters

- `environment` string, string, required

## Request body

- DatabaseMetadata
  - `metadata` object: Object with user defined key-value pairs.

## Response `201`

Successfully set the environment metadata.

- SetEnvironmentExampleRc201
  - `code` integer: HTTP response code.
  - `error` boolean: Flag if there is an error in response. *False* for this response.
  - `result` boolean: Flag for if the environment was set successfully.

## Other responses

- `400`: Failed due to missing or malformed data. Verify that all parameters are complete.
- `403`: Failed to validate because you do not have access to the server.
- `404`: Failed to find specified environment

---

[API](https://skmtc.dev/macrometa/apis/macrometa-api-reference.md) - [All operations](https://skmtc.dev/macrometa/apis/macrometa-api-reference/llms.txt) - [OpenAPI document](https://skmtc.dev/macrometa/apis/macrometa-api-reference/revisions/2006b6d7f31d?raw)
