# PATCH /users/{name}/backup-excludes/{id}

First published 3 Oct 2026 (release 0.1.0) · Unchanged since publication

UrbeStack release 0.2.35 API operation in the backups group.

Lock or unlock a customer's backup exclusion

- Who may call it: administrator
- Token scope, any of: backups, all
- Answers: 200 OK

Use the id returned by GET /users/{name}/backup-excludes. Set locked to true to prevent the customer from editing or removing the exclusion, or false to let them do so. The API returns 400 if locked is missing and 403 if the caller lacks administrator privileges. The response contains the updated exclusion in exclude.

## As a command

- [urbestack-backup-exclude-set](https://urbestack.com/docs/commands/urbestack-backup-exclude-set.md): Locks or unlocks a customer's backup exclusion.

## Parameters

- `name` (path, Username, required)
- `id` (path, integer, 1 or more, required)

## Request body

JSON, the type [BackupExcludeLock](https://urbestack.com/docs/api/types/BackupExcludeLock.md).

- `locked` (boolean, required)

## Example

Set $API to the base URL and $TOKEN to the token, as the [API overview](https://urbestack.com/docs/api.md) shows.

```
curl -sS -X PATCH "$API/users/alice/backup-excludes/1" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "locked": true
  }'
```

Response, 200 OK:

```
{
  "exclude": {
    "created_at": "2026-09-09T10:15:00Z",
    "id": 1,
    "locked": true,
    "path": "public_html/index.php"
  }
}
```

## Errors

- 400: --id is required
- 400: --user is required
- 400: Invalid boolean
- 400: Invalid id
- 400: Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter
- 400: Say --lock or --unlock, one of them
- 400: Username '<value>' is reserved
- 400: body is missing required field locked
- 401: Authentication required
- 403: Only an administrator locks or unlocks a row
- 404: No such row
- 404: Unknown user <user>
