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

# Delete Organization

> Delete an organization. The organization must have no users before it can be deleted.



## OpenAPI

````yaml /openapi.yaml delete /organizations/{organization_id}
openapi: 3.0.0
info:
  title: Answering Agent API
  description: API for Answering Agent platform
  version: 1.0.0
servers:
  - url: https://answeringagent.com/api/v1
    description: Production API
  - url: https://playground.answeringagent.com/api/v1
    description: Playground API
security: []
paths:
  /organizations/{organization_id}:
    delete:
      tags:
        - Organizations
      summary: Delete Organization
      description: >-
        Delete an organization. The organization must have no users before it
        can be deleted.
      operationId: deleteOrganization
      parameters:
        - in: path
          name: organization_id
          required: true
          schema:
            type: integer
          description: The ID of the organization
      responses:
        '200':
          description: Organization deleted successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Organization deleted successfully
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Organization not found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Organization not found
        '422':
          description: Organization cannot be deleted because it has users.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: >-
                      Cannot delete organization with users. Remove all users
                      first.
      security:
        - ApiKeyAuth: []
components:
  responses:
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: API key is required
                enum:
                  - API key is required
                  - Invalid credentials
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````