# Update a mount

Change a mount's path, scope, target, description, or settings. Its files stay.

`PATCH https://api.smallworld.sh/api/v1/mounts/:mountId`

## Parameters

| Name | Location | Type | Required | Description |
| --- | --- | --- | --- | --- |
| mountId | path | UUID | Yes | The mount's ID, returned as id when the mount was created. |
| path | body | string | No | A new path inside /workspace, with the same rules as when creating a mount. |
| scope | body | string | No | A new scope: global, group, or user. Send it whenever you change the scope or target, with groupId for a group mount or userId for a user mount. |
| groupId | body | string | No | Your application's group ID. Required for a group mount, and only allowed for one. The group must already exist. |
| userId | body | string | No | Your application's user ID. Required for a user mount, and only allowed for one. The user must already exist. |
| description | body | string \| null | No | A new description, at most 2000 characters. null or an empty string removes it. |
| settings | body | object | No | How agents' changes to the mount are handled: create, update, delete, move, and rename, each allow, ask, or deny. Reads are always allowed. Only the settings you send change. |

## Request examples

### curl

```curl
curl --fail-with-body -X PATCH 'https://api.smallworld.sh/api/v1/mounts/0199a1c4-5b6e-7a10-9c2d-3e4f5a6b7c8d' \
  -H "Authorization: Bearer $SMALLWORLD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "settings": {
    "update": "allow"
  }
}'
```

### typescript

```typescript
const response = await fetch("https://api.smallworld.sh/api/v1/mounts/0199a1c4-5b6e-7a10-9c2d-3e4f5a6b7c8d", {
  method: "PATCH",
  headers: { Authorization: `Bearer ${apiKey}`, "Content-Type": "application/json" },
  body: JSON.stringify({
  "settings": {
    "update": "allow"
  }
}),
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
const result = await response.json();
```

### python

```python
response = requests.patch(
    "https://api.smallworld.sh/api/v1/mounts/0199a1c4-5b6e-7a10-9c2d-3e4f5a6b7c8d",
    headers={"Authorization": f"Bearer {api_key}"},
    json={
  "settings": {
    "update": "allow"
  }
},
    timeout=30,
)
response.raise_for_status()
result = response.json()
```

## Responses

Returns id, path, scope (global, group, or user), groupId (your group ID, for a group mount), userId (your user ID, for a user mount), nullable description, settings with create, update, delete, move, and rename (each allow, ask, or deny), fileCount (files, not folders), totalBytes, and ISO 8601 createdAt and updatedAt timestamps. groupId and userId are null when they don't apply.

### 200

Returns id, path, scope (global, group, or user), groupId (your group ID, for a group mount), userId (your user ID, for a user mount), nullable description, settings with create, update, delete, move, and rename (each allow, ask, or deny), fileCount (files, not folders), totalBytes, and ISO 8601 createdAt and updatedAt timestamps. groupId and userId are null when they don't apply.

```json
{
  "id": "0199a1c4-5b6e-7a10-9c2d-3e4f5a6b7c8d",
  "path": "/workspace/docs",
  "scope": "group",
  "groupId": "team_42",
  "userId": null,
  "description": "Product documentation. Answers to customer questions go in faq.md.",
  "settings": {
    "create": "allow",
    "update": "allow",
    "delete": "ask",
    "move": "ask",
    "rename": "ask"
  },
  "fileCount": 2,
  "totalBytes": 91,
  "createdAt": "2026-10-10T12:00:00.000Z",
  "updatedAt": "2026-10-10T12:00:01.000Z"
}
```

### 400

mount_invalid_path: path isn't inside /workspace (such as /docs, or /workspace itself), isn't canonical (such as /workspace/a/../b or a trailing slash), contains null bytes, backslashes, or control characters, or is longer than 1024 bytes or has a segment over 255 bytes. The message names the problem. invalid_request: The body is invalid: scope is missing or invalid while groupId or userId is sent, groupId or userId doesn't match the scope, a setting isn't allow, ask, or deny, the description is too long, or the body has an unknown field. The message names the problem.

#### mount_invalid_path

path isn't inside /workspace (such as /docs, or /workspace itself), isn't canonical (such as /workspace/a/../b or a trailing slash), contains null bytes, backslashes, or control characters, or is longer than 1024 bytes or has a segment over 255 bytes. The message names the problem.

