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

# Delete an environment API key

> Delete an environment API key

<Info>
  Requires an [Account API key](/docs/reference/backend/http-api/api-keys#account-api-keys). Create one from [Account API keys](https://app.nango.dev/api-keys) in the dashboard.
</Info>

Deletes an Environment API key. `environment_id` is the numeric ID returned when the environment was [created](/docs/reference/backend/http-api/environments/create). `key_id` is the numeric ID returned when the key was [created](/docs/reference/backend/http-api/environments/create-api-key).


## OpenAPI

````yaml DELETE /environment/api-keys
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:
  /environment/api-keys:
    delete:
      summary: Delete an environment API key
      description: Delete an environment API key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - environment_id
                - key_id
              properties:
                environment_id:
                  type: integer
                  minimum: 1
                  description: Numeric environment ID that owns the key.
                  example: 123
                key_id:
                  type: integer
                  minimum: 1
                  description: Numeric key ID returned when the key was created.
                  example: 456
      responses:
        '200':
          description: Successfully deleted the Environment API key
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    example: true
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/StdError'
    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'
    ServerError:
      description: Server error
      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: >-
        An Environment API key from your Nango environment, or an Account API
        key for account-level endpoints.

````