REST APIWorkspaces

Delete workspace

Delete a workspace.

DELETE/v1/workspaces/:workspaceId

Overview

A workspace is a private file system your agents keep between sessions. Several agents can share one. These endpoints manage the workspace record: its name, metadata, and network policy. None of them start the workspace or add compute cost. The workspace starts only when an agent first reads, writes, or runs something in it. Every request is scoped to your tenant.

Endpoints

List workspacesGET/v1/workspaces

List workspaces.

Lists your tenant's workspaces newest first, one page at a time. Pass nextCursor as cursor to get the next page. The workspace reserved for the platform-managed ba assist agent is never listed.

Request

Requires bearer authentication.

FieldTypeLocationRequiredDescription
cursorstringquerynextCursor from the previous page.
limitintegerqueryPage size, from 1 to 200. Defaults to 50. 1–200. Defaults to 50.
userIdstringqueryReturn only workspaces with this exact userId. Send "" for tenant-level workspaces.

Response

Deletion started and is still running.

This response has no body.

Returns 200 OK as application/json. A page of workspaces.

Response schema: WorkspaceList.

{
  "data": [
    {
      "id": "ws_3Vb8Ny6HpU1cGf4M",
      "tenantId": "ten_8Hq2Zr5WcY1bJt6D",
      "name": "Release files",
      "userId": "user_42",
      "metadata": {
        "project": "docs"
      },
      "networkPolicy": {
        "mode": "allowlist",
        "allowedHosts": [
          "registry.npmjs.org"
        ]
      },
      "createdAt": "2026-07-10T10:00:00.000Z",
      "updatedAt": "2026-07-10T10:00:00.000Z"
    }
  ],
  "nextCursor": null
}

Errors

StatusCodesDescription
400validation_failed, invalid_cursorThe request is invalid
401unauthorizedThe credential is missing or invalid
402subscription_requiredAn active subscription or usage credit is required

See REST errors for the error envelope and shared codes.

cURL

curl "$BLAZING_AGENTS_BASE_URL/v1/workspaces" \
  --header "Authorization: Bearer $BLAZING_AGENTS_API_KEY"

Create workspacePOST/v1/workspaces

Create a workspace.

Creates a private file system your agents can keep between sessions. Creating it adds no compute cost: the workspace starts only when an agent first reads, writes, or runs something in it.

Request

Requires bearer authentication and a JSON body.

FieldTypeLocationRequiredDescription
namestringbodyDisplay name, up to 80 characters. Leave it out for an unnamed workspace. 1–80 characters.
userIdstringbodyYour own ID for the end user who owns the workspace. "" means a tenant-level workspace. It cannot be changed later. Defaults to "".
metadataobjectbodyYour own key-value data, returned as sent. Defaults to {}.
networkPolicyobjectbodyWhich hosts the workspace can reach: unrestricted, allowlist with allowedHosts, or offline. Defaults to {"mode":"unrestricted"}.

Response

Deletion started and is still running.

This response has no body.

Returns 201 Created as application/json. The created workspace.

Response schema: Workspace.

{
  "id": "ws_3Vb8Ny6HpU1cGf4M",
  "tenantId": "ten_8Hq2Zr5WcY1bJt6D",
  "name": "Release files",
  "userId": "user_42",
  "metadata": {
    "project": "docs"
  },
  "networkPolicy": {
    "mode": "allowlist",
    "allowedHosts": [
      "registry.npmjs.org"
    ]
  },
  "createdAt": "2026-07-10T10:00:00.000Z",
  "updatedAt": "2026-07-10T10:00:00.000Z"
}

Errors

StatusCodesDescription
400validation_failedThe request is invalid
401unauthorizedThe credential is missing or invalid
402subscription_requiredAn active subscription or usage credit is required
429rate_limitedToo many requests
503service_unavailableThe service is temporarily unavailable

See REST errors for the error envelope and shared codes.

cURL

curl --request POST "$BLAZING_AGENTS_BASE_URL/v1/workspaces" \
  --header "Authorization: Bearer $BLAZING_AGENTS_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{"name":"Release files","userId":"user_42","metadata":{"project":"docs"},"networkPolicy":{"mode":"allowlist","allowedHosts":["registry.npmjs.org"]}}'

Get workspaceGET/v1/workspaces/:workspaceId

Get a workspace.

Returns a workspace without starting it.

Request

Requires bearer authentication.

FieldTypeLocationRequiredDescription
workspaceIdstringpathrequiredID of the workspace.

