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

# Delete Secret

> Delete a secret.

This operation cannot be undone. Secrets that are linked to environments
will be automatically unlinked.



## OpenAPI

````yaml https://api.primeintellect.ai/openapi.json delete /api/v1/secrets/{secret_id}
openapi: 3.1.0
info:
  title: PI API
  version: 0.1.0
servers:
  - url: https://api.primeintellect.ai
security: []
paths:
  /api/v1/secrets/{secret_id}:
    delete:
      tags:
        - Secrets
      summary: Delete Secret
      description: |-
        Delete a secret.

        This operation cannot be undone. Secrets that are linked to environments
        will be automatically unlinked.
      operationId: delete_secret_api_v1_secrets__secret_id__delete
      parameters:
        - name: secret_id
          in: path
          required: true
          schema:
            type: string
            title: Secret Id
        - name: teamId
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Team ID for team secrets
            title: Teamid
          description: Team ID for team secrets
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '401':
          description: Authorization failed
        '422':
          description: Invalid request data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    ErrorResponse:
      properties:
        errors:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
          title: Errors
      type: object
      required:
        - errors
      title: ErrorResponse
    ErrorDetail:
      properties:
        param:
          type: string
          title: Param
        details:
          type: string
          title: Details
      type: object
      required:
        - param
        - details
      title: ErrorDetail
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````