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

# Archive a team via Admin API

> The path parameter may be the team id or the team name (case-insensitive).



## OpenAPI

````yaml /api-reference/openapi.json delete /terraform/teams/{id}
openapi: 3.0.0
info:
  title: Costory
  version: '1.0'
  description: API Documentation
servers:
  - url: https://app-api.costory.io
security: []
paths:
  /terraform/teams/{id}:
    delete:
      tags:
        - Admin Teams
      summary: Archive a team via Admin API
      description: >-
        The path parameter may be the team id or the team name
        (case-insensitive).
      parameters:
        - schema:
            type: string
            description: Team id (cuid) or team name within the organization
          required: true
          description: Team id (cuid) or team name within the organization
          name: id
          in: path
      responses:
        '200':
          description: Team archived
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdminSuccessResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
      security:
        - bearerAuth: []
        - apiKeyAuth: []
components:
  schemas:
    AdminSuccessResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
      required:
        - success
    Unauthorized:
      type: object
      properties:
        error:
          type: string
          description: Unauthorized error message
      required:
        - error
    NotFound:
      type: object
      properties:
        error:
          type: string
          description: Resource not found error code
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT or Clerk ak_* API key
      description: >-
        Send `Authorization: Bearer <credential>` using either a Clerk session
        JWT or a Clerk API key (`ak_*`). API keys may identify a user (`user_*`)
        or organization (`org_*`) principal and are generated in the Clerk
        Dashboard under API keys.
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-token
      description: >-
        API token for authentication (or Admin API key). The token is scoped per
        organization and can be retrieved in the Organization Switcher.

````