> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paradime.io/llms.txt
> Use this file to discover all available pages before exploring further.

# setEnvironmentVariables

> Sets variables of the workspace or of one of its environments, in one write. Redeploys the Bolt schedules when the workspace's or a Bolt environment's variables change, and rewrites the workspace's editor settings when the workspace's change. Needs `env_vars:write`.



**mutation** `setEnvironmentVariables(input: SetEnvironmentVariablesInput!): SetEnvironmentVariablesPayload!`

## Arguments

**`input`**: `SetEnvironmentVariablesInput!` (required)

The variables.

## Returns

`SetEnvironmentVariablesPayload!`

**`variables`**: `EnvironmentVariableConnection!`

The scope's variables after the change.

**Arguments:**

- `first`: `Int` = 100 — How many to return: 100 by default, at most 500. 0 returns only `totalCount`.
- `after`: `String` — The `endCursor` of the previous page.

---

**`changedNames`**: `[String!]!`

The names the call added, gave a new value or deleted; empty when nothing changed.

## Examples

```graphql Mutation
mutation SetEnvironmentVariables($input: SetEnvironmentVariablesInput!) {
  setEnvironmentVariables(input: $input) {
    variables {
      edges {
        cursor
        node {
          __typename
        }
      }
      pageInfo {
        startCursor
        endCursor
        hasNextPage
        hasPreviousPage
      }
      totalCount
    }
    changedNames
  }
}
```

```json Variables
{
  "input": {
    "scope": "WORKSPACE",
    "variables": [
      {
        "name": "string",
        "value": "string"
      }
    ]
  }
}
```

```json Response
{
  "data": {
    "setEnvironmentVariables": {
      "variables": {
        "edges": [
          {
            "cursor": "string",
            "node": {
              "__typename": "EnvironmentVariable"
            }
          }
        ],
        "pageInfo": {
          "startCursor": "string",
          "endCursor": "string",
          "hasNextPage": true,
          "hasPreviousPage": true
        },
        "totalCount": 1
      },
      "changedNames": [
        "string"
      ]
    }
  }
}
```


## Related topics

- [Administration API: Environment variables](https://docs.paradime.io/developers/graphql-api/admin-api/environment-variables.md)
- [Administration API: Environments](https://docs.paradime.io/developers/graphql-api/admin-api/environments.md)
- [Getting started with the Paradime CLI](https://docs.paradime.io/developers/paradime-cli/getting-started.md)
- [Manage workspace configurations](https://docs.paradime.io/guides/paradime-101/getting-started-with-your-paradime-workspace/managing-workspace-configurations.md)
- [Environment Variables in Commands](https://docs.paradime.io/products/bolt/creating-schedules/environment-variables-in-commands.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.