---
raw: true
search:
  tags:
    - Variables
    - PUT
seo:
  description: >-
    Creates or updates a team variable by name. The new value applies… Reference
    for the PUT /v1/teams/{teamId}/variables/{name} endpoint in the Spacefast
    API.
sidebar:
  label: Set a team variable
  badge: PUT
title: Set a team variable
type: openapi-operation
---
Creates or updates a team variable by name. The new value applies when a version next finalizes; live versions keep their sealed values.

`PUT /v1/teams/{teamId}/variables/{name}`

**Request body** (`application/json`, required)

- `value` (string, required)
- `secret` (boolean, required) — Whether the value is write-only.
- `channelValues` (object)

Request body example:

```json
{
  "value": "string",
  "secret": true,
  "channelValues": {
    "property1": "string",
    "property2": "string"
  }
}
```

**Responses**

- `200` — Response for status 200
- `default` — Problem details (RFC 9457). Any 4xx/5xx response is one \`application/problem+json\` document.

Response example, 200:

```json
{
  "$schema": "http://example.com",
  "data": {
    "name": "string",
    "scope": "space",
    "secret": true,
    "value": "string",
    "channelValues": {
      "property1": "string",
      "property2": "string"
    },
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z"
  },
  "operation": {
    "id": "string",
    "kind": "string",
    "status": "queued",
    "resources": [
      {
        "type": "string",
        "id": "string"
      }
    ],
    "progress": {
      "total": 0,
      "completed": 0,
      "failed": 0
    },
    "diagnostics": [
      {
        "code": "string",
        "severity": "info",
        "message": "string",
        "path": "string",
        "provider": "infra",
        "details": {
          "property1": null,
          "property2": null
        },
        "fix": "string",
        "retryable": true
      }
    ],
    "createdAt": "2019-08-24T14:15:22Z",
    "finishedAt": "2019-08-24T14:15:22Z"
  }
}
```
