Documents

Data Source Delete

Markdown for LLMs
DELETE
/documents/datasource/{dataSourceId}/delete

Deletes a data source. Afterwards documents-data-source-get answers its id with 500 DATA_SOURCE_NOT_FOUND.

A data source attached to document solutions can be deleted: it is removed from every solution it was attached to. Deleting the same id again returns 200 again.

An id that matches no data source fails with 500 DATA_SOURCE_NOT_FOUND, and an id that is not a GUID with a bodiless 404.

Authorization

AuthorizationBearer <token>

JWT token to authenticate the request.

In: header

X-Api-Key<token>

API key, sent as a request header.

In: header

Path Parameters

dataSourceId*string

Id of the data source to delete, as returned by documents-data-source-create in result.data.dataSource.id. Must be a GUID: a value that is not one matches no route and returns a bodiless 404. A well-formed id that matches no data source returns 500 DATA_SOURCE_NOT_FOUND.

Formatuuid

Response Body

application/json

application/json

application/json

curl -X DELETE "https://example.com/documents/datasource/3f2504e0-4f89-41d3-9a0c-0305e82c3301/delete"
{  "result": {    "statusCode": 200,    "message": "Deleted"  },  "origin": "DELETE https://api.doctavian.com/v1/documents/datasource/{dataSourceId}/delete",  "dateTime": "2026-07-14T09:30:00.000Z",  "userId": "e9593294-80fc-490c-89ad-c44776fda4c7",  "operationId": "56784ff40e158b8d7bc6051a7c8224ef"}
{  "error": {    "statusCode": 401,    "message": "The request could not be authenticated.",    "innerErrors": [      {        "code": "UNAUTHORIZED",        "message": "The request could not be authenticated.",        "userMessage": "Your session has expired or is invalid. Please sign in again."      }    ]  },  "origin": "DELETE https://api.doctavian.com/v1/documents/datasource/{dataSourceId}/delete",  "dateTime": "2026-01-02T12:34:56.000Z",  "operationId": "5e01114674b01b82d587b2e0f06bb484",  "userId": "748b2a39-7231-4b49-832b-9ef189074a21"}
Empty
{  "error": {    "statusCode": 500,    "message": "Internal Server Error",    "innerErrors": [      {        "code": "DELETE_DATA_SOURCE_ERROR",        "message": "The data source could not be deleted.",        "userMessage": "Something went wrong. Please try again or contact support.",        "eventId": "c2f4e1a7-9b3d-4e58-a6f0-1d7b8e2c5a94"      }    ]  },  "origin": "DELETE https://api.doctavian.com/v1/documents/datasource/{dataSourceId}/delete",  "dateTime": "2026-10-13T08:55:27.000Z",  "userId": "1fa93f1d-07e8-4e08-84e6-c0098f3b6ed5",  "operationId": "53359f71dbbd17f953359f71dbbd17f9"}