Skip to main content
DELETE
Delete a file from a knowledge folder
Using our API via a dedicated deployment? Just replace api.langdock.com with your deployment’s base URL: <deployment-url>/api/public
The Knowledge Folder API manages resources that appear as Knowledge bases in the Library.
Deletes a file (attachment) from a Knowledge base. This removes the file and all associated embeddings, making the content no longer searchable.
Requires an API key with the KNOWLEDGE_FOLDER_API scope. The API key itself needs the Editor role on the Knowledge base. See Share Knowledge bases with the API for setup instructions.

Request Format

Path Parameters

Examples

Delete with cURL

Delete with JavaScript

Bulk Delete Example

Response Format

Success Response (200 OK)

Example Response

Error Handling

Important Notes

Deletion is permanent. The file and all associated embeddings will be removed and cannot be recovered.
  • The attachment must belong to the specified Knowledge base
  • The Knowledge base must be shared with your API key
  • Deleting an attachment removes it from search results immediately
  • Embeddings associated with the attachment are also deleted
Langdock intentionally blocks browser-origin requests to protect your API key and ensure your applications remain secure. For more information, please see our guide on API Key Best Practices.

Authorizations

Authorization
string
header
required

API key as Bearer token. Format "Bearer YOUR_API_KEY"

Path Parameters

folderId
string
required

The ID of the knowledge folder

attachmentId
string
required

The ID of the attachment to delete

Response

200

Attachment deleted successfully