Response

Deletion started and is still running.

This response has no body.

Returns 200 OK as application/json. The workspace.

Response schema: Workspace.

{
  "id": "ws_3Vb8Ny6HpU1cGf4M",
  "tenantId": "ten_8Hq2Zr5WcY1bJt6D",
  "name": "Release files",
  "userId": "user_42",
  "metadata": {
    "project": "docs"
  },
  "networkPolicy": {
    "mode": "allowlist",
    "allowedHosts": [
      "registry.npmjs.org"
    ]
  },
  "createdAt": "2026-07-10T10:00:00.000Z",
  "updatedAt": "2026-07-10T10:00:00.000Z"
}

Errors

StatusCodesDescription
400validation_failedThe request is invalid
401unauthorizedThe credential is missing or invalid
402subscription_requiredAn active subscription or usage credit is required
404workspace_not_foundThe resource was not found

See REST errors for the error envelope and shared codes.

cURL

curl "$BLAZING_AGENTS_BASE_URL/v1/workspaces/ws_1234567890ABCDEF" \
  --header "Authorization: Bearer $BLAZING_AGENTS_API_KEY"

Update workspacePUT/v1/workspaces/:workspaceId

Update a workspace.

Updates a workspace's name, metadata, or network policy. Send at least one field. metadata and networkPolicy replace their current values, and name: null clears the name. userId cannot be changed. If a new network policy switches between unrestricted and a restricted mode, a running workspace saves its files and stops; it applies the new policy the next time an agent uses it. A concurrent workspace change can return 409 workspace_busy; retry after the active work finishes.

Request

Requires bearer authentication and a JSON body.

FieldTypeLocationRequiredDescription
workspaceIdstringpathrequiredID of the workspace.
namestring | nullbodyNew display name, up to 80 characters, or null to clear it. 1–80 characters.
metadataobjectbodyReplaces the workspace's metadata.
networkPolicyobjectbodyReplaces the network policy. Which hosts the workspace can reach: unrestricted, allowlist with allowedHosts, or offline.

Response

Deletion started and is still running.

This response has no body.

Returns 200 OK as application/json. The updated workspace.

Response schema: Workspace.

{
  "id": "ws_3Vb8Ny6HpU1cGf4M",
  "tenantId": "ten_8Hq2Zr5WcY1bJt6D",
  "name": "Release files",
  "userId": "user_42",
  "metadata": {
    "project": "docs"
  },
  "networkPolicy": {
    "mode": "offline"
  },
  "createdAt": "2026-07-10T10:00:00.000Z",
  "updatedAt": "2026-07-10T10:15:00.000Z"
}

Errors

StatusCodesDescription
400validation_failedThe request is invalid
401unauthorizedThe credential is missing or invalid
402subscription_requiredAn active subscription or usage credit is required
404workspace_not_foundThe resource was not found
409workspace_busyThe request conflicts with the resource's current state
502internalAn upstream service failed

See REST errors for the error envelope and shared codes.

cURL

curl --request PUT "$BLAZING_AGENTS_BASE_URL/v1/workspaces/ws_1234567890ABCDEF" \
  --header "Authorization: Bearer $BLAZING_AGENTS_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{"networkPolicy":{"mode":"offline"}}'

Delete workspaceDELETE/v1/workspaces/:workspaceId

Delete a workspace.

Permanently deletes a workspace and all its files. Every agent needs a workspace, so move attached agents to another workspace first: while any agent uses it, the request returns 409 workspace_in_use with their IDs in details.agentIds. Returns 202 while cleanup is still running and 204 when deletion finishes right away.

Request

Requires bearer authentication.

FieldTypeLocationRequiredDescription
workspaceIdstringpathrequiredID of the workspace.

Response

Deletion started and is still running.

This response has no body.

Returns 202 Accepted. Deletion started and is still running.

Returns 204 No Content. The workspace was deleted.

Errors

StatusCodesDescription
400validation_failedThe request is invalid
401unauthorizedThe credential is missing or invalid
402subscription_requiredAn active subscription or usage credit is required
404workspace_not_foundThe resource was not found
409workspace_in_use, workspace_busyThe request conflicts with the resource's current state
503service_unavailableThe service is temporarily unavailable

See REST errors for the error envelope and shared codes.

cURL

curl --request DELETE "$BLAZING_AGENTS_BASE_URL/v1/workspaces/ws_1234567890ABCDEF" \
  --header "Authorization: Bearer $BLAZING_AGENTS_API_KEY"

Next