---
title: "Update workspace"
method: PATCH
path: "/workspaces/{workspace_id}"
tags: ["Workspaces"]
---

# Update workspace

`PATCH /workspaces/{workspace_id}`

## Request

- Base URL: `https://app.mammoth.io/api/v2`
- URL: `https://app.mammoth.io/api/v2/workspaces/{workspace_id}`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-KEY` and API key in header `X-API-SECRET` and API key in header `X-WORKSPACE-ID`

Update workspace details

## Path parameters

- `workspace_id` integer, required: Workspace refers to a collection of projects. Workspace ID is unique identifier for workspace.

## Request body

- WorkspacePatch: Update workspace details
  - `patches` WorkspacePatchOp[], required
    - `op` 'replace', required: Operation
    - `path` 'name' | 'metadata' | 'plan_id' | 'billing_cycle' | 'storage_gb', required: Path
    - `value` union, required: New Workspace name, metadata, plan_id, billing_cycle, or storage_gb
      - string
      - object
      - integer

## Response `200`

Updated workspace details

- WorkspacesWorkspaceSchemaWorkspaceUpdate
  - `name` string, nullable: Name of the workspace
  - `metadata` object, nullable: Metadata for the workspace
  - `plan_id` integer, nullable: ID of the plan assigned to the workspace
  - `billing_cycle` string, nullable: Billing cycle for the workspace (monthly/yearly)
  - `storage_gb` integer, nullable: Chosen TOTAL storage allocation in GB on the plan
  - `checkout_url` string, nullable: Present when the plan change requires payment. The FE should redirect the user here to complete checkout.
  - `next_action` string, nullable: BE-decided next step for the FE after the plan change (none / checkout_required / contact_sales / ...).
  - `next_action_message` string, nullable: Human-readable one-liner for the next action.
  - `next_action_url` string, nullable: URL the FE should redirect to for the next action (mirrors checkout_url when the action is checkout).

## Other responses

- `400`: Bad Request
- `401`: Authorization error

---

[API](https://skmtc.dev/mammoth/apis/mammoth-analytics.md) · [All operations](https://skmtc.dev/mammoth/apis/mammoth-analytics/llms.txt) · [OpenAPI document](https://skmtc.dev/mammoth/apis/mammoth-analytics/revisions/4b2c943a00dc?raw)
