Document: Delete v1
The delete
document API endpoint allows you to delete an existing document from a memory on Langbase dynamically with the API. This endpoint requires an Org or User API key.
You will need to generate an API key to authenticate your requests. For more information, visit the User/Org API key documentation.
Delete a document by specifying the memory name and document name in the path.
Headers
- Name
Content-Type
- Type
- string
- Required
- Required
- Description
Request content type. Needs to be
application/json
.
- Name
Authorization
- Type
- string
- Required
- Required
- Description
Replace
<YOUR_API_KEY>
with your user/org API key.
Path Parameters
- Name
memoryName
- Type
- string
- Required
- Required
- Description
The name of the memory containing the document.
Replace
{memoryName}
with the name of the memory.
- Name
documentName
- Type
- string
- Required
- Required
- Description
The name of the document to delete.
Replace
{documentName}
with the name of the document.
Install the SDK
npm i langbase
Environment variables
.env file
LANGBASE_API_KEY="<YOUR_API_KEY>"
Delete Document
curl -X DELETE https://api.langbase.com/v1/memory/{memoryName}/documents/{documentName} \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer <YOUR_API_KEY>"
Response
- Name
Response
- Type
- object
- Description
The response object returned by the API endpoint.
Response
interface Response { success: boolean; }
- Name
success
- Type
- boolean
- Description
Indicates whether the deletion was successful.
API Response
{
"success": true
}