> ## Documentation Index
> Fetch the complete documentation index at: https://docs.opnform.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Workspace

> Permanently delete a workspace. Requires `workspaces-write`.

# Delete Workspace

Permanently remove a workspace. This operation is irreversible and will remove all associated forms, submissions, and settings.

## Authentication & Scope

Requires the `workspaces-write` ability. User must be an **admin** of the workspace.

## Request

```http theme={null}
DELETE /open/workspaces/{workspaceId} HTTP/1.1
Host: api.opnform.com
Authorization: Bearer <token>
```

### Path Parameters

| Parameter   | Type   | Description                    |
| ----------- | ------ | ------------------------------ |
| workspaceId | number | ID of the workspace to delete. |

## Response

`200 OK` – Confirmation message and the ID of the deleted workspace.

```json theme={null}
{
  "message": "Workspace deleted.",
  "workspace_id": 12
}
```

`403 Forbidden` – The token lacks `workspaces-write` or you lack permission.


## OpenAPI

````yaml delete /open/workspaces/{workspaceId}
openapi: 3.0.1
info:
  title: OpnForm API
  description: API for interacting with OpnForm, primarily used for Zapier integration
  version: 1.0.0
servers:
  - url: https://api.opnform.com
security:
  - bearerAuth: []
tags:
  - name: Workspaces
    description: Create and manage workspaces.
  - name: Workspace Users
    description: Manage users within a workspace.
  - name: Forms
    description: Manage and retrieve forms.
  - name: Submissions
    description: Access and manage form submissions.
  - name: Integrations
    description: Manage form integrations (webhooks) via API.
  - name: Zapier
    description: Legacy endpoints for the Zapier integration.
paths:
  /open/workspaces/{workspaceId}:
    delete:
      tags:
        - Workspaces
      summary: Delete Workspace
      description: Permanently delete a workspace. Requires `workspaces-write`.
      parameters:
        - name: workspaceId
          in: path
          required: true
          schema:
            type: number
      responses:
        '204':
          description: Deleted
        '403':
          description: Forbidden
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Personal Access Token
      x-bearer-scopemap:
        workspaces-read: Read access to workspaces
        workspaces-write: Write access to workspaces
        workspace-users-read: Read access to workspace users
        workspace-users-write: Write access to workspace users
        forms-read: Read access to forms
        forms-write: Write access to forms
        manage-integrations: Manage form integrations (webhooks)

````