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

# Detach function

> Detaches a function from a collection.



## OpenAPI

````yaml https://api.trychroma.com/openapi.json post /api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/attached_functions/{name}/detach
openapi: 3.1.0
info:
  title: chroma-frontend
  description: ''
  license:
    name: ''
  version: 1.0.0
servers: []
security: []
paths:
  /api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/attached_functions/{name}/detach:
    post:
      tags:
        - Function
      summary: Detach function
      description: Detaches a function from a collection.
      operationId: detach_function
      parameters:
        - name: tenant
          in: path
          description: Tenant UUID
          required: true
          schema:
            type: string
          example: 1e30d217-3d78-4f8c-b244-79381dc6a254
        - name: database
          in: path
          description: Database name
          required: true
          schema:
            type: string
        - name: collection_id
          in: path
          description: Collection UUID
          required: true
          schema:
            type: string
          example: 1e30d217-3d78-4f8c-b244-79381dc6a254
        - name: name
          in: path
          description: Function name
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DetachFunctionRequest'
        required: true
      responses:
        '200':
          description: Function detached successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DetachFunctionResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    DetachFunctionRequest:
      type: object
      properties:
        delete_output:
          type: boolean
          description: >-
            Whether to delete the output collection as well when detaching the
            function.
    DetachFunctionResponse:
      type: object
      required:
        - success
      properties:
        success:
          type: boolean
    ErrorResponse:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: string
        message:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-chroma-token

````