> ## Documentation Index
> Fetch the complete documentation index at: https://nango-wari-add-support-for-sagemember.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete a function

> Deletes a deployed function and enqueues its async teardown. Functions managed by `nango deploy` (repo source) cannot be deleted through this endpoint. Requires an API key with the `environment:functions:delete` scope.

<Info>
  Requires an API key with the `environment:functions:delete` scope. [Learn more about API key scopes](/reference/backend/http-api/api-keys#scopes).
</Info>

Deletes a deployed function and enqueues its async teardown. Functions managed by `nango deploy` (repo source) cannot be deleted through this endpoint.


## OpenAPI

````yaml DELETE /integrations/{uniqueKey}/functions/{name}
openapi: 3.1.0
info:
  title: Nango API
  description: Nango API specs used to authorize & sync data with external APIs.
  version: 1.0.0
servers:
  - url: https://api.nango.dev
    description: Production server
  - url: http://localhost:3003
    description: Local server
security:
  - bearerAuth: []
externalDocs:
  url: https://nango.dev/docs/reference/backend/http-api/authentication
paths:
  /integrations/{uniqueKey}/functions/{name}:
    delete:
      summary: Delete a function
      description: >-
        Deletes a deployed function and enqueues its async teardown. Functions
        managed by `nango deploy` (repo source) cannot be deleted through this
        endpoint. Requires an API key with the `environment:functions:delete`
        scope.
      parameters:
        - name: uniqueKey
          in: path
          required: true
          schema:
            type: string
          description: The integration ID (unique_key) that you created in Nango.
        - name: name
          in: path
          required: true
          schema:
            type: string
          description: The name of the function.
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - sync
              - action
          description: >-
            Required to disambiguate a sync and an action that share a name.
            On-event functions are not yet supported.
      responses:
        '200':
          description: Successfully enqueued the function deletion
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - success
                    properties:
                      success:
                        type: boolean
        '400':
          description: Invalid request, or the function is managed by `nango deploy`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - function_managed_by_deploy
                      message:
                        type: string
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  responses:
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/StdError'
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/StdError'
    NotFound:
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/StdError'
  schemas:
    StdError:
      type: object
      additionalProperties: false
      properties:
        error:
          type: object
          additionalProperties: false
          required:
            - code
          properties:
            code:
              type: string
            message:
              type: string
            errors:
              type: array
              items:
                type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: The secret key from your Nango environment.

````