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

# Delete a space

> Deletes the space for good: its database, data keys, objects and copies. Returns a receipt.



## OpenAPI

````yaml openapi/en/control.json DELETE /v1/spaces/{space_id}
openapi: 3.1.0
info:
  title: Niadra control API
  version: '1'
  description: >-
    Tenants, projects, sources, keys, people, configuration and usage. It never
    receives customer content.
servers:
  - url: https://control.api.niadra.com
security: []
paths:
  /v1/spaces/{space_id}:
    delete:
      summary: Delete a space
      description: >-
        Deletes a space for good. Its keys stop working at once; the cell that
        serves it drops the space's

        database, destroys its data keys, deletes its stored objects, nightly
        dumps, secrets and cache keys,

        and sends back a deletion receipt, which `GET
        /v1/spaces/{space_id}/deletion-receipt` shows. The

        answer comes before the cell finishes, with `status` `deleting`; asking
        again returns the same state.

        Needs the admin role.


        **Authentication.** Person token issued by the control plane
        (`Authorization: Bearer <JWT>`), with the role the operation needs.
      operationId: delete_space_v1_spaces__space_id__delete
      parameters:
        - in: path
          name: space_id
          required: true
          schema:
            format: uuid
            title: Space Id
            type: string
          example: 0192f0a0-3d4e-7f50-8b61-7c8d9e0f1a24
      responses:
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpaceDeletionOut'
              example:
                space_id: 0192f0a0-3d4e-7f50-8b61-7c8d9e0f1a24
                deleted_at: '2026-09-24T15:02:00Z'
                status: deleting
                receipt: null
          description: The deleted space, with `status` `deleting` until the cell finishes.
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: The request does not match the contract.
      security:
        - personToken: []
components:
  schemas:
    SpaceDeletionOut:
      additionalProperties: false
      properties:
        deleted_at:
          format: date-time
          title: Deleted At
          type: string
          description: When an admin deleted the space.
        receipt:
          anyOf:
            - $ref: '#/components/schemas/DeletionReceiptOut'
            - type: 'null'
          description: What the cell deleted; null while `status` is `deleting`.
        space_id:
          format: uuid
          title: Space Id
          type: string
        status:
          description: >-
            `deleting` until the cell reports what it deleted; then `deleted`,
            with the receipt.
          enum:
            - deleting
            - deleted
          title: Status
          type: string
      required:
        - space_id
        - deleted_at
        - status
      title: SpaceDeletionOut
      type: object
    Problem:
      additionalProperties: false
      description: RFC 9457 problem details; `code` comes from the versioned error catalog.
      properties:
        code:
          title: Code
          type: string
        detail:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Detail
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Request Id
        status:
          title: Status
          type: integer
        title:
          title: Title
          type: string
        type:
          default: about:blank
          title: Type
          type: string
      required:
        - title
        - status
        - code
      title: Problem
      type: object
    DeletionReceiptOut:
      additionalProperties: false
      description: >-
        What the cell deleted, as it reported it. The data keys are destroyed,
        so any copy of the space's

        data that still exists (the database server's own snapshots, until
        `instance_snapshot_expiry`) can

        no longer be read.
      properties:
        backups_deleted:
          description: Nightly dumps of the space's database deleted.
          title: Backups Deleted
          type: integer
        cell_id:
          title: Cell Id
          type: string
          description: The cell that deleted the space.
        db_name:
          description: The space's database, dropped.
          title: Db Name
          type: string
        dek_versions_destroyed:
          description: Versions of the space's data keys destroyed.
          items:
            type: integer
          title: Dek Versions Destroyed
          type: array
        dropped_at:
          format: date-time
          title: Dropped At
          type: string
          description: When the space's database was dropped.
        instance_snapshot_expiry:
          description: >-
            When the last automatic snapshot of the database server that may
            hold the space's encrypted data expires.
          format: date-time
          title: Instance Snapshot Expiry
          type: string
        objects_deleted:
          description: >-
            Stored objects deleted: raw payloads, media, imports, exports, event
            archives and audit anchors.
          title: Objects Deleted
          type: integer
        receipt_hash:
          description: SHA-256 of the receipt's canonical JSON, in hexadecimal.
          title: Receipt Hash
          type: string
        received_at:
          format: date-time
          title: Received At
          type: string
          description: When the control plane stored the receipt.
        secrets_deleted:
          description: Secret versions deleted (webhook and export credentials).
          title: Secrets Deleted
          type: integer
        space_id:
          format: uuid
          title: Space Id
          type: string
      required:
        - space_id
        - cell_id
        - db_name
        - dropped_at
        - dek_versions_destroyed
        - objects_deleted
        - backups_deleted
        - secrets_deleted
        - instance_snapshot_expiry
        - receipt_hash
        - received_at
      title: DeletionReceiptOut
      type: object
  securitySchemes:
    personToken:
      type: http
      scheme: bearer
      bearerFormat: JWT

````