# Set or clear environment values

`POST /api/projects/{name}/env` · Praecise Cloud · Projects

Set or clear environment values. Values are never read back, only key names. The service restarts.

- Scope: env
- Role: owner

## Parameters

- `name` (path, required), string: The project's name.

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "set": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Keys to set, with their values."
    },
    "clear": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Keys to remove."
    }
  }
}
```

## Responses

- `200`: The environment was changed.
- `400`: The request is not valid: a bad parameter, or a release that is not kept. Code bad_request or bad_release.
- `401`: No token, or the token is unknown, revoked or expired. Code unauthenticated, token_revoked or token_expired.
- `403`: The token lacks the scope, the call is not open to tokens, or the caller is not an owner. Code scope_missing, session_required or owner_required.
- `404`: No such project, or one the caller cannot see. The two are not told apart. Code not_found.
- `429`: Too many requests for this token. Retry-After says how many seconds to wait. Code rate_limited.

## Example

```sh
curl -X POST 'https://console.praecise.cloud/api/projects/{name}/env' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "set": {},
  "clear": [
    "string"
  ]
}'
```
