---
updatedAt: 2026-11-02T17:49:14.000Z
agentTools:
  projectIndex: https://api-docs.render.com/llms.txt
---

# Delete secret file

Delete a particular secret file from a particular build source.

This only applies to secret files set directly on the build source, not to secret files in a linked environment group.


# OpenAPI definition

```json
{
  "openapi": "3.0.2",
  "info": {
    "title": "Render Public API",
    "description": "Manage everything about your Render services",
    "version": "1.0.0",
    "contact": {
      "name": "Render API",
      "url": "https://community.render.com",
      "email": "support@render.com"
    }
  },
  "x-readme": {
    "metrics-enabled": false
  },
  "servers": [
    {
      "url": "https://api.render.com/v1"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Build Sources",
      "description": "Manage shared build sources for builds and images."
    }
  ],
  "paths": {
    "/build-sources/{buildSourceId}": {
      "parameters": [
        {
          "name": "buildSourceId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/build-sources/{buildSourceId}/secret-files/{envVarKey}": {
      "parameters": [
        {
          "$ref": "#/paths/~1build-sources~1{buildSourceId}/parameters/0"
        },
        {
          "name": "envVarKey",
          "in": "path",
          "required": true,
          "description": "The file name of the secret file",
          "schema": {
            "type": "string"
          }
        }
      ],
      "delete": {
        "summary": "Delete secret file",
        "description": "Delete a particular secret file from a particular build source.\n\nThis only applies to secret files set directly on the build source, not to secret files in a linked environment group.\n",
        "operationId": "delete-build-source-secret-file",
        "tags": [
          "Build Sources"
        ],
        "responses": {
          "204": {
            "description": "Secret file deleted"
          },
          "401": {
            "$ref": "#/components/responses/401Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/403Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/404NotFound"
          },
          "406": {
            "$ref": "#/components/responses/406NotAcceptable"
          },
          "410": {
            "$ref": "#/components/responses/410Gone"
          },
          "429": {
            "$ref": "#/components/responses/429RateLimit"
          },
          "500": {
            "$ref": "#/components/responses/500InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/503ServiceUnavailable"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "error": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "code": {
            "type": "string",
            "description": "A stable, machine-readable identifier present on specific errors that clients can handle specially. Each endpoint documents the codes it can return. The errorCode schema lists the full vocabulary of codes."
          }
        }
      }
    },
    "responses": {
      "401Unauthorized": {
        "description": "Authorization information is missing or invalid.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/error"
            }
          }
        }
      },
      "403Forbidden": {
        "description": "You do not have permissions for the requested resource. If a scoped API token does not satisfy the endpoint's minimum scope requirements, the response has code insufficient_token_scope and its message lists all minimum required scopes. Broader scopes that include their permissions also satisfy the requirements. Passing this check does not guarantee access to the requested resource or to conditional operations.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/error"
            }
          }
        }
      },
      "404NotFound": {
        "description": "Unable to find the requested resource.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/error"
            }
          }
        }
      },
      "406NotAcceptable": {
        "description": "Unable to generate preferred media types as specified by Accept request header.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/error"
            }
          }
        }
      },
      "410Gone": {
        "description": "The requested resource is no longer available.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/error"
            }
          }
        }
      },
      "429RateLimit": {
        "description": "Rate limit has been surpassed.\n\nRate-limited endpoints also return `RateLimit-Limit`, `RateLimit-Remaining`, and\n`RateLimit-Reset` on successful responses so clients can track their remaining quota.\n",
        "headers": {
          "Retry-After": {
            "description": "Seconds to wait before retrying the request.",
            "schema": {
              "type": "integer",
              "example": 30
            }
          },
          "RateLimit-Limit": {
            "description": "Maximum number of requests allowed in the current window.",
            "schema": {
              "type": "integer",
              "example": 100
            }
          },
          "RateLimit-Remaining": {
            "description": "Number of requests remaining in the current window. Always `0` for this response.",
            "schema": {
              "type": "integer",
              "example": 0
            }
          },
          "RateLimit-Reset": {
            "description": "Seconds until the current rate limit window resets.",
            "schema": {
              "type": "integer",
              "example": 30
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/error"
            },
            "example": {
              "message": "rate limit exceeded"
            }
          }
        }
      },
      "500InternalServerError": {
        "description": "An unexpected server error has occurred.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/error"
            }
          }
        }
      },
      "503ServiceUnavailable": {
        "description": "Server currently unavailable.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/error"
            }
          }
        }
      }
    }
  }
}
```