SweetConnect LogoSweetConnect
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, 'datasourceType' is mandatory and controls how the adapter object is validated.

Access restricted to roles:

  • admin
  • manufacturer-admin
  • manufacturer-user
PATCH
/v1/datasources/{datasourceId}

Path Parameters

datasourceId*string

UUID of the datasource

Formatuuid

Request 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-controller/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 internal server error occurred.",
      "extension": {}
    }
  ]
}