Delete file

deleteFile(input: DeleteFileInput!): DeleteFilePayload

Requires project.files.write; API keys also need delete scope.

Arguments

ArgumentTypeRequired
inputDeleteFileInput!Yes

Input fields

input

DeleteFileInput

FieldTypeRequiredDescription
filePathString!YesFile path whose deletion appends a deletion version in main or the selected branch; immutable history remains. URL-encode this path when supplied in a REST URL.
expectedVersionIdStringNoOptional optimistic-concurrency guard: the delete is rejected before any mutation when the file's current version no longer matches.
refStringNoCanonical content selector: main, branch:<name-or-id>, release:<version> or env:<name>. An unresolvable reference is rejected; it never falls back to main. A release or environment is read-only, so a write addressed to one is refused rather than applied elsewhere.
branchIdStringNoLegacy alias for ref=branch:<value>. Supplying both is accepted when they name the same content and rejected when they do not.

Response

Returns DeleteFilePayload. Open the type for its fields and nested types.

FieldTypeDescription
okBoolean!Always true: the file was deleted. A failure is a GraphQL error.

Types marked with ! cannot be null. Lists use [Type] notation. The type index lists all published input and response types.

Example

graphql
mutation DeleteFile($input: DeleteFileInput!) {
  deleteFile(input: $input) {
    ok
  }
}
json
{
  "input": {
    "filePath": "example"
  }
}