ApiDatasources
Update an existing datasource
Partially update fields of an existing datasource by its UUID. You can:
- send only 'name' to rename the datasource
- send 'datasourceType' and 'adapter' to change the adapter configuration
- or send all three fields to update name and adapter in one request
When 'adapter' is present,
datasourceTypeis mandatory and controls how the adapter object is validated.
Access restricted to roles:
- admin
- manufacturer-admin
- manufacturer-user
Authorization
bearer AuthorizationBearer <token>
In: header
Path Parameters
datasourceId*string
UUID of the datasource
Format
uuidRequest Body
application/json
Partial update payload. At least one of 'name' or ('datasourceType' + 'adapter') must be provided.
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X PATCH "https://my.sweetconnect.io/api/databus/v1/datasources/9488c561-749f-4b3d-8c2f-30e867ba66db" \ -H "Content-Type: application/json" \ -d '{ "name": "new-name" }'{
"data": {
"affected": "1"
}
}{
"errors": [
{
"errorCode": "RequestValidationError",
"message": "The 'username' field is required.",
"extension": {
"type": "body",
"key": "username"
}
}
]
}{
"errors": [
{
"errorCode": "Unauthorized",
"message": "Authentication is required to access this resource.",
"extension": {}
}
]
}{
"errors": [
{
"errorCode": "NoPermission",
"message": "You do not have permission to access this resource.",
"extension": {}
}
]
}{
"errors": [
{
"errorCode": "InternalServerError",
"message": "An unexpected error occurred. See logs for further details or create a support ticket.",
"extension": {}
}
]
}