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

# Workspaces

> Working copies for editing a resource, such as an automation, as text before committing it.

## Queries

* [`workspace`](https://developers.redo.com/docs/api-reference/v3/reference/workspaces/queries/workspace) — Read a workspace. Null if it doesn't exist or expired.

## Mutations

* [`workspaceCommit`](https://developers.redo.com/docs/api-reference/v3/reference/workspaces/mutations/workspace-commit) — Save a workspace to its resource. STALE if the resource changed since the workspace started; INVALID while an ERROR diagnostic remains. The workspace stays open. For an automation, publish with `automationPublish` next. Null if the workspace is gone.
* [`workspaceCreate`](https://developers.redo.com/docs/api-reference/v3/reference/workspaces/mutations/workspace-create) — Open a working copy of a resource. Omit `resourceId` to start a new resource; committing creates it. Null if the resource doesn't exist. Read the resource type's guide in `automationCatalog` first.
* [`workspaceDelete`](https://developers.redo.com/docs/api-reference/v3/reference/workspaces/mutations/workspace-delete) — Discard a workspace. The resource is unchanged. False if the workspace doesn't exist.
* [`workspaceUpdate`](https://developers.redo.com/docs/api-reference/v3/reference/workspaces/mutations/workspace-update) — Apply text edits to a workspace, in order. Edits fail only mechanically (stale revision, text not found or ambiguous, more than 100 edits or 1 MB); text that doesn't parse is reported in `diagnostics`. Changes only the working copy. Null if the workspace is gone.

## Objects

* [`Diagnostic`](https://developers.redo.com/docs/api-reference/v3/reference/workspaces/diagnostic) — A problem in a document. Its message names a `diagnostics/<code>` page in `automationCatalog` that explains it.
* [`DiagnosticFix`](https://developers.redo.com/docs/api-reference/v3/reference/workspaces/diagnostic-fix) — A suggested fix: edits to apply with `workspaceUpdate`.
* [`TextEdit`](https://developers.redo.com/docs/api-reference/v3/reference/workspaces/text-edit) — Replace `find`, which occurs exactly once in the document, with `replace`. Pass it to `workspaceUpdate` as is.
* [`Workspace`](https://developers.redo.com/docs/api-reference/v3/reference/workspaces/workspace) — A working copy of one resource, as text. Edit it with `workspaceUpdate`, check `diagnostics`, then save it with `workspaceCommit`. Expires 7 days after its last change.

## Input objects

* [`TextEditInput`](https://developers.redo.com/docs/api-reference/v3/reference/workspaces/text-edit-input) — Replace `find` with `replace`. `find` must occur exactly once unless `all` is set. Omit `find` to replace the whole document.

## Enums

* [`DiagnosticSeverity`](https://developers.redo.com/docs/api-reference/v3/reference/workspaces/diagnostic-severity) — How much a diagnostic matters.
* [`WorkspaceCommitStatus`](https://developers.redo.com/docs/api-reference/v3/reference/workspaces/workspace-commit-status) — What a commit did.
* [`WorkspaceResourceType`](https://developers.redo.com/docs/api-reference/v3/reference/workspaces/workspace-resource-type) — A kind of resource a workspace can edit.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.