```json
{
  "statusCode": 400,
  "code": "mount_invalid_path",
  "message": "path must be a path inside /workspace, such as /workspace/docs"
}
```

#### invalid_request

The body is invalid: scope is missing or invalid while groupId or userId is sent, groupId or userId doesn't match the scope, a setting isn't allow, ask, or deny, the description is too long, or the body has an unknown field. The message names the problem.

```json
{
  "statusCode": 400,
  "code": "invalid_request",
  "message": "scope must be global, group, or user"
}
```

### 401

authentication_required: The Authorization header is missing or empty. invalid_api_key: The API key is invalid or revoked, or the header doesn't use the Bearer scheme.

#### authentication_required

The Authorization header is missing or empty.

```json
{
  "statusCode": 401,
  "code": "authentication_required",
  "message": "Authentication is required"
}
```

#### invalid_api_key

The API key is invalid or revoked, or the header doesn't use the Bearer scheme.

```json
{
  "statusCode": 401,
  "code": "invalid_api_key",
  "message": "The API key is invalid or revoked"
}
```

### 403

ip_not_allowed: The request came from an address outside the workspace's IP allowlist.

#### ip_not_allowed

The request came from an address outside the workspace's IP allowlist.

```json
{
  "statusCode": 403,
  "code": "ip_not_allowed",
  "message": "The source IP address is not allowed by this account's security settings"
}
```

### 404

mount_not_found: The mount does not exist in your workspace, or mountId isn't a mount ID. group_not_found: scope is group and the group does not exist in your workspace. Create it with POST /groups first; nothing is changed. user_not_found: scope is user and the user does not exist in your workspace. Create it with POST /users first; nothing is changed.

#### mount_not_found

The mount does not exist in your workspace, or mountId isn't a mount ID.

```json
{
  "statusCode": 404,
  "code": "mount_not_found",
  "message": "Mount not found"
}
```

#### group_not_found

scope is group and the group does not exist in your workspace. Create it with POST /groups first; nothing is changed.

```json
{
  "statusCode": 404,
  "code": "group_not_found",
  "message": "Group not found"
}
```

#### user_not_found

scope is user and the user does not exist in your workspace. Create it with POST /users first; nothing is changed.

```json
{
  "statusCode": 404,
  "code": "user_not_found",
  "message": "User not found"
}
```

### 409

mount_path_conflict: Another mount with the same scope and target (the workspace, the same group, or the same user) has the same path or one that contains or lies inside this one. Mounts of different scopes may overlap.

#### mount_path_conflict

Another mount with the same scope and target (the workspace, the same group, or the same user) has the same path or one that contains or lies inside this one. Mounts of different scopes may overlap.

```json
{
  "statusCode": 409,
  "code": "mount_path_conflict",
  "message": "/workspace/docs/team overlaps /workspace/docs, another mount of the same group"
}
```

### 413

request_too_large: The JSON body is larger than 12 MiB. File uploads count toward it, base64 or escaping included.

#### request_too_large

The JSON body is larger than 12 MiB. File uploads count toward it, base64 or escaping included.

```json
{
  "statusCode": 413,
  "code": "request_too_large",
  "message": "The request body is larger than 12 MiB."
}
```

### 415

unsupported_media_type: The request has a body that isn't JSON. Send JSON with Content-Type: application/json, or no body at all.

#### unsupported_media_type

The request has a body that isn't JSON. Send JSON with Content-Type: application/json, or no body at all.

```json
{
  "statusCode": 415,
  "code": "unsupported_media_type",
  "message": "Send the request body as JSON with Content-Type: application/json."
}
```

### 500

internal_error: An unexpected server error.

#### internal_error

An unexpected server error.

```json
{
  "statusCode": 500,
  "code": "internal_error",
  "message": "Internal server error"
}
```

## Notes

- Send any of path, scope, groupId, userId, description, and settings. To change the scope or target, send scope with its groupId or userId, such as { "scope": "group", "groupId": "team_42" } to turn a user mount into a group mount. groupId or userId without scope is invalid.

- A new path, scope, or target is checked for conflicts again, as when creating a mount, and returns 409 when it overlaps another mount of the same scope and target.

- Any edit, even of the description, discards the mount's changes from commands that are still running or waiting for approval: a waiting approval is interrupted, and the command's stderr says why. Commands that start afterwards use the new configuration.
