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

# Archive Organization or Workspace

> Archives an organization or workspace by ID. When archiving an organization, all associated workspaces, assistants and campaigns are also archived in a cascading manner. When archiving a workspace, all its associated assistants and campaigns are archived. Requires admin or organization_admin role.




## OpenAPI

````yaml https://api.voice-agents.miraiminds.co/swagger.yaml post /v1/admin/organization/archive
openapi: 3.0.3
info:
  title: Voice Agent by Mirai Minds
  version: 1.1.0
  contact:
    name: API Architecture Team
    url: https://miraiminds.co
  license:
    name: Mirai Minds Proprietary License
    url: >-
      https://github.com/MiraiMinds/voice-agent-integration-specs/blob/main/LICENSE.md
servers:
  - url: https://api.voice-agents.miraiminds.co
    description: Production Server
  - url: https://api.stage.voice-agent.miraiminds.co
    description: Staging Server
  - url: http://localhost:3000
    description: Local Server
security:
  - PublicKeyAuth: []
    PrivateKeyAuth: []
paths:
  /v1/admin/organization/archive:
    post:
      tags:
        - Organization
      summary: Archive Organization or Workspace
      description: >
        Archives an organization or workspace by ID. When archiving an
        organization, all associated workspaces, assistants and campaigns are
        also archived in a cascading manner. When archiving a workspace, all its
        associated assistants and campaigns are archived. Requires admin or
        organization_admin role.
      operationId: archiveOrganizationOrWorkspace
      parameters:
        - $ref: '#/components/parameters/PublicKeyHeader'
        - $ref: '#/components/parameters/PrivateKeyHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ArchiveUnarchiveRequest'
            examples:
              archive_organization:
                summary: Archive an organization
                value:
                  type: organization
                  id: 507f1f77bcf86cd799439011
              archive_workspace:
                summary: Archive a workspace
                value:
                  type: workspace
                  id: 507f1f77bcf86cd799439022
      responses:
        '200':
          description: Successfully archived
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ArchiveUnarchiveResponse'
              examples:
                organization_archived:
                  summary: Organization archived
                  value:
                    status_code: 200
                    message: Organization archived successfully.
                    data: null
                workspace_archived:
                  summary: Workspace archived
                  value:
                    status_code: 200
                    message: Workspace archived successfully.
                    data: null
        '400':
          description: Validation Error (invalid type or id)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - missing or invalid authentication
        '403':
          description: Forbidden - insufficient role permissions
components:
  parameters:
    PublicKeyHeader:
      name: x-public-key
      in: header
      required: true
      schema:
        type: string
    PrivateKeyHeader:
      name: x-private-key
      in: header
      required: true
      schema:
        type: string
  schemas:
    ArchiveUnarchiveRequest:
      type: object
      required:
        - type
        - id
      properties:
        type:
          type: string
          enum:
            - organization
            - workspace
          description: >
            The entity type to archive or unarchive. Use "organization" to
            target an organization (cascades to all workspaces, assistants, and
            campaigns). Use "workspace" to target a single workspace (cascades
            to its assistants and campaigns).
          example: organization
        id:
          type: string
          pattern: ^[0-9a-fA-F]{24}$
          description: >-
            The MongoDB ObjectId of the organization or workspace to
            archive/unarchive.
          example: 507f1f77bcf86cd799439011
    ArchiveUnarchiveResponse:
      type: object
      properties:
        status_code:
          type: integer
          example: 200
        message:
          type: string
          example: Organization archived successfully.
        data:
          type: object
          nullable: true
          description: >
            For archive operations and organization unarchive, this is null. For
            workspace unarchive, this contains the workspace document.
    ErrorResponse:
      type: object
      properties:
        code:
          type: integer
          example: 400
        message:
          type: string
          example: Validation error
  securitySchemes:
    PublicKeyAuth:
      type: apiKey
      in: header
      name: x-public-key
    PrivateKeyAuth:
      type: apiKey
      in: header
      name: x-private-key

````