# Update a workspace

Change the name of an existing workspace.

```text
PATCH $CLOUDSIGMA_API_BASE/workspaces/{id}
```

## Before you call this API

Configure the [regional API endpoint and authentication](https://omnifabric.cloudsigma.com/docs/developer/endpoints-and-authentication.html.md).

First [list workspaces](https://omnifabric.cloudsigma.com/docs/reference/api/ai-studio/workspaces/list-workspaces.html.md#query-parameters) to confirm the workspace to update.  You do not need to enter a workspace before calling this API.

## Path parameter and request body

Replace `$CLOUDSIGMA_API_KEY`, `$WORKSPACE_ID`, and `$WORKSPACE_NAME` with actual values.

:::::::{div} mo-api-tabs
::::::{tab-set}
:::::{tab-item} Input example

```bash
curl -X PATCH "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "'"$WORKSPACE_NAME"'"
  }'
```

:::::
:::::{tab-item} Parameter details

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | ID of the workspace to update. |
| `name` | string | Yes | New workspace name. It cannot be empty. |

:::::
::::::
:::::::

## Successful response

On success, the API returns 200, which indicates that the name was saved.

:::::::{div} mo-api-tabs
::::::{tab-set}
:::::{tab-item} Response example

```json
{
  "code": "OK",
  "msg": "OK"
}
```

:::::
:::::{tab-item} Field details

| Field | Type | Description |
| --- | --- | --- |
| `code` | string | `OK` on success. |
| `msg` | string | `OK` on success. |

:::::
::::::
:::::::

## Error response

:::::::{div} mo-api-tabs
::::::{tab-set}
:::::{tab-item} Response example

```json
{
  "code": "ErrParamInvalid",
  "msg": "Invalid request parameters",
  "data": null
}
```

:::::
:::::{tab-item} Field details

| Field | Type | Description |
| --- | --- | --- |
| `code` | string | Error code. |
| `msg` | string | Human-readable error message. |
| `data` | null | `null` in an error response. |

:::::
::::::
:::::::

## Next steps

[List workspaces](https://omnifabric.cloudsigma.com/docs/reference/api/ai-studio/workspaces/list-workspaces.html.md#query-parameters) to confirm that the name was updated.
