---
title: "Change the purchased storage allocation"
method: PUT
path: "/workspaces/{workspace_id}/subscription/storage"
tags: ["Stripe Subscriptions"]
---

# Change the purchased storage allocation

`PUT /workspaces/{workspace_id}/subscription/storage`

## Request

- Base URL: `https://app.mammoth.io/api/v2`
- URL: `https://app.mammoth.io/api/v2/workspaces/{workspace_id}/subscription/storage`
- 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`

Set the workspace's TOTAL storage allocation on an inline-pricing plan. The plan's subscription item is re-priced and the difference invoiced immediately. When the card payment fails, the storage stays as it was, checkout_url is the Stripe page that pays the invoice and next_action is payment_pending. While a change is waiting for payment, the request is refused with 409.

## Path parameters

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

## Request body

- UpdateSubscriptionStorageRequestSchema
  - `storage_gb` integer, required: Chosen TOTAL storage allocation in GB; the plan's included storage or one of its storage options

## Response `200`

Request fulfilled, document follows

- UpdateSubscriptionStorageResponseSchema
  - `storage_gb` integer, required
  - `message` string, required
  - `checkout_url` string, nullable
  - `next_action` string, nullable

## Other responses

- `400`: Bad request syntax or unsupported method

---

[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/5dfd1c296ded?raw)
