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

# Delete a team

> Deletes a team. Only the team creator can do this, and it needs the `team.manage` permission. The team must have no resources, a balance of zero or less, and no charges in the current calendar month (Solar Hijri calendar). All members, roles, invitations and permissions are removed.



## OpenAPI

````yaml /spec/platform-teams.yaml delete /v2/teams/{teamID}
openapi: 3.0.1
info:
  title: Teams & Access
  version: 1.0.0
  description: >
    Create teams, invite people, and control what each member can do.


    A team is a separate account that owns its own resources and billing.

    Members work on the team's resources with their own API token by adding

    `teamID` to their requests. Access comes from two places:


    - **Role permissions** apply across the whole team. Every member has
      exactly one role.
    - **Resource permissions** give one member access to one specific
      resource, such as a single app or database.

    A request is allowed if either source grants a required permission.


    Every team starts with these built-in roles:


    | Role | Permissions |

    |------|-------------|

    | مالک | `manage` and `create` on every resource type, plus `billing.manage`
    and `team.manage`. The team creator always has this role. |

    | مدیر | `manage` and `create` on every resource type |

    | گرداننده | `operate` on every resource type |

    | بازرس | `view` on every resource type |

    | حسابدار | `billing.manage` |

    | مهمان | No permissions |


    The number of members, custom roles and resource permissions per team,

    and the number of teams per user, are limited.
servers:
  - url: https://api.liara.ir
security:
  - bearerAuth: []
tags:
  - name: Teams
    description: Create, list, rename and delete teams.
  - name: Invitations
    description: Invite people to a team and accept invitations.
  - name: Members
    description: List members, remove them, change their role, or leave a team.
  - name: Roles
    description: List roles and manage custom roles.
  - name: Resource Permissions
    description: Give members access to specific resources.
paths:
  /v2/teams/{teamID}:
    delete:
      tags:
        - Teams
      summary: Delete a team
      description: >-
        Deletes a team. Only the team creator can do this, and it needs the
        `team.manage` permission. The team must have no resources, a balance of
        zero or less, and no charges in the current calendar month (Solar Hijri
        calendar). All members, roles, invitations and permissions are removed.
      operationId: deleteTeam
      parameters:
        - $ref: '#/components/parameters/TeamIDPath'
      responses:
        '200':
          description: The team was deleted. The response body is empty.
        '400':
          description: >-
            `teamID` is invalid, or the team can't be deleted yet:
            `positive_balance`, `cannot_delete_team_with_resources_or_members`
            or `cannot_delete_team_with_usage_in_current_month`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                hasResources:
                  summary: Team still has resources
                  value:
                    statusCode: 400
                    error: Bad Request
                    message: Cannot delete team with resources or members
                    data:
                      code: cannot_delete_team_with_resources_or_members
                positiveBalance:
                  summary: Team has a positive balance
                  value:
                    statusCode: 400
                    error: Bad Request
                    message: You have a positive balance. Please contact support.
                    data:
                      code: positive_balance
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: >-
            You aren't a member (`team_not_found`), your role lacks
            `team.manage` (`no_permission`), or you aren't the team creator
            (`not_allowed_to_delete_team`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                statusCode: 403
                error: Forbidden
                message: You are not allowed to delete this team
                data:
                  code: not_allowed_to_delete_team
components:
  parameters:
    TeamIDPath:
      name: teamID
      in: path
      required: true
      description: The team's ID.
      schema:
        $ref: '#/components/schemas/ObjectID'
      example: '000000000000000000000002'
  schemas:
    Error:
      type: object
      description: Standard error body.
      properties:
        statusCode:
          type: integer
        error:
          type: string
          description: HTTP status text.
        message:
          type: string
          description: What went wrong.
        data:
          type: object
          nullable: true
          description: >-
            Extra details. When present, `code` is a stable, machine-readable
            error code.
          properties:
            code:
              type: string
    ObjectID:
      type: string
      pattern: ^[0-9a-fA-F]{24}$
      description: 24-character hexadecimal ID.
    AuthError:
      type: object
      description: Error body returned when the API token is rejected.
      properties:
        error:
          type: string
  responses:
    Unauthorized:
      description: The API token is missing, invalid or expired.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthError'
          example:
            error: Unauthorized.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Send your API token as `Authorization: Bearer <api-token>`.'

````

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