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

# Reset a staging space

> Account root or admin only. Deletes up to 2000 live and archived tasks per call through the normal delete path (events are published, external ids tombstoned). Call again until `remaining` is 0.



## OpenAPI

````yaml /api-reference/endpoint/workspaces/openapi.json post /workspaces/space/{space_id}/reset
openapi: 3.0.3
info:
  title: Workspaces Service API
  version: 1.0.0
  description: API for managing workspaces, tasks, and comments
servers:
  - url: https://api.quiva.ai
    description: Production API server
security:
  - bearerAuth: []
  - apiKeyAuth: []
paths:
  /workspaces/space/{space_id}/reset:
    post:
      tags:
        - Sandbox
      summary: Reset a staging space
      description: >-
        Account root or admin only. Deletes up to 2000 live and archived tasks
        per call through the normal delete path (events are published, external
        ids tombstoned). Call again until `remaining` is 0.
      parameters:
        - name: space_id
          in: path
          required: true
          description: Space id. Case-insensitive; canonical form is upper case.
          schema:
            type: string
      responses:
        '200':
          description: Progress.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpaceResetResponse'
        '401':
          description: >-
            Not authenticated, or the integration token was revoked
            (`token_revoked`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            Forbidden: `scope_denied`, or `integration_not_allowed` for an
            integration bearer outside workspaces.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: '`space_not_found`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: '`space_not_staging` or `space_bound`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: The task list could not be read.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: The space could not be read. Retry. No `code`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    SpaceResetResponse:
      type: object
      properties:
        space_id:
          type: string
        deleted:
          type: integer
        failed:
          type: integer
          description: Tasks in this batch that could not be deleted.
        remaining:
          type: integer
          description: >-
            Failed plus anything past the cap. Call again until 0. A lower bound
            when past the cap.
        external_ids_cleared:
          type: integer
          description: >-
            External-id map entries removed for the space. 0 while tasks remain
            past the cap; the map is cleared once the space is fully listed.
      required:
        - space_id
        - deleted
        - failed
        - remaining
        - external_ids_cleared
    Error:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
          description: Stable machine code. Branch on this, not on `error`.
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT Authorization header using the Bearer scheme
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key

````

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