Skip to main content

Delete a File

Delete a File with no protected references.

Path

DELETE /api/v1/forward/files/{file_id}

Request headers

HeaderRequiredDescription
AuthorizationYesBearer <PAT or SAT>
References are checked before deletion. An unarchived Schedule, including a paused Schedule, that references the file causes HTTP 409. Updating or clearing the Schedule file configuration, or archiving the Schedule, releases that configuration reference. Files selected by an unfinished Schedule Run remain protected until the Run reaches a terminal state. See Schedule file deletion restrictions. References from other Templates / Identity Configs or Sessions may also continue to prevent deletion. A File is deleted when no references block deletion; it no longer appears in the default list afterward.

Path parameters

ParameterTypeRequiredDescription
file_idstringYesFile ID to delete.

Query parameters

ParameterTypeRequiredDescription
identity_idstringNoFor Identity-owned resources only. PATs may supply this query parameter; omitting it uses the administrator scope. SAT ownership is determined by the credential; any SAT (including Admin SAT) explicitly supplying this parameter, even with an empty value, receives HTTP 400. See Identity ownership.

Example request

curl -X DELETE "https://api.qoder.com/api/v1/forward/files/file_xxx" \
  -H "Authorization: Bearer $QODER_ACCESS_TOKEN"

Example response

{
  "id": "file_xxx",
  "type": "file_deleted",
  "deleted": true
}

Response fields

FieldTypeDescription
idstringID of the deleted resource.
typestringDeletion result type.
deletedbooleanWhether the resource was deleted.

Errors

HTTPTypeTrigger
400invalid_request_errorThe request body, path parameters, or query parameters are invalid, including any SAT explicitly supplying query identity_id (even with an empty value).
401authentication_errorThe authentication token is missing or invalid.
403permission_errorAn owner mismatch occurs in the administrator scope, or a downstream service denies access.
404not_found_errorThe File does not exist, is not registered, or is not visible in the current Identity scope; the Identity specified by the PAT is invalid, disabled, deleted, or outside the caller's ownership.
409conflict_errorAn idempotency-key conflict, creation recovery requiring manual intervention, or remaining references from a Template / Identity Config, unarchived Schedule, unfinished Schedule Run, or Session.
429rate_limit_errorUpload capacity is insufficient.
500/502/503api_errorForward or a dependent service failed.