> ## 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.

# createWorkspace

> 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.

**Required scopes:** [`automations_write`](/docs/api-reference/v3/reference/scopes#scope-automations_write)

## Arguments

**resourceId** `ID`

The resource to edit; omit to start a new one.

**resourceType** *required*

What kind of resource to edit.

## Returns

**createWorkspace**

A working copy of one resource, as text. Edit it with `updateWorkspace`, check `diagnostics`, then save it with `commitWorkspace`. Expires 7 days after its last change.

**fields**

**diagnostics** *required*

Problems in the current text. Commit refuses while any is an ERROR. Apply a fix by passing its `edits` to `updateWorkspace`.

**fields**

**code** `String!` *required*

A stable code, such as E0101.

**column** `Int`

1-based column on that line.

**fixes** *required*

Suggested fixes, best first.

**fields**

**edits** *required*

The edits, in order.

**needsInput** `Boolean!` *required*

True when the edits insert a placeholder you must fill in before committing.

**title** `String!` *required*

What the fix does.

**line** `Int`

1-based line in the document, when it has one.

**message** `String!` *required*

What is wrong.

**severity** *required*

How much it matters.

**document** `String!` *required*

The working copy's text. Pass `startLine` and `endLine` (1-based, inclusive) to read part of it.

**fields**

**Arguments**

**endLine** `Int`

Last line.

**startLine** `Int`

First line.

**expiresAt** *required*

When the workspace expires unless changed again.

**id** `ID!` *required*

The workspace's id.

**resourceId** `ID`

The resource it edits; null until a new resource is first committed.

**resourceType** *required*

What kind of resource it edits.

**revision** `String!` *required*

The workspace's current revision. Opaque; pass it as `expectedRevision` to `updateWorkspace` and `commitWorkspace`.

**stale** `Boolean!` *required*

True when the resource changed since this workspace started, so commit will return STALE. Start a new workspace and redo your edits.

## Example

```graphql theme={null}
mutation {
  createWorkspace(resourceId: "...", resourceType: AUTOMATION) {
    document
    expiresAt
    id
    resourceId
    resourceType
    revision
    stale
  }
}
```


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