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

# Preview deleting or closing the organization (owner only)

> Tells whether `DELETE /organizations/:id` would delete the organization (no production CFDI) or close it (production CFDI retained until `retainedUntil`), and how many stamps or cancellations are still in progress (which block both).



## OpenAPI

````yaml https://api.timbrix.mx/api/openapi.json get /organizations/{id}/close-preview
openapi: 3.0.0
info:
  title: Timbrix API
  description: >-
    API de facturación electrónica CFDI 4.0 para México, con servidor OAuth2
    para gestionar organizaciones, miembros y webhooks. Compatible con agentes
    de IA — ver la extensión `x-ai-agent-friendly` en la raíz de esta spec.


    REST API with OAuth2 server for managing organizations, members, and
    webhooks.
  version: '1.0'
  contact: {}
servers: []
security: []
tags:
  - name: organizations
    description: Organization management endpoints
  - name: oauth
    description: OAuth2 authentication and authorization
  - name: webhooks
    description: Webhook configuration and delivery
  - name: users
    description: User information endpoints
  - name: api-keys
    description: API Keys management and validation
  - name: request-logs
    description: API request log
paths:
  /organizations/{id}/close-preview:
    get:
      tags:
        - organizations
      summary: Preview deleting or closing the organization (owner only)
      description: >-
        Tells whether `DELETE /organizations/:id` would delete the organization
        (no production CFDI) or close it (production CFDI retained until
        `retainedUntil`), and how many stamps or cancellations are still in
        progress (which block both).
      operationId: OrganizationsController_getClosePreview
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Close preview.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClosePreviewResponseDto'
        '401':
          description: Authentication required. Provide a valid bearer token.
        '403':
          description: Access denied. Only the organization owner can see this.
        '404':
          description: Organization not found with the provided ID.
      security:
        - bearer: []
components:
  schemas:
    ClosePreviewResponseDto:
      type: object
      properties:
        mode:
          type: string
          enum:
            - delete
            - close
          example: close
          description: >-
            What `DELETE /organizations/:id` would do: `delete` (no production
            CFDI) or `close` (production CFDI are retained).
        retainedUntil:
          type: string
          nullable: true
          example: '2033-01-01T05:59:59.000Z'
          description: Retention date when `mode` is `close`; null otherwise.
        pending:
          description: >-
            Operations in progress. The organization cannot be closed or deleted
            while any count is above zero.
          allOf:
            - $ref: '#/components/schemas/ClosePreviewPendingDto'
      required:
        - mode
        - retainedUntil
        - pending
    ClosePreviewPendingDto:
      type: object
      properties:
        stampAttempts:
          type: number
          example: 0
          description: CFDI stamps still being confirmed with the PAC.
        cancellations:
          type: number
          example: 1
          description: Cancellations waiting for the SAT or the receiver.
      required:
        - stampAttempts
        - cancellations
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````

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