---
title: "updateWorkspace"
---

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

# updateWorkspace

Path: agenthold API › workspaces

`PATCH /workspaces/{workspaceId}`

URL: `/api/v1/workspaces/{workspaceId}`

## Authentication

Requires one of the following:

- `session`, apiKey, in cookie
- `token`, http bearer, header `Authorization`

## Path parameters

- `workspaceId` (`updateWorkspace.path.workspaceId`; string, required)

## Request body

_Required._

- `name` (`updateWorkspace.name`; string, required)
  - maxLength: `100` · minLength: `1`

## Example request

```json
{
  "name": "string"
}
```

## Code samples

### cURL

```bash
curl --request PATCH \
  --url '<base-url>/api/v1/workspaces/<workspaceId>' \
  --header 'Content-Type: application/json' \
  --cookie 'agenthold_session=<agenthold_session>' \
  --data '
{
  "name": "string"
}
'
```

### TypeScript

```typescript
const url = '<base-url>/api/v1/workspaces/<workspaceId>';
const options = {
  method: 'PATCH',
  headers: {
    'Content-Type': 'application/json',
    cookie: 'agenthold_session=<agenthold_session>'
  },
  body: JSON.stringify({name: 'string'})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "<base-url>/api/v1/workspaces/<workspaceId>"

payload = { "name": "string" }
headers = {
    "cookie": "agenthold_session=<agenthold_session>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Updated.

#### Example

```json
{
  "id": "string",
  "name": "string",
  "personal": true,
  "role": "owner",
  "createdAt": "2019-08-24T14:15:22Z"
}
```

- `id` (`updateWorkspace.response.200.id`; string, required)
- `name` (`updateWorkspace.response.200.name`; string, required)
- `personal` (`updateWorkspace.response.200.personal`; boolean, required)
- `role` (`updateWorkspace.response.200.role`; string, required)
  - one of `"owner"`, `"admin"`, `"member"`
- `createdAt` (`updateWorkspace.response.200.createdAt`; string, required)
  - format: `date-time`

### 400

Error.

#### Example

```json
{
  "error": "string"
}
```

- `error` (`updateWorkspace.response.400.error`; string, required)

### 403

Error.

#### Example

```json
{
  "error": "string"
}
```

- `error` (`updateWorkspace.response.403.error`; string, required)

### 404

Error.

#### Example

```json
{
  "error": "string"
}
```

- `error` (`updateWorkspace.response.404.error`; string, required)


Source: https://agenthold.dev/api/workspaces/update/index.md
