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

# Post adminsandboxdestroy batch

> Destroy sandboxes in bulk by filter (admin)

Required token scopes: `instance|update`



## OpenAPI

````yaml /swagger.json post /admin/sandbox/destroy-batch
openapi: 3.0.0
info:
  version: 1.0.0
  title: Teable App
  description: Manage Data as easy as drink a cup of tea
  x-logo:
    backgroundColor: '#F0F0F0'
    altText: Teable logo
servers:
  - url: https://app.teable.ai/api
security: []
tags:
  - name: base
    x-group: project
  - name: base node
    x-group: project node
  - name: base-share
    x-group: project-share
paths:
  /admin/sandbox/destroy-batch:
    post:
      tags:
        - admin
        - sandbox
      description: |-
        Destroy sandboxes in bulk by filter (admin)

        Required token scopes: `instance|update`
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                principalType:
                  type: string
                  enum:
                    - app
                    - user
                status:
                  type: string
                purge:
                  type: boolean
      responses:
        '200':
          description: Aggregate destroy result
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: number
                  succeeded:
                    type: number
                  failed:
                    type: array
                    items:
                      type: object
                      properties:
                        principalId:
                          type: string
                        error:
                          type: string
                      required:
                        - principalId
                        - error
                required:
                  - total
                  - succeeded
                  - failed
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: Shell
          source: |-
            curl --request POST \
              --url https://app.teable.ai/api/admin/sandbox/destroy-batch \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"principalType":"app","status":"string","purge":true}'
        - lang: JavaScript
          source: |-
            const url = 'https://app.teable.ai/api/admin/sandbox/destroy-batch';
            const options = {
              method: 'POST',
              headers: {
                Authorization: 'Bearer REPLACE_BEARER_TOKEN',
                'content-type': 'application/json'
              },
              body: '{"principalType":"app","status":"string","purge":true}'
            };

            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: Node.js
          source: >-
            const http = require('https');


            const options = {
              method: 'POST',
              hostname: 'app.teable.ai',
              port: null,
              path: '/api/admin/sandbox/destroy-batch',
              headers: {
                Authorization: 'Bearer REPLACE_BEARER_TOKEN',
                'content-type': 'application/json'
              }
            };


            const req = http.request(options, function (res) {
              const chunks = [];

              res.on('data', function (chunk) {
                chunks.push(chunk);
              });

              res.on('end', function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });


            req.write(JSON.stringify({principalType: 'app', status: 'string',
            purge: true}));

            req.end();
        - lang: Python
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("app.teable.ai")


            payload =
            "{\"principalType\":\"app\",\"status\":\"string\",\"purge\":true}"


            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
            }


            conn.request("POST", "/api/admin/sandbox/destroy-batch", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````