Zum Inhalt springen
DeutschlandGPT

Replace file in folder

Replaces an existing file in a document folder. The new file is stored and the existing one removed in one step: if the upload fails or is refused (for example 413, a storage limit, checked on the size after the replace), the original stays in place. A file that is not in this folder returns 404. Max 50 MB.

PUThttps://api.deutschlandgpt.de/v2/document-folders/{id}/files/{fileId}

Example request

curl https://api.deutschlandgpt.de/v2/document-folders/{id}/files/{fileId} \
  -X PUT \
  -H "Authorization: Bearer $DGPT_API_KEY"

Parameters

idstring<uuid>required

Document folder ID

fileIdstringrequired

File ID to replace

Response

200application/json
{
  "file_id": "string"
}

File replaced

file_idstring

Response codes

200

File replaced

object
400

Invalid file type or size

401

Unauthorized

402

Insufficient credits or spending limit exceeded

Error
403

Requires enterprise workspace

404

Folder or file not found

413

Storage limit reached: the document folder, the uploading person or the organisation would exceed its storage limit. Nothing was stored.

object
Was this page helpful?