Documents

Data Source Update

Markdown for LLMs
PUT
/documents/datasource/{dataSourceId}/update

Replaces a data source in full. Every writable field is taken from the request: anything omitted is cleared, not left as it was, so send the complete resource rather than only the parts that change.

To change just the folder a data source sits in, use documents-data-source-move instead — that operation takes only the folder rather than the whole record.

Identifiers, ownership and timestamps stay server-assigned and cannot be set here; the id travels in the path, not in the body.

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 replace, as returned by documents-data-source-create in result.data.dataSource.id.

Formatuuid

Request Body

application/json

The data source as it should be after the call.

TypeScript Definitions

Use the request body type in TypeScript.

Body for replacing a data source, following the standard request envelope: the resource under its own name alongside an optional externalContext.

Response Body

application/json

application/json

application/json

application/json

curl -X PUT "https://example.com/documents/datasource/3f2504e0-4f89-41d3-9a0c-0305e82c3301/update" \  -H "Content-Type: application/json" \  -d '{    "dataSource": {      "name": "Q3 Sales Report Data",      "description": "Account records used for quarterly reports, now including cancelled accounts.",      "urn": "a4f8c9d2-6b3e-4f1a-9c7d-2e5b8a1f4d6c",      "loadMethod": "Storage",      "documentSolutions": [        {          "id": "6ccb8ca9-2952-4dbf-a4b0-4a48bdeb1922"        }      ]    },    "externalContext": {      "id": "789"    }  }'
{  "result": {    "statusCode": 200,    "message": "OK",    "data": {      "dataSource": {        "id": "3f2504e0-4f89-41d3-9a0c-0305e82c3301",        "subscriptionId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",        "ownerId": "1a2b3c4d-5e6f-4a1b-8c2d-3e4f5a6b7c8d",        "lastModifiedUserId": "1a2b3c4d-5e6f-4a1b-8c2d-3e4f5a6b7c8d",        "name": "Q3 Sales Report Data",        "description": "Account records used for quarterly reports, now including cancelled accounts.",        "urn": "a4f8c9d2-6b3e-4f1a-9c7d-2e5b8a1f4d6c",        "loadMethod": "Storage",        "createdDate": "2026-09-18T12:15:53.000Z",        "lastModifiedDate": "2026-09-24T02:05:18.000Z",        "ownerName": "Jane Doe",        "lastModifiedUserName": "Jane Doe",        "documentSolutions": [          {            "id": "6ccb8ca9-2952-4dbf-a4b0-4a48bdeb1922",            "name": "Quarterly Invoicing",            "description": "Invoice run for quarterly billing."          }        ]      }    }  },  "origin": "PUT https://api.doctavian.com/v1/documents/datasource/{dataSourceId}/update",  "dateTime": "2026-09-24T02:05:18.000Z",  "externalContext": {    "id": "789"  },  "userId": "1a2b3c4d-5e6f-4a1b-8c2d-3e4f5a6b7c8d",  "operationId": "c17e93b40d5a4f28a6b1e70c34d98f61"}
{  "error": {    "statusCode": 400,    "message": "The request was rejected.",    "innerErrors": [      {        "code": "DATA_NAME_REQUIRED",        "message": "The request was rejected.",        "userMessage": "Check the highlighted fields and try again."      }    ]  },  "origin": "PUT https://api.doctavian.com/v1/documents/datasource/{dataSourceId}/update",  "dateTime": "2026-09-24T02:05:18.000Z",  "userId": "1a2b3c4d-5e6f-4a1b-8c2d-3e4f5a6b7c8d",  "operationId": "c17e93b40d5a4f28a6b1e70c34d98f61"}
{  "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": "PUT https://api.doctavian.com/v1/documents/datasource/{dataSourceId}/update",  "dateTime": "2026-09-24T02:05:18.000Z",  "userId": "1a2b3c4d-5e6f-4a1b-8c2d-3e4f5a6b7c8d",  "operationId": "c17e93b40d5a4f28a6b1e70c34d98f61"}
Empty
{  "error": {    "statusCode": 500,    "message": "The data source could not be updated.",    "innerErrors": [      {        "code": "UPDATE_DATA_SOURCE_ERROR",        "message": "The data source could not be updated.",        "userMessage": "Something went wrong. Please try again or contact support."      }    ]  },  "origin": "PUT https://api.doctavian.com/v1/documents/datasource/{dataSourceId}/update",  "dateTime": "2026-09-24T02:05:18.000Z",  "userId": "1a2b3c4d-5e6f-4a1b-8c2d-3e4f5a6b7c8d",  "operationId": "c17e93b40d5a4f28a6b1e70c34d98f61"}