---
title: "Create a durable source workspace"
method: POST
path: "/v1/spaces/{spaceId}/source/workspaces"
tags: ["Git"]
---

# Create a durable source workspace

`POST /v1/spaces/{spaceId}/source/workspaces`

## Request

- Base URL: `https://api.spacefast.com`
- URL: `https://api.spacefast.com/v1/spaces/{spaceId}/source/workspaces`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://api.spacefast.com/v1/auth/oauth2/authorize`, token URL `https://api.spacefast.com/v1/auth/oauth2/token`; client credentials, token URL `https://api.spacefast.com/v1/auth/oauth2/token`, scopes: `spaces:write`, `spaces:read`)

Create a workspace without a local checkout. Send a unique operationId in the request body. Reuse that operationId and the exact input after an uncertain response. Read the workspace ID from data.workspace.id in the API response. Use this ID as workspaceId in later requests.

The API uses saved source when it exists. Otherwise, omit originalUploadVersionId to import the current eligible direct upload. Send the field only to pin a known eligible upload. If neither source exists, the API creates an empty baseline. This action does not deploy or change the live version.

## Path parameters

- `spaceId` string, required

## Request body

- object
  - `operationId` string, required: Unique ID for this operation. Reuse this ID and the same input after an uncertain response.
  - `name` string
  - `targetBranch` string: Existing project branch. Defaults to the production branch.
  - `originalUploadVersionId` string: Pinned eligible direct upload to import if this Space has no saved source. Omit to import the current eligible direct upload automatically. Never send a build output version.
  - `author` object: Omit to use the registered name and email. If they are incomplete, send the author once when you create the workspace. This affects attribution only.
    - `name` string, required
    - `email` string, email, required

## Response `200`

Response for status 200

- object
  - `$schema` string, uri: Canonical JSON Schema URL for this response body. The server also sends it in the `Link: rel="describedby"` response header.
  - `data` object, required
    - `workspace` object, required
      - `id` string, required
      - `spaceId` string, required
      - `repositoryId` string, required
      - `targetBranch` string, required
      - `name` string, required
      - `revision` integer, required
      - `state` 'initializing' | 'active' | 'conflicted' | 'closed', required
      - `baseCommitSha` string, nullable, required
      - `indexCommitSha` string, nullable, required
      - `workingCommitSha` string, nullable, required
      - `headCommitSha` string, nullable, required
      - `originalUploadVersionId` string, nullable, required
      - `hasStagedChanges` boolean, required
      - `hasUnstagedChanges` boolean, required
      - `hasPendingChanges` boolean, required
      - `needsSync` boolean, required
      - `pendingOperationId` string, nullable, required
      - `autoDeploy` boolean, required
      - `createdAt` string, required
      - `updatedAt` string, required
    - `commit` object
      - `sourceCommitSha` string, required
      - `parentSourceCommitSha` string, required
      - `message` string, required
      - `autoDeploy` boolean, required
    - `conflicts` object
      - `phase` 'staged' | 'working' | 'undo', required
      - `labels` object, required
        - `ours` string, required
        - `theirs` string, required
      - `files` object[], required
        - `path` string, required
        - `result` string, required
        - `base` object, required
          - `sourceCommitSha` string, required
          - `content` string, nullable, required
          - `exists` boolean, required
          - `binary` boolean, required
          - `truncated` boolean, required
          - `mode` string, nullable, required
        - `ours` object, required
          - `sourceCommitSha` string, required
          - `content` string, nullable, required
          - `exists` boolean, required
          - `binary` boolean, required
          - `truncated` boolean, required
          - `mode` string, nullable, required
        - `theirs` object, required
          - `sourceCommitSha` string, required
          - `content` string, nullable, required
          - `exists` boolean, required
          - `binary` boolean, required
          - `truncated` boolean, required
          - `mode` string, nullable, required

## Other responses

- `default`: Problem details (RFC 9457). Any 4xx/5xx response is one `application/problem+json` document.

---

[API](https://skmtc.dev/spacefast/apis/spacefast-api.md) · [All operations](https://skmtc.dev/spacefast/apis/spacefast-api/llms.txt) · [OpenAPI document](https://skmtc.dev/spacefast/apis/spacefast-api/revisions/bd165bc7c983?raw)
