Skip to content

Clear auto-delete rules

Viewing v1, superseded by v2

DELETE
/v1/workspaces/{workspace_id}/storage/auto-delete
curl --request DELETE \
--url https://api.app.layer.ai/api/v1/workspaces/:workspace_id/storage/auto-delete \
--header 'Authorization: Bearer <token>'

v1 is superseded. v1 was superseded by v2 on 2026-08-26. A sunset date has not been announced yet; v1 will be deprecated as a whole before removal. Migrate with the v2 migration guide.

Remove the workspace’s own auto-delete rules, so it follows its ancestors’ again. Requires settings admin.

workspace_id
required
Workspace ID

ID of the workspace that owns the resource.

string format: uuid

ID of the workspace that owns the resource.

Idempotency-Key
string
<= 255 characters

Opaque key making a retry of this request return the first result. A 2xx response is replayed for 24 hours with Idempotent-Replayed: true. A 4xx releases the key. A 5xx, or a request still running, holds the key for 120 seconds, during which a retry gets 409; after that a retry executes again. The key covers the method, path, query, and byte-identical body it was first used with; reusing it for a different request is rejected with 422. Protection is best effort: if the key store is unavailable, or a record is lost early, a retry can execute again even after an earlier 409. See the Idempotency section of the API description.

Successful Response

Media typeapplication/json
AutoDeleteOutput
object
is_available
required
Is Available

Whether the workspace can use auto-delete: Enterprise only.

boolean
policy
required
Any of:
AutoDeletePolicyIO
object
is_enabled
Is Enabled

Whether the rules run every night.

boolean
rules
Rules

A file any rule reaches is deleted. A file something depends on, or that is public or featured, never is.

Array<object>
<= 10 items
AutoDeleteRuleIO
object
older_than_days
required
Older Than Days

Delete files created at least this many days ago (7 or more).

integer
>= 7 <= 3650
origin
Any of:
StoredFileOrigin

Whether a file is the output of a generation, or something a person put in the workspace.

string
Allowed values: generated uploaded
content_categories
Content Categories

Only these content categories; every category when empty.

Array<string>
Allowed values: image video mesh audio pose safetensors playable spine font world pbr_materials landing_page other
keep_labeled
Keep Labeled

Keep files with a label.

boolean
default: true
keep_in_folder
Keep In Folder

Keep files filed in a folder.

boolean
default: true
keep_liked
Keep Liked

Keep files someone liked.

boolean
default: true
keep_pinned
Keep Pinned

Keep files someone pinned.

boolean
default: true
is_locked
Is Locked

Whether every workspace under this one must follow these rules, whatever they set.

boolean
notify_admins
Notify Admins

Whether admins are told what each run deleted.

boolean
effective_policy
required
Any of:
EffectiveAutoDeletePolicyOutput
object
policy
required
AutoDeletePolicyIO
object
is_enabled
Is Enabled

Whether the rules run every night.

boolean
rules
Rules

A file any rule reaches is deleted. A file something depends on, or that is public or featured, never is.

Array<object>
<= 10 items
AutoDeleteRuleIO
object
older_than_days
required
Older Than Days

Delete files created at least this many days ago (7 or more).

integer
>= 7 <= 3650
origin
Any of:
StoredFileOrigin

Whether a file is the output of a generation, or something a person put in the workspace.

string
Allowed values: generated uploaded
content_categories
Content Categories

Only these content categories; every category when empty.

Array<string>
Allowed values: image video mesh audio pose safetensors playable spine font world pbr_materials landing_page other
keep_labeled
Keep Labeled

Keep files with a label.

boolean
default: true
keep_in_folder
Keep In Folder

Keep files filed in a folder.

boolean
default: true
keep_liked
Keep Liked

Keep files someone liked.

boolean
default: true
keep_pinned
Keep Pinned

Keep files someone pinned.

boolean
default: true
is_locked
Is Locked

Whether every workspace under this one must follow these rules, whatever they set.

boolean
notify_admins
Notify Admins

Whether admins are told what each run deleted.

boolean
source_workspace_id
required
Source Workspace ID

The workspace that set the policy: this one or an ancestor.

string format: uuid
source_workspace_name
required
Source Workspace Name

That workspace’s name.

string
nullable
is_locked_by_ancestor
required
Is Locked By Ancestor

Whether an ancestor locked it, so this workspace cannot set its own.

boolean
Example
{
"policy": {
"is_enabled": false,
"rules": [
{
"origin": "generated",
"content_categories": [
"image"
],
"keep_labeled": true,
"keep_in_folder": true,
"keep_liked": true,
"keep_pinned": true
}
],
"is_locked": false,
"notify_admins": false
},
"effective_policy": {
"policy": {
"is_enabled": false,
"rules": [
{
"origin": "generated",
"content_categories": [
"image"
],
"keep_labeled": true,
"keep_in_folder": true,
"keep_liked": true,
"keep_pinned": true
}
],
"is_locked": false,
"notify_admins": false
}
}
}

Unauthenticated — missing or invalid Bearer token.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
error_code
required

Machine-readable error code: the last path segment of type.

string
field

The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.

string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description.",
"error_code": "ERROR_CODE",
"field": "tileability"
}

Forbidden — insufficient permissions, or the access token lacks the scope the operation requires.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
error_code
required

Machine-readable error code: the last path segment of type.

string
field

The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.

string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description.",
"error_code": "ERROR_CODE",
"field": "tileability"
}

Resource not found.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
error_code
required

Machine-readable error code: the last path segment of type.

string
field

The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.

string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description.",
"error_code": "ERROR_CODE",
"field": "tileability"
}

The outcome of the request with this Idempotency-Key is not known yet: it is still running, or it failed without a stored response. Retry after the number of seconds in Retry-After.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
error_code
required

Machine-readable error code: the last path segment of type.

string
field

The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.

string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description.",
"error_code": "ERROR_CODE",
"field": "tileability"
}

Invalid input parameters, or an Idempotency-Key reused for a different request.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
error_code
required

Machine-readable error code: the last path segment of type.

string
field

The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.

string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description.",
"error_code": "ERROR_CODE",
"field": "tileability"
}

Rate limited — retry after the number of seconds in Retry-After.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
error_code
required

Machine-readable error code: the last path segment of type.

string
field

The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.

string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description.",
"error_code": "ERROR_CODE",
"field": "tileability"
}

Internal server error.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
error_code
required

Machine-readable error code: the last path segment of type.

string
field

The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.

string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description.",
"error_code": "ERROR_CODE",
"field": "tileability"
}