Skip to main content
DELETE
Delete an attachment
⚠️ Using our API via a dedicated deployment? Just replace api.langdock.com with your deployment’s base URL: <deployment-url>/api/public
Delete an attachment by its ID. The attachment must belong to the same workspace as the API key and must either be created by the API key’s creator or belong to a Knowledge base shared with the API key.
Requires an API key with the KNOWLEDGE_FOLDER_API scope. You can create API Keys in your Workspace settings.

Request Format

Send the attachment ID in the request body as JSON.

Response Format

Example

Error Handling

A deleted attachment can no longer be referenced in Agent conversations or restored via the API.
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"

Body

application/json
attachmentId
string<uuid>
required

The ID of the attachment to delete

Response

Attachment deleted successfully

success
boolean
required
Example:

true

message
string
required
Example:

"Attachment deleted successfully"

attachmentId
string<uuid>
required

The ID of the deleted attachment