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

# Delete a workspace

> Deletes a workspace. Optionally, for AI Perceptions workspaces, the associated custom channel may also be deleted.



## OpenAPI

````yaml /api/api_docs.yaml delete /workspaces/{id}
openapi: 3.1.0
info:
  title: PeakMetrics API
  description: >
    The PeakMetrics API provides programmatic access to narrative intelligence
    data.


    Access millions of mentions across news, social media, and online platforms,
    enriched with custom AI-powered

    smart categories and over 50 metadata properties. The API enables you to

    identify, analyze, and act on emerging narratives in real-time.
  version: 2.0.0
servers:
  - url: https://api.peakmetrics.com
    description: Main (production) server
security:
  - BearerAuth: []
tags:
  - name: Authorization
  - name: Workspaces
  - name: Explore
    description: >
      Run an ad-hoc [Explore](/help/get-started-with-peakmetrics/explore) query
      without creating a workspace, and get back Volume Over Time (`POST
      /explore/analytics/timeline`) or a Channel, Language, or Domain
      distribution (`POST /explore/analytics/distribution`).


      Both endpoints use the same Bearer JWT authentication as the rest of the
      API and take their parameters as a JSON body.


      ### Rate limits and quota


      - **5 queries per user per minute**, shared across both Explore endpoints.
      The minute is a fixed window of 60 seconds from the first request in the
      window. Exceeding it returns a `429` with `error: "rate_limited"` and
      `retryAfterSeconds`.

      - **1,000 queries per user per endpoint per month.** Each endpoint has its
      own monthly allowance, which resets at the start of each calendar month
      (UTC). Exceeding it returns a `429` with `error: "quota_exceeded"` and
      `retryAfterSeconds` set to the time until the reset.


      Every request counts toward the per-minute limit; only successful (`200`)
      requests count toward the monthly quota.


      Both limits are shared with the Explore tools in the [PeakMetrics MCP
      server](/mcp/capabilities), so queries your AI assistant runs there count
      toward the same totals.
  - name: Folders
  - name: Channels
  - name: Locations
    description: >
      PeakMetrics resolves a normalized location on mentions across every
      channel, using a

      six-level taxonomy: `region`, `subregion`, `country`, `state`, `county`,
      and `city`.

      `state` and `county` are United States only.


      Look locations up with `GET /locations`, read a mention's resolved
      location from the

      `location` object on `GET /workspaces/{workspaceId}/mentions`, filter the
      mentions,

      timeline, or distribution endpoints with the `locations.<level>`
      parameters, and

      break counts down with the matching `locations.<level>` `group_by` values.
  - name: Custom Channels
  - name: Custom Enrichments
    description: >
      Custom enrichments let you push external context about mentions into
      PeakMetrics,

      attached to individual mentions and used alongside all other mention
      metadata across

      the platform. Once written, enrichment values feed into narrative
      analysis, workspace

      summaries, and notifications, and are available through the customer API
      and the MCP

      server.


      Your team manages its own custom enrichments through the API: create one
      with

      `POST /customEnrichments`, list them with `GET /customEnrichments`, rename
      one or

      replace its option list with `PUT /customEnrichments/{enrichmentId}`,
      retire one with

      `DELETE /customEnrichments/{enrichmentId}`, and push values for individual
      mentions

      with `PUT /mentions/customEnrichments`.
paths:
  /workspaces/{id}:
    delete:
      tags:
        - Workspaces
      summary: Delete a workspace
      description: >-
        Deletes a workspace. Optionally, for AI Perceptions workspaces, the
        associated custom channel may also be deleted.
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: The unique identifier of the workspace to delete.
        - in: query
          name: include_custom_channel
          required: false
          schema:
            type: boolean
          description: >
            When set to exactly `true`, also deletes the custom channel
            associated with an AI Perceptions workspace. That channel stores the
            AI answers tracked for the workspace's benchmarks, so deleting it
            removes those stored answers along with the workspace.


            Only valid when `id` refers to an AI Perceptions workspace.
            Supplying this parameter for any other workspace type returns a
            `400`. Any value other than exactly `true` (including `false`) is
            treated as not provided and the custom channel is left in place.
          example: true
      responses:
        '204':
          description: The workspace was deleted.
          content:
            application/json:
              schema:
                type: object
        '400':
          description: >-
            `include_custom_channel` was supplied for a workspace that is not an
            AI Perceptions workspace.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
              examples:
                include_custom_channel_not_allowed:
                  summary: include_custom_channel not allowed for this workspace
                  value:
                    error: >-
                      include_custom_channel is only supported for AI
                      Perceptions workspaces
        '401':
          description: Missing or invalid access token.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
              examples:
                unauthorized:
                  summary: Missing or invalid access token
                  value:
                    error: Missing or invalid access token
        '404':
          description: >-
            No workspace with the given `id` exists for the authenticated user's
            team.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
              examples:
                not_found:
                  summary: Workspace not found
                  value:
                    error: Workspace not found
        '502':
          description: >-
            A step of the delete failed downstream (the custom channel or the
            workspace's smart categories). Nothing was removed and the workspace
            is left in place; retry, or contact support if it keeps failing.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
              examples:
                downstream_failure:
                  summary: Delete not completed
                  value:
                    error: >-
                      Could not delete the workspace's custom channel; nothing
                      was removed. Retry, or contact support.
      security:
        - BearerAuth: []
